summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2022-02-09 22:55:41 +0100
committerAki <please@ignore.pl>2022-02-09 22:55:41 +0100
commitb4e3f5d4837e7da50b19a7064318eae5176887d0 (patch)
tree9f28e1e69900c81b22b6527975b36e422c3197dc
parent373dc625f82b47096893add42c4472e4a57ab7eb (diff)
downloadstarshatter-b4e3f5d4837e7da50b19a7064318eae5176887d0.zip
starshatter-b4e3f5d4837e7da50b19a7064318eae5176887d0.tar.gz
starshatter-b4e3f5d4837e7da50b19a7064318eae5176887d0.tar.bz2
Added simplistic install-time configuration
-rw-r--r--CMakeLists.txt7
-rw-r--r--Datafile/CMakeLists.txt1
-rw-r--r--Stars45/CMakeLists.txt1
-rw-r--r--contrib/CMakeLists.txt5
-rw-r--r--data/CMakeLists.txt7
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}
+ )