From 736082081e2c45a7a0b2de6bfbfbfe84fde1a2b6 Mon Sep 17 00:00:00 2001 From: terik23 Date: Sat, 8 Jun 2019 14:49:31 +0500 Subject: [PATCH] fix cmake --- CMakeLists.txt | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e84a736..d7ae6d1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.6) +cmake_minimum_required(VERSION 3.8) project(nameof VERSION "0.8.3" LANGUAGES CXX) @@ -20,10 +20,11 @@ if(NAMEOF_OPT_BUILD_TESTS) add_subdirectory(test) endif() -include(GNUInstallDirs) include(CMakePackageConfigHelpers) add_library(${PROJECT_NAME} INTERFACE) +add_library(${PROJECT_NAME}::${PROJECT_NAME} ALIAS ${PROJECT_NAME}) +target_compile_features(${PROJECT_NAME} INTERFACE cxx_std_17) target_include_directories(${PROJECT_NAME} INTERFACE $ @@ -34,16 +35,14 @@ write_basic_package_version_file(${PROJECT_NAME}ConfigVersion.cmake COMPATIBILITY AnyNewerVersion) install(TARGETS ${PROJECT_NAME} - EXPORT ${PROJECT_NAME}Targets - PUBLIC_HEADER DESTINATION include - INCLUDES DESTINATION include) + EXPORT ${PROJECT_NAME}Config) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake DESTINATION lib/cmake/${PROJECT_NAME}) -install(EXPORT ${PROJECT_NAME}Targets +install(EXPORT ${PROJECT_NAME}Config NAMESPACE ${PROJECT_NAME}:: DESTINATION lib/cmake/${PROJECT_NAME}) install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include - DESTINATION include) + DESTINATION .) \ No newline at end of file