summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Holman <dholman@gymli.org>2024-09-20 23:07:16 -0500
committerDanny Holman <dholman@gymli.org>2024-09-20 23:07:16 -0500
commitc76518f425835309b9f3a000eb4792489fbb518d (patch)
treef045c8c22986e05d80672081786fb3f93f5ab4f3
parent0b301a7ed041c85548b896418d926563e6eb0762 (diff)
make: add additional information to install
Add additional information to the install directives so that a CMake-compatible config file is generated and each component is placed into their proper place as set by a package maintainer. Signed-off-by: Danny Holman <dholman@gymli.org>
-rw-r--r--CMakeLists.txt21
1 files changed, 20 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d64deb7..1c9ce1d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3,6 +3,8 @@ cmake_minimum_required(VERSION 3.20)
set(CMAKE_C_STANDARD 23)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_C_EXTENSIONS ON)
+set(CMAKE_C_VISIBILITY_PRESET hidden)
+set(CMAKE_VISIBILITY_INLINES_HIDDEN YES)
project(rune-engine VERSION 0.61.0 DESCRIPTION "High performance game engine designed for Quake-style shooters")
@@ -24,6 +26,7 @@ list(APPEND SOURCE_FILES
set(HEADER_DIR include)
add_compile_definitions(VERSION="${PROJECT_VERSION}")
+add_compile_definitions(RAPI_EXPORT)
add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES})
set_property(TARGET ${PROJECT_NAME} PROPERTY ENABLE_EXPORTS ON)
@@ -31,5 +34,21 @@ target_include_directories(${PROJECT_NAME} PUBLIC ${HEADER_DIR})
set_target_properties(${PROJECT_NAME} PROPERTIES VERSION ${PROJECT_VERSION})
set_target_properties(${PROJECT_NAME} PROPERTIES SOVERSION ${PROJECT_VERSION_MAJOR})
-install(TARGETS ${PROJECT_NAME} DESTINATION lib)
+include(GNUInstallDirs)
+install(TARGETS ${PROJECT_NAME}
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+ COMPONENT ${PROJECT_NAME}_Runtime
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ COMPONENT ${PROJECT_NAME}_Runtime
+ NAMELINK_COMPONENT ${PROJECT_NAME}_Development
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ COMPONENT ${PROJECT_NAME}_Development
+)
install(DIRECTORY ${HEADER_DIR}/rune DESTINATION include)
+
+include(CMakePackageConfigHelpers)
+write_basic_package_version_file(
+ ${PROJECT_NAME}Version.cmake
+ VERSION ${PROJECT_VERSION}
+ COMPATIBILITY SameMajorVersion
+)