Skip to content

Commit b3ea26e

Browse files
committed
cmake: Fix install manifest generator to take into account build configuration (Debug vs Release etc)
1 parent 0397b6b commit b3ea26e

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

packaging/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ add_custom_target(generate_manifest
4040
COMMAND ${CMAKE_COMMAND}
4141
-D INSTALL_DIR=${CMAKE_INSTALL_PREFIX}
4242
-D BUILD_DIR=${PROJECT_BINARY_DIR}
43+
-D CONFIG=$<CONFIG>
4344
-P "${CMAKE_CURRENT_SOURCE_DIR}/install_manifest.cmake"
4445
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
4546
COMMENT "Generating install manifest"

packaging/install_manifest.cmake

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,15 @@ endfunction(file)
124124
# script.
125125
#
126126

127-
set(CMAKE_INSTALL_CONFIG_NAME "Release")
127+
if(CONFIG)
128+
set(CMAKE_INSTALL_CONFIG_NAME ${CONFIG})
129+
else()
130+
set(CMAKE_INSTALL_CONFIG_NAME "Release")
131+
endif()
128132
set(CMAKE_INSTALL_PREFIX ".")
129133

134+
message("Install manifest for build configuration: ${CMAKE_INSTALL_CONFIG_NAME}")
135+
130136
foreach(COMP ${CPACK_COMPONENTS_ALL})
131137
set(CMAKE_INSTALL_COMPONENT ${COMP})
132138
#message("\nComponent: ${CMAKE_INSTALL_COMPONENT}")

0 commit comments

Comments
 (0)