Skip to content
Snippets Groups Projects
Commit 5492870b authored by Martin Killenberg's avatar Martin Killenberg
Browse files

Merge project-template (automated)

parents b573a824 6b132697
No related branches found
Tags 08.00.01
1 merge request!10update project template
#!/bin/bash
## The purpose of this script is to call the correct version of the config
## generator for a particulat server config. The directory with the
## config generator version is put into a template by cmake, and this script
## is placed into the actual server config directory.
server_type="$1"
if [[ -z ${server_type} ]]; then
echo "No server type given at command line."
exit 1
fi
export CFGDIR="$(dirname "$(which "$0")")"
@ConfigGenerator_DIR@/config myself --type ${server_type}
......@@ -26,7 +26,7 @@
SET(ConfigGenerator_FOUND 0)
file(GLOB ConfigGenerator_SEARCH_PATHS ${CMAKE_CURRENT_LIST_DIR} "/usr/share/ConfigGenerator*")
file(GLOB ConfigGenerator_SEARCH_PATHS ${CMAKE_CURRENT_LIST_DIR} "${CMAKE_INSTALL_PREFIX}/share/ConfigGenerator*" "/usr/share/ConfigGenerator*")
FIND_PATH(ConfigGenerator_DIR
NAMES ConfigGeneratorConfigVersion.cmake
PATHS ${ConfigGenerator_SEARCH_PATHS}
......
......@@ -18,9 +18,10 @@ cmake_minimum_required(VERSION 3.14)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules)
find_package(ConfigGenerator 02.00 REQUIRED)
find_package(ConfigGenerator 03.00 REQUIRED)
list(APPEND CMAKE_MODULE_PATH ${ConfigGenerator_DIR}/shared)
set(DESTDIR share/ConfigGenerator-${PROJECT_NAME}-${${PROJECT_NAME}_MAJOR_VERSION}-${${PROJECT_NAME}_MINOR_VERSION})
# find all server type directories in our source directory and copy them to the build directory
......@@ -34,6 +35,10 @@ foreach(hostlist ${hostlists})
list(APPEND servertypes "${servertype}")
endforeach()
# prepare a configure script which knows the version of config generator to call
configure_file(${PROJECT_SOURCE_DIR}/cmake/ConfigGenerator_configureThisHost.sh.in ${PROJECT_BINARY_DIR}/configureThisHost.sh @ONLY)
# install server types (scripts are installed by upstream config generator project)
foreach(servertype ${servertypes})
install(DIRECTORY "${servertype}/settings" DESTINATION "${DESTDIR}/${servertype}")
......@@ -41,3 +46,5 @@ foreach(servertype ${servertypes})
file(GLOB thefiles LIST_DIRECTORIES no "${servertype}/*")
install(FILES ${thefiles} DESTINATION "${DESTDIR}/${servertype}")
endforeach()
install(PROGRAMS ${PROJECT_BINARY_DIR}/configureThisHost.sh DESTINATION "${DESTDIR}" )
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment