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
0bb17379
Commit
0bb17379
authored
5 years ago
by
Martin Christoph Hierholzer
Browse files
Options
Downloads
Patches
Plain Diff
added cmake include for config-generator-based projects
parent
7d5a768d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cmake/config_generator_project.cmake
+51
-0
51 additions, 0 deletions
cmake/config_generator_project.cmake
with
51 additions
and
0 deletions
cmake/config_generator_project.cmake
0 → 100644
+
51
−
0
View file @
0bb17379
#
# cmake include to be used for config generator based projects.
#
# Configuration packages for servers can have a very simple CMakeLists.txt like this:
#
# PROJECT(exampleserver-config NONE)
# cmake_minimum_required(VERSION 3.5)
#
# set(${PROJECT_NAME}_MAJOR_VERSION 01)
# set(${PROJECT_NAME}_MINOR_VERSION 00)
# set(${PROJECT_NAME}_PATCH_VERSION 00)
# include(cmake/set_version_numbers.cmake)
#
# include(cmake/config_generator_project.cmake)
#
list
(
APPEND CMAKE_MODULE_PATH
${
CMAKE_SOURCE_DIR
}
/cmake/Modules
)
find_package
(
ConfigGenerator 01.00 REQUIRED
)
set
(
DESTDIR share/ConfigGenerator
${
ConfigGenerator_VERSION
}
)
# copy all script files from config generator to our build directory
file
(
GLOB scripts RELATIVE
${
ConfigGenerator_DIR
}
${
ConfigGenerator_DIR
}
/*.sh
${
ConfigGenerator_DIR
}
/*.py
${
ConfigGenerator_DIR
}
/*.inc
${
ConfigGenerator_DIR
}
/ConfigGenerator/*.py
)
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
)
foreach
(
hostlist
${
hostlists
}
)
string
(
REPLACE
"/hostlist"
""
servertype
"
${
hostlist
}
"
)
list
(
APPEND servertypes
"
${
servertype
}
"
)
endforeach
()
# copy all server type directories to the build directory
foreach
(
servertype
${
servertypes
}
)
file
(
GLOB_RECURSE files 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)
foreach
(
servertype
${
servertypes
}
)
install
(
DIRECTORY
"
${
servertype
}
/settings"
DESTINATION
"
${
DESTDIR
}
/
${
servertype
}
"
)
install
(
DIRECTORY
"
${
servertype
}
/templates"
DESTINATION
"
${
DESTDIR
}
/
${
servertype
}
"
)
file
(
GLOB thefiles LIST_DIRECTORIES no
"
${
servertype
}
/*"
)
install
(
FILES
${
thefiles
}
DESTINATION
"
${
DESTDIR
}
/
${
servertype
}
"
)
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