瀏覽代碼

Fix --find-package mode on Cygwin, where enable_language(RC) is called

In --find-package mode we can't enable a language, since a lot of
stuff has not been set up, e.g. which make tool to use.
So disable enable_language() in this mode.

Alex
Alex Neundorf 14 年之前
父節點
當前提交
59238dc2de
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      Modules/CMakeFindPackageMode.cmake

+ 6 - 0
Modules/CMakeFindPackageMode.cmake

@@ -41,6 +41,12 @@ endif()
 # it doesn't know whether it should set WIN32 or not:
 cmake_minimum_required(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION} )
 
+macro(ENABLE_LANGUAGE)
+  # disable the enable_language() command, otherwise --find-package breaks on Windows.
+  # On Windows, enable_language(RC) is called in the platform files unconditionally.
+  # But in --find-package mode, we don't want (and can't) enable any language.
+endmacro()
+
 include(CMakeDetermineSystem)
 
 # short-cut some tests on Darwin, see Darwin-GNU.cmake: