diff --git a/CMakeLists.txt b/CMakeLists.txt index 118c2e7..afc69a2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,8 @@ cmake_minimum_required(VERSION 2.6) project(CosmoToolbox) +option(BUILD_SHARED_LIBS "Build shared libraries." OFF) + find_path(NETCDF_INCLUDE_PATH NAMES netcdf.h) find_path(GSL_INCLUDE_PATH NAMES gsl/gsl_blas.h) diff --git a/sample/CMakeLists.txt b/sample/CMakeLists.txt index d0ad82e..1bffaaa 100644 --- a/sample/CMakeLists.txt +++ b/sample/CMakeLists.txt @@ -1,4 +1,4 @@ -SET(tolink ${CMAKE_BINARY_DIR}/src/libCosmoTool.so ${GSL_LIBRARY} ${GSLCBLAS_LIBRARY}) +SET(tolink CosmoTool ${GSL_LIBRARY} ${GSLCBLAS_LIBRARY}) include_directories(${CMAKE_SOURCE_DIR}/src) add_executable(testBQueue testBQueue.cpp) @@ -9,3 +9,12 @@ target_link_libraries(testInterpolate ${tolink}) add_executable(testSmooth testSmooth.cpp) target_link_libraries(testSmooth ${tolink}) + +add_executable(testkd testkd.cpp) +target_link_libraries(testkd ${tolink}) + +add_executable(testkd2 testkd2.cpp) +target_link_libraries(testkd2 ${tolink}) + +add_executable(testDelaunay testDelaunay.cpp) +target_link_libraries(testDelaunay ${tolink}) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4550564..f89d2c4 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -33,11 +33,12 @@ SET(CosmoTool_SRCS ${CosmoTool_SRCS} yorick.hpp ) -add_library(CosmoTool SHARED ${CosmoTool_SRCS}) -target_link_libraries(CosmoTool ${NETCDF_LIBRARY} ${NETCDFCPP_LIBRARY}) +add_library(CosmoTool ${CosmoTool_SRCS}) +target_link_libraries(CosmoTool ${NETCDF_LIBRARY} ${NETCDFCPP_LIBRARY} ${GSL_LIBRARY} ${GSLCBLAS_LIBRARY}) install(TARGETS CosmoTool - LIBRARY DESTINATION lib) + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) install(DIRECTORY . DESTINATION include/CosmoTool FILES_MATCHING PATTERN "*.hpp") install(DIRECTORY . DESTINATION include/CosmoTool