cmake_minimum_required (VERSION 3.7) project(controller) add_executable(controller main.c) option(WIRING_PI_DEBUG "Use WiringPi Debugging Tool" OFF) SET(CMAKE_C_FLAGS "-Wall -Wextra -lwiringPi -luuid -g") if(WIRING_PI_DEBUG) add_compile_definitions("WIRING_PI_DEBUG") endif(WIRING_PI_DEBUG) aux_source_directory(. SRC_DIR) aux_source_directory(models MODEL_SRC) target_sources(controller PRIVATE ${SRC_DIR} ${MODEL_SRC}) target_include_directories(controller PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})