Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
GeoModel
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
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
Code review analytics
Issue analytics
Insights
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
GeoModelDev
GeoModel
Commits
d2a2eea4
Commit
d2a2eea4
authored
3 years ago
by
Riccardo Maria Bianchi
Browse files
Options
Downloads
Patches
Plain Diff
(cmake) Fix the targets export to also have proper version number
parent
6f691039
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
FullSimLight/MagneticField/CMakeLists.txt
+25
-4
25 additions, 4 deletions
FullSimLight/MagneticField/CMakeLists.txt
FullSimLight/MagneticField/cmake/MagneticFieldConfig.cmake.in
+17
-0
17 additions, 0 deletions
...SimLight/MagneticField/cmake/MagneticFieldConfig.cmake.in
with
42 additions
and
4 deletions
FullSimLight/MagneticField/CMakeLists.txt
+
25
−
4
View file @
d2a2eea4
...
...
@@ -3,13 +3,10 @@ cmake_minimum_required( VERSION 3.1...3.19 )
project
(
"MagneticField"
VERSION
${
GeoModel_VERSION
}
LANGUAGES CXX
)
# Set up the build of the
three
libraries of the project
.
# Set up the build of the libraries of the project
's subpackages
add_subdirectory
(
MagFieldInterfaces
)
add_subdirectory
(
MagFieldServices
)
install
(
EXPORT MagFieldInterfaces-export FILE MagneticField-MagFieldInterfaces.cmake DESTINATION lib/cmake/MagneticField
)
install
(
EXPORT MagFieldServices-export FILE MagneticField-MagFieldServices.cmake DESTINATION lib/cmake/MagneticField
)
install
(
FILES cmake/MagneticFieldConfig.cmake DESTINATION lib/cmake/MagneticField
)
# Install headers
file
(
GLOB HEADERS_Int MagFieldInterfaces/MagFieldInterfaces/*.h
)
...
...
@@ -21,4 +18,28 @@ install( FILES ${HEADERS_Svc}
DESTINATION
${
CMAKE_INSTALL_INCLUDEDIR
}
/MagFieldServices
COMPONENT Development
)
# install the CMake configuration files of the subpackages
install
(
EXPORT MagFieldInterfaces-export FILE MagneticField-MagFieldInterfaces.cmake DESTINATION lib/cmake/MagneticField
)
install
(
EXPORT MagFieldServices-export FILE MagneticField-MagFieldServices.cmake DESTINATION lib/cmake/MagneticField
)
# Write and install the version file
write_basic_config_version_file
(
${
CMAKE_BINARY_DIR
}${
CMAKE_FILES_DIRECTORY
}
/
${
PROJECT_NAME
}
ConfigVersion.cmake
VERSION
${
PROJECT_VERSION
}
COMPATIBILITY SameMajorVersion
)
install
(
FILES
${
CMAKE_BINARY_DIR
}${
CMAKE_FILES_DIRECTORY
}
/
${
PROJECT_NAME
}
ConfigVersion.cmake
COMPONENT Development
DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
/cmake/
${
PROJECT_NAME
}
)
# Install the hand-written project configuration.
configure_file
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/cmake/MagneticFieldConfig.cmake.in
${
CMAKE_BINARY_DIR
}${
CMAKE_FILES_DIRECTORY
}
/
${
PROJECT_NAME
}
Config.cmake
@ONLY
)
install
(
FILES
${
CMAKE_BINARY_DIR
}${
CMAKE_FILES_DIRECTORY
}
/
${
PROJECT_NAME
}
Config.cmake
COMPONENT Development
DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
/cmake/
${
PROJECT_NAME
}
)
This diff is collapsed.
Click to expand it.
FullSimLight/MagneticField/cmake/MagneticFieldConfig.cmake
→
FullSimLight/MagneticField/cmake/MagneticFieldConfig.cmake
.in
+
17
−
0
View file @
d2a2eea4
...
...
@@ -3,3 +3,15 @@ get_filename_component(SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
include(${SELF_DIR}/MagneticField-MagFieldInterfaces.cmake)
include(${SELF_DIR}/MagneticField-MagFieldServices.cmake)
# Set the version of the installed project.
set( MagneticField_VERSION "@PROJECT_VERSION@" )
# Print some standard messages about the package being found.
include( FindPackageHandleStandardArgs )
find_package_handle_standard_args( MagneticField
FOUND_VAR MagneticField_FOUND
REQUIRED_VARS SELF_DIR
VERSION_VAR MagneticField_VERSION )
# Clean up.
unset( SELF_DIR )
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