-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
35 lines (28 loc) · 1.34 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
cmake_minimum_required(VERSION 3.1.0)
project (Plant)
set (CMAKE_CXX_STANDARD 11)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
include_directories(.)
include_directories(src)
include_directories(test)
find_package (Threads)
find_package( CURL )
find_library(wiringPi_LIB wiringPi)
add_executable(Plant src/main.cpp src/ultrasonic.cpp src/MCP3008.cpp src/DHT11.cpp src/pump.cpp)
add_executable(unit_test_ultra test/ultra_test.cpp src/ultrasonic.cpp)
add_executable(unit_test_soil test/soil_test.cpp src/MCP3008.cpp)
add_executable(unit_test_pump test/soil_pump_test.cpp src/MCP3008.cpp)
add_executable(unit_test_low test/ultra_pump_test.cpp src/ultrasonic.cpp)
add_executable(unit_test_dht test/dht_test.cpp src/DHT11.cpp)
TARGET_LINK_LIBRARIES(Plant ${wiringPi_LIB} rt fcgi++ fcgi ${CMAKE_THREAD_LIBS_INIT} curl)
TARGET_LINK_LIBRARIES(unit_test_ultra ${wiringPi_LIB})
TARGET_LINK_LIBRARIES(unit_test_soil ${wiringPi_LIB})
TARGET_LINK_LIBRARIES(unit_test_pump ${wiringPi_LIB})
TARGET_LINK_LIBRARIES(unit_test_low ${wiringPi_LIB})
TARGET_LINK_LIBRARIES(unit_test_dht ${wiringPi_LIB})
enable_testing()
add_test(NAME Test_for_ultra COMMAND unit_test_ultra)
add_test(NAME Test_for_soil COMMAND unit_test_soil)
add_test(NAME Test_for_pump COMMAND unit_test_pump)
add_test(NAME Test_for_low COMMAND unit_test_low)
add_test(NAME Test_for_dht COMMAND unit_test_dht)