diff --git a/CMakeLists.txt b/CMakeLists.txt index fbf2edb..35d69d0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.6) +cmake_minimum_required(VERSION 3.15) project(libcanon VERSION 0.1.0 LANGUAGES CXX) # OPTIONS @@ -8,6 +8,8 @@ option(BUILD_DOCS "Build the API documentation" OFF) # Set the building options. set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_EXTENSIONS OFF) # The main components. add_subdirectory(include) @@ -35,7 +37,7 @@ write_basic_package_version_file(${CONFIGVERSION_FILE} VERSION ${PROJECT_VERSION} COMPATIBILITY SameMajorVersion) install(EXPORT libcanon_exports FILE libcanon-targets.cmake - NAMESPACE libcanon DESTINATION ${CONFIG_DESTINATION}) + NAMESPACE libcanon:: DESTINATION ${CONFIG_DESTINATION}) install(FILES ${CONFIG_FILE} ${CONFIGVERSION_FILE} DESTINATION ${CONFIG_DESTINATION}) diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt index 7960e2f..9c044bc 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -1,8 +1,8 @@ -# The phony licanon library for export. +# The phony libcanon library for export. add_library(headers INTERFACE) target_include_directories(headers INTERFACE - $ - $) + $ + $) install(TARGETS headers EXPORT libcanon_exports) # Installation of the real thing. diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 5f53d8e..f2252fb 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -13,10 +13,7 @@ add_subdirectory(googletest EXCLUDE_FROM_ALL) include(CTest) function(add_simple_test name) add_executable("${name}" "${name}.cpp") - target_include_directories("${name}" PRIVATE - "${libcanon_SOURCE_DIR}/include" - "${gtest_SOURCE_DIR}/include") - target_link_libraries("${name}" gtest gtest_main) + target_link_libraries("${name}" PRIVATE headers gtest gtest_main) add_test(NAME "${name}" COMMAND "${name}") endfunction()