Commit 101cfff4 authored by steinbac's avatar steinbac

refactored finding boost into tests

parent 3ac78cdb
......@@ -24,6 +24,7 @@ SET (COMPASS_VENDOR_ID "psteinb")
SET (COMPASS_ID "${COMPASS_VENDOR_ID}.${PROJECT_NAME}")
option(WITH_CXX11_ABI "enable _GLIBCXX_USE_CXX11_ABI in GCC 5.0+" ON)
option(WITH_TESTS "enable unit tests" ON)
check_cxx_compiler_flag(-Wl,-Bsymbolic HAS_BSYMBOLIC_COMPILERFLAG)
check_cxx_compiler_flag("-Xclang -march=native" HAS_XCLANG_COMPILERFLAG)
......@@ -55,27 +56,17 @@ IF(NOT WIN32)
ELSE()
check_symbol_exists(__cpuid "intrin.h" GET_CPUID_INSTRINSIC_EXISTS)
check_symbol_exists(__cpuidex "intrin.h" GET_CPUIDEX_INSTRINSIC_EXISTS)
add_definitions(-DBOOST_ALL_NO_LIB)
ENDIF()
if(WITH_TESTS)
add_definitions(-DBOOST_ALL_NO_LIB)
set(Boost_USE_STATIC_LIBS OFF)
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME OFF)
ENDIF()
#list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake )
FIND_PACKAGE (Boost 1.50 COMPONENTS system filesystem unit_test_framework QUIET)
IF(DEFINED Boost_FOUND)
include_directories(${Boost_INCLUDE_DIR})
link_directories(${Boost_LIBRARY_DIR})
MESSAGE("++ Boost libraries found : ${Boost_LIBRARIES}")
ADD_SUBDIRECTORY(tests)
add_subdirectory(tests)
enable_testing()
include("CTestLists.txt")
else()
MESSAGE("++ Boost not found ++ skipping tests!")
endif()
################################ EXPORT/INSTALL ################################
......
......@@ -10,11 +10,8 @@ cmake_host_system_information(RESULT CURRENT_HOSTNAME QUERY HOSTNAME)
if(${CURRENT_HOSTNAME} MATCHES ".*(falcon2|schorle|scicomp-pc-3|recovery-station).*")
message(">> hostname (${CURRENT_HOSTNAME}): added compass test ")
add_test(NAME compass_impl COMMAND test_compass_impl)
elseif(${CURRENT_HOSTNAME} MATCHES ".*(juron).*")
message(">> hostname (${CURRENT_HOSTNAME}): added power8 test ")
add_test(NAME power8_impl COMMAND test_power8_impl)
else()
message(">> unknown host (${CURRENT_HOSTNAME}): no tests were written for your host ")
endif()
add_test(NAME bitview COMMAND test_bitview)
add_test(NAME bitview COMMAND test_bitview)
FIND_PACKAGE (Boost 1.50 COMPONENTS system filesystem unit_test_framework QUIET)
IF(DEFINED Boost_FOUND)
include_directories(${Boost_INCLUDE_DIR})
link_directories(${Boost_LIBRARY_DIR})
MESSAGE("++ Boost libraries found : ${Boost_LIBRARIES}")
else()
MESSAGE("++ Boost not found ++ skipping tests!")
endif()
INCLUDE_DIRECTORIES(.)
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/include)
......@@ -6,11 +20,6 @@ cmake_host_system_information(RESULT CURRENT_HOSTNAME QUERY HOSTNAME)
if(${CURRENT_HOSTNAME} MATCHES ".*(falcon2|schorle|scicomp-pc-3|recovery-station).*")
add_executable(test_compass_impl test_compass_impl.cpp)
target_link_libraries(test_compass_impl ${Boost_LIBRARIES})
elseif(${CURRENT_HOSTNAME} MATCHES "juronb.*")
find_package(Threads REQUIRED)
add_executable(test_power8_impl test_power8_impl.cpp)
target_link_libraries(test_power8_impl ${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
endif()
add_executable(test_bitview test_bitview.cpp)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment