forked from ikeyasu/arduino-mock
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
44 lines (34 loc) · 1.06 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
cmake_minimum_required (VERSION 2.8.8)
project (arduino_mock)
find_package(Threads REQUIRED)
add_subdirectory(lib/gtest)
add_subdirectory(lib/gmock)
message ("building arduino_mock")
message("Gtest include: ${GTEST_INCLUDE_DIRS}")
message("Gmock include: ${GMOCK_INCLUDE_DIRS}")
include_directories(${GTEST_INCLUDE_DIRS} ${GMOCK_INCLUDE_DIRS} include)
file(GLOB SRC
"src/ArduinoMockAll.cc"
)
add_library(arduino_mock STATIC ${SRC})
target_include_directories(arduino_mock
PUBLIC "include"
)
target_link_libraries(arduino_mock
${GTEST_LIBS_DIR}/libgtest.a
${GMOCK_LIBS_DIR}/libgmock.a
${CMAKE_THREAD_LIBS_INIT}
)
set_target_properties( arduino_mock
PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/dist/lib"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/dist/lib"
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/dist/bin"
)
target_compile_features(arduino_mock PRIVATE cxx_delegating_constructors)
add_dependencies(arduino_mock gtest gmock)
option(test "Build all tests." OFF)
if (test)
enable_testing()
add_subdirectory(test)
endif()