11cmake_minimum_required (VERSION 3.5)
22
3- project (open_simulation_interface)
3+ # Set the project version
4+ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR AND NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES )
5+ message (STATUS "Setting build type to 'Release' as none was specified." )
6+ set (CMAKE_BUILD_TYPE "Release" CACHE
7+ STRING "Choose the type of build." FORCE)
8+ # Set the possible values of build type for cmake-gui
9+ set_property (CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
10+ "Debug" "Release" "MinSizeRel" "RelWithDebInfo" )
11+ endif ()
12+
13+ # Read the version number from the file "VERSION"
14+ file (STRINGS "VERSION" VERSION_CONTENTS)
15+ foreach (LINE ${VERSION_CONTENTS} )
16+ string (REGEX REPLACE " |\t " "" LINE ${LINE} )
17+ string (REGEX MATCH "^[^=]+" VERSION_NAME ${LINE} )
18+ string (REPLACE "${VERSION_NAME} =" "" VERSION_VALUE ${LINE} )
19+ set (${VERSION_NAME} "${VERSION_VALUE} " )
20+ endforeach ()
21+
22+ project (
23+ open_simulation_interface
24+ DESCRIPTION "A generic interface for the environmental perception of automated driving functions in virtual scenarios."
25+ HOMEPAGE_URL "https://github.com/OpenSimulationInterface/open-simulation-interface"
26+ VERSION ${VERSION_MAJOR} .${VERSION_MINOR} .${VERSION_PATCH}
27+ LANGUAGES CXX
28+ )
29+ set (OPEN_SIMULATION_INTERFACE_VERSION ${VERSION_MAJOR} .${VERSION_MINOR} .${VERSION_PATCH} )
430
531# Toplevel check
632set (OSI_IS_TOP_LEVEL OFF )
@@ -16,35 +42,9 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
1642option (OSI_BUILD_FLATBUFFER "Build flatbuffer versions of libraries" OFF )
1743option (OSI_BUILD_DOCUMENTATION "Build flatbuffer versions of libraries" ${OSI_IS_TOP_LEVEL} )
1844
19- # Set a default build type if none was specified
20- set (default_build_type "Release" )
21- if (EXISTS "${CMAKE_SOURCE_DIR} /.git" )
22- set (default_build_type "Debug" )
23- endif ()
24-
25- # read the version number from the file "VERSION"
26- file (STRINGS "VERSION" VERSION_CONTENTS)
27- foreach (LINE ${VERSION_CONTENTS} )
28- string (REGEX REPLACE " |\t " "" LINE ${LINE} )
29- string (REGEX MATCH "^[^=]+" VERSION_NAME ${LINE} )
30- string (REPLACE "${VERSION_NAME} =" "" VERSION_VALUE ${LINE} )
31- set (${VERSION_NAME} "${VERSION_VALUE} " )
32- endforeach ()
33- set (OPEN_SIMULATION_INTERFACE_VERSION ${VERSION_MAJOR} .${VERSION_MINOR} .${VERSION_PATCH} )
34-
3545set (${PROJECT_NAME} _SOVERSION "${VERSION_MAJOR} .${VERSION_MINOR} .${VERSION_PATCH} " )
3646set (${PROJECT_NAME} _LIBVERSION "${VERSION_MAJOR} .${VERSION_MINOR} .${VERSION_PATCH} " )
3747
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" )
46- endif ()
47-
4848# Offer the user the choice of overriding the installation directories
4949set (OSI_INSTALL_LIB_DIR lib CACHE PATH "Installation directory for libraries" )
5050set (OSI_INSTALL_INCLUDE_DIR include CACHE PATH "Installation directory for header files" )
0 commit comments