skullc-peripherals/CMakeLists.txt
Erki 82f62d1650
All checks were successful
continuous-integration/drone/push Build is passing
Initial commit
2021-09-19 15:42:37 +03:00

56 lines
1.1 KiB
CMake

cmake_minimum_required(VERSION 3.8 FATAL_ERROR)
set(version 0.1.0)
project(skullc
VERSION ${version}
LANGUAGES
C
CXX
)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_BINARY_DIR})
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/)
set(CMAKE_CXX_STANDARD 17)
list(APPEND CMAKE_CXX_FLAGS "-Wall -Wextra")
option(WITH_DOCS "Enable building docs." OFF)
option(WITH_TESTS "Enable unit testing." OFF)
option(WITH_HAL "Enable the compiling and deployment of the HAL dependent sections." OFF)
include(skullc-install)
add_subdirectory(Peripherals)
add_subdirectory(Utility)
add_subdirectory(Messaging)
if(WITH_TESTS)
enable_testing()
add_subdirectory(Tests)
endif()
if(WITH_DOCS)
add_subdirectory(docs)
endif()
## Install
configure_file(skullc-config.cmake
"${CMAKE_BINARY_DIR}/skullc-config.cmake"
@ONLY
)
include(CMakePackageConfigHelpers)
write_basic_package_version_file(
"${CMAKE_BINARY_DIR}/skullc-config-version.cmake"
VERSION ${version}
COMPATIBILITY AnyNewerVersion
)
install(
FILES
"${CMAKE_BINARY_DIR}/skullc-config.cmake"
DESTINATION lib/cmake/skullc
)