Skip to content

Commit

Permalink
SD: Move to FetchContent project
Browse files Browse the repository at this point in the history
  • Loading branch information
jngrad committed Jul 4, 2020
1 parent b9dc8d0 commit 70465f4
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 10 deletions.
17 changes: 17 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
13 changes: 4 additions & 9 deletions libs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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 $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/stokesian_dynamics/include>)
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)
2 changes: 1 addition & 1 deletion src/core/stokesian_dynamics/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 70465f4

Please sign in to comment.