Notes |
|
(0024263)
|
Eric NOULARD
|
2010-12-19 06:52
|
|
Hi Bo,
In which case would you have to install
something from build dir you don't know ?
Doesn't
INSTALL(FILES myoddfile DESTINATION...)
work as expected if the command is in inside the appropriate CMakeLists.txt?
If it doesn't did you try using "CMAKE_CFG_INTDIR", like in:
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/myoddfile DESTINATION...)
Now if your INSTALL command is done in a script launched by CMake (and not directly in some CMakeLists.txt) then
$ENV{CMAKE_CONFIG_TYPE} should contain the value of the -C argument
or nothing if none was specified, so you should be able to build
CPACK_BUILD_DIR with something like:
set(config_type $ENV{CMAKE_CONFIG_TYPE})
if (MSVC)
if(config_type)
set(CPACK_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/${config_type}")
else(config_type)
set(CPACK_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/Release")
endif(config_type)
endif(MSVC) |
|
|
(0033230)
|
Mark Stijnman
|
2013-06-04 09:21
|
|
I ended up here when searching for the same information, because I want to use the build configuration name in the package name. While this is a different use case than the original submitter, I'm posting my solution here for those who are searching for the same: the information from -C is available in the variable CPACK_BUILD_CONFIG. Note that this variable is only available inside your project-specific CPack configuration file (as specified by CPACK_PROJECT_CONFIG_FILE).
This is not in the documentation, as far as I could tell. I found this from studying the source code, and doing some experimentation. So since this is currently an undocumented feature, I don't know if we can depend on this in the future. Maybe this should be made an officially supported feature, and have it added to the documentation? That should completely address this ticket, in my view. |
|
|
(0041723)
|
Kitware Robot
|
2016-06-10 14:28
|
|
Resolving issue as `moved`.
This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page. |
|