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
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:
ADD_CUSTOM_TARGET(pack_src COMMAND make package_source COMMENT "Packaging Source files" DEPENDS other_dependency VERBATIM )
Note that I have to add
package_source, as CMake does not recognize
package_source, and I need to call it explicitly.