From 82666a060622fdcb51e3f45b13c33acf40f2675c Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Wed, 15 Sep 2010 20:51:18 +0200 Subject: [PATCH] Updated CMake lists --- CMakeLists.txt | 2 ++ sample/CMakeLists.txt | 11 ++++++++++- src/CMakeLists.txt | 7 ++++--- 3 files changed, 16 insertions(+), 4 deletions(-) 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 67ebb7f..ca6c825 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -34,11 +34,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