Somewhat related to - CPack script not recognizing CMAKE_BINARY_DIR
These are some steps in my CPack configuration file -
....
configure_file(README.md README.md COPYONLY)
set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_BINARY_DIR}/README.md")
set(CPACK_RESOURCE_FILE_README "${CMAKE_BINARY_DIR}/README.md")
configure_file(${CMAKE_SOURCE_DIR}/cmake/modules/CPackfoo.cmake.in ${CMAKE_SOURCE_DIR}/cmake/modules/CPackfoo.cmake @ONLY)
set(CPACK_INSTALL_SCRIPTS ${CMAKE_SOURCE_DIR}/cmake/modules/CPackfoo.cmake)
....
And these are some steps inside CPackfoo.cmake.in
-
....
if (APPLE)
....
execute_process(COMMAND textutil -convert html README.md -output "@CMAKE_BINARY_DIR@/README.html")
set(CPACK_PACKAGE_DESCRIPTION_FILE "@CMAKE_BINARY_DIR@/README.html") # Trying to overwrite the variable
set(CPACK_RESOURCE_FILE_README "@CMAKE_BINARY_DIR@/README.html") # Trying to overwrite the variable
....
endif()
....
But when packaging for APPLE, the README.html file is not present either in the packaged tarball or the .pkg file.
I think the variables set in CPackfoo.cmake are not carried over to the original CPack configuration file.
How could I fix this?