CMakeLists.txt 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. # Author:
  2. # Sven Czarnian <devel@svcz.de>
  3. # License:
  4. # GPLv3
  5. # Brief:
  6. # Creates the AMAN-EuroScope solution
  7. CMAKE_MINIMUM_REQUIRED(VERSION 3.14)
  8. # define the project information
  9. PROJECT(ArrivalMANager LANGUAGES CXX VERSION "0.1.0")
  10. # define the language parameters
  11. SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON)
  12. SET(CMAKE_CXX_STANDARD 20)
  13. SET(CMAKE_CXX_STANDARD_REQUIRED ON)
  14. SET(CMAKE_CXX_EXTENSIONS OFF)
  15. SET(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE TRUE)
  16. # adapt compiler flags based on used compiler
  17. IF (MSVC)
  18. IF (CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
  19. STRING(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
  20. ELSE ()
  21. SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
  22. ENDIF ()
  23. IF (NOT CMAKE_CXX_FLAGS MATCHES "/MP")
  24. SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
  25. SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP")
  26. ENDIF ()
  27. SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /sdl /permissive- /DNOMINMAX")
  28. SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /sdl /permissive- /DNOMINMAX")
  29. SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /MANIFESTUAC:NO")
  30. ADD_DEFINITIONS(/D_USRDLL /D_CRT_SECURE_NO_WARNINGS)
  31. ENDIF ()
  32. # define include directories
  33. INCLUDE_DIRECTORIES(
  34. ${CMAKE_SOURCE_DIR}/include
  35. ${CMAKE_BINARY_DIR}/include
  36. )
  37. INCLUDE(cmake/3rdParty.cmake)
  38. INCLUDE(cmake/Protobuf.cmake)
  39. INCLUDE(cmake/FindEuroScope.cmake)
  40. # register all cmake helper to find required modules and find 3rd-party components
  41. SET(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_SOURCE_DIR}/cmake")
  42. FIND_PACKAGE(EuroScope REQUIRED)
  43. IF(NOT EuroScope_FOUND)
  44. MESSAGE(FATAL_ERROR "Unablet to build without EuroScope and the EuroScope-SDK")
  45. ENDIF()