Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
GeoModelCore
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Jira
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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
GeoModelDev
GeoModelCore
Commits
9d20af91
Commit
9d20af91
authored
5 years ago
by
Riccardo Maria Bianchi
Browse files
Options
Downloads
Patches
Plain Diff
Add export targets to be able to use find_package() on build folder.
parent
8fb8ffb6
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!9
Fix friend classes persistification and concurrent access to add() method
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
CMakeLists.txt
+25
-2
25 additions, 2 deletions
CMakeLists.txt
with
25 additions
and
2 deletions
CMakeLists.txt
+
25
−
2
View file @
9d20af91
...
...
@@ -56,6 +56,28 @@ install(
COMPONENT Development
DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
/cmake/
${
PROJECT_NAME
}
)
# Export targets from the *build* tree for use by outside projects.
#
# INFO:
# Thus, this project can be used by other projects without being installed.
# This is useful for development: you can build a child projet without an
# install path.
# For example:
# while generating GeoModel projects with CMake as Xcode project on macOS,
# after having built GeoModelCore, you can use that to build GeoModelIO without
# the need of an installation step, by simply prepend 'GeoModelCore_DIR' as this:
# $ GeoModelCore_DIR=../b_core/CMakeFiles cmake -G Xcode ../../GeoModelIO
# which is useful when generating projects
# that needs to be built with Xcode. Xcode in fact does not handle well the install
# folder generated by CMake: sometimes the content of that is not updated when
# updating the code, which results in keeping running the same old code even if
# we modified our source code.
# export(EXPORT ${PROJECT_NAME}-export NAMESPACE "${PROJECT_NAME}::" FILE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${PROJECT_NAME}Config.cmake)
export
(
TARGETS GeoGenericFunctions GeoModelKernel NAMESPACE
"
${
PROJECT_NAME
}
::"
FILE
${
CMAKE_BINARY_DIR
}${
CMAKE_FILES_DIRECTORY
}
/
${
PROJECT_NAME
}
Targets.cmake
)
# Set up the packaging of the project using CPack.
include
(
GeoModelCorePackaging
)
...
...
@@ -79,9 +101,10 @@ if (DOXYGEN_FOUND)
# request to configure the file
configure_file
(
${
DOXYGEN_IN
}
${
DOXYGEN_OUT
}
@ONLY
)
message
(
"Doxygen build started"
)
# note the option ALL which allows to build the docs together with the application
# note:
# - `make doc` builds the Doxygen docs on request
# - `make all` allows to build the docs together with the application
add_custom_target
(
doc
COMMAND
${
DOXYGEN_EXECUTABLE
}
${
DOXYGEN_OUT
}
WORKING_DIRECTORY
${
CMAKE_CURRENT_BINARY_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