diff options
-rw-r--r-- | CMakeLists.txt | 7 | ||||
-rw-r--r-- | Datafile/CMakeLists.txt | 1 | ||||
-rw-r--r-- | Stars45/CMakeLists.txt | 1 | ||||
-rw-r--r-- | contrib/CMakeLists.txt | 5 | ||||
-rw-r--r-- | data/CMakeLists.txt | 7 |
5 files changed, 21 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 478ce93..d26ac35 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,6 +3,13 @@ set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_EXTENSIONS Yes) set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules") project(Starshatter) +if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + if(CMAKE_HOST_SYSTEM_NAME MATCHES Windows) + set(CMAKE_INSTALL_PREFIX "C:/Program Files (x86)/Starshatter" CACHE PATH "Prefix to install to" FORCE) + else() + set(CMAKE_INSTALL_PREFIX "/opt/starshatter" CACHE PATH "Prefix to install to" FORCE) + endif() +endif() if(MSVC) set(WINDOWSSDK_LIBPATH "C:/Program Files (x86)/Windows Kits/10/Lib/10.0.19041.0" CACHE FILEPATH "Path to a versioned lib directory of selected Windows SDK") set(WINDOWSSDK_PATH "C:/Program Files (x86)/Windows Kits/10/Include/10.0.19041.0" CACHE FILEPATH "Path to a versioned include directory of selected Windows SDK") diff --git a/Datafile/CMakeLists.txt b/Datafile/CMakeLists.txt index 663964d..74d2ec4 100644 --- a/Datafile/CMakeLists.txt +++ b/Datafile/CMakeLists.txt @@ -16,3 +16,4 @@ target_compile_definitions( Datafile PUBLIC UNICODE ) +install(TARGETS Datafile RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}) diff --git a/Stars45/CMakeLists.txt b/Stars45/CMakeLists.txt index 0fe8069..c04ba86 100644 --- a/Stars45/CMakeLists.txt +++ b/Stars45/CMakeLists.txt @@ -329,3 +329,4 @@ else() PUBLIC -l:libdxguid.a ) endif() +install(TARGETS Stars45 RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}) diff --git a/contrib/CMakeLists.txt b/contrib/CMakeLists.txt index ea23799..3845b71 100644 --- a/contrib/CMakeLists.txt +++ b/contrib/CMakeLists.txt @@ -3,3 +3,8 @@ add_subdirectory(ogg) add_subdirectory(Opcode) add_subdirectory(vorbis) add_subdirectory(zlib) +install( + TARGETS png15 Opcode zlib + RUNTIME + DESTINATION ${CMAKE_INSTALL_PREFIX} + ) diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt index 410ecbf..1496ec4 100644 --- a/data/CMakeLists.txt +++ b/data/CMakeLists.txt @@ -18,3 +18,10 @@ add_downloadable_resource( add_datafile(content RESOURCES resource_content) add_datafile(shatter RESOURCES resource_shatter) add_datafile(start RESOURCES resource_start) +install( + FILES + ${CMAKE_CURRENT_BINARY_DIR}/content.dat + ${CMAKE_CURRENT_BINARY_DIR}/shatter.dat + ${CMAKE_CURRENT_BINARY_DIR}/start.dat + DESTINATION ${CMAKE_INSTALL_PREFIX} + ) |