Closed nm004 closed 8 months ago
Can you confirm if it works with the package name lowercased, like polyhook_2-config.cmake
@stevemk14ebr Thank you for your reply.
Yes, that worked too.
My patch is like this:
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6f072d3..bfbe0d3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,7 @@
cmake_minimum_required(VERSION 3.15)
project(PolyHook_2)
+string(TOLOWER ${PROJECT_NAME} LOWERCASE_PROJECT_NAME)
include(CMakePackageConfigHelpers)
if(WIN32)
@@ -374,14 +375,14 @@ endif()
configure_package_config_file(
"${PROJECT_NAME}-config.cmake.in"
- "${PROJECT_NAME}-config.cmake"
+ "${LOWERCASE_PROJECT_NAME}-config.cmake"
INSTALL_DESTINATION
"lib/${PROJECT_NAME}"
)
install(
FILES
- "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake"
+ "${CMAKE_CURRENT_BINARY_DIR}/${LOWERCASE_PROJECT_NAME}-config.cmake"
DESTINATION
"lib/${PROJECT_NAME}"
)
Hi @stevemk14ebr.
I am going to use PolyHook_2_0 for my project, but
find_package(PolyHook_2 CONFIG REQUIRED)
does not work when building my project on Linux. Although,find_package
worked when I renamedPolyHook_2-config.cmake
toPolyHook_2Config.cmake
.According to the official documentation,
<PackageName>-config.cmake
(PolyHook_2-config.cmake
in this case) is not expected:I appreciate your great work.