From 69de687876b7dd035352e52843190decb94321fe Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Thu, 31 Jan 2019 16:02:18 +0100 Subject: [PATCH] Add missing deps --- external/external_build.cmake | 4 ++++ sample/CMakeLists.txt | 6 ++++++ src/CMakeLists.txt | 1 + 3 files changed, 11 insertions(+) diff --git a/external/external_build.cmake b/external/external_build.cmake index 48ce837..53f7949 100644 --- a/external/external_build.cmake +++ b/external/external_build.cmake @@ -12,6 +12,7 @@ SET(BOOST_URL "http://sourceforge.net/projects/boost/files/boost/1.61.0/boost_1_ SET(GSL_URL "ftp://ftp.gnu.org/gnu/gsl/gsl-1.15.tar.gz" CACHE STRING "URL to download GSL from ") mark_as_advanced(FFTW_URL EIGEN_URL HDF5_URL NETCDF_URL BOOST_URL GSL_URL) +SET(all_deps) MACRO(CHECK_CHANGE_STATE VAR) IF (DEFINED _PREVIOUS_${VAR}) @@ -108,6 +109,7 @@ if (INTERNAL_HDF5) MESSAGE(STATUS "Internal HDF5 directory: $ENV{HDF5_ROOT}") MESSAGE(STATUS "Libs: ${HDF5_LIBRARIES}") SET(HDF5_FOUND TRUE) + SET(all_deps ${all_deps} hdf5) else (INTERNAL_HDF5) mark_as_advanced(CLEAR HDF5_LIBRARIES HDF5_CXX_LIBRARIES HDF5_INCLUDE_DIRS) if(HDF5_ROOTDIR) @@ -209,6 +211,8 @@ if (INTERNAL_NETCDF) SET(NETCDF_INCLUDE_PATH ${NETCDF_BIN_DIR}/include CACHE STRING "NetCDF include" FORCE) SET(NETCDFCPP_INCLUDE_PATH ${NETCDF_INCLUDE_PATH} CACHE STRING "NetCDF C++ include path" FORCE) + SET(all_deps ${all_deps} netcdf netcdf-c++) + ELSE(INTERNAL_NETCDF) find_path(NETCDF_INCLUDE_PATH NAMES netcdf.h) find_path(NETCDFCPP_INCLUDE_PATH NAMES netcdfcpp.h netcdf) diff --git a/sample/CMakeLists.txt b/sample/CMakeLists.txt index 02b7a12..53429da 100644 --- a/sample/CMakeLists.txt +++ b/sample/CMakeLists.txt @@ -105,6 +105,12 @@ if (Boost_FOUND) add_executable(graficToDensity graficToDensity.cpp) target_link_libraries(graficToDensity ${tolink}) + if (all_deps) + message(STATUS "Deps = ${all_deps}") + add_dependencies(gadgetToArray ${all_deps}) + add_dependencies(testHDF5 ${all_deps}) + add_dependencies(graficToDensity ${all_deps}) + endif() endif() endif (Boost_FOUND) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b9c1dc2..8b27365 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -38,6 +38,7 @@ if (HDF5_FOUND) h5_readFlash.cpp loadFlash.cpp ) + set_property(TARGET CosmoHDF5 PROPERTY POSITION_INDEPENDENT_CODE ${BUILD_SHARED_LIBS}) target_include_directories(CosmoHDF5 BEFORE PRIVATE ${HDF5_INCLUDE_DIR}) else(HDF5_FOUND) add_library(CosmoHdf5 OBJECT