Skip to content
Snippets Groups Projects
Commit 7645e93e authored by Stephan Schulz's avatar Stephan Schulz
Browse files

create package config automatically

parent 4948d84b
No related branches found
No related tags found
1 merge request!15CMake projectconfig
Pipeline #58121 passed
......@@ -61,6 +61,13 @@ else()
find_package(MPI REQUIRED COMPONENTS CXX)
endif (CM_ALL_FORTRAN)
# Prepare the Config.cmake.in
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/Config.cmake.in
"@PACKAGE_INIT@\n
\n
include(CMakeFindDependencyMacro)\n
find_dependency(MPI)\n"
)
if(CM_ALL_VTK_OUTPUT)
message("Using VTK output")
......@@ -75,8 +82,14 @@ if(CM_ALL_VTK_OUTPUT)
if(NOT VTK_FOUND)
message(FATAL_ERROR "VTK not found, help CMake to find it by setting VTK_LIBRARY and VTK_INCLUDE_DIR")
endif()
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/Config.cmake.in "find_dependency(VTK)\n")
endif(CM_ALL_VTK_OUTPUT)
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/Config.cmake.in
"include(\"\${CMAKE_CURRENT_LIST_DIR}/ALLTargets.cmake\")\n
check_required_components(ALL)\n"
)
if (CM_ALL_DEBUG)
message("Using ALL debug information")
add_compile_definitions("ALL_DEBUG_ENABLED")
......@@ -122,7 +135,7 @@ install(EXPORT ALLTargets
)
include(CMakePackageConfigHelpers)
configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in
configure_package_config_file(${CMAKE_CURRENT_BINARY_DIR}/Config.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/ALLConfig.cmake"
INSTALL_DESTINATION lib/cmake/ALL
)
......
@PACKAGE_INIT@
include(CMakeFindDependencyMacro)
find_dependency(MPI)
#todo(s.schulz): Somehow propagate the VTK switch...
find_dependency(VTK)
include("${CMAKE_CURRENT_LIST_DIR}/ALLTargets.cmake")
check_required_components(ALL)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment