2017-02-17 18:10:03 +01:00
|
|
|
cmake_minimum_required(VERSION 2.8)
|
|
|
|
|
|
|
|
project(multi_array)
|
|
|
|
|
2017-11-20 22:22:57 +01:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror -std=c++11 -Wpedantic -O3")
|
2017-02-17 18:10:03 +01:00
|
|
|
|
2017-03-23 21:05:40 +01:00
|
|
|
enable_testing()
|
|
|
|
|
2017-02-17 18:10:03 +01:00
|
|
|
find_package( GTest REQUIRED )
|
|
|
|
if(GTest_FOUND)
|
|
|
|
include_directories(${GTEST_INCLUDE_DIRS})
|
|
|
|
else()
|
|
|
|
message(FATAL_ERROR "GTest not found")
|
|
|
|
endif()
|
|
|
|
|
2017-11-20 22:30:07 +01:00
|
|
|
find_package(Threads REQUIRED)
|
|
|
|
if(Threads_FOUND)
|
2017-12-18 14:02:37 +01:00
|
|
|
#include_directories(${Threads_INCLUDE_DIRS})
|
2017-11-20 22:30:07 +01:00
|
|
|
else()
|
|
|
|
message(FATAL_ERROR "Threads not found")
|
|
|
|
endif()
|
|
|
|
|
2017-02-17 18:10:03 +01:00
|
|
|
include_directories(src)
|
|
|
|
|
2017-12-25 01:35:09 +01:00
|
|
|
set(INDEX_CC_FILES "${INDEX_CC_FILES}" "src/ranges/range_base.cc" "src/ranges/index_info.cc")
|
2017-12-18 11:19:04 +01:00
|
|
|
set(MA_CC_FILES "${MA_CC_FILES}" "${INDEX_CC_FILES}" "src/operation_utils.cc")
|
|
|
|
|
|
|
|
add_executable(iutest src/ranges/tests/index_unit_test.cc ${INDEX_CC_FILES})
|
2017-12-18 17:13:11 +01:00
|
|
|
target_link_libraries(iutest ${GTEST_BOTH_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
|
2017-08-07 11:22:42 +02:00
|
|
|
add_test(NAME iutest COMMAND iutest)
|
2017-02-17 18:10:03 +01:00
|
|
|
|
2017-12-18 11:19:04 +01:00
|
|
|
add_executable(mautest src/tests/ma_unit_test.cc ${MA_CC_FILES})
|
2017-12-18 17:13:11 +01:00
|
|
|
target_link_libraries(mautest ${GTEST_BOTH_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
|
2017-12-18 11:19:04 +01:00
|
|
|
add_test(NAME mautest COMMAND mautest)
|
2017-08-08 18:07:58 +02:00
|
|
|
|
2017-12-18 11:19:04 +01:00
|
|
|
add_executable(oputest src/tests/op_unit_test.cc ${MA_CC_FILES})
|
2017-12-18 17:13:11 +01:00
|
|
|
target_link_libraries(oputest ${GTEST_BOTH_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
|
2017-12-18 11:19:04 +01:00
|
|
|
add_test(NAME oputest COMMAND oputest)
|
2017-08-08 18:07:58 +02:00
|
|
|
|
2017-12-23 18:54:10 +01:00
|
|
|
add_executable(opptest src/tests/op_perf_test.cc ${MA_CC_FILES})
|
|
|
|
#target_link_libraries(oputest)
|
|
|
|
|
2017-02-17 18:10:03 +01:00
|
|
|
#install(TARGETS testm DESTINATION install)
|
|
|
|
|
|
|
|
set(CMAKE_INSTALL_PREFIX ..)
|