11cmake_minimum_required (VERSION 3.10)
22
3- project (open_simulation_interface)
4-
53# Toplevel check
64set (OSI_IS_TOP_LEVEL OFF )
75if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR )
86 set (OSI_IS_TOP_LEVEL ON )
97endif ()
108
11- # Set the C++ standard
12- set (CMAKE_CXX_STANDARD 17 CACHE STRING "C++ standard to be used" )
13- set (CMAKE_CXX_STANDARD_REQUIRED ON )
14-
15- if (MSVC )
16- add_compile_options (/wd4141 /wd4244 /wd4251 /wd4267 /wd4305 /wd4355 /wd4800 /wd4996)
17- endif ()
18-
199# Set a default build type if none was specified
2010set (default_build_type "Release" )
21- if (EXISTS "${CMAKE_SOURCE_DIR} /.git" )
22- set (default_build_type "Debug" )
11+
12+ if (OSI_IS_TOP_LEVEL AND NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES )
13+ message (STATUS "Setting build type to '${default_build_type} ' as none was specified." )
14+ set (CMAKE_BUILD_TYPE "${default_build_type} " CACHE
15+ STRING "Choose the type of build." FORCE)
16+ # Set the possible values of build type for cmake-gui
17+ set_property (CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
18+ "Debug" "Release" "MinSizeRel" "RelWithDebInfo" )
2319endif ()
2420
2521# read the version number from the file "VERSION"
@@ -32,19 +28,25 @@ foreach(LINE ${VERSION_CONTENTS})
3228endforeach ()
3329set (OPEN_SIMULATION_INTERFACE_VERSION ${VERSION_MAJOR} .${VERSION_MINOR} .${VERSION_PATCH} )
3430
35- set (${PROJECT_NAME} _SOVERSION "${VERSION_MAJOR} .${VERSION_MINOR} .${VERSION_PATCH} " )
36- set (${PROJECT_NAME} _LIBVERSION "${VERSION_MAJOR} .${VERSION_MINOR} .${VERSION_PATCH} " )
31+ project (
32+ open_simulation_interface
33+ DESCRIPTION "A generic interface for the environmental perception of automated driving functions in virtual scenarios."
34+ HOMEPAGE_URL "https://github.com/OpenSimulationInterface/open-simulation-interface"
35+ VERSION ${OPEN_SIMULATION_INTERFACE_VERSION}
36+ LANGUAGES CXX
37+ )
3738
38- # configure build version
39- if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES )
40- message (STATUS "Setting build type to '${default_build_type} ' as none was specified." )
41- set (CMAKE_BUILD_TYPE "${default_build_type} " CACHE
42- STRING "Choose the type of build." FORCE)
43- # Set the possible values of build type for cmake-gui
44- set_property (CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
45- "Debug" "Release" "MinSizeRel" "RelWithDebInfo" )
39+ # Set the C++ standard
40+ set (CMAKE_CXX_STANDARD 17 CACHE STRING "C++ standard to be used" )
41+ set (CMAKE_CXX_STANDARD_REQUIRED ON )
42+
43+ if (MSVC )
44+ add_compile_options (/wd4141 /wd4244 /wd4251 /wd4267 /wd4305 /wd4355 /wd4800 /wd4996)
4645endif ()
4746
47+ set (${PROJECT_NAME} _SOVERSION "${VERSION_MAJOR} .${VERSION_MINOR} .${VERSION_PATCH} " )
48+ set (${PROJECT_NAME} _LIBVERSION "${VERSION_MAJOR} .${VERSION_MINOR} .${VERSION_PATCH} " )
49+
4850# Offer the user the choice of overriding the installation directories
4951set (OSI_INSTALL_LIB_DIR lib CACHE PATH "Installation directory for libraries" )
5052set (OSI_INSTALL_INCLUDE_DIR include CACHE PATH "Installation directory for header files" )
5658endif ()
5759set (OSI_INSTALL_CMAKE_DIR ${DEF_INSTALL_CMAKE_DIR} CACHE PATH "Installation directory for CMake files" )
5860
59- set (OSI_INSTALL_LIB_DIR ${OSI_INSTALL_LIB_DIR} /osi ${VERSION_MAJOR} )
61+ set (OSI_INSTALL_LIB_DIR ${OSI_INSTALL_LIB_DIR} )
6062set (OSI_INSTALL_INCLUDE_DIR ${OSI_INSTALL_INCLUDE_DIR} /osi${VERSION_MAJOR} )
6163
6264configure_file (open-simulation-interface /osi_version.proto.in osi_version.proto)
0 commit comments