diff --git a/CMakeLists.txt b/CMakeLists.txt index ca0746f..f47a368 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,7 +9,7 @@ set(CMAKE_CXX_EXTENSIONS OFF) set(THIRD_PARTY_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party) if(MSVC AND (MSVC_VERSION LESS 1900)) -message(FATAL_ERROR "Visual Studio Compiler Version >= 1900 Required to build.") + message(FATAL_ERROR "Visual Studio Compiler Version >= 1900 Required to build.") endif() # This project follows semantic versioning (https://semver.org/) diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 87341b3..4b9dc09 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -49,18 +49,13 @@ install(TARGETS ze_loader NAMELINK_COMPONENT level-zero-devel ) -if(UNIX) - file(RELATIVE_PATH ze_loader_include_dir "${CMAKE_INSTALL_FULL_LIBDIR}/pkgconfig" "${CMAKE_INSTALL_FULL_INCLUDEDIR}") - file(RELATIVE_PATH ze_loader_lib_dir "${CMAKE_INSTALL_FULL_LIBDIR}/pkgconfig" "${CMAKE_INSTALL_FULL_LIBDIR}") +file(RELATIVE_PATH pkgconfig_prefix "${CMAKE_INSTALL_FULL_LIBDIR}/pkgconfig" "${CMAKE_INSTALL_PREFIX}") +file(RELATIVE_PATH pkgconfig_include_dir "${CMAKE_INSTALL_PREFIX}" "${CMAKE_INSTALL_FULL_INCLUDEDIR}") +file(RELATIVE_PATH pkgconfig_lib_dir "${CMAKE_INSTALL_PREFIX}" "${CMAKE_INSTALL_FULL_LIBDIR}") - configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/libze_loader.pc.in - ${CMAKE_CURRENT_BINARY_DIR}/libze_loader.pc - @ONLY) - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libze_loader.pc" DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}/pkgconfig" COMPONENT level-zero-devel) - configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/level-zero.pc.in - ${CMAKE_CURRENT_BINARY_DIR}/level-zero.pc - @ONLY) - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/level-zero.pc" DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}/pkgconfig" COMPONENT level-zero-devel) -endif() +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libze_loader.pc.in ${CMAKE_CURRENT_BINARY_DIR}/libze_loader.pc @ONLY) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/level-zero.pc.in ${CMAKE_CURRENT_BINARY_DIR}/level-zero.pc @ONLY) + +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libze_loader.pc" + "${CMAKE_CURRENT_BINARY_DIR}/level-zero.pc" + DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}/pkgconfig" COMPONENT level-zero-devel) diff --git a/source/level-zero.pc.in b/source/level-zero.pc.in index 0cef86f..a28d9d3 100644 --- a/source/level-zero.pc.in +++ b/source/level-zero.pc.in @@ -1,7 +1,6 @@ -pc_path=${pcfiledir} -includedir=${pc_path}/@ze_loader_include_dir@ -libdir=${pc_path}/@ze_loader_lib_dir@ - +prefix=${pcfiledir}/@pkgconfig_prefix@ +includedir=${prefix}/@pkgconfig_include_dir@ +libdir=${prefix}/@pkgconfig_lib_dir@ Name: Level Zero Description: Level Zero diff --git a/source/libze_loader.pc.in b/source/libze_loader.pc.in index cda18c7..97f48a4 100644 --- a/source/libze_loader.pc.in +++ b/source/libze_loader.pc.in @@ -1,7 +1,6 @@ -pc_path=${pcfiledir} -includedir=${pc_path}/@ze_loader_include_dir@ -libdir=${pc_path}/@ze_loader_lib_dir@ - +prefix=${pcfiledir}/@pkgconfig_prefix@ +includedir=${prefix}/@pkgconfig_include_dir@ +libdir=${prefix}/@pkgconfig_lib_dir@ Name: Level Zero Loader Description: Runtime Library Loader for Level Zero @@ -10,5 +9,3 @@ Version: @PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_PATCH@ Requires: Libs: -L${libdir} -lze_loader CFlags: -I${includedir} - -