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 871be7e commit 6880a95
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ opensuse:15.1:
stage: build
image: docker.pkg.github.com/espressomd/docker/opensuse:446ff604bbfa63f30ddb462697fa0d0dc2630460
script:
- export with_cuda=false myconfig=maxset make_check_python=false with_stokesian_dynamics=true
- export with_cuda=false myconfig=maxset make_check_python=false
- bash maintainer/CI/build_cmake.sh
tags:
- docker
Expand Down Expand Up @@ -228,7 +228,7 @@ cuda9-maxset:
GCOV: 'gcov-6'
script:
- export myconfig=maxset with_cuda=true with_coverage=true test_timeout=900 srcdir=${CI_PROJECT_DIR}
- export with_scafacos=true with_stokesian_dynamics=true
- export with_scafacos=true
- bash maintainer/CI/build_cmake.sh
artifacts:
paths:
Expand Down
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
2 changes: 1 addition & 1 deletion doc/sphinx/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,7 @@ the CMake logic needs editing:
.. code-block:: bash
sed -ri 's|GIT_REPOSITORY +.+/stokesian_dynamics|GIT_REPOSITORY /work/username/stokesian_dynamics|' CMakeLists.txt
sed -ri 's|GIT_REPOSITORY +.+stokesian-dynamics.git|GIT_REPOSITORY /work/username/stokesian_dynamics|' CMakeLists.txt
Compiling, testing and installing
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 6880a95

Please sign in to comment.