-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
31 lines (31 loc) · 1.04 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
cmake_minimum_required(VERSION 2.6)
project(RectangularScintillator)
if(DEFINED MATH_H_INC)
include_directories(${MATH_H_INC})
get_directory_property(has_parent PARENT_DIRECTORY)
if(has_parent)
set(RECTSCIN_INC
${CMAKE_CURRENT_SOURCE_DIR}/include
${MATH_H_INC}
PARENT_SCOPE
)
endif()
file(GLOB SOURCES src/*.cpp)
file(GLOB TESTS tests/*.cpp)
file(GLOB EXAMPLES Example/*.cpp)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
include_directories(${MATH_H_INC})
add_library(rectscin SHARED ${SOURCES})
foreach(example ${EXAMPLES})
get_filename_component(ex_app ${example} NAME_WE)
add_executable(${ex_app} ${example})
target_link_libraries(${ex_app} rectscin)
endforeach()
if(DEFINED GTEST)
add_executable(rectscin-test.exe ${TESTS})
target_link_libraries(rectscin-test.exe rectscin gtest gtest_main)
endif()
else()
message(FATAL_ERROR "RectangularScintillator library requires math_h subproject to add. View README")
endif()