Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow pkg-config files on Windows as well #254

Merged
merged 1 commit into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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/)
Expand Down
23 changes: 9 additions & 14 deletions source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
7 changes: 3 additions & 4 deletions source/level-zero.pc.in
Original file line number Diff line number Diff line change
@@ -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
Expand Down
9 changes: 3 additions & 6 deletions source/libze_loader.pc.in
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -10,5 +9,3 @@ Version: @PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_PATCH@
Requires:
Libs: -L${libdir} -lze_loader
CFlags: -I${includedir}


Loading