forked from dillonhuff/gpr
-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
37 lines (25 loc) · 922 Bytes
/
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
32
33
34
35
36
37
cmake_minimum_required(VERSION 2.6)
project(gpr)
#set(CMAKE_CXX_FLAGS_DEBUG "-g")
#set(CMAKE_CXX_FLAGS_RELEASE "-O2")
#SET(EXTRA_CXX_COMPILE_FLAGS "-std=c++11 -I./src -I./test -Werror -Wall")
#SET(EXTRA_CXX_COMPILE_FLAGS "-std=c++11 -I./src -I./test -Wall")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CXX_COMPILE_FLAGS}")
OPTION(GPR_BUILD_TESTS "Build gpr tests" ON)
option(GPR_BUILD_SAMPLE "Build gpr sample" ON)
INCLUDE_DIRECTORIES(./src/)
SET(GPR_HEADERS src/gcode_program.h
src/parser.h)
SET(GPR_CPPS src/parser.cpp
src/gcode_program.cpp)
add_library(gpr ${GPR_CPPS} ${GPR_HEADERS})
SET(TEST_FILES test/parser_tests.cpp
test/main.cpp)
IF(GPR_BUILD_TESTS)
add_executable(all-tests ${TEST_FILES})
target_link_libraries(all-tests gpr)
ENDIF(GPR_BUILD_TESTS)
IF(GPR_BUILD_SAMPLE)
add_executable(parse-gcode src/main.cpp)
target_link_libraries(parse-gcode gpr)
ENDIF(GPR_BUILD_SAMPLE)