Skip to content
Snippets Groups Projects
Commit 3d7829b2 authored by René Paris's avatar René Paris
Browse files

Merge branch 'reduce-dir-depth'

parents ea4a2b2b e0c22865
No related branches found
No related tags found
1 merge request!69Reduce dir depth
Showing
with 127 additions and 149 deletions
File moved
......@@ -14,36 +14,131 @@ cmake_minimum_required(VERSION 3.15.0 FATAL_ERROR)
# Add the custom CMake modules to CMake's module path
list(PREPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
# Determine if ScenarioAPI is built as a subproject (using add_subdirectory) or if it is the main project.
if(NOT DEFINED ScenarioAPI_MAIN_PROJECT)
set(ScenarioAPI_MAIN_PROJECT OFF)
# Determine if MantleAPI is built as a subproject (using add_subdirectory) or if it is the main project.
if(NOT DEFINED MantleAPI_MAIN_PROJECT)
set(MantleAPI_MAIN_PROJECT OFF)
if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
set(ScenarioAPI_MAIN_PROJECT ON)
set(MantleAPI_MAIN_PROJECT ON)
endif()
endif()
project(
ScenarioAPI
MantleAPI
VERSION 0.1.0
DESCRIPTION "Scenario API, an abstraction layer for environmental simulators"
DESCRIPTION "MantleAPI, an abstraction layer for environmental simulators"
LANGUAGES CXX
)
# Options that control generation of various targets.
option(ScenarioAPI_DOC "Generate the doc target." ${ScenarioAPI_MAIN_PROJECT})
option(ScenarioAPI_INSTALL "Generate the install target." ${ScenarioAPI_MAIN_PROJECT})
option(ScenarioAPI_TEST "Generate the test target." ${ScenarioAPI_MAIN_PROJECT})
option(ScenarioAPI_PACKAGE "Generate the package target." ${ScenarioAPI_MAIN_PROJECT})
option(ScenarioAPI_ENABLE_WARNINGS "Enable compiler warnings." ${ScenarioAPI_MAIN_PROJECT})
option(ScenarioAPI_ENABLE_WERROR "Fail and stop if a warning is triggered." ${ScenarioAPI_MAIN_PROJECT})
if(ScenarioAPI_TEST)
enable_testing()
option(MantleAPI_DOC "Generate the doc target." ${MantleAPI_MAIN_PROJECT})
option(MantleAPI_INSTALL "Generate the install target." ${MantleAPI_MAIN_PROJECT})
option(MantleAPI_TEST "Generate the test target." ${MantleAPI_MAIN_PROJECT})
option(MantleAPI_PACKAGE "Generate the package target." ${MantleAPI_MAIN_PROJECT})
option(MantleAPI_ENABLE_WARNINGS "Enable compiler warnings." ${MantleAPI_MAIN_PROJECT})
option(MantleAPI_ENABLE_WERROR "Fail and stop if a warning is triggered." ${MantleAPI_MAIN_PROJECT})
if(MSVC)
if(MantleAPI_ENABLE_WARNINGS)
add_compile_options(/W4)
endif()
if(MantleAPI_ENABLE_WERROR)
add_compile_options(/WX /wd4996)
endif()
else()
if(MantleAPI_ENABLE_WARNINGS)
add_compile_options(-Wall -Wextra)
endif()
if(MantleAPI_ENABLE_WERROR)
add_compile_options(-Werror -Wno-error=deprecated-declarations)
endif()
endif()
# Fetch dependencies
include(CPM)
add_subdirectory(MantleAPI)
CPMAddPackage(
NAME units
GITHUB_REPOSITORY nholthaus/units
GIT_TAG v2.3.3
VERSION 2.3.3
OPTIONS "DISABLE_PREDEFINED_UNITS ON"
"ENABLE_PREDEFINED_ACCELERATION_UNITS ON"
"ENABLE_PREDEFINED_ANGLE_UNITS ON"
"ENABLE_PREDEFINED_ANGULAR_VELOCITY_UNITS ON"
"ENABLE_PREDEFINED_CONCENTRATION_UNITS ON"
"ENABLE_PREDEFINED_FORCE_UNITS ON"
"ENABLE_PREDEFINED_LENGTH_UNITS ON"
"ENABLE_PREDEFINED_MASS_UNITS ON"
"ENABLE_PREDEFINED_PRESSURE_UNITS ON"
"ENABLE_PREDEFINED_TEMPERATURE_UNITS ON"
"ENABLE_PREDEFINED_TIME_UNITS ON"
"ENABLE_PREDEFINED_VELOCITY_UNITS ON"
)
# Add library
file(
GLOB_RECURSE HEADERS
RELATIVE ${PROJECT_SOURCE_DIR}/include
CONFIGURE_DEPENDS "*.h"
)
add_library(MantleAPI INTERFACE)
add_library(MantleAPI::MantleAPI ALIAS MantleAPI)
target_link_libraries(MantleAPI INTERFACE units::units)
include(GNUInstallDirs)
set(INSTALL_CONFIG_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/MantleAPI")
target_include_directories(
MantleAPI INTERFACE $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
target_compile_features(MantleAPI INTERFACE cxx_std_17)
# Configure export
include(CMakePackageConfigHelpers)
configure_package_config_file(
"${PROJECT_SOURCE_DIR}/cmake/MantleAPIConfig.cmake.in" "${PROJECT_BINARY_DIR}/MantleAPIConfig.cmake"
INSTALL_DESTINATION ${INSTALL_CONFIG_DIR}
PATH_VARS CMAKE_INSTALL_INCLUDEDIR
)
write_basic_package_version_file(
"${PROJECT_BINARY_DIR}/MantleAPIConfigVersion.cmake"
VERSION ${PROJECT_VERSION}
COMPATIBILITY SameMajorVersion
)
# Configure install
if(MantleAPI_INSTALL)
install(DIRECTORY include/ TYPE INCLUDE)
install(TARGETS MantleAPI EXPORT MantleAPITargets)
install(
EXPORT MantleAPITargets
DESTINATION ${INSTALL_CONFIG_DIR}
NAMESPACE MantleAPI::
)
install(
FILES "${PROJECT_BINARY_DIR}/MantleAPIConfig.cmake" "${PROJECT_BINARY_DIR}/MantleAPIConfigVersion.cmake"
DESTINATION ${INSTALL_CONFIG_DIR}
COMPONENT dev
)
endif()
# Build docs
if(MantleAPI_DOC)
add_subdirectory(doc)
endif()
# Build tests
if(MantleAPI_TEST)
enable_testing()
add_subdirectory(test)
endif()
if(ScenarioAPI_PACKAGE)
include(ScenarioAPICPack)
# Configure package
if(MantleAPI_PACKAGE)
include(MantleAPICPack)
endif()
################################################################################
# Copyright (c) 2021 Daimler TSS GmbH
# Copyright (c) 2022 Mercedes-Benz Tech Innovation GmbH
#
# This program and the accompanying materials are made available under the terms
# of the Eclipse Public License 2.0 which is available at
# https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
################################################################################
if(MSVC)
if(ScenarioAPI_ENABLE_WARNINGS)
add_compile_options(/W4)
endif()
if(ScenarioAPI_ENABLE_WERROR)
add_compile_options(/WX /wd4996)
endif()
else()
if(ScenarioAPI_ENABLE_WARNINGS)
add_compile_options(-Wall -Wextra)
endif()
if(ScenarioAPI_ENABLE_WERROR)
add_compile_options(-Werror -Wno-error=deprecated-declarations)
endif()
endif()
add_subdirectory(include)
if(ScenarioAPI_DOC)
add_subdirectory(doc)
endif()
if(ScenarioAPI_TEST)
add_subdirectory(test)
endif()
################################################################################
# Copyright (c) 2021 Daimler TSS GmbH
# Copyright (c) 2022 Mercedes-Benz Tech Innovation GmbH
#
# This program and the accompanying materials are made available under the terms
# of the Eclipse Public License 2.0 which is available at
# https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
################################################################################
CPMAddPackage(
NAME units
GITHUB_REPOSITORY nholthaus/units
GIT_TAG v2.3.3
VERSION 2.3.3
OPTIONS "DISABLE_PREDEFINED_UNITS ON"
"ENABLE_PREDEFINED_ACCELERATION_UNITS ON"
"ENABLE_PREDEFINED_ANGLE_UNITS ON"
"ENABLE_PREDEFINED_ANGULAR_VELOCITY_UNITS ON"
"ENABLE_PREDEFINED_CONCENTRATION_UNITS ON"
"ENABLE_PREDEFINED_FORCE_UNITS ON"
"ENABLE_PREDEFINED_LENGTH_UNITS ON"
"ENABLE_PREDEFINED_MASS_UNITS ON"
"ENABLE_PREDEFINED_PRESSURE_UNITS ON"
"ENABLE_PREDEFINED_TEMPERATURE_UNITS ON"
"ENABLE_PREDEFINED_TIME_UNITS ON"
"ENABLE_PREDEFINED_VELOCITY_UNITS ON"
)
file(
GLOB_RECURSE HEADERS
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
CONFIGURE_DEPENDS "*.h"
)
add_library(ScenarioAPI INTERFACE)
add_library(ScenarioAPI::ScenarioAPI ALIAS ScenarioAPI)
target_link_libraries(ScenarioAPI INTERFACE units::units)
include(GNUInstallDirs)
set(INSTALL_CONFIG_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/ScenarioAPI")
target_include_directories(
ScenarioAPI INTERFACE $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/MantleAPI/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
target_compile_features(ScenarioAPI INTERFACE cxx_std_17)
include(CMakePackageConfigHelpers)
configure_package_config_file(
"${PROJECT_SOURCE_DIR}/cmake/ScenarioAPIConfig.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/ScenarioAPIConfig.cmake"
INSTALL_DESTINATION ${INSTALL_CONFIG_DIR}
PATH_VARS CMAKE_INSTALL_INCLUDEDIR
)
write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/ScenarioAPIConfigVersion.cmake"
VERSION ${PROJECT_VERSION}
COMPATIBILITY SameMajorVersion
)
if(ScenarioAPI_INSTALL)
install(DIRECTORY MantleAPI TYPE INCLUDE)
install(TARGETS ScenarioAPI EXPORT ScenarioAPITargets)
install(
EXPORT ScenarioAPITargets
DESTINATION ${INSTALL_CONFIG_DIR}
NAMESPACE ScenarioAPI::
)
install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/ScenarioAPIConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/ScenarioAPIConfigVersion.cmake"
DESTINATION ${INSTALL_CONFIG_DIR}
COMPONENT dev
)
endif()
# Scenario API
# MantleAPI
A collection of interfaces for abstraction between a scenario engine and an environment simulator.
It is intended to be usable with a wide variety of scenario description languages by implementing according scenario engines.
......
File moved
################################################################################
# Copyright (c) 2021 Daimler TSS GmbH
# Copyright (c) 2022 Mercedes-Benz Tech Innovation GmbH
#
# This program and the accompanying materials are made available under the terms
# of the Eclipse Public License 2.0 which is available at
......@@ -8,16 +9,15 @@
# SPDX-License-Identifier: EPL-2.0
################################################################################
set(CPACK_PACKAGE_NAME "scenario_api")
set(CPACK_PACKAGE_NAME "${PROJECT_NAME}")
set(CPACK_PACKAGE_VENDOR "simopenpass Eclipse project team")
set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
set(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME})
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Scenario API")
set(CPACK_PACKAGE_FILE_NAME
"${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_SYSTEM_NAME}")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${PROJECT_DESCRIPTION}")
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_SYSTEM_NAME}")
set(CPACK_PACKAGE_INSTALL_DIRECTORY ${CPACK_PACKAGE_NAME})
set(CPACK_PACKAGE_CHECKSUM SHA512)
set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE.txt")
......
################################################################################
# Copyright (c) 2021 Daimler TSS GmbH
# Copyright (c) 2022 Mercedes-Benz Tech Innovation GmbH
#
# This program and the accompanying materials are made available under the terms
# of the Eclipse Public License 2.0 which is available at
......@@ -10,11 +11,11 @@
@PACKAGE_INIT@
if(NOT TARGET ScenarioAPI::ScenarioAPI AND NOT ScenarioAPI_BINARY_DIR)
set_and_check(ScenarioAPI_INCLUDE_DIR "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@")
mark_as_advanced(ScenarioAPI_INCLUDE_DIR)
include("${CMAKE_CURRENT_LIST_DIR}/ScenarioAPITargets.cmake")
endif()
include(CMakeFindDependencyMacro)
find_dependency(units)
if(NOT TARGET MantleAPI::MantleAPI AND NOT MantleAPI_BINARY_DIR)
set_and_check(MantleAPI_INCLUDE_DIR "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@")
mark_as_advanced(MantleAPI_INCLUDE_DIR)
include("${CMAKE_CURRENT_LIST_DIR}/MantleAPITargets.cmake")
endif()
......@@ -13,7 +13,7 @@ find_package(Doxygen QUIET REQUIRED dot OPTIONAL_COMPONENTS mscgen dia)
set(DOXYGEN_BUILTIN_STL_SUPPORT YES)
set(DOXYGEN_DOT_IMAGE_FORMAT svg)
set(DOXYGEN_IMAGE_PATH ${CMAKE_CURRENT_LIST_DIR}/images)
set(DOXYGEN_INCLUDE_PATH ${PROJECT_SOURCE_DIR})
set(DOXYGEN_INCLUDE_PATH ${PROJECT_SOURCE_DIR}/include)
set(DOXYGEN_INTERACTIVE_SVG YES)
set(DOXYGEN_QUIET YES)
set(DOXYGEN_TAB_SIZE 2)
......@@ -21,6 +21,5 @@ set(DOXYGEN_UML_LOOK YES)
set(DOXYGEN_USE_MDFILE_AS_MAINPAGE README.md)
doxygen_add_docs(
${PROJECT_NAME}_doc ${PROJECT_SOURCE_DIR}/README.md ${PROJECT_SOURCE_DIR}/MantleAPI/include
COMMENT "Generate html docs"
${PROJECT_NAME}_doc ${PROJECT_SOURCE_DIR}/README.md ${PROJECT_SOURCE_DIR}/include COMMENT "Generate html docs"
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment