-
Notifications
You must be signed in to change notification settings - Fork 4
/
CPackLists.txt
49 lines (45 loc) · 1.75 KB
/
CPackLists.txt
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# -*- cmake -*-
set(CPACK_PACKAGE_VERSION "${PROJECT_VERSION}")
set(CPACK_PACKAGE_VERSION_MAJOR "${PROJECT_VERSION_MAJOR}")
set(CPACK_PACKAGE_VERSION_MINOR "${PROJECT_VERSION_MINOR}")
set(CPACK_PACKAGE_VERSION_PATCH "${PROJECT_VERSION_PATCH}")
set(CPACK_PACKAGE_VENDOR "${PROJECT_VENDOR}")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "${PROJECT_NAME}")
set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${PROJECT_NAME}")
set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/resources/installer-license.txt")
set(CPACK_CREATE_DESKTOP_LINKS TRUE)
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
set(CPACK_NSIS_DISPLAY_NAME "${PROJECT_NAME}")
set(CPACK_NSIS_PACKAGE_NAME "${PROJECT_NAME}")
set(CPACK_NSIS_MODIFY_PATH TRUE)
set(CPACK_NSIS_EXECUTABLES_DIRECTORY "bin")
set(CPACK_NSIS_CREATE_ICONS_EXTRA
"SetOutPath '$INSTDIR'
CreateShortCut '$DESKTOP\\\\${PROJECT_NAME}.lnk' '$INSTDIR\\\\bin\\\\adlrt' ''
CreateShortCut '$SMPROGRAMS\\\\${PROJECT_NAME}\\\\${PROJECT_NAME}.lnk' '$INSTDIR\\\\bin\\\\adlrt' '' '$INSTDIR\\\\icons\\\\adl.ico'")
set(CPACK_NSIS_DELETE_ICONS_EXTRA
"Delete '$DESKTOP\\\\${PROJECT_NAME}.lnk'
Delete '$SMPROGRAMS\\\\${PROJECT_NAME}\\\\${PROJECT_NAME}.lnk'")
endif()
include(CPack)
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
set(windows_bundle_DLLS
"libgcc_s_sjlj-1.dll"
"libgcc_s_seh-1.dll"
"libstdc++-6.dll"
"libwinpthread-1.dll"
"iconv.dll"
"libintl-8.dll"
"SDL2.dll")
unset(_dllfile CACHE)
foreach(dll ${windows_bundle_DLLS})
find_file(_dllfile "${dll}" PATH_SUFFIXES "bin")
if(_dllfile)
message("!! DLL \"${dll}\" from \"${_dllfile}\"")
install(FILES "${_dllfile}" DESTINATION "bin")
else()
message("!! DLL \"${dll}\" not found")
endif()
unset(_dllfile CACHE)
endforeach()
endif()