Skip to content
Snippets Groups Projects
Commit 2c3fc125 authored by Carsten Gräser's avatar Carsten Gräser
Browse files

[cmake] Update build system

The creation of the library needs to be updated, because
otherwise the library is not found by downstream modules.
parent d5027adb
No related branches found
No related tags found
1 merge request!82[cmake] Update build system
Pipeline #65686 passed
cmake_minimum_required(VERSION 2.8.6) if(dune-common_VERSION VERSION_GREATER_EQUAL 2.10.0)
cmake_minimum_required(VERSION 3.16)
else()
cmake_minimum_required(VERSION 3.13)
endif()
project(dune-solvers CXX) project(dune-solvers CXX)
if(NOT (dune-common_DIR OR dune-common_ROOT OR if(NOT (dune-common_DIR OR dune-common_ROOT OR
...@@ -22,9 +26,17 @@ dune_project() ...@@ -22,9 +26,17 @@ dune_project()
find_package(SuiteSparse OPTIONAL_COMPONENTS UMFPACK) find_package(SuiteSparse OPTIONAL_COMPONENTS UMFPACK)
include(AddSuiteSparseFlags) include(AddSuiteSparseFlags)
# Create library target and export it as Dune::Solvers
dune_add_library(dunesolvers EXPORT_NAME Solvers LINK_LIBRARIES ${DUNE_LIBS})
dune_register_package_flags(LIBRARIES dunesolvers)
add_subdirectory("dune") add_subdirectory("dune")
add_subdirectory("doc") add_subdirectory("doc")
add_subdirectory("cmake/modules") add_subdirectory("cmake/modules")
# finalize the dune project, e.g. generating config.h etc. if(dune-common_VERSION VERSION_GREATER_EQUAL 2.10.0)
finalize_dune_project(GENERATE_CONFIG_H_CMAKE) finalize_dune_project()
else()
finalize_dune_project(GENERATE_CONFIG_H_CMAKE)
endif()
dune_add_library("dunesolvers"
iterationsteps/blockgssteps.cc
solvers/criterion.cc)
dune_register_package_flags(LIBRARIES dunesolvers)
add_subdirectory("common") add_subdirectory("common")
add_subdirectory("iterationsteps") add_subdirectory("iterationsteps")
add_subdirectory("norms") add_subdirectory("norms")
...@@ -12,6 +6,10 @@ add_subdirectory("solvers") ...@@ -12,6 +6,10 @@ add_subdirectory("solvers")
add_subdirectory("test") add_subdirectory("test")
add_subdirectory("transferoperators") add_subdirectory("transferoperators")
target_sources(dunesolvers PRIVATE
iterationsteps/blockgssteps.cc
solvers/criterion.cc)
install(FILES install(FILES
computeenergy.hh computeenergy.hh
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dune/solvers) DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dune/solvers)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment