cmake_minimum_required(VERSION 3.16) project(microirc LANGUAGES C) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic") if (NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Debug) endif() set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/build/bin) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/build/lib) set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/build/archive) if ( UIRC_IRCV3 ) add_definitions(-DUIRC_IRCV3) endif() if ( BUILD_TESTS ) enable_testing() add_subdirectory(tests) endif() set(build_FILES src/uirc.c) if ( USE_HELPERS ) message("Helper functions are going to be built.") set(build_FILES src/uirc.c src/helpers.c) endif() add_library(uirc SHARED ${build_FILES}) set_property(TARGET uirc PROPERTY C_STANDARD 99) install(TARGETS uirc DESTINATION ${CMAKE_INSTALL_BINDIR})