Xavier Del Campo Romero
5d5bc88e57
This is meant to replace the dynamic generation of a version control file called version.xml, as well as the xmlversion command line tool, wth a static, line-separated list of files that the engine can use to parse the version numbers.
37 lines
1.2 KiB
CMake
37 lines
1.2 KiB
CMake
cmake_minimum_required(VERSION 3.14)
|
|
project(speed-dreams-data LANGUAGES NONE VERSION 2.4.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)
|
|
install(FILES user-files DESTINATION ${datadir})
|