From bd8b733d5e3df7ae584090d4558b1617489eae8b Mon Sep 17 00:00:00 2001 From: Alexander Neundorf Date: Tue, 28 Aug 2007 10:52:07 -0400 Subject: [PATCH] ENH: use the same CMAKE_SKIP_RPATH setting in CHECK_C/CXX_SOURCE_RUNS as in the main project. I think it doesn't make sense if a project disables RPATH, uses CHECK_C_SOURCE_RUNS() to see if something is able to run, and this succeeds because it has been built with RPATH, but an executable built within the project won't be able to run since it has been built without RPATH. Alex --- Modules/CheckCSourceRuns.cmake | 1 + Modules/CheckCXXSourceRuns.cmake | 1 + 2 files changed, 2 insertions(+) diff --git a/Modules/CheckCSourceRuns.cmake b/Modules/CheckCSourceRuns.cmake index c54070a8b..c5455ae10 100644 --- a/Modules/CheckCSourceRuns.cmake +++ b/Modules/CheckCSourceRuns.cmake @@ -37,6 +37,7 @@ MACRO(CHECK_C_SOURCE_RUNS SOURCE VAR) ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS} + -DCMAKE_SKIP_RPATH:BOOL=${CMAKE_SKIP_RPATH} "${CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES}" "${CHECK_C_SOURCE_COMPILES_ADD_INCLUDES}" COMPILE_OUTPUT_VARIABLE OUTPUT) diff --git a/Modules/CheckCXXSourceRuns.cmake b/Modules/CheckCXXSourceRuns.cmake index 01d4c6430..b0c9ba52f 100644 --- a/Modules/CheckCXXSourceRuns.cmake +++ b/Modules/CheckCXXSourceRuns.cmake @@ -37,6 +37,7 @@ MACRO(CHECK_CXX_SOURCE_RUNS SOURCE VAR) ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS} + -DCMAKE_SKIP_RPATH:BOOL=${CMAKE_SKIP_RPATH} "${CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES}" "${CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES}" COMPILE_OUTPUT_VARIABLE OUTPUT)