From c129bc23a4db3f29141ba321aa2de59c0f4a4121 Mon Sep 17 00:00:00 2001 From: Xorg Date: Thu, 21 May 2020 22:10:23 +0200 Subject: [PATCH] CMake: fix install target's export --- libcpuid/CMakeLists.txt | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/libcpuid/CMakeLists.txt b/libcpuid/CMakeLists.txt index 66a13d6..3821a3e 100644 --- a/libcpuid/CMakeLists.txt +++ b/libcpuid/CMakeLists.txt @@ -8,7 +8,7 @@ set(cpuid_sources msrdriver.c asm-bits.c) -if(WIN32 AND "${MSVC_CXX_ARCHITECTURE_ID}" MATCHES "x64") +if("${MSVC_CXX_ARCHITECTURE_ID}" MATCHES "x64") list(APPEND cpuid_sources masm-x64.asm) endif() @@ -67,26 +67,20 @@ configure_package_config_file("${CMAKE_MODULE_PATH}/Config.cmake.in" "${project_ INSTALL_DESTINATION "${config_install_dir}") # Installation -if(WIN32) - install( - TARGETS cpuid - EXPORT "${TARGETS_EXPORT_NAME}" - LIBRARY DESTINATION "lib" - ARCHIVE DESTINATION "lib" - RUNTIME DESTINATION "bin" - INCLUDES - DESTINATION "include") - install( - EXPORT "${TARGETS_EXPORT_NAME}" - NAMESPACE "${namespace}" - DESTINATION "${config_install_dir}") -else() - install( - TARGETS cpuid - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) -endif() +install( + TARGETS cpuid + EXPORT "${TARGETS_EXPORT_NAME}" + LIBRARY DESTINATION "lib" + ARCHIVE DESTINATION "lib" + RUNTIME DESTINATION "bin" + INCLUDES + PUBLIC_HEADER DESTINATION "include") + +install( + EXPORT "${TARGETS_EXPORT_NAME}" + NAMESPACE "${namespace}" + DESTINATION "${config_install_dir}") install(FILES "${project_config}" "${version_config}" DESTINATION "${config_install_dir}")