浏览代码

CMake: Don't export(PACKAGE) when cross-compiling

When cross-compiling, the build directory won't contain
anything useful to the host system. Therefore, we shouldn't
register the build directory in CMake's package registry.
Sam Edwards 6 年之前
父节点
当前提交
d058cb16fd
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      CMakeLists.txt

+ 3 - 1
CMakeLists.txt

@@ -114,4 +114,6 @@ write_basic_package_version_file(
 install(FILES "${PROJECT_BINARY_DIR}/Panda3DConfigVersion.cmake"
   DESTINATION "lib/cmake/Panda3D")
 
-export(PACKAGE Panda3D)
+if(NOT CMAKE_CROSSCOMPILING)
+  export(PACKAGE Panda3D)
+endif()