Skip to content
Snippets Groups Projects
Commit 6b132697 authored by Martin Killenberg's avatar Martin Killenberg Committed by Martin Killenberg
Browse files

fix(project-template): servers might call wrong config generator version

Provide a configure script which knows the version of config generator
parent fa4beb5f
No related branches found
No related tags found
1 merge request!10update project template
This commit is part of merge request !10. Comments created here will be created in the context of that merge request.
#!/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}
......@@ -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