CMakeLists.txt 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. CONFIGURE_FILE(
  33. ${CMAKE_SOURCE_DIR}/version.h.in
  34. ${CMAKE_BINARY_DIR}/include/version.h
  35. )
  36. CONFIGURE_FILE(
  37. ${CMAKE_SOURCE_DIR}/res/ArrivalMANager.rc.in
  38. ${CMAKE_BINARY_DIR}/ArrivalMANager.rc
  39. )
  40. # define include directories
  41. INCLUDE_DIRECTORIES(
  42. ${CMAKE_SOURCE_DIR}
  43. ${CMAKE_SOURCE_DIR}/include
  44. ${CMAKE_BINARY_DIR}/include
  45. )
  46. INCLUDE(cmake/3rdParty.cmake)
  47. INCLUDE(cmake/Protobuf.cmake)
  48. INCLUDE(cmake/FindEuroScope.cmake)
  49. # register all cmake helper to find required modules and find 3rd-party components
  50. SET(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_SOURCE_DIR}/cmake")
  51. FIND_PACKAGE(EuroScope REQUIRED)
  52. IF(NOT EuroScope_FOUND)
  53. MESSAGE(FATAL_ERROR "Unablet to build without EuroScope and the EuroScope-SDK")
  54. ENDIF()
  55. ADD_SUBDIRECTORY(src)