mesytec-mnode/src/CMakeLists.txt
2023-06-27 20:19:58 +02:00

32 lines
1.2 KiB
CMake

set(MY_WARN_FLAGS -Wall -Wextra -Wpedantic)
find_package(Threads)
# Bit of a hack to set the variables here. If set earlier clang-tidy will for
# some reason pickup log.c and warn about some va_list stuff. Might be because
# log.c is in the source directory as the same does not happen with the imgui
# object library. TODO: move logc to externals.
#find_program(CLANG_TIDY_EXECUTABLE clang-tidy)
#if (CLANG_TIDY_EXECUTABLE)
# set(CMAKE_C_CLANG_TIDY clang-tidy -p ${CMAKE_BINARY_DIR} --extra-arg=-std=c11)
# set(CMAKE_CXX_CLANG_TIDY clang-tidy -p ${CMAKE_BINARY_DIR} --extra-arg=-std=c++17)
#endif()
#add_library(dp_common dp_common.c)
#target_compile_features(dp_common PRIVATE c_std_11)
#target_compile_options(dp_common PUBLIC ${DP_WARN_FLAGS}) # spread warning flags
#target_link_libraries(dp_common
# PUBLIC logc
# PUBLIC nng
# PUBLIC Threads::Threads
#)
#target_include_directories(dp_common INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
add_executable(main main.cc)
target_compile_features(main PRIVATE cxx_std_17)
target_link_libraries(main PRIVATE mesytec-mvlc PRIVATE nng)
target_compile_options(main PRIVATE ${MY_WARN_FLAGS})
#unset(CMAKE_C_CLANG_TIDY)
#unset(CMAKE_CXX_CLANG_TIDY)