smanders / externpro

build external projects with cmake
MIT License
13 stars 12 forks source link

externpro PRO_ params cmake_parse_arguments #379

Open smanders opened 1 year ago

smanders commented 1 year ago

each project has a

set(PRO_<PROJECT-NAME>

where many project params are defined as part of PRO_<PROJECT-NAME>

currently, externpro cmake functions that call cmake_parse_arguments (in xpfunmac.cmake) set the options, oneValueArgs, and multiValueArgs the specific cmake function needs to parse out of PRO_<PROJECT-NAME>... but as the PRO_<PROJECT-NAME> "vocabulary" has grown, the parse has become a little brittle: order starts to matter because the cmake function doesn't set all of the possible "vocabulary"

for now, things just work, mostly... but I've had the thought that I should define the PRO_<PROJECT-NAME> vocabulary in some global variables -- perhaps something like this

set(g_xpro_options
  GRAPH
  NO_README
  )
set(g_xpro_oneValueArgs
  BUILD_FUNC # macpro, used by glew and webpro
  BUILD_FUNC_ARG # macpro, used by glew and webpro
  DEPS_FUNC
  DEPS_VARS
  DESC
  DIFF
  DLDIR
  DLMD5
  DLNAME
  DLURL
  GIT_ORIGIN
  GIT_REF
  GIT_TAG
  GIT_TRACKING_BRANCH
  GIT_UPSTREAM
  GRAPH_LABEL
  GRAPH_NODE # TODO clean-up some uses of this?
  GRAPH_SHAPE
  NAME
  PARENT # used internally by ipPatch
  PATCH
  PATCH_STRIP
  SUBDIR
  SUPERPRO
  VER
  )
set(g_xpro_multiValueArgs
  BUILD_DEPS
  DLADD
  LICENSE
  REPO
  SIBLINGS # used internally by ipPatch
  SUBPRO
  WEB
  )

and perhaps also include some documentation, even a simple comment, to describe these params (some of them have some comments in the example above -- where they are used, TODOs, etc)