CMakeLists.txt 2.0 KB

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