SacBase / cmake-common

CMake files commonly used by sac packages
Other
0 stars 4 forks source link

SAC2CRC Target argument parsing inefficent #1

Open hv15 opened 7 years ago

hv15 commented 7 years ago

I made a change to the macro in d53c626840b757edf808a643226b5adaa9d2c031 which introduced an extra parameter. Sadly, I had assumed that CMake does not check the number of arguments passed to the macro - in principle this is true, however CMake does check that all named arguments are given. As such, the LIBS argument is needed, even if it isn't relevent for the given SAC project, resulting in syntax like:

CREATE_SAC2CRC_TARGET ("modulename" "${DLL_BUILD_DIR}" "${DLL_BUILD_DIR}" "")

Suggested fix for this is to removed the name/required argument and instead check for extra passed arguments using ${ARGN} and parse these seperately - this actually potentially convienet solution to also allow for arbitary values that can be exposed with the project-specific sac2crc file...

ashinkarov commented 7 years ago

I wouldn't worry about this too much. As updates in cmake-common do not propagate to sac packages automatically, one can fix this when bumping the version of cmake-common in each package. So I don't think this is a real problem.

Using ${ARGN} is fine by me.