cosmotool/src/CMakeLists.txt

106 lines
2.5 KiB
CMake
Raw Normal View History

2014-05-25 11:11:44 +02:00
2010-09-12 21:09:39 +02:00
SET(CosmoTool_SRCS
fortran.cpp
interpolate.cpp
load_data.cpp
loadGadget.cpp
loadRamses.cpp
powerSpectrum.cpp
2010-09-12 21:22:20 +02:00
miniargs.cpp
growthFactor.cpp
cosmopower.cpp
2015-02-10 14:20:09 +01:00
cic.cpp
2010-09-12 21:09:39 +02:00
)
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)
set(CosmoTool_SRCS ${CosmoTool_SRCS}
h5_readFlash.cpp
loadFlash.cpp
)
else(HDF5_FOUND)
set(CosmoTool_SRCS ${CosmoTool_SRCS}
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
)
2015-04-07 14:45:38 +02:00
include_directories(${GSL_INCLUDE_PATH} ${CMAKE_BINARY_DIR}/src)
2011-06-06 15:56:54 +02:00
2015-04-07 14:45:38 +02:00
set(CosmoTool_LIBS ${GSL_LIBRARIES})
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)
2011-06-06 15:56:54 +02:00
if (HDF5_FOUND)
set(CosmoTool_LIBS ${CosmoTool_LIBS} ${HDF5_CXX_LIBRARIES} ${HDF5_LIBRARIES})
include_directories(${HDF5_INCLUDE_DIRS})
endif (HDF5_FOUND)
set(CosmoTool_LIBS ${CosmoTool_LIBS} PARENT_SCOPE)
if (BUILD_SHARED_LIBS)
add_library(CosmoTool SHARED ${CosmoTool_SRCS})
target_link_libraries(CosmoTool ${CosmoTool_LIBS})
if (BUILD_STATIC_LIBS)
add_library(CosmoTool_static STATIC ${CosmoTool_SRCS})
set_target_properties(CosmoTool_static PROPERTIES COMPILE_FLAGS "${CMAKE_C_COMPILE_OPTIONS_PIC}")
endif(BUILD_STATIC_LIBS)
else (BUILD_SHARED_LIBS)
add_library(CosmoTool STATIC ${CosmoTool_SRCS})
set_target_properties(CosmoTool PROPERTIES COMPILE_FLAGS "${CMAKE_C_COMPILE_OPTIONS_PIC}")
endif (BUILD_SHARED_LIBS)
2010-09-12 21:09:39 +02:00
install(TARGETS CosmoTool
2010-09-15 20:51:18 +02:00
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
if (BUILD_SHARED_LIBS)
install(TARGETS CosmoTool_static
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
endif (BUILD_SHARED_LIBS)
2010-09-12 21:09:39 +02:00
install(DIRECTORY . DESTINATION include/CosmoTool
FILES_MATCHING PATTERN "*.hpp")
2014-05-22 09:27:53 +02:00
install(DIRECTORY ${OMPTL_BUILD_DIR}
DESTINATION include/CosmoTool/omptl)
2010-09-12 21:09:39 +02:00
install(DIRECTORY . DESTINATION include/CosmoTool
FILES_MATCHING PATTERN "*.tcc")