speed-dreams-data/CMakeLists.txt
Xavier Del Campo Romero c6b10bd9c6
CMakeLists.txt: Reduce project version to 2.3.0
Until 2.4.0 is released, the project version should stay at 2.3.0.
Otherwise, the project version would mismatch with that obtained via
`git describe --tags --dirty`.
2025-01-14 02:47:17 +01:00

39 lines
1.2 KiB
CMake

cmake_minimum_required(VERSION 3.14)
project(speed-dreams-data LANGUAGES NONE VERSION 2.3.0)
# Because of this being a pure CMake project (i.e., no languages),
# this might cause a warning message from CMake since CMAKE_INSTALL_LIBDIR
# cannot be determined. Instead, ${CMAKE_INSTALL_PREFIX}/lib will be used,
# since this is assumed as safe.
# Further reference:
# https://gitlab.kitware.com/cmake/cmake/-/issues/23461
include(GNUInstallDirs)
set(datadir ${CMAKE_INSTALL_DATADIR}/games/speed-dreams-2 CACHE PATH
"Place where all the static data files should go")
include(CMakePackageConfigHelpers)
configure_package_config_file(
cmake/${PROJECT_NAME}.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake
INSTALL_DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/cmake/${PROJECT_NAME}
PATH_VARS datadir
)
write_basic_package_version_file(
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
COMPATIBILITY SameMajorVersion
ARCH_INDEPENDENT
)
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/cmake/${PROJECT_NAME}
)
add_subdirectory(data)
include(cmake/packaging-config.cmake)
include(CPack)