1
0
Fork 0
mirror of https://github.com/anrieff/libcpuid synced 2024-12-16 16:35:45 +00:00

CMake: fix install target's export

This commit is contained in:
Xorg 2020-05-21 22:10:23 +02:00
parent 1a00dac1ee
commit c129bc23a4
No known key found for this signature in database
GPG key ID: 1E55EE2EFF18BC1A

View file

@ -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}")