-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
28 lines (23 loc) · 928 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
cmake_minimum_required(VERSION 2.8.9)
set(COMPONENT_NAME preemptrt-gpiotest) #set the name of the binary
project(${COMPONENT_NAME})
file(GLOB SOURCES "*.c")
#set(CMAKE_EXE_LINKER_FLAGS -static)
set(CMAKE_CXX_FLAGS_RELEASE "-O0")
find_library(GPIOD_LIBRARY NAMES libgpiod.so)
if(NOT GPIOD_LIBRARY)
message(FATAL_ERROR "gpiod library not found. Install apt install libgpiod-dev")
endif()
add_executable(${COMPONENT_NAME} ${SOURCES})
install(TARGETS ${COMPONENT_NAME} DESTINATION sbin)
target_link_libraries(${COMPONENT_NAME} rt gpiod)
add_subdirectory(check_clocks)
#for cross compiling
#cmake -H. -BOutput -DCMAKE_TOOLCHAIN_FILE=/path/to/toolchain-arm-backup.cmake -DCMAKE_INSTALL_PREFIX=/home/user/tmp/
#cmake --build Output -- all -j$(nproc)
#cmake --build Output -- install -j$(nproc)
#for local compiling
#cmake -H. -BOutput
#cmake --build Output -- all -j$(nproc)
#for cleaning make generated output
#rm -rf Output