Skip to content
Snippets Groups Projects
Commit 55746f2f authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

Merge branch 'issue/optional-submodules' into 'master'

Make nanoflann an optional dependency

See merge request !29
parents 0dfdf383 798569c3
No related branches found
No related tags found
1 merge request!29Make nanoflann an optional dependency
Pipeline #10471 passed
......@@ -20,18 +20,20 @@ dune_add_test(SOURCES discretegridviewfunctiontest.cc
dune-foamgrid_FOUND
dune-functions_FOUND)
dune_add_test(SOURCES explicitsurfacetest.cc
COMPILE_DEFINITIONS
DUNE_GRID_PATH=\"${PROJECT_SOURCE_DIR}/doc/grids/\"
LINK_LIBRARIES
nanoflann::nanoflann
CMAKE_GUARD
dune-foamgrid_FOUND
dune-functions_FOUND)
if(TARGET nanoflann::nanoflann)
dune_add_test(SOURCES explicitsurfacetest.cc
COMPILE_DEFINITIONS
DUNE_GRID_PATH=\"${PROJECT_SOURCE_DIR}/doc/grids/\"
LINK_LIBRARIES
nanoflann::nanoflann
CMAKE_GUARD
dune-foamgrid_FOUND
dune-functions_FOUND)
endif()
dune_add_test(SOURCES implicitsurfacetest.cc
COMPILE_DEFINITIONS
DUNE_GRID_PATH=\"${PROJECT_SOURCE_DIR}/doc/grids/\"
CMAKE_GUARD
dune-foamgrid_FOUND
dune-functions_FOUND)
\ No newline at end of file
dune-functions_FOUND)
......@@ -8,17 +8,15 @@ if(GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git")
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
RESULT_VARIABLE GIT_SUBMOD_RESULT)
if(NOT GIT_SUBMOD_RESULT EQUAL "0")
message(FATAL_ERROR "git submodule update --init failed with ${GIT_SUBMOD_RESULT}, please checkout submodules")
message(WARNING "git submodule update --init failed with ${GIT_SUBMOD_RESULT}, please checkout submodules or set GIT_SUBMODULE=OFF")
endif()
endif()
endif()
if(NOT EXISTS "${PROJECT_SOURCE_DIR}/libs/nanoflann/include/nanoflann.hpp")
message(FATAL_ERROR "The submodules were not downloaded! GIT_SUBMODULE was turned off or failed. Please update submodules and try again.")
if(EXISTS "${PROJECT_SOURCE_DIR}/libs/nanoflann/include/nanoflann.hpp")
set(DUNE_REENABLE_ADD_TEST ON)
set(BUILD_BENCHMARKS OFF CACHE BOOL "")
set(BUILD_EXAMPLES OFF CACHE BOOL "")
set(BUILD_TESTS OFF CACHE BOOL "")
add_subdirectory(nanoflann)
endif()
set(DUNE_REENABLE_ADD_TEST ON)
set(BUILD_BENCHMARKS OFF CACHE BOOL "")
set(BUILD_EXAMPLES OFF CACHE BOOL "")
set(BUILD_TESTS OFF CACHE BOOL "")
add_subdirectory(nanoflann)
\ No newline at end of file
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