forked from darsto/brother-scand
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathCMakeLists.txt
58 lines (47 loc) · 1.61 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
cmake_minimum_required(VERSION 3.10.2)
project(brother_scanner_driver C CXX)
set(CMAKE_C_STANDARD 11)
find_package(Threads)
include_directories(.)
add_library(ber ber/ber.c ber/ber.h ber/snmp.c ber/snmp.h)
add_library(scanner_driver
con_queue.c
con_queue.h
config.c
config.h
connection.c
connection.h
data_channel.c
data_channel.h
event_thread.c
event_thread.h
log.c
log.h)
target_link_libraries(scanner_driver ${CMAKE_THREAD_LIBS_INIT})
add_library(button_driver
device_handler.c
device_handler.h
snmp.c
snmp.h)
target_link_libraries(button_driver scanner_driver ber)
add_executable(brother_scanner_driver main.c)
add_executable(brother_scanner_cli scanner_cli.c)
target_link_libraries(brother_scanner_driver button_driver)
target_link_libraries(brother_scanner_cli scanner_driver)
add_subdirectory("/usr/src/googletest" ${CMAKE_BINARY_DIR}/gtest)
enable_testing()
include_directories(${GTEST_INCLUDE_DIRS})
add_executable(tests device_handler_test.cpp connection_test.cpp data_channel_test.cpp connection_base_test.h)
target_link_libraries(tests button_driver gtest gtest_main)
add_test(AllTests tests)
# Generate clang compilation database
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
find_package(PythonInterp)
find_program(iwyu_tool_path NAMES iwyu_tool)
if (iwyu_tool_path AND PYTHONINTERP_FOUND)
add_custom_target(iwyu
COMMAND "${PYTHON_EXECUTABLE}" "${iwyu_tool_path}" -p "${CMAKE_BINARY_DIR}" -- --mapping_file ../check_mk.imp
COMMENT "Running include-what-you-use tool"
VERBATIM
)
endif()