diff options
author | Brad King <brad.king@kitware.com> | 2009-12-14 17:47:14 -0500 |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2009-12-14 17:47:14 -0500 |
commit | 9199f7c627dffa729f4c1cb771c465c86ed16933 (patch) | |
tree | 6b4080b883645405b3eeaa0f0fd2eb1e0316df10 /CMakeLists.txt | |
parent | 19839e96f61f215fb0f5de2a3d752bb0661fb1f1 (diff) | |
download | cmake-9199f7c627dffa729f4c1cb771c465c86ed16933.tar.gz |
Disable arch-specific try_run in CMake itself
We disallow try_run() when CMAKE_TRY_COMPILE_OSX_ARCHITECTURES is set
because the binary might not be able to run on the host architecture.
This prevents us from creating ppc test binaries on i386 Mac machines
that cause Rosetta install dialogs to appear.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index ec318082c8..b4d6c5c6a4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,6 +29,17 @@ IF(NOT ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.4) INSTALL(CODE "SET(CMAKE_INSTALL_SELF_2_4 1)") ENDIF() +IF("${CMake_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}") + # Disallow architecture-specific try_run. It may not run on the host. + MACRO(TRY_RUN) + IF(CMAKE_TRY_COMPILE_OSX_ARCHITECTURES) + MESSAGE(FATAL_ERROR "TRY_RUN not allowed with CMAKE_TRY_COMPILE_OSX_ARCHITECTURES=[${CMAKE_TRY_COMPILE_OSX_ARCHITECTURES}]") + ELSE() + _TRY_RUN(${ARGV}) + ENDIF() + ENDMACRO() +ENDIF() + #----------------------------------------------------------------------- # a macro to deal with system libraries, implemented as a macro # simply to improve readability of the main script |