[CMake] [CPack] Preprocess or postprocess for make package* targets
CPack can pack source and binary accourding to
CPACK_PACKAGE_VERSION_MAJOR, CPACK_PACKAGE_VERSION_MINOR, CPACK_PACKAGE_VERSION_PATCH
CPACK_SOURCE_IGNORE_FILES, CPACK_PACKAGE_IGNORE_FILES in CMakeLists.txt.
CMake then produce targets like
CMake itself does not recognize the these targets. So we cannot associate and
depend any targets by either
, in other words, CMake does not recognize
But what if you do want to associate some commands and targets before or after the package is built?
Here is some quick hack: Use a target:
COMMAND make package_source
COMMENT "Packaging Source files"
Note that I have to add
package_source, as CMake does not recognize
package_source, and I need to call it explicitly.