123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- cmake_minimum_required(VERSION 3.13)
- if(${CMAKE_VERSION} VERSION_GREATER_EQUAL 3.12)
- cmake_policy(SET CMP0074 NEW)
- endif()
- set(ROTOR_LIGHT_VERSION "0.01")
- project (rotor_light LANGUAGES CXX VERSION ${ROTOR_LIGHT_VERSION})
- set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
- if (NOT DEFINED CMAKE_CXX_VISIBILITY_PRESET AND
- NOT DEFINED CMAKE_VISIBILITY_INLINES_HIDDEN)
- set(CMAKE_CXX_VISIBILITY_PRESET hidden)
- set(CMAKE_VISIBILITY_INLINES_HIDDEN YES)
- endif ()
- set(ROTOR_LIGHT_TIMEPOINT "int64_t" CACHE STRING "TimePoint type [default: int64_t]")
- set(ROTOR_LIGHT_DURATION "int32_t" CACHE STRING "Duration type [default: int32_t]")
- include(CMakePrintHelpers)
- include(GenerateExportHeader)
- add_library(rotor_light
- src/rotor-light/actor.cpp
- src/rotor-light/queue.cpp
- src/rotor-light/planner.cpp
- src/rotor-light/supervisor.cpp
- )
- target_include_directories(rotor_light
- PUBLIC
- $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
- $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>
- $<INSTALL_INTERFACE:include>
- )
- target_compile_features(rotor_light PUBLIC cxx_std_17)
- set_target_properties(rotor_light PROPERTIES
- CXX_STANDARD 17
- CXX_STANDARD_REQUIRED YES
- CXX_EXTENSIONS NO
- )
- target_compile_definitions(rotor_light PUBLIC
- "ROTOR_LIGHT_TIMEPOINT=${ROTOR_LIGHT_TIMEPOINT}"
- "ROTOR_LIGHT_DURATION=${ROTOR_LIGHT_DURATION}"
- )
- if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
- add_subdirectory("examples")
- if ("${TOOLCHAIN_PREFIX}" STREQUAL "")
- include(CTest)
- if (BUILD_TESTING)
- add_subdirectory("tests")
- endif()
- endif()
- find_package(Doxygen)
- if (DOXYGEN_FOUND)
- set(DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/docs/Doxyfile.in)
- set(DOXYGEN_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
- configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY)
- add_custom_target( doc_doxygen ALL
- COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT}
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
- COMMENT "Generating API documentation with Doxygen"
- VERBATIM)
- file(GLOB DOC_IMAGES CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/docs/*.png)
- file(COPY ${DOC_IMAGES} DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/doxygen)
- message("Doxygen need to be installed to generate the doxygen documentation")
- endif()
- endif()
|