Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

CMakeLists.txt 967B

7 år sedan
123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. cmake_minimum_required(VERSION 3.2)
  2. project(ScopeGuard VERSION 0.0.2)
  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. if( CMAKE_BUILD_TYPE )
  7. message(STATUS "Build Type : ${CMAKE_BUILD_TYPE}")
  8. else()
  9. message(STATUS "Build Type : None")
  10. endif()
  11. add_compile_options(-Wall
  12. -Wextra
  13. -pedantic
  14. -Werror
  15. -Wshadow
  16. -Wold-style-cast
  17. )
  18. set(CMAKE_CXX_STANDARD 14)
  19. set(CMAKE_CXX_STANDARD_REQUIRED ON)
  20. set(CMAKE_CXX_EXTENSIONS OFF)
  21. add_library(ScopeGuard INTERFACE)
  22. target_include_directories(ScopeGuard INTERFACE
  23. $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
  24. $<INSTALL_INTERFACE:include>)
  25. if( UNITTEST )
  26. enable_testing()
  27. add_subdirectory("test")
  28. endif()
  29. include(Install)