-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathCMakeLists.txt
106 lines (73 loc) · 2.69 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#
# This file is part of the LaserShark 3d Printer host application.
#
# Copyright (C) 2014 Jeffrey Nelson <nelsonjm@macpod.net>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# pass the following to cmake to include symbols for gdb.
#-DCMAKE_BUILD_TYPE=Debug
# pass one of the following to cmake to to enable/disable debug printing.
#-DDEBUG_PRINT=ON
#-DDEBUG_PRINT=OFF
project(lasershark_3d_printer)
cmake_minimum_required(VERSION 2.6)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/Modules/")
find_package(json-rpc-cpp REQUIRED)
find_package(libusb-1.0 REQUIRED)
set(CMAKE_CXX_FLAGS "-Wall -std=c++11")
set(CMAKE_C_FLAGS "-Wall")
set(CMAKE_CXX_FLAGS_DEBUG "-g")
set(CMAKE_C_FLAGS_DEBUG "-g")
option(DEBUG_PRINT "Print debug messages" OFF)
if (DEBUG_PRINT)
message("-- Debug printing enabled")
add_definitions(-DDEBUG_PRINT)
else (DEBUG_PRINT)
message("-- Debug printing disabled")
endif (DEBUG_PRINT)
add_subdirectory (base64)
add_subdirectory (lodepng)
include_directories(${LIBUSB_1_INCLUDE_DIRS})
add_subdirectory(twostep)
add_subdirectory (lasershark)
include_directories(${JSON_RPC_CPP_INCLUDE_DIRS})
include_directories(${CMAKE_SOURCE_DIR}/twostep)
include_directories(${CMAKE_SOURCE_DIR}/lasershark)
set(lasershark_3dp_SRC
lasershark_3dp.cpp
LaserSharkJSONServer.cpp
TwoStepJSONServer.cpp
debug.h
)
add_executable(lasershark_3dp ${lasershark_3dp_SRC})
target_link_libraries (lasershark_3dp ${LIBUSB_1_LIBRARIES} ${JSON_RPC_CPP_LIBRARIES} base64 lodepng lasershark twostep)
include_directories(${CMAKE_SOURCE_DIR}/twostep/lasershark_hostapp)
set(lasershark_3dp_client_SRC
lasershark_3dp_client.cpp
lasersharkjsonclient.h
debug.h
)
add_executable(lasershark_3dp_client ${lasershark_3dp_client_SRC})
target_link_libraries (lasershark_3dp_client ${JSON_RPC_CPP_LIBRARIES} base64)
add_custom_target (twostep_stubs
COMMAND jsonrpcstub -s -c -o ./ twostep_spec.json TwoStepJSON
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
VERBATIM
)
add_custom_target (lasershark_stubs
COMMAND jsonrpcstub -s -c -o ./ lasershark_spec.json LaserSharkJSON
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
VERBATIM
)