Skip to content

Commit

Permalink
cmake: Fix malformed CMake package location on Windows
Browse files Browse the repository at this point in the history
CMake doesn't expect CMake package files to be separated in
subdirectories on Windows and instead expects all files to be put in
a single directory `cmake` found within one of the PREFIX paths.

Also fixes circular dependency in w32-pthreads CMake package config
file.
  • Loading branch information
PatTheMav authored and RytoEX committed Aug 20, 2024
1 parent 117ee9c commit c89cef3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion cmake/common/helpers_common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,11 @@ function(target_export target)
set(package_destination "Frameworks/${target}.framework/Resources/cmake")
set(include_destination "Frameworks/${target}.framework/Headers")
else()
set(package_destination "${OBS_CMAKE_DESTINATION}/${target}")
if(OS_WINDOWS)
set(package_destination "${OBS_CMAKE_DESTINATION}")
else()
set(package_destination "${OBS_CMAKE_DESTINATION}/${target}")
endif()
set(include_destination "${OBS_INCLUDE_DESTINATION}")
endif()

Expand Down
2 changes: 1 addition & 1 deletion deps/w32-pthreads/cmake/w32-pthreadsConfig.cmake.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@PACKAGE_INIT@

include("${CMAKE_CURRENT_LIST_DIR}/@[email protected]")
check_required_components("@PROJECT_NAME@")
check_required_components("w32-pthreads")

0 comments on commit c89cef3

Please sign in to comment.