diff options
author | Petr Hosek <petrhosek@users.noreply.github.com> | 2022-06-18 02:55:46 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-18 02:55:46 +0300 |
commit | 082deffc80ce517f81dc2f3aebe6ba671fcd09c9 (patch) | |
tree | 617a393e4a650cd77a8e70bf781e29302d6ac9e4 /CMakeLists.txt | |
parent | 9fa621933fc6080b96fa0f037cdc7cd2c69ab272 (diff) |
Define namespace prefixed alias for cpuinfo in the CMake build (#89)
This allows projects that depend on cpuinfo to use namespace qualified
target name regardless of whether they consume cpuinfo through
add_subdirectory or find_package.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 74364e8..7c28761 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -264,6 +264,8 @@ ENDIF() TARGET_LINK_LIBRARIES(cpuinfo PRIVATE clog) TARGET_LINK_LIBRARIES(cpuinfo_internals PRIVATE clog) +ADD_LIBRARY(${PROJECT_NAME}::cpuinfo ALIAS cpuinfo) + # support find_package(cpuinfo CONFIG) INCLUDE(CMakePackageConfigHelpers) GET_FILENAME_COMPONENT(CONFIG_FILE_PATH ${CMAKE_CURRENT_BINARY_DIR}/cpuinfo-config.cmake ABSOLUTE) |