Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TEC Server Config
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MSK-SW
Infrastructure and Support
TEC
TEC Server Config
Commits
185e2753
Commit
185e2753
authored
2 years ago
by
Martin Christoph Hierholzer
Browse files
Options
Downloads
Patches
Plain Diff
project-template: update for config generator 3.0 (#11327)
parent
f24bd471
No related branches found
No related tags found
1 merge request
!3
update project template
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cmake/config_generator_project.cmake
+4
-17
4 additions, 17 deletions
cmake/config_generator_project.cmake
with
4 additions
and
17 deletions
cmake/config_generator_project.cmake
+
4
−
17
View file @
185e2753
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
# Configuration packages for servers can have a very simple CMakeLists.txt like this:
# Configuration packages for servers can have a very simple CMakeLists.txt like this:
#
#
# PROJECT(exampleserver-config NONE)
# PROJECT(exampleserver-config NONE)
# cmake_minimum_required(VERSION 3.
5
)
# cmake_minimum_required(VERSION 3.
14
)
#
#
# # Note: Always keep MAJOR_VERSION and MINOR_VERSION identical to the server version. Count only the patch separately.
# # Note: Always keep MAJOR_VERSION and MINOR_VERSION identical to the server version. Count only the patch separately.
# set(${PROJECT_NAME}_MAJOR_VERSION 01)
# set(${PROJECT_NAME}_MAJOR_VERSION 01)
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
#
#
# include(cmake/config_generator_project.cmake)
# include(cmake/config_generator_project.cmake)
#
#
cmake_minimum_required
(
VERSION 3.14
)
list
(
APPEND CMAKE_MODULE_PATH
${
CMAKE_SOURCE_DIR
}
/cmake/Modules
)
list
(
APPEND CMAKE_MODULE_PATH
${
CMAKE_SOURCE_DIR
}
/cmake/Modules
)
...
@@ -22,27 +23,14 @@ list(APPEND CMAKE_MODULE_PATH ${ConfigGenerator_DIR}/shared)
...
@@ -22,27 +23,14 @@ list(APPEND CMAKE_MODULE_PATH ${ConfigGenerator_DIR}/shared)
set
(
DESTDIR share/ConfigGenerator-
${
PROJECT_NAME
}
-
${${
PROJECT_NAME
}
_MAJOR_VERSION
}
-
${${
PROJECT_NAME
}
_MINOR_VERSION
}
)
set
(
DESTDIR share/ConfigGenerator-
${
PROJECT_NAME
}
-
${${
PROJECT_NAME
}
_MAJOR_VERSION
}
-
${${
PROJECT_NAME
}
_MINOR_VERSION
}
)
# copy all script files from config generator to our build directory
# find all server type directories in our source directory and copy them to the build directory
file
(
GLOB_RECURSE scripts RELATIVE
${
ConfigGenerator_DIR
}
${
ConfigGenerator_DIR
}
/*
)
foreach
(
script
${
scripts
}
)
configure_file
(
"
${
ConfigGenerator_DIR
}
/
${
script
}
"
"
${
PROJECT_BINARY_DIR
}
/
${
script
}
"
COPYONLY
)
endforeach
()
# find all server type directories in our source directory
file
(
GLOB hostlists RELATIVE
${
PROJECT_SOURCE_DIR
}
*/hostlist
)
file
(
GLOB hostlists RELATIVE
${
PROJECT_SOURCE_DIR
}
*/hostlist
)
foreach
(
hostlist
${
hostlists
}
)
foreach
(
hostlist
${
hostlists
}
)
string
(
REPLACE
"/hostlist"
""
servertype
"
${
hostlist
}
"
)
string
(
REPLACE
"/hostlist"
""
servertype
"
${
hostlist
}
"
)
file
(
COPY
"
${
PROJECT_SOURCE_DIR
}
/
${
servertype
}
"
DESTINATION
"
${
PROJECT_BINARY_DIR
}
"
)
list
(
APPEND servertypes
"
${
servertype
}
"
)
list
(
APPEND servertypes
"
${
servertype
}
"
)
endforeach
()
endforeach
()
# copy all server type directories to the build directory
foreach
(
servertype
${
servertypes
}
)
file
(
GLOB_RECURSE files FOLLOW_SYMLINKS RELATIVE
${
PROJECT_SOURCE_DIR
}
${
servertype
}
/*
)
foreach
(
f
${
files
}
)
configure_file
(
"
${
f
}
"
"
${
PROJECT_BINARY_DIR
}
/
${
f
}
"
COPYONLY
)
endforeach
()
endforeach
()
# install server types (scripts are installed by upstream config generator project)
# install server types (scripts are installed by upstream config generator project)
foreach
(
servertype
${
servertypes
}
)
foreach
(
servertype
${
servertypes
}
)
install
(
DIRECTORY
"
${
servertype
}
/settings"
DESTINATION
"
${
DESTDIR
}
/
${
servertype
}
"
)
install
(
DIRECTORY
"
${
servertype
}
/settings"
DESTINATION
"
${
DESTDIR
}
/
${
servertype
}
"
)
...
@@ -50,4 +38,3 @@ foreach(servertype ${servertypes})
...
@@ -50,4 +38,3 @@ foreach(servertype ${servertypes})
file
(
GLOB thefiles LIST_DIRECTORIES no
"
${
servertype
}
/*"
)
file
(
GLOB thefiles LIST_DIRECTORIES no
"
${
servertype
}
/*"
)
install
(
FILES
${
thefiles
}
DESTINATION
"
${
DESTDIR
}
/
${
servertype
}
"
)
install
(
FILES
${
thefiles
}
DESTINATION
"
${
DESTDIR
}
/
${
servertype
}
"
)
endforeach
()
endforeach
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment