-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
43 lines (32 loc) · 1.19 KB
/
CMakeLists.txt
File metadata and controls
43 lines (32 loc) · 1.19 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
cmake_minimum_required (VERSION 2.5)
project (LARcpp)
#set(CMAKE_BUILD_TYPE Release)
SET(CMAKE_CXX_FLAGS "-std=c++0x")
# Set the default CMAKE_BUILD_TYPE if not already specified
if( NOT CMAKE_BUILD_TYPE )
set( CMAKE_BUILD_TYPE Release CACHE STRING
"Choose the type of build, options are: Debug Release"
FORCE )
endif()
#Bring the headers into the project
include_directories(include)
#Can manually add the sources using the set command as follows:
#set(SOURCES src/mainapp.cpp src/Student.cpp)
#However, the file(GLOB...) allows for wildcard additions:
file(GLOB SOURCES "src/*.cpp")
#Generate the shared library from the sources
add_library(LARcpp SHARED ${SOURCES})
#Set the location for library installation -- i.e., /usr/local/lib in this case
# not really necessary in this example. Use "sudo make install" to apply
install(TARGETS LARcpp DESTINATION /usr/lib)
#Install headers
install(DIRECTORY include/ DESTINATION /usr/include/LARcpp)
#############
## TESTS
#############
# Load the tests sources and headers
include_directories(test/include)
file(GLOB TESTS "test/src/*.cpp")
#Generate the test executable
add_executable(testLAR ${TESTS})
target_link_libraries(testLAR LARcpp)