etl/CMakeLists.txt
John Wellbelove 36d126c93e Squashed commit of the following:
commit c217b3ec12b26104e8f1027c1766cc9d49b93a29
Author: John Wellbelove <john.wellbelove@asterconsulting.co.uk>
Date:   Thu Apr 21 11:57:55 2022 +0200

    Added mutex traits

    Added transparent comparator test to multimap

commit b6487b869e5599ea067d45af1778d5c0f90c6a52
Author: John Wellbelove <john.wellbelove@asterconsulting.co.uk>
Date:   Thu Apr 21 10:42:06 2022 +0200

    Modified char8_t, char16_t and char32_t macros.

    Added conditional compilation on the presense of native char8_t, char16_t and char32_t types.

commit 2c2bd86ce3d5d5d698e922518421a93f70a9cc1e
Author: John Wellbelove <john.wellbelove@asterconsulting.co.uk>
Date:   Thu Apr 21 10:29:04 2022 +0200

    Modified char8_t, char16_t and char32_t macros.

    Added conditional compilation on the presense of native char8_t, char16_t and char32_t types.

commit d16242d20e9b6df6752a926d862d0016a452bada
Author: John Wellbelove <john.wellbelove@asterconsulting.co.uk>
Date:   Wed Apr 20 13:53:37 2022 +0200

    Expanded constexpr test

commit fad097e6656cd4639c2d81bc8cad2467cae4b4ce
Author: John Wellbelove <john.wellbelove@asterconsulting.co.uk>
Date:   Wed Apr 20 13:53:05 2022 +0200

    Added ETL_OVERRIDE to state chart process_event()

commit 25403c2225f3aff0b99105a54cfc44f1cf88d527
Author: John Wellbelove <john.wellbelove@asterconsulting.co.uk>
Date:   Wed Apr 20 13:41:00 2022 +0200

    Added test_etl_traits

commit e42c778cf645cb8fc06e5930336e7f1183004dfe
Author: John Wellbelove <john.wellbelove@asterconsulting.co.uk>
Date:   Wed Apr 20 13:38:22 2022 +0200

    Removed unused code.

commit 5a25c0c1973f7094ef3aa5b6f29529e96450451c
Author: John Wellbelove <john.wellbelove@asterconsulting.co.uk>
Date:   Sun Apr 17 13:17:29 2022 +0200

    Large and small character support macros

commit 6a463fb65ef655b700a8dea381265a3c1b622658
Author: Melg Eight <public.melg8@gmail.com>
Date:   Sun Apr 17 13:54:34 2022 +0300

    Fix spelling (#535)

    Signed-off-by: Melg Eight <public.melg8@gmail.com>

commit 5468eb659c8b4ecdb3d08e8b8f0442c5a2549a48
Author: Gabriel Arjones <arjones@arjones.com>
Date:   Thu Apr 14 17:55:27 2022 -0300

    cmake: write an arch independent version file (#534)
2022-04-21 12:11:26 +02:00

64 lines
2.4 KiB
CMake

#######################################################################
# The Embedded Template Library (https://www.etlcpp.com/)
#######################################################################
cmake_minimum_required(VERSION 3.5.0)
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/helpers.cmake)
determine_version_with_git(${GIT_DIR_LOOKUP_POLICY})
project(etl VERSION ${ETL_VERSION})
option(BUILD_TESTS "Build unit tests" OFF)
option(NO_STL "No STL" OFF)
add_library(${PROJECT_NAME} INTERFACE)
target_include_directories(${PROJECT_NAME} SYSTEM INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
target_link_libraries(${PROJECT_NAME} INTERFACE)
# only install if top level project
if(${CMAKE_PROJECT_NAME} STREQUAL ${PROJECT_NAME})
# Steps here based on excellent guide: https://dominikberner.ch/cmake-interface-lib/
# Which also details all steps
include(CMakePackageConfigHelpers)
install(TARGETS ${PROJECT_NAME}
EXPORT ${PROJECT_NAME}Targets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
if(ETL_VERSION)
# Generate the package configuration files using CMake provided macros
write_basic_package_version_file(
"${PROJECT_NAME}ConfigVersion.cmake"
COMPATIBILITY SameMajorVersion
ARCH_INDEPENDENT
)
endif()
configure_package_config_file(
"${PROJECT_SOURCE_DIR}/cmake/${PROJECT_NAME}Config.cmake.in"
"${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
INSTALL_DESTINATION
${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/cmake)
# Install target file, then package configuration files, and finally the headers
install(EXPORT ${PROJECT_NAME}Targets
FILE ${PROJECT_NAME}Targets.cmake
NAMESPACE ${PROJECT_NAME}::
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/cmake)
install(FILES "${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
"${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/cmake)
install(DIRECTORY ${PROJECT_SOURCE_DIR}/include/etl DESTINATION include)
endif()
if (BUILD_TESTS)
enable_testing()
add_subdirectory(test)
endif()