2020-12-28 15:39:13 +00:00
|
|
|
cmake_minimum_required(VERSION 3.0)
|
2020-12-07 10:49:21 +00:00
|
|
|
project(kerstezel-klant)
|
|
|
|
|
2020-12-28 15:43:09 +00:00
|
|
|
option(SPOOF "Spoof interactions with the BCM2835 library (allows building on non-raspberry pi devices" OFF)
|
|
|
|
|
2020-12-07 10:49:21 +00:00
|
|
|
if (MSVC)
|
2020-12-28 15:39:13 +00:00
|
|
|
add_compile_options(/W4 /WX)
|
2020-12-07 10:49:21 +00:00
|
|
|
else()
|
2020-12-28 15:39:13 +00:00
|
|
|
add_compile_options(-Wall -Wextra -pedantic -Werror)
|
2020-12-07 10:49:21 +00:00
|
|
|
endif()
|
|
|
|
|
2020-12-28 15:39:13 +00:00
|
|
|
add_compile_definitions(LOG_PREFIX="${CMAKE_SOURCE_DIR}")
|
|
|
|
|
|
|
|
if(SPOOF)
|
|
|
|
add_compile_definitions(SPOOF)
|
|
|
|
endif()
|
2020-12-07 10:49:21 +00:00
|
|
|
|
|
|
|
set(KERSTEZEL_SOURCES src/kerstezel.c)
|
|
|
|
set(KERSTEZEL_HEADERS src/kerstezel.h)
|
|
|
|
|
|
|
|
add_executable(kerstezel ${KERSTEZEL_SOURCES} ${KERSTEZEL_HEADERS})
|
2020-12-28 15:39:13 +00:00
|
|
|
if(NOT SPOOF)
|
|
|
|
target_link_libraries(kerstezel -lbcm2835)
|
|
|
|
endif()
|
2020-12-08 07:19:20 +00:00
|
|
|
install(TARGETS kerstezel DESTINATION sbin)
|