From 0afe7b7eab13f672f6325a35bc8dbfbb91104f2d Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Wed, 12 Sep 2012 21:30:20 -0400 Subject: [PATCH] Fixed build for handling only static lib --- sample/CMakeLists.txt | 4 ++-- src/CMakeLists.txt | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/sample/CMakeLists.txt b/sample/CMakeLists.txt index d895959..408ccf8 100644 --- a/sample/CMakeLists.txt +++ b/sample/CMakeLists.txt @@ -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}) add_executable(testBQueue testBQueue.cpp) @@ -35,4 +35,4 @@ add_executable(testEskow testEskow.cpp) target_link_libraries(testEskow ${tolink}) add_executable(testAlgo testAlgo.cpp) -target_link_libraries(testAlgo ${tolink}) \ No newline at end of file +target_link_libraries(testAlgo ${tolink}) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e31e51a..8e05ccc 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -54,6 +54,9 @@ if (HDF5_FOUND) include_directories(${HDF5_INCLUDE_DIRS}) endif (HDF5_FOUND) +message("${CosmoTool_LIBS}") +set(CosmoTool_LIBS ${CosmoTool_LIBS} PARENT_SCOPE) + if (BUILD_SHARED_LIBS) add_library(CosmoTool SHARED ${CosmoTool_SRCS}) target_link_libraries(CosmoTool ${CosmoTool_LIBS}) @@ -62,7 +65,7 @@ if (BUILD_SHARED_LIBS) add_library(CosmoTool_static STATIC ${CosmoTool_SRCS}) endif(BUILD_STATIC_LIBS) else (BUILD_SHARED_LIBS) - add_library(CosmoTool STATIC ${CosmoTool_LIBS}) + add_library(CosmoTool STATIC ${CosmoTool_SRCS}) endif (BUILD_SHARED_LIBS) install(TARGETS CosmoTool