cosmotool/src/CMakeLists.txt

122 lines
3.1 KiB
CMake
Raw Normal View History

2014-05-25 11:11:44 +02:00
SET(CosmoTool_SRCS
fortran.cpp
interpolate.cpp
load_data.cpp
loadRamses.cpp
powerSpectrum.cpp
miniargs.cpp
growthFactor.cpp
cosmopower.cpp
cic.cpp
)
2010-09-12 21:09:39 +02:00
IF (Boost_FOUND)
include_directories(${Boost_INCLUDE_DIRS})
2015-04-28 17:07:57 +02:00
SET(CosmoTool_SRCS
${CosmoTool_SRCS}
loadGadget.cpp
)
ENDIF (Boost_FOUND)
IF (ENABLE_OPENMP)
ENDIF (ENABLE_OPENMP)
2015-04-07 14:45:38 +02:00
IF (YORICK_SUPPORT)
IF(FOUND_NETCDF3)
2012-09-19 15:15:09 +02:00
SET(CosmoTool_SRCS ${CosmoTool_SRCS} yorick_nc3.cpp)
2015-04-07 14:45:38 +02:00
ELSE(FOUND_NETCDF3)
IF(FOUND_NETCDF4)
2012-09-19 15:15:09 +02:00
SET(CosmoTool_SRCS ${CosmoTool_SRCS} yorick_nc4.cpp)
2015-04-07 14:45:38 +02:00
ENDIF(FOUND_NETCDF4)
ENDIF(FOUND_NETCDF3)
ENDIF(YORICK_SUPPORT)
2012-09-19 15:15:09 +02:00
2011-06-06 15:56:54 +02:00
if (HDF5_FOUND)
add_library(CosmoHDF5 OBJECT
2011-06-06 15:56:54 +02:00
h5_readFlash.cpp
loadFlash.cpp
)
2019-01-31 16:02:18 +01:00
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
loadFlash_dummy.cpp
)
2011-06-06 15:56:54 +02:00
endif (HDF5_FOUND)
2010-09-12 21:22:20 +02:00
SET(CosmoTool_SRCS ${CosmoTool_SRCS}
2010-09-12 21:09:39 +02:00
bqueue.hpp
config.hpp
dinterpolate.hpp
field.hpp
fixArray.hpp
fortran.hpp
interpolate3d.hpp
interpolate.hpp
kdtree_leaf.hpp
load_data.hpp
loadGadget.hpp
loadRamses.hpp
loadSimu.hpp
miniargs.hpp
mykdtree.hpp
octTree.hpp
powerSpectrum.hpp
sparseGrid.hpp
sphSmooth.hpp
yorick.hpp
growthFactor.hpp
2010-09-12 21:09:39 +02:00
)
2016-11-26 21:30:44 +01:00
include_directories(${GSL_INCLUDE_PATH} ${CMAKE_BINARY_DIR}/src)
2011-06-06 15:56:54 +02:00
2020-04-10 18:02:18 +02:00
set(CosmoTool_LIBS ${GSL_LIBRARIES} ${Boost_TARGET})
2015-04-07 14:45:38 +02:00
if(YORICK_SUPPORT)
set(CosmoTool_LIBS ${CosmoTool_LIBS} ${NETCDFCPP_LIBRARY} ${NETCDF_LIBRARY} ${GSL_LIBRARIES})
include_directories(${NETCDF_INCLUDE_PATH} ${NETCDFCPP_INCLUDE_PATH})
endif(YORICK_SUPPORT)
2016-11-26 21:30:44 +01:00
2011-06-06 15:56:54 +02:00
if (HDF5_FOUND)
2020-02-10 08:40:17 +01:00
set(CosmoTool_LIBS ${CosmoTool_LIBS} ${HDF5_CXX_LIBRARIES} ${HDF5_HL_LIBRARIES} ${HDF5_LIBRARIES} ${ZLIB_LIBRARY})
2016-11-26 21:30:44 +01:00
message(STATUS "CosmoTool_LIBS: ${CosmoTool_LIBS}")
2011-06-06 15:56:54 +02:00
endif (HDF5_FOUND)
set(CosmoTool_LIBS ${CosmoTool_LIBS} PARENT_SCOPE)
if (BUILD_SHARED_LIBS)
add_library(CosmoTool SHARED ${CosmoTool_SRCS} $<TARGET_OBJECTS:CosmoHDF5>)
target_link_libraries(CosmoTool ${CosmoTool_LIBS})
if (BUILD_STATIC_LIBS)
add_library(CosmoTool_static STATIC ${CosmoTool_SRCS} $<TARGET_OBJECTS:CosmoHDF5>)
target_link_libraries(CosmoTool_static)
set_property(TARGET CosmoTool_static PROPERTY POSITION_INDEPENDENT_CODE ON)
2020-04-03 19:17:27 +02:00
add_dependencies(CosmoTool_static ${cosmotool_DEPS})
endif(BUILD_STATIC_LIBS)
else (BUILD_SHARED_LIBS)
add_library(CosmoTool STATIC ${CosmoTool_SRCS} $<TARGET_OBJECTS:CosmoHDF5>)
2020-04-14 17:46:14 +02:00
target_link_libraries(CosmoTool ${CosmoTool_LIBS})
set_property(TARGET CosmoTool PROPERTY POSITION_INDEPENDENT_CODE ON)
2020-04-03 19:17:27 +02:00
add_dependencies(CosmoTool ${cosmotool_DEPS})
endif (BUILD_SHARED_LIBS)
2010-09-12 21:09:39 +02:00
IF(NOT COSMOTOOL_PYTHON_PACKAGING)
install(TARGETS CosmoTool
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
if (BUILD_SHARED_LIBS)
install(TARGETS CosmoTool_static
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
endif (BUILD_SHARED_LIBS)
install(DIRECTORY . DESTINATION include/CosmoTool
FILES_MATCHING PATTERN "*.hpp")
install(DIRECTORY ${OMPTL_BUILD_DIR}
DESTINATION include/CosmoTool)
install(DIRECTORY . DESTINATION include/CosmoTool
FILES_MATCHING PATTERN "*.tcc")
ENDIF()