summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeCInformation.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2011-01-19 23:05:46 (GMT)
committerBrad King <brad.king@kitware.com>2011-01-19 23:15:36 (GMT)
commita146e03422dcfaa6df6dc2f5ce594862126b17ef (patch)
tree1f01015337becf942f34b63d43b9bb694ce043df /Modules/CMakeCInformation.cmake
parent295b5b60df5d9427fdb891fd51333c12089ee129 (diff)
downloadCMake-a146e03422dcfaa6df6dc2f5ce594862126b17ef.zip
CMake-a146e03422dcfaa6df6dc2f5ce594862126b17ef.tar.gz
CMake-a146e03422dcfaa6df6dc2f5ce594862126b17ef.tar.bz2
Fix relative CMAKE_USER_MAKE_RULES_OVERRIDE (#11725)
In commit 295b5b60 (Honor CMAKE_USER_MAKE_RULES_OVERRIDE in try_compile, 2010-06-29) we started passing the value of this variable when building a try_compile project. If the variable contains a relative path it must be treated with respect to the file where it is first used. Ensure that the value is converted to a full path so that it is correctly referenced in the try_compile projects.
Diffstat (limited to 'Modules/CMakeCInformation.cmake')
-rw-r--r--Modules/CMakeCInformation.cmake14
1 files changed, 9 insertions, 5 deletions
diff --git a/Modules/CMakeCInformation.cmake b/Modules/CMakeCInformation.cmake
index fb4f0e8..1dc46f2 100644
--- a/Modules/CMakeCInformation.cmake
+++ b/Modules/CMakeCInformation.cmake
@@ -1,6 +1,6 @@
#=============================================================================
-# Copyright 2004-2009 Kitware, Inc.
+# Copyright 2004-2011 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
@@ -74,12 +74,16 @@ ENDIF (NOT _INCLUDED_FILE)
# be made to those values.
IF(CMAKE_USER_MAKE_RULES_OVERRIDE)
- INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE})
-ENDIF(CMAKE_USER_MAKE_RULES_OVERRIDE)
+ # Save the full path of the file so try_compile can use it.
+ INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE} RESULT_VARIABLE _override)
+ SET(CMAKE_USER_MAKE_RULES_OVERRIDE "${_override}")
+ENDIF()
IF(CMAKE_USER_MAKE_RULES_OVERRIDE_C)
- INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE_C})
-ENDIF(CMAKE_USER_MAKE_RULES_OVERRIDE_C)
+ # Save the full path of the file so try_compile can use it.
+ INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE_C} RESULT_VARIABLE _override)
+ SET(CMAKE_USER_MAKE_RULES_OVERRIDE_C "${_override}")
+ENDIF()
# for most systems a module is the same as a shared library