CMakeLists.txt 738 Bytes
Newer Older
Christoph Richter's avatar
Christoph Richter committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
cmake_minimum_required(VERSION 3.5)
set(CMAKE_CXX_STANDARD 11)

project(testing_model 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})

# create static library
include_directories(${INCLUDE_DIRS})
add_library(testing_model testing_model.h)
target_include_directories(testing_model PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(testing_model PUBLIC ${LIBS})
set_target_properties(testing_model PROPERTIES LINKER_LANGUAGE CXX)

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