Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

CMakeLists.txt 1.1KB

7 anos atrás
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. cmake_minimum_required(VERSION 3.2)
  2. project(ScopeGuard VERSION 0.0.3)
  3. message(STATUS "~~~ ${PROJECT_NAME} v${PROJECT_VERSION} ~~~")
  4. set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
  5. option(UNITTEST "Build Unit Tests" ON)
  6. option(COVERAGE "Enable Coverage" OFF)
  7. message(STATUS "Coverage : ${COVERAGE}")
  8. if( CMAKE_BUILD_TYPE )
  9. message(STATUS "Build Type : ${CMAKE_BUILD_TYPE}")
  10. else()
  11. message(STATUS "Build Type : None")
  12. endif()
  13. if( COVERAGE )
  14. include(Coverage)
  15. endif()
  16. add_compile_options(-Wall
  17. -Wextra
  18. -pedantic
  19. -Werror
  20. -Wshadow
  21. -Wold-style-cast
  22. )
  23. set(CMAKE_CXX_STANDARD 14)
  24. set(CMAKE_CXX_STANDARD_REQUIRED ON)
  25. set(CMAKE_CXX_EXTENSIONS OFF)
  26. add_library(ScopeGuard INTERFACE)
  27. target_include_directories(ScopeGuard INTERFACE
  28. $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
  29. $<INSTALL_INTERFACE:include>)
  30. if( UNITTEST )
  31. enable_testing()
  32. add_subdirectory("test")
  33. endif()
  34. include(Install)