浏览代码

cmake: Fix malformed CMake package location on Windows

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.
PatTheMav 1 年之前
父节点
当前提交
c89cef3aa5
共有 2 个文件被更改,包括 6 次插入2 次删除
  1. 5 1
      cmake/common/helpers_common.cmake
  2. 1 1
      deps/w32-pthreads/cmake/w32-pthreadsConfig.cmake.in

+ 5 - 1
cmake/common/helpers_common.cmake

@@ -292,7 +292,11 @@ function(target_export target)
     set(package_destination "Frameworks/${target}.framework/Resources/cmake")
     set(package_destination "Frameworks/${target}.framework/Resources/cmake")
     set(include_destination "Frameworks/${target}.framework/Headers")
     set(include_destination "Frameworks/${target}.framework/Headers")
   else()
   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}")
     set(include_destination "${OBS_INCLUDE_DESTINATION}")
   endif()
   endif()
 
 

+ 1 - 1
deps/w32-pthreads/cmake/w32-pthreadsConfig.cmake.in

@@ -1,4 +1,4 @@
 @PACKAGE_INIT@
 @PACKAGE_INIT@
 
 
 include("${CMAKE_CURRENT_LIST_DIR}/@[email protected]")
 include("${CMAKE_CURRENT_LIST_DIR}/@[email protected]")
-check_required_components("@PROJECT_NAME@")
+check_required_components("w32-pthreads")