-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCreateDist.cmake
More file actions
26 lines (22 loc) · 889 Bytes
/
CreateDist.cmake
File metadata and controls
26 lines (22 loc) · 889 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# This procedure will add installation functionality to CMake build
# If you open build folder and call `make install`,
# in project's root, folder "dist" will be created with subdirectory
# for your OS. Inside, you will find redistributable package.
set(DIST_DIR ${CMAKE_SOURCE_DIR}/dist)
if(UNIX)
set(CMAKE_INSTALL_PREFIX ${DIST_DIR}/unix)
elseif(WIN32)
set(CMAKE_INSTALL_PREFIX ${DIST_DIR}/win32)
elseif(APPLE)
set(CMAKE_INSTALL_PREFIX ${DIST_DIR}/apple)
elseif(MINGW)
set(CMAKE_INSTALL_PREFIX ${DIST_DIR}/mingw)
elseif(MSYS)
set(CMAKE_INSTALL_PREFIX ${DIST_DIR}/msys)
elseif(CYGWIN)
set(CMAKE_INSTALL_PREFIX ${DIST_DIR}/cygwin)
else()
MESSAGE(SEND_ERROR "Unknown platform, can't configure install")
endif()
install(TARGETS ${EXECUTABLE_NAME} RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX})
install(DIRECTORY ${RES_DIR} DESTINATION ${CMAKE_INSTALL_PREFIX})