Skip to content

Commit 717ee47

Browse files
committed
Packaging: on Windows, specify whether it's a release or a debug version.
1 parent 2a9dea4 commit 717ee47

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

cmake/packaging/CMakeLists.txt

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ if(WIN32)
3030
endif()
3131

3232
set(CPACK_GENERATOR ${NSIS_GENERATOR} ZIP)
33-
set(CPACK_SYSTEM_NAME "Windows")
33+
set(CPACK_SYSTEM_NAME "-Windows")
3434
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE.txt")
3535

3636
# Specify the default installation directory.
@@ -44,7 +44,7 @@ elseif(APPLE)
4444
set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME ${CMAKE_PROJECT_NAME})
4545

4646
set(CPACK_GENERATOR productbuild ZIP)
47-
set(CPACK_SYSTEM_NAME "macOS")
47+
set(CPACK_SYSTEM_NAME "-macOS")
4848
set(CPACK_PROJECT_CONFIG_FILE ${CMAKE_CURRENT_SOURCE_DIR}/distrib/package.cmake)
4949

5050
set(CPACK_RESOURCE_FILE_WELCOME "${CMAKE_CURRENT_SOURCE_DIR}/distrib/welcome.txt")
@@ -56,24 +56,32 @@ else()
5656
# Select TGZ as the packager on Linux.
5757

5858
set(CPACK_GENERATOR TGZ)
59-
set(CPACK_SYSTEM_NAME "Linux")
59+
set(CPACK_SYSTEM_NAME "-Linux")
6060
endif()
6161

6262
# Specify the package file name.
6363

6464
if(${LIBOPENCOR_TARGET_ARCHITECTURE} STREQUAL "Intel")
65-
set(LIBRARY_ARCHITECTURE "Intel")
65+
set(LIBRARY_ARCHITECTURE "-Intel")
6666
else()
67-
set(LIBRARY_ARCHITECTURE "ARM")
67+
set(LIBRARY_ARCHITECTURE "-ARM")
6868
endif()
6969

7070
if(LIBOPENCOR_SHARED_LIBS)
71-
set(LIBRARY_TYPE "Shared")
71+
set(LIBRARY_TYPE "-Shared")
7272
else()
73-
set(LIBRARY_TYPE "Static")
73+
set(LIBRARY_TYPE "-Static")
7474
endif()
7575

76-
set(CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_NAME}-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}-${CPACK_SYSTEM_NAME}-${LIBRARY_ARCHITECTURE}-${LIBRARY_TYPE})
76+
if(WIN32)
77+
if(RELEASE_MODE)
78+
set(LIBRARY_MODE "-Release")
79+
else()
80+
set(LIBRARY_MODE "-Debug")
81+
endif()
82+
endif()
83+
84+
set(CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_NAME}-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}${CPACK_SYSTEM_NAME}${LIBRARY_ARCHITECTURE}${LIBRARY_TYPE}${LIBRARY_MODE})
7785

7886
# Package libOpenCOR.
7987

0 commit comments

Comments
 (0)