Skip to content
Snippets Groups Projects
Commit 9d20af91 authored by Riccardo Maria Bianchi's avatar Riccardo Maria Bianchi :sunny:
Browse files

Add export targets to be able to use find_package() on build folder.

parent 8fb8ffb6
Branches
Tags
1 merge request!9Fix friend classes persistification and concurrent access to add() method
......@@ -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}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment