diff --git a/CMakeLists.txt b/CMakeLists.txt index e60c00f0a78..37f6a1743a5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -293,6 +293,23 @@ if(WITH_STOKESIAN_DYNAMICS) endif() endif(WITH_STOKESIAN_DYNAMICS) +if(WITH_STOKESIAN_DYNAMICS) + set(CMAKE_INSTALL_LIBDIR + "${CMAKE_INSTALL_PREFIX}/${PYTHON_INSTDIR}/espressomd") + cmake_minimum_required(VERSION 3.11) + include(FetchContent) + FetchContent_Declare( + stokesian_dynamics + GIT_REPOSITORY https://github.com/hmenke/espresso-stokesian-dynamics.git + GIT_TAG 860ceac208175) + FetchContent_GetProperties(stokesian_dynamics) + if(NOT stokesian_dynamics_POPULATED) + FetchContent_Populate(stokesian_dynamics) + add_subdirectory(${stokesian_dynamics_SOURCE_DIR} + ${stokesian_dynamics_BINARY_DIR}) + endif() +endif(WITH_STOKESIAN_DYNAMICS) + if(WITH_VALGRIND_INSTRUMENTATION) find_package(PkgConfig) pkg_check_modules(VALGRIND valgrind) diff --git a/libs/CMakeLists.txt b/libs/CMakeLists.txt index 9b8583c44b7..2e876e3dbb3 100644 --- a/libs/CMakeLists.txt +++ b/libs/CMakeLists.txt @@ -1,13 +1,8 @@ add_library(Random123 INTERFACE) -target_include_directories(Random123 SYSTEM INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/Random123-1.09/include) +target_include_directories( + Random123 SYSTEM INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/Random123-1.09/include) target_compile_definitions(Random123 INTERFACE R123_USE_MULHILO64_C99) add_library(h5xx INTERFACE) -target_include_directories(h5xx SYSTEM INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/h5xx) - -if(STOKESIAN_DYNAMICS OR STOKESIAN_DYNAMICS_GPU) - add_library(stokesian_dynamics INTERFACE) - target_include_directories(stokesian_dynamics INTERFACE $) - set(CMAKE_INSTALL_LIBDIR "${CMAKE_INSTALL_PREFIX}/${PYTHON_INSTDIR}/espressomd") - add_subdirectory(stokesian_dynamics/src) -endif() +target_include_directories(h5xx SYSTEM + INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/h5xx) diff --git a/src/core/stokesian_dynamics/CMakeLists.txt b/src/core/stokesian_dynamics/CMakeLists.txt index ffaaa02af88..9292f026a36 100644 --- a/src/core/stokesian_dynamics/CMakeLists.txt +++ b/src/core/stokesian_dynamics/CMakeLists.txt @@ -18,7 +18,7 @@ # target_include_directories( - EspressoCore PRIVATE ${CMAKE_SOURCE_DIR}/libs/stokesian_dynamics/include + EspressoCore PRIVATE ${stokesian_dynamics_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src/core/stokesian_dynamics) target_sources(EspressoCore