From 0fe45db47151781a8ad042fed07fdb7eca1eb453 Mon Sep 17 00:00:00 2001 From: hrocho Date: Wed, 18 Apr 2018 15:19:03 +0200 Subject: [PATCH] cmake --- CMakeLists.txt | 10 +++++++++- init.sh.in | 4 ++-- tests/CMakeLists.txt | 4 +++- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7a531c3..7b20e0c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -70,7 +70,15 @@ file(GLOB HEADERS *.h) add_library(catima SHARED ${SOURCES}) add_library(catima_static STATIC ${SOURCES}) -set_target_properties(catima_static PROPERTIES OUTPUT_NAME catima POSITION_INDEPENDENT_CODE ON) +set_target_properties(catima PROPERTIES + POSITION_INDEPENDENT_CODE ON + LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib + ) +set_target_properties(catima_static + PROPERTIES OUTPUT_NAME catima + POSITION_INDEPENDENT_CODE ON + ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib + ) target_link_libraries(catima ${EXTRA_LIBS} ${GSL_LIBRARIES} ) target_link_libraries(catima_static ${EXTRA_LIBS} ${GSL_LIBRARIES}) diff --git a/init.sh.in b/init.sh.in index ca633dd..45fc1b1 100644 --- a/init.sh.in +++ b/init.sh.in @@ -1,3 +1,3 @@ export CATIMAPATH=${PROJECT_BINARY_DIR} -#export PATH=$PATH:$CATIMAPATH/bin -export ${RPATH_VARIABLE}=$LD_LIBRARY_PATH:$CATIMAPATH +export PATH=$PATH:$CATIMAPATH/bin +export ${RPATH_VARIABLE}=$LD_LIBRARY_PATH:$CATIMAPATH/lib diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 57e6871..8cd4446 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,3 +1,4 @@ +enable_testing() add_definitions(-Dlest_FEATURE_COLOURISE=1) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/tests) @@ -6,6 +7,7 @@ set(CATIMA_TESTS test_calculations test_generated test_storage test_structures t foreach(entry ${CATIMA_TESTS}) add_executable(${entry} ${entry}.cpp) target_link_libraries(${entry} catima) + add_test(${entry} ${PROJECT_BINARY_DIR}/tests/${entry}) endforeach(entry in ${CATIMA_TESTS}) @@ -14,4 +16,4 @@ MESSAGE( STATUS "CMAKE_C_COMPILER: " ${CMAKE_C_COMPILER} ) foreach(entry ${C_TESTS}) add_executable(${entry} ${entry}.c) target_link_libraries(${entry} catima) -endforeach(entry in ${C_TESTS}) \ No newline at end of file +endforeach(entry in ${C_TESTS})