-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
54 lines (44 loc) · 1.1 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
cmake_minimum_required(VERSION 3.5.1)
project(rgd C CXX)
## set up test
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O3 -std=c++14 -fPIC -L/usr/local/lib")
# Proto file
get_filename_component(rgd_proto "rgd.proto" ABSOLUTE)
get_filename_component(rgd_proto_path "${rgd_proto}" PATH)
# Generated sources
add_custom_target(proto ALL DEPENDS ${rgd_proto_srcs} ${rgd_proto_hdrs})
set(rgd_proto_srcs "${CMAKE_CURRENT_BINARY_DIR}/rgd.pb.cc")
set(rgd_proto_hdrs "${CMAKE_CURRENT_BINARY_DIR}/rgd.pb.h")
add_custom_command(
OUTPUT "${rgd_proto_srcs}" "${rgd_proto_hdrs}"
COMMAND protoc
ARGS --cpp_out "${CMAKE_CURRENT_BINARY_DIR}"
-I "${rgd_proto_path}"
"${rgd_proto}"
DEPENDS "${rgd_proto}")
include_directories("${CMAKE_CURRENT_BINARY_DIR}")
add_executable(z3test
z3test.cc
util.cc
z3solver.cc
${rgd_proto_srcs}
)
target_link_libraries(z3test
z3
protobuf
pthread
boost_system
boost_filesystem)
add_executable(z3ntest
z3ntest.cc
util.cc
z3solver.cc
${rgd_proto_srcs}
)
target_link_libraries(z3ntest
z3
protobuf
pthread
boost_system
boost_filesystem)