-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
39 lines (29 loc) · 929 Bytes
/
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
cmake_minimum_required(VERSION 3.7)
# Set the project name
project(DHT11)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_VERBOSE_MAKEFILE TRUE)
# Have CMake find our pthreads library within our toolchain (required for this library)
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
find_package(Threads REQUIRED)
#Find the wiringPi library
find_library(wiringPi_LIB wiringPi)
#Find the sqlite3 library
find_library(SQLITE3_LIBRARY sqlite3)
# Create a sources variable with a link to all cpp files to compile
set(SOURCES
src/main.cpp
src/DHT11.cpp
src/Database.cpp)
# Add an executable with the above sources
add_executable(${PROJECT_NAME} ${SOURCES})
target_include_directories(${PROJECT_NAME}
PRIVATE
${PROJECT_SOURCE_DIR}/include
${CMAKE_THREAD_LIBS_INIT} crypt m rt
)
target_link_libraries(${PROJECT_NAME}
PRIVATE
${wiringPi_LIB}
${SQLITE3_LIBRARY}
)