Made SHARP building optional
This commit is contained in:
parent
6296f4c8cf
commit
848f557626
@ -12,6 +12,7 @@ get_git_head_revision(HEAD GIT_VER)
|
|||||||
option(BUILD_SHARED_LIBS "Build shared libraries." OFF)
|
option(BUILD_SHARED_LIBS "Build shared libraries." OFF)
|
||||||
option(BUILD_STATIC_LIBS "Build static libraries." ON)
|
option(BUILD_STATIC_LIBS "Build static libraries." ON)
|
||||||
option(ENABLE_OPENMP "Enable OpenMP support." OFF)
|
option(ENABLE_OPENMP "Enable OpenMP support." OFF)
|
||||||
|
option(ENABLE_SHARP "Enable SPHT support." ON)
|
||||||
|
|
||||||
find_path(NETCDF_INCLUDE_PATH NAMES netcdf.h)
|
find_path(NETCDF_INCLUDE_PATH NAMES netcdf.h)
|
||||||
find_path(NETCDFCPP_INCLUDE_PATH NAMES netcdfcpp.h netcdf)
|
find_path(NETCDFCPP_INCLUDE_PATH NAMES netcdfcpp.h netcdf)
|
||||||
@ -30,21 +31,21 @@ find_library(NETCDFCPP_LIBRARY NAMES netcdf_c++ netcdf_c++4)
|
|||||||
find_library(GSL_LIBRARY gsl)
|
find_library(GSL_LIBRARY gsl)
|
||||||
find_library(GSLCBLAS_LIBRARY gslcblas)
|
find_library(GSLCBLAS_LIBRARY gslcblas)
|
||||||
|
|
||||||
SET(SHARP_SOURCE ${CMAKE_SOURCE_DIR}/external/sharp)
|
if (ENABLE_SHARP)
|
||||||
SET(DEP_BUILD ${CMAKE_SOURCE_DIR}/external/sharp/auto)
|
SET(SHARP_SOURCE ${CMAKE_SOURCE_DIR}/external/sharp)
|
||||||
ExternalProject_Add(sharp
|
SET(DEP_BUILD ${CMAKE_SOURCE_DIR}/external/sharp/auto)
|
||||||
SOURCE_DIR ${SHARP_SOURCE}
|
ExternalProject_Add(sharp
|
||||||
BUILD_IN_SOURCE 1
|
SOURCE_DIR ${SHARP_SOURCE}
|
||||||
CONFIGURE_COMMAND ${SHARP_SOURCE}/configure --prefix=${DEP_BUILD}
|
BUILD_IN_SOURCE 1
|
||||||
BUILD_COMMAND ${CMAKE_MAKE_PROGRAM}
|
CONFIGURE_COMMAND ${SHARP_SOURCE}/configure --prefix=${DEP_BUILD}
|
||||||
INSTALL_COMMAND echo "No install"
|
BUILD_COMMAND ${CMAKE_MAKE_PROGRAM}
|
||||||
)
|
INSTALL_COMMAND echo "No install"
|
||||||
|
)
|
||||||
|
SET(SHARP_LIBRARY ${DEP_BUILD}/lib/libsharp.a)
|
||||||
|
SET(SHARP_LIBRARIES ${SHARP_LIBRARY})
|
||||||
|
SET(SHARP_INCLUDE_PATH ${DEP_BUILD}/include)
|
||||||
|
endif (ENABLE_SHARP)
|
||||||
|
|
||||||
SET(SHARP_LIBRARY ${DEP_BUILD}/lib/libsharp.a)
|
|
||||||
SET(FFTPACK_LIBRARY ${DEP_BUILD}/lib/libfftpack.a)
|
|
||||||
SET(CUTILS_LIBRARY ${DEP_BUILD}/lib/libc_utils.a)
|
|
||||||
SET(SHARP_LIBRARIES ${SHARP_LIBRARY} ${FFTPACK_LIBRARY} ${CUTILS_LIBRARY})
|
|
||||||
SET(SHARP_INCLUDE_PATH ${DEP_BUILD}/include)
|
|
||||||
|
|
||||||
set(HDF5_FIND_COMPONENTS HL CXX)
|
set(HDF5_FIND_COMPONENTS HL CXX)
|
||||||
if(HDF5_ROOTDIR)
|
if(HDF5_ROOTDIR)
|
||||||
|
@ -52,13 +52,13 @@ if (FFTW3_FOUND AND FFTW3F_FOUND AND EIGEN3_FOUND)
|
|||||||
target_link_libraries(test_fft_calls ${tolink} ${FFTW3_LIBRARIES} ${FFTW3F_LIBRARIES})
|
target_link_libraries(test_fft_calls ${tolink} ${FFTW3_LIBRARIES} ${FFTW3F_LIBRARIES})
|
||||||
endif (FFTW3_FOUND AND FFTW3F_FOUND AND EIGEN3_FOUND)
|
endif (FFTW3_FOUND AND FFTW3F_FOUND AND EIGEN3_FOUND)
|
||||||
|
|
||||||
if (SHARP_LIBRARY AND SHARP_INCLUDE_PATH AND EIGEN3_FOUND)
|
if (ENABLE_SHARP AND SHARP_LIBRARY AND SHARP_INCLUDE_PATH AND EIGEN3_FOUND)
|
||||||
include_directories(${SHARP_INCLUDE_PATH})
|
include_directories(${SHARP_INCLUDE_PATH})
|
||||||
add_executable(test_healpix_calls test_healpix_calls.cpp)
|
add_executable(test_healpix_calls test_healpix_calls.cpp)
|
||||||
target_link_libraries(test_healpix_calls ${tolink} ${SHARP_LIBRARIES})
|
target_link_libraries(test_healpix_calls ${tolink} ${SHARP_LIBRARIES})
|
||||||
set_target_properties(test_healpix_calls PROPERTIES COMPILE_FLAGS ${OpenMP_CXX_FLAGS} LINK_FLAGS ${OpenMP_CXX_FLAGS})
|
set_target_properties(test_healpix_calls PROPERTIES COMPILE_FLAGS ${OpenMP_CXX_FLAGS} LINK_FLAGS ${OpenMP_CXX_FLAGS})
|
||||||
add_dependencies(test_healpix_calls sharp)
|
add_dependencies(test_healpix_calls sharp)
|
||||||
endif (SHARP_LIBRARY AND SHARP_INCLUDE_PATH AND EIGEN3_FOUND)
|
endif (ENABLE_SHARP AND SHARP_LIBRARY AND SHARP_INCLUDE_PATH AND EIGEN3_FOUND)
|
||||||
|
|
||||||
add_executable(test_cosmopower test_cosmopower.cpp)
|
add_executable(test_cosmopower test_cosmopower.cpp)
|
||||||
target_link_libraries(test_cosmopower ${tolink})
|
target_link_libraries(test_cosmopower ${tolink})
|
||||||
|
Loading…
Reference in New Issue
Block a user