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.

46 line
967B

  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)