Currently, for windows, I use a local installation area. Between Qt, and other 3rd party shared libraries, its difficult to have a user create installation otherwise. To do so, I have used for sometime, and it works great, setting the CMAKE_INSTALL_PREFIX to the following
SET(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/Install)
IF(${CMAKE_INSTALL_CONFIG_NAME} MATCHES “^([Dd][Ee][Bb][Uu][Gg])$”)
SET(CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}.debug)
ENDIF()
Some of the 3rd party libraries, unfortunately, do not differentiate debug vs release, thus the need to have “Install” and “Install.debug”
This works great, except during the actual install phase, we need to add some INSTALL( CODE ) to do the same thing
IF("${CMAKE_INSTALL_CONFIG_NAME}" MATCHES “^([Dd][Ee][Bb][Uu][Gg])$”)
SET(CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}.debug)
ENDIF()
No big deal, it was figured out, and works great.
However, we to be able to create a package in debug as well…
And here is where the problem comes in, the CPack system, doesnt use the CMAKE_INSTALL_PREFIX variable in the same manner… So the files get installed into the “debug” directory, however, the packaging looks in the non-debug area, which is empty.
Is there any variable that is set during the Package phase that I can use as a guard?
if ( NOT CPACK_RUNNING_NOW )
…
endif()
Or does anyone have any other solution for this?