Allow internal version of dependencies
This commit is contained in:
parent
7a27dae025
commit
9c9aa6c2e3
3 changed files with 232 additions and 42 deletions
|
@ -5,20 +5,22 @@ project(CosmoToolbox)
|
|||
|
||||
include(GetGitRevisionDescription)
|
||||
include(ExternalProject)
|
||||
include(FindOpenMP)
|
||||
include(FindPkgConfig)
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
include(FindPythonInterp)
|
||||
set(NumPy_FIND_REQUIRED TRUE)
|
||||
include(${CMAKE_SOURCE_DIR}/FindPyLibs.cmake)
|
||||
include(${CMAKE_SOURCE_DIR}/FindNumPy.cmake)
|
||||
|
||||
|
||||
get_git_head_revision(HEAD GIT_VER)
|
||||
|
||||
option(BUILD_SHARED_LIBS "Build shared libraries." OFF)
|
||||
option(BUILD_STATIC_LIBS "Build static libraries." ON)
|
||||
option(ENABLE_OPENMP "Enable OpenMP support." OFF)
|
||||
option(ENABLE_SHARP "Enable SPHT support." ON)
|
||||
option(ENABLE_SHARP "Enable SHARP support." ON)
|
||||
option(INTERNAL_HDF5 "Build internal version of HDF5" OFF)
|
||||
option(INTERNAL_NETCDF "Build internal version of NETCDF" OFF)
|
||||
option(INTERNAL_BOOST "Build internal version of BOOST" OFF)
|
||||
|
||||
IF(BUILD_SHARED_LIBS AND BUILD_STATIC_LIBS)
|
||||
SET(CosmoTool_local CosmoTool_static)
|
||||
|
@ -26,10 +28,7 @@ ELSE(BUILD_SHARED_LIBS AND BUILD_STATIC_LIBS)
|
|||
SET(CosmoTool_local CosmoTool)
|
||||
ENDIF(BUILD_SHARED_LIBS AND BUILD_STATIC_LIBS)
|
||||
|
||||
find_path(NETCDF_INCLUDE_PATH NAMES netcdf.h)
|
||||
find_path(NETCDFCPP_INCLUDE_PATH NAMES netcdfcpp.h netcdf)
|
||||
find_path(GSL_INCLUDE_PATH NAMES gsl/gsl_blas.h)
|
||||
find_library(NETCDFCPP_LIBRARY NAMES netcdf_c++ netcdf_c++4)
|
||||
include(${CMAKE_SOURCE_DIR}/external/external_build.cmake)
|
||||
|
||||
IF(EXISTS ${NETCDFCPP_INCLUDE_PATH}/netcdf AND ${NETCDFCPP_LIBRARY} MATCHES "netcdf_c\\+\\+4")
|
||||
SET(FOUND_NETCDF4 1)
|
||||
|
@ -39,52 +38,20 @@ ELSE(EXISTS ${NETCDFCPP_INCLUDE_PATH}/netcdf AND ${NETCDFCPP_LIBRARY} MATCHES "n
|
|||
FILE(WRITE ${CMAKE_BINARY_DIR}/src/ctool_netcdf_ver.hpp "#undef NETCDFCPP4")
|
||||
ENDIF(EXISTS ${NETCDFCPP_INCLUDE_PATH}/netcdf AND ${NETCDFCPP_LIBRARY} MATCHES "netcdf_c\\+\\+4")
|
||||
|
||||
find_library(NETCDF_LIBRARY netcdf)
|
||||
find_library(GSL_LIBRARY gsl)
|
||||
find_library(GSLCBLAS_LIBRARY gslcblas)
|
||||
|
||||
find_program(CYTHON cython)
|
||||
|
||||
find_package(Boost 1.53)
|
||||
|
||||
include(${CMAKE_SOURCE_DIR}/external/external_build.cmake)
|
||||
|
||||
set(HDF5_FIND_COMPONENTS HL CXX)
|
||||
if(HDF5_ROOTDIR)
|
||||
SET(ENV{HDF5_ROOT} ${HDF5_ROOTDIR})
|
||||
endif(HDF5_ROOTDIR)
|
||||
include(FindHDF5)
|
||||
|
||||
include(FindPkgConfig)
|
||||
|
||||
pkg_check_modules(FFTW3 fftw3>=3.3)
|
||||
pkg_check_modules(FFTW3F fftw3f>=3.3)
|
||||
pkg_check_modules(EIGEN3 eigen3)
|
||||
|
||||
|
||||
find_library(FFTW3F_LIBRARY_FULL fftw3f PATHS ${FFTW3F_LIBDIR} NO_DEFAULT_PATH)
|
||||
find_library(FFTW3_LIBRARY_FULL fftw3 PATHS ${FFTW3_LIBDIR} NO_DEFAULT_PATH)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
set(NETCDF_FIND_REQUIRED TRUE)
|
||||
set(GSL_FIND_REQUIRED TRUE)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(NetCDF DEFAULT_MSG NETCDF_LIBRARY NETCDFCPP_LIBRARY NETCDF_INCLUDE_PATH)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GSL DEFAULT_MSG GSL_LIBRARY GSLCBLAS_LIBRARY GSL_INCLUDE_PATH)
|
||||
|
||||
IF(ENABLE_OPENMP)
|
||||
|
||||
IF (NOT OPENMP_FOUND)
|
||||
MESSAGE(ERROR "No known compiler option for enabling OpenMP")
|
||||
ENDIF(NOT OPENMP_FOUND)
|
||||
|
||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
|
||||
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_C_FLAGS}")
|
||||
ENDIF(ENABLE_OPENMP)
|
||||
|
||||
|
||||
|
||||
set(GSL_LIBRARIES ${GSL_LIBRARY} ${GSLCBLAS_LIBRARY})
|
||||
|
||||
# CPACK Configuration
|
||||
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "A toolbox for impatient cosmologists")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue