Skip to content

Commit 6853cac

Browse files
CMAKE: Conditionally add value of CPACK_BUILD_CONFIG to package name
This is an undocumented variable that will hold the build configuration, e.g. Debug, Release, etc., used to create a package with CPack. It is only set if you provide an explicit configuration argument to CPack.
1 parent 45f1ce7 commit 6853cac

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

cmake/cpack-setup.cmake

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@ else ()
3939
list(APPEND buildSuffix "win32")
4040
endif ()
4141

42-
list(APPEND buildSuffix "\${CPACK_BUILD_CONFIG}")
42+
# Append -C argument to CPack, if not empty
43+
if (CPACK_BUILD_CONFIG)
44+
list(APPEND buildSuffix "${CPACK_BUILD_CONFIG}")
45+
endif ()
46+
4347
## If using Visual Studio, append the compiler and toolkit:
4448
if (CMAKE_GENERATOR MATCHES "Visual Studio 17 .*")
4549
list(APPEND buildSuffix "vs2022")

0 commit comments

Comments
 (0)