Fixed conflict
This commit is contained in:
commit
7b5b1d5002
@ -11,10 +11,17 @@ option(BUILD_SHARED_LIBS "Build shared libraries." OFF)
|
|||||||
option(BUILD_STATIC_LIBS "Build static libraries." ON)
|
option(BUILD_STATIC_LIBS "Build static libraries." 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(GSL_INCLUDE_PATH NAMES gsl/gsl_blas.h)
|
find_path(GSL_INCLUDE_PATH NAMES gsl/gsl_blas.h)
|
||||||
|
|
||||||
|
IF(EXISTS ${NETCDFCPP_INCLUDE_PATH}/netcdf)
|
||||||
|
FILE(WRITE ${CMAKE_BINARY_DIR}/src/ctool_netcdf_ver.hpp "#define NETCDFCPP4 1")
|
||||||
|
ELSE(EXISTS ${NETCDFCPP_INCLUDE_PATH}/netcdf)
|
||||||
|
FILE(WRITE ${CMAKE_BINARY_DIR}/src/ctool_netcdf_ver.hpp "#undef NETCDFCPP4")
|
||||||
|
ENDIF(EXISTS ${NETCDFCPP_INCLUDE_PATH}/netcdf)
|
||||||
|
|
||||||
find_library(NETCDF_LIBRARY netcdf)
|
find_library(NETCDF_LIBRARY netcdf)
|
||||||
find_library(NETCDFCPP_LIBRARY netcdf_c++)
|
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)
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
SET(tolink ${GSL_LIBRARIES} CosmoTool)
|
SET(tolink ${GSL_LIBRARIES} CosmoTool ${CosmoTool_LIBS})
|
||||||
include_directories(${CMAKE_SOURCE_DIR}/src ${NETCDF_INCLUDE_PATH} ${GSL_INCLUDE_PATH})
|
include_directories(${CMAKE_SOURCE_DIR}/src ${NETCDF_INCLUDE_PATH} ${GSL_INCLUDE_PATH})
|
||||||
|
|
||||||
add_executable(testBQueue testBQueue.cpp)
|
add_executable(testBQueue testBQueue.cpp)
|
||||||
@ -38,4 +38,4 @@ add_executable(testAlgo testAlgo.cpp)
|
|||||||
target_link_libraries(testAlgo ${tolink})
|
target_link_libraries(testAlgo ${tolink})
|
||||||
|
|
||||||
add_executable(testBSP testBSP.cpp)
|
add_executable(testBSP testBSP.cpp)
|
||||||
target_link_libraries(testBSP ${tolink})
|
target_link_libraries(testBSP ${tolink})
|
||||||
|
@ -46,7 +46,7 @@ SET(CosmoTool_SRCS ${CosmoTool_SRCS}
|
|||||||
growthFactor.hpp
|
growthFactor.hpp
|
||||||
)
|
)
|
||||||
|
|
||||||
include_directories(${GSL_INCLUDE_PATH} ${NETCDF_INCLUDE_PATH})
|
include_directories(${GSL_INCLUDE_PATH} ${NETCDF_INCLUDE_PATH} ${NETCDFCPP_INCLUDE_PATH} ${CMAKE_BINARY_DIR}/src)
|
||||||
|
|
||||||
set(CosmoTool_LIBS ${NETCDF_LIBRARY} ${NETCDFCPP_LIBRARY} ${GSL_LIBRARIES})
|
set(CosmoTool_LIBS ${NETCDF_LIBRARY} ${NETCDFCPP_LIBRARY} ${GSL_LIBRARIES})
|
||||||
if (HDF5_FOUND)
|
if (HDF5_FOUND)
|
||||||
@ -54,6 +54,9 @@ if (HDF5_FOUND)
|
|||||||
include_directories(${HDF5_INCLUDE_DIRS})
|
include_directories(${HDF5_INCLUDE_DIRS})
|
||||||
endif (HDF5_FOUND)
|
endif (HDF5_FOUND)
|
||||||
|
|
||||||
|
message("${CosmoTool_LIBS}")
|
||||||
|
set(CosmoTool_LIBS ${CosmoTool_LIBS} PARENT_SCOPE)
|
||||||
|
|
||||||
if (BUILD_SHARED_LIBS)
|
if (BUILD_SHARED_LIBS)
|
||||||
add_library(CosmoTool SHARED ${CosmoTool_SRCS})
|
add_library(CosmoTool SHARED ${CosmoTool_SRCS})
|
||||||
target_link_libraries(CosmoTool ${CosmoTool_LIBS})
|
target_link_libraries(CosmoTool ${CosmoTool_LIBS})
|
||||||
@ -62,7 +65,7 @@ if (BUILD_SHARED_LIBS)
|
|||||||
add_library(CosmoTool_static STATIC ${CosmoTool_SRCS})
|
add_library(CosmoTool_static STATIC ${CosmoTool_SRCS})
|
||||||
endif(BUILD_STATIC_LIBS)
|
endif(BUILD_STATIC_LIBS)
|
||||||
else (BUILD_SHARED_LIBS)
|
else (BUILD_SHARED_LIBS)
|
||||||
add_library(CosmoTool STATIC ${CosmoTool_LIBS})
|
add_library(CosmoTool STATIC ${CosmoTool_SRCS})
|
||||||
endif (BUILD_SHARED_LIBS)
|
endif (BUILD_SHARED_LIBS)
|
||||||
|
|
||||||
install(TARGETS CosmoTool
|
install(TARGETS CosmoTool
|
||||||
|
@ -1,5 +1,11 @@
|
|||||||
|
#include "ctool_netcdf_ver.hpp"
|
||||||
#include "config.hpp"
|
#include "config.hpp"
|
||||||
|
#ifdef NETCDFCPP4
|
||||||
|
#include <netcdf>
|
||||||
|
using namespace netCDF
|
||||||
|
#else
|
||||||
#include <netcdfcpp.h>
|
#include <netcdfcpp.h>
|
||||||
|
#endif
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include "yorick.hpp"
|
#include "yorick.hpp"
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
Loading…
Reference in New Issue
Block a user