소스 검색

FortranCInterface: Use CMake 2.8.0 behavior

The FortranCInterface module should execute with CMake 2.8.0 behavior
even if policies are set differently by the including project.  In
particular, it makes use of empty list elements and therefore expects
NEW behavior of CMP0007.
Brad King 16 년 전
부모
커밋
184a3418e6
1개의 변경된 파일7개의 추가작업 그리고 0개의 파일을 삭제
  1. 7 0
      Modules/FortranCInterface.cmake

+ 7 - 0
Modules/FortranCInterface.cmake

@@ -100,6 +100,10 @@ if(FortranCInterface_SOURCE_DIR)
   return()
 endif()
 
+# Use CMake 2.8.0 behavior for this module regardless of including context.
+cmake_policy(PUSH)
+cmake_policy(VERSION 2.8.0)
+
 #-----------------------------------------------------------------------------
 # Verify that C and Fortran are available.
 foreach(lang C Fortran)
@@ -273,3 +277,6 @@ function(FortranCInterface_VERIFY)
       "The output was:\n  ${_output}")
   endif()
 endfunction()
+
+# Restore including context policies.
+cmake_policy(POP)