Skip to content
Snippets Groups Projects
Commit 763dd6a4 authored by Santiago Ospina De Los Ríos's avatar Santiago Ospina De Los Ríos
Browse files

Add CMake EXPORT targets

parent 9fa29073
No related branches found
No related tags found
1 merge request!49Resolve "Finish installation and usage instruction on the documentation"
Pipeline #32891 failed
......@@ -58,3 +58,20 @@ add_subdirectory(cmake/modules)
# finalize the dune project, e.g. generating config.h etc.
finalize_dune_project(GENERATE_CONFIG_H_CMAKE)
install(EXPORT dune_copasi
FILE
dune-copasi-targets.cmake
NAMESPACE
dune_copasi::
DESTINATION
"${CMAKE_INSTALL_LIBDIR}/cmake/dune-copasi"
)
include(CMakePackageConfigHelpers)
configure_package_config_file(
"dune-copasi-config.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/dune-copasi-config.cmake"
INSTALL_DESTINATION
"${CMAKE_INSTALL_LIBDIR}/cmake/dune-copasi-config"
)
......@@ -7,7 +7,7 @@ RUN ln -s /duneci/toolchains/${TOOLCHAIN} /duneci/toolchain
ENV PATH=/duneci/install/bin:$PATH
RUN echo 'CMAKE_FLAGS+=" -DDUNE_PYTHON_VIRTUALENV_SETUP=1"' >> /duneci/cmake-flags/enable_virtualenv
RUN echo 'CMAKE_FLAGS+=" -DDUNE_PYTHON_VIRTUALENV_SETUP=1 -DDUNE_PYTHON_VIRTUALENV_PATH=/duneci/install/dune-python-venv"' >> /duneci/cmake-flags/enable_virtualenv
RUN duneci-install-module -b releases/2.7 https://gitlab.dune-project.org/core/dune-common.git \
&& duneci-install-module -b releases/2.7 https://gitlab.dune-project.org/core/dune-geometry.git \
&& duneci-install-module -b releases/2.7 https://gitlab.dune-project.org/staging/dune-uggrid.git \
......@@ -20,4 +20,4 @@ RUN duneci-install-module -b releases/2.7 https://gitlab.dune-project.org/core/d
&& duneci-install-module -b support/dune-copasi-v0.3 --recursive https://gitlab.dune-project.org/copasi/dune-logging.git \
&& duneci-install-module -b support/dune-copasi-v0.3 https://gitlab.dune-project.org/copasi/dune-pdelab.git \
&& duneci-install-module -b support/dune-copasi-v0.3 https://gitlab.dune-project.org/copasi/dune-multidomaingrid.git
RUN dunecontrol --opts=/duneci/dune.opts bexec cmake --build . -- install && rm -rf /duneci/modules/*
RUN find modules/* -prune -type d -exec cmake --build '{}'/build-cmake --target install \;
@PACKAGE_INIT@
get_filename_component(dune_copasi_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
include(CMakeFindDependencyMacro)
if(NOT TARGET dune_copasi::dune_copasi)
include("${dune_copasi_CMAKE_DIR}/dune-copasi-targets.cmake")
endif()
......@@ -25,7 +25,7 @@ elseif(Filesystem_FOUND)
endif()
if(BUILD_SHARED_LIBS)
install(TARGETS dune_copasi_lib)
install(TARGETS dune_copasi_lib EXPORT dune_copasi)
endif()
# MultiDomain library
......@@ -51,6 +51,7 @@ if(DUNE_COPASI_MD_EXECUTABLE)
dune_copasi_md_lib_fv
dune_copasi_md_lib_cg
dune_copasi_md_lib_fv_cg
EXPORT dune_copasi
COMPONENT MultiDomain
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
......@@ -82,6 +83,7 @@ if(DUNE_COPASI_SD_EXECUTABLE)
dune_copasi_sd_lib_fv_cg
COMPONENT SigleDomain
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
EXPORT dune_copasi
)
endif()
endif()
......
......@@ -6,6 +6,7 @@ if(DUNE_COPASI_SD_EXECUTABLE)
target_link_libraries(dune_copasi_sd PRIVATE dune_copasi_sd_lib)
add_dependencies(dune_copasi dune_copasi_sd)
install(TARGETS dune_copasi_sd
EXPORT dune_copasi
COMPONENT SigleDomain
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
endif()
......@@ -16,6 +17,7 @@ if(DUNE_COPASI_MD_EXECUTABLE)
target_link_libraries(dune_copasi_md PRIVATE dune_copasi_md_lib)
add_dependencies(dune_copasi dune_copasi_md)
install(TARGETS dune_copasi_md
EXPORT dune_copasi
COMPONENT MultiDomain
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
endif()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment