Skip to content
Snippets Groups Projects
Verified Commit 771fc799 authored by Martin Stump's avatar Martin Stump
Browse files

Reduce dir depth


* Move "doc", "include" and "test" to the root dir
* Rename to MantleAPI

Signed-off-by: default avatarMartin Stump <martin.stump@mercedes-benz.com>
parent bf53f32f
No related branches found
No related tags found
No related merge requests found
Showing
with 65 additions and 81 deletions
File moved
...@@ -14,36 +14,58 @@ cmake_minimum_required(VERSION 3.15.0 FATAL_ERROR) ...@@ -14,36 +14,58 @@ cmake_minimum_required(VERSION 3.15.0 FATAL_ERROR)
# Add the custom CMake modules to CMake's module path # Add the custom CMake modules to CMake's module path
list(PREPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake") 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. # Determine if MantleAPI is built as a subproject (using add_subdirectory) or if it is the main project.
if(NOT DEFINED ScenarioAPI_MAIN_PROJECT) if(NOT DEFINED MantleAPI_MAIN_PROJECT)
set(ScenarioAPI_MAIN_PROJECT OFF) set(MantleAPI_MAIN_PROJECT OFF)
if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
set(ScenarioAPI_MAIN_PROJECT ON) set(MantleAPI_MAIN_PROJECT ON)
endif() endif()
endif() endif()
project( project(
ScenarioAPI MantleAPI
VERSION 0.1.0 VERSION 0.1.0
DESCRIPTION "Scenario API, an abstraction layer for environmental simulators" DESCRIPTION "MantleAPI, an abstraction layer for environmental simulators"
LANGUAGES CXX LANGUAGES CXX
) )
# Options that control generation of various targets. # Options that control generation of various targets.
option(ScenarioAPI_DOC "Generate the doc target." ${ScenarioAPI_MAIN_PROJECT}) option(MantleAPI_DOC "Generate the doc target." ${MantleAPI_MAIN_PROJECT})
option(ScenarioAPI_INSTALL "Generate the install target." ${ScenarioAPI_MAIN_PROJECT}) option(MantleAPI_INSTALL "Generate the install target." ${MantleAPI_MAIN_PROJECT})
option(ScenarioAPI_TEST "Generate the test target." ${ScenarioAPI_MAIN_PROJECT}) option(MantleAPI_TEST "Generate the test target." ${MantleAPI_MAIN_PROJECT})
option(ScenarioAPI_PACKAGE "Generate the package target." ${ScenarioAPI_MAIN_PROJECT}) option(MantleAPI_PACKAGE "Generate the package target." ${MantleAPI_MAIN_PROJECT})
option(ScenarioAPI_ENABLE_WARNINGS "Enable compiler warnings." ${ScenarioAPI_MAIN_PROJECT}) option(MantleAPI_ENABLE_WARNINGS "Enable compiler warnings." ${MantleAPI_MAIN_PROJECT})
option(ScenarioAPI_ENABLE_WERROR "Fail and stop if a warning is triggered." ${ScenarioAPI_MAIN_PROJECT}) option(MantleAPI_ENABLE_WERROR "Fail and stop if a warning is triggered." ${MantleAPI_MAIN_PROJECT})
if(ScenarioAPI_TEST) if(MSVC)
enable_testing() 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() endif()
include(CPM) include(CPM)
add_subdirectory(MantleAPI)
if(ScenarioAPI_PACKAGE) add_subdirectory(include)
include(ScenarioAPICPack)
if(MantleAPI_DOC)
add_subdirectory(doc)
endif()
if(MantleAPI_TEST)
enable_testing()
add_subdirectory(test)
endif()
if(MantleAPI_PACKAGE)
include(MantleAPICPack)
endif() 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()
# Scenario API # MantleAPI
A collection of interfaces for abstraction between a scenario engine and an environment simulator. 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. 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) 2021 Daimler TSS GmbH
# Copyright (c) 2022 Mercedes-Benz Tech Innovation GmbH
# #
# This program and the accompanying materials are made available under the terms # This program and the accompanying materials are made available under the terms
# of the Eclipse Public License 2.0 which is available at # of the Eclipse Public License 2.0 which is available at
...@@ -8,16 +9,15 @@ ...@@ -8,16 +9,15 @@
# SPDX-License-Identifier: EPL-2.0 # 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_VENDOR "simopenpass Eclipse project team")
set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}) set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR}) set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH}) set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION}) set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
set(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}) set(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME})
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Scenario API") set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${PROJECT_DESCRIPTION}")
set(CPACK_PACKAGE_FILE_NAME set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_SYSTEM_NAME}")
"${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_SYSTEM_NAME}")
set(CPACK_PACKAGE_INSTALL_DIRECTORY ${CPACK_PACKAGE_NAME}) set(CPACK_PACKAGE_INSTALL_DIRECTORY ${CPACK_PACKAGE_NAME})
set(CPACK_PACKAGE_CHECKSUM SHA512) set(CPACK_PACKAGE_CHECKSUM SHA512)
set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE.txt") set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE.txt")
......
################################################################################ ################################################################################
# Copyright (c) 2021 Daimler TSS GmbH # 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 # This program and the accompanying materials are made available under the terms
# of the Eclipse Public License 2.0 which is available at # of the Eclipse Public License 2.0 which is available at
...@@ -10,10 +11,10 @@ ...@@ -10,10 +11,10 @@
@PACKAGE_INIT@ @PACKAGE_INIT@
if(NOT TARGET ScenarioAPI::ScenarioAPI AND NOT ScenarioAPI_BINARY_DIR) if(NOT TARGET MantleAPI::MantleAPI AND NOT MantleAPI_BINARY_DIR)
set_and_check(ScenarioAPI_INCLUDE_DIR "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@") set_and_check(MantleAPI_INCLUDE_DIR "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@")
mark_as_advanced(ScenarioAPI_INCLUDE_DIR) mark_as_advanced(MantleAPI_INCLUDE_DIR)
include("${CMAKE_CURRENT_LIST_DIR}/ScenarioAPITargets.cmake") include("${CMAKE_CURRENT_LIST_DIR}/MantleAPITargets.cmake")
endif() endif()
include(CMakeFindDependencyMacro) include(CMakeFindDependencyMacro)
......
...@@ -13,7 +13,7 @@ find_package(Doxygen QUIET REQUIRED dot OPTIONAL_COMPONENTS mscgen dia) ...@@ -13,7 +13,7 @@ find_package(Doxygen QUIET REQUIRED dot OPTIONAL_COMPONENTS mscgen dia)
set(DOXYGEN_BUILTIN_STL_SUPPORT YES) set(DOXYGEN_BUILTIN_STL_SUPPORT YES)
set(DOXYGEN_DOT_IMAGE_FORMAT svg) set(DOXYGEN_DOT_IMAGE_FORMAT svg)
set(DOXYGEN_IMAGE_PATH ${CMAKE_CURRENT_LIST_DIR}/images) 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_INTERACTIVE_SVG YES)
set(DOXYGEN_QUIET YES) set(DOXYGEN_QUIET YES)
set(DOXYGEN_TAB_SIZE 2) set(DOXYGEN_TAB_SIZE 2)
...@@ -21,6 +21,5 @@ set(DOXYGEN_UML_LOOK YES) ...@@ -21,6 +21,5 @@ set(DOXYGEN_UML_LOOK YES)
set(DOXYGEN_USE_MDFILE_AS_MAINPAGE README.md) set(DOXYGEN_USE_MDFILE_AS_MAINPAGE README.md)
doxygen_add_docs( doxygen_add_docs(
${PROJECT_NAME}_doc ${PROJECT_SOURCE_DIR}/README.md ${PROJECT_SOURCE_DIR}/MantleAPI/include ${PROJECT_NAME}_doc ${PROJECT_SOURCE_DIR}/README.md ${PROJECT_SOURCE_DIR}/include COMMENT "Generate html docs"
COMMENT "Generate html docs"
) )
...@@ -34,47 +34,45 @@ file( ...@@ -34,47 +34,45 @@ file(
CONFIGURE_DEPENDS "*.h" CONFIGURE_DEPENDS "*.h"
) )
add_library(ScenarioAPI INTERFACE) add_library(MantleAPI INTERFACE)
add_library(ScenarioAPI::ScenarioAPI ALIAS ScenarioAPI) add_library(MantleAPI::MantleAPI ALIAS MantleAPI)
target_link_libraries(ScenarioAPI INTERFACE units::units) target_link_libraries(MantleAPI INTERFACE units::units)
include(GNUInstallDirs) include(GNUInstallDirs)
set(INSTALL_CONFIG_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/ScenarioAPI") set(INSTALL_CONFIG_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/MantleAPI")
target_include_directories( target_include_directories(
ScenarioAPI INTERFACE $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/MantleAPI/include> MantleAPI INTERFACE $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
) )
target_compile_features(ScenarioAPI INTERFACE cxx_std_17) target_compile_features(MantleAPI INTERFACE cxx_std_17)
include(CMakePackageConfigHelpers) include(CMakePackageConfigHelpers)
configure_package_config_file( configure_package_config_file(
"${PROJECT_SOURCE_DIR}/cmake/ScenarioAPIConfig.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/ScenarioAPIConfig.cmake" "${PROJECT_SOURCE_DIR}/cmake/MantleAPIConfig.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/MantleAPIConfig.cmake"
INSTALL_DESTINATION ${INSTALL_CONFIG_DIR} INSTALL_DESTINATION ${INSTALL_CONFIG_DIR}
PATH_VARS CMAKE_INSTALL_INCLUDEDIR PATH_VARS CMAKE_INSTALL_INCLUDEDIR
) )
write_basic_package_version_file( write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/ScenarioAPIConfigVersion.cmake" "${CMAKE_CURRENT_BINARY_DIR}/MantleAPIConfigVersion.cmake"
VERSION ${PROJECT_VERSION} VERSION ${PROJECT_VERSION}
COMPATIBILITY SameMajorVersion COMPATIBILITY SameMajorVersion
) )
if(ScenarioAPI_INSTALL) if(MantleAPI_INSTALL)
install(DIRECTORY MantleAPI TYPE INCLUDE) install(DIRECTORY MantleAPI TYPE INCLUDE)
install(TARGETS ScenarioAPI EXPORT ScenarioAPITargets) install(TARGETS MantleAPI EXPORT MantleAPITargets)
install( install(
EXPORT ScenarioAPITargets EXPORT MantleAPITargets
DESTINATION ${INSTALL_CONFIG_DIR} DESTINATION ${INSTALL_CONFIG_DIR}
NAMESPACE ScenarioAPI:: NAMESPACE MantleAPI::
) )
install( install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/ScenarioAPIConfig.cmake" FILES "${CMAKE_CURRENT_BINARY_DIR}/MantleAPIConfig.cmake" "${CMAKE_CURRENT_BINARY_DIR}/MantleAPIConfigVersion.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/ScenarioAPIConfigVersion.cmake"
DESTINATION ${INSTALL_CONFIG_DIR} DESTINATION ${INSTALL_CONFIG_DIR}
COMPONENT dev COMPONENT dev
) )
......
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