CMakeLists.txt 1.3 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
cmake_minimum_required(VERSION 3.5)
set(CMAKE_CXX_STANDARD 11)

project(test_math_floatDivisionTest LANGUAGES CXX)

#set cmake module path
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)

# add dependencies
find_package(Armadillo REQUIRED)
set(INCLUDE_DIRS ${INCLUDE_DIRS} ${Armadillo_INCLUDE_DIRS})
set(LIBS ${LIBS} ${Armadillo_LIBRARIES})

# additional commands

# create static library
include_directories(${INCLUDE_DIRS})
add_library(test_math_floatDivisionTest test_math_floatDivisionTest.h)
19
target_include_directories(test_math_floatDivisionTest PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${INCLUDE_DIRS})
20
21
22
23
24
25
26
27
28
29
30
31
target_link_libraries(test_math_floatDivisionTest PUBLIC ${LIBS})
set_target_properties(test_math_floatDivisionTest PROPERTIES LINKER_LANGUAGE CXX)

# export cmake project
export(TARGETS test_math_floatDivisionTest FILE test_math_floatDivisionTest.cmake)

# additional commands end
include_directories(test)
add_executable(test_math_floatDivisionTest_StreamTests  test/tests_main.cpp)
target_compile_definitions(test_math_floatDivisionTest_StreamTests PRIVATE CATCH_CONFIG_MAIN=1 ARMA_DONT_USE_WRAPPER)
target_link_libraries(test_math_floatDivisionTest_StreamTests  PUBLIC test_math_floatDivisionTest)
set_target_properties(test_math_floatDivisionTest_StreamTests  PROPERTIES LINKER_LANGUAGE CXX)