From 25e6e38c85eea2bba775e4239f0ed49de3aabc50 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Fri, 16 Jul 2021 00:48:00 +0200 Subject: [PATCH] cmake: allow libcpuid to be added as a CMake subproject (#155) --- CMakeLists.txt | 2 +- libcpuid/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f6e7358..912382b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,7 +13,7 @@ set(CMAKE_CXX_STANDARD 11) set(CMAKE_C_STANDARD 99) # Global variables -set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") +list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake") if(UNIX) include(GNUInstallDirs) diff --git a/libcpuid/CMakeLists.txt b/libcpuid/CMakeLists.txt index 7031650..c857e30 100644 --- a/libcpuid/CMakeLists.txt +++ b/libcpuid/CMakeLists.txt @@ -67,7 +67,7 @@ include(CMakePackageConfigHelpers) write_basic_package_version_file("${version_config}" COMPATIBILITY SameMajorVersion) # Configure 'Config.cmake' Use variables: * TARGETS_EXPORT_NAME * PROJECT_NAME -configure_package_config_file("${CMAKE_MODULE_PATH}/Config.cmake.in" "${project_config}" +configure_package_config_file("${PROJECT_SOURCE_DIR}/cmake/Config.cmake.in" "${project_config}" INSTALL_DESTINATION "${config_install_dir}") # Installation