-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathpackage.cmake
46 lines (37 loc) · 1.33 KB
/
package.cmake
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
# Configure CPack variables before including CPack
set(CPACK_PACKAGE_VENDOR OpenSWE1R)
set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_SOURCE_DIR}/LICENSE.txt)
if(NOT CPACK_GENERATOR)
# Set default list of supported CPack generators if not specified by the user
if(WIN32 OR APPLE)
set(CPACK_GENERATOR "ZIP")
else()
set(CPACK_GENERATOR "TGZ")
endif()
endif()
include(cmake/determine_app_version.cmake)
set(CPACK_PACKAGE_VERSION ${APP_VERSION})
set(CPACK_PACKAGE_FILE_NAME OpenSWE1R-${APP_VERSION})
include(CPack)
# Install required files
set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION ".")
# Install main binaries
install(TARGETS openswe1r
RUNTIME DESTINATION ${CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION}
)
# Install documentation
install(FILES README.md LICENSE.txt DESTINATION ${CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION})
# Install additional binary modules
if(MSVC)
# Install required runtime libraries
include(InstallRequiredSystemLibraries)
# vcpkg will automatically move the required binaries to the build folder
foreach(lib OpenAL32 unicorn SDL2)
install(FILES $<TARGET_FILE_DIR:openswe1r>/${lib}.dll
DESTINATION ${CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION}
)
endforeach()
install(FILES $<TARGET_FILE_DIR:openswe1r>/glew32$<$<CONFIG:Debug>:d>.dll
DESTINATION ${CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION}
)
endif()