You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
1.1KB

  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. 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)