Commit Graph

5298 Commits

Author SHA1 Message Date
Adam Strzelecki f7df82acaa BundleUtilities: Resolve & replace @rpath placeholders
This is done by gathering LC_RPATH commands for main bundle executable and
using it for @rpath lookup in dependent frameworks.

All functions that need to carry rpaths to now take optional <rpaths> argument.

This enabled apps using @rpath to be bundled correctly, which will be necessary
for upcoming Qt 5.4 that will use @rpath for all frameworks.

Check that install_name_tool has -delete_rpath before using it.
Otherwise it will fail with Xcode 3.x on 10.5 which has no -delete_rpath
option for install_name_tool command, that was first introduced in 10.6
SDK, even that 10.5 supports LC_RPATH and @rpath.
2014-10-10 10:16:24 -04:00
Adam Strzelecki 14bc686fff GetPrerequisites: Make sure dyld placeholders are prefixes
Mac OS X dyld placeholders should be always prefixes, otherwise this can lead
to some undefined behavior.
2014-10-10 10:16:15 -04:00
Adam Strzelecki 6c31379741 BundleUtilities: Use find on UNIX for fast executable lookup
It makes whole executable process quicker on UNIX, especially for large bundles
containing many files, since using find narrows results to only files having
executable flags then all further tests follow.

Since find ... -perm +0111 is not clearly POSIX compliant and some Linux
versions refuse it, it is better to use longer but portable:

   find ... -perm \( -perm -0100 -o -perm -0010 -o -perm -0001 \)
2014-10-10 10:15:56 -04:00
Brad King f640b2a41f Merge topic 'cleanup-CMP0054'
69fe5920 GenerateExportHeader: Avoid if() quoted auto-dereference
2014-09-30 11:29:09 -04:00
Brad King 40ae354ebb Merge topic 'GNUInstallDirs-typo'
33f03129 Fix typo in Modules/GNUInstallDirs.cmake (#15176)
2014-09-30 11:29:04 -04:00
Brad King 34d035e70e Merge topic 'vs-nsight-tegra-generator'
df84281d Help: Add notes for topic 'vs-nsight-tegra-generator'
69e198dc VS: Generate Nsight Tegra project revision number
5365c9ac VS: Map Nsight Tegra file types in .vcxproj files
178f56a5 VS: Fix Tegra-Android platform linking of libraries by name
7115702f Tests: Add test for VS Nsight Tegra generator support
a6289499 VS: Generate ANDROID_GUI executables as app packages
c12e4699 Add 'ANDROID_API' target property to set Android Target API
9a4df52a Add 'ANDROID_GUI' target property to mark Android applications
16569abf cmTarget: Track internally whether platform is Android
ef0fd4f0 VS: Teach vcxproj generation about the Tegra-Android platform
d09b60f5 VS: Detect compiler id of Nsight Tegra-Android toolchains
2f071466 VS: Teach VS >= 10 to recognize CMAKE_SYSTEM_NAME 'Android'
2014-09-30 08:46:27 -04:00
Brad King 178f56a579 VS: Fix Tegra-Android platform linking of libraries by name
Nsight Tegra Visual Studio Edition handles prefixing of library names
with '-l' automatically, so teach the generator not to do so.

Reported-by: Mourad Boufarguine <mourad@boufarguine.name>
2014-09-30 08:45:35 -04:00
Brad King d09b60f563 VS: Detect compiler id of Nsight Tegra-Android toolchains
Teach CMakeDetermineCompilerId to recognize the Tegra-Android platform
and generate a test project for Nsight Tegra tools.  Locate the full
path to CMAKE_<LANG>_COMPILER by computing it within the test project
build environment.

Also teach CMakeFindBinUtils that this variant of the Visual Studio
generator uses UNIX-like instead of MS-like archiving and linking tools.
2014-09-29 16:05:53 -04:00
Brad King 69fe5920b3 GenerateExportHeader: Avoid if() quoted auto-dereference
When testing CMAKE_CXX_COMPILER_ID values with if(MATCHES),
do not explicitly dereference or quote CMAKE_CXX_COMPILER_ID.
We want if() to auto-dereference the variable and not its value.
2014-09-29 15:53:38 -04:00
David Coppa 33f031295c Fix typo in Modules/GNUInstallDirs.cmake (#15176)
Commit d4fdd9c189 ("GNUInstallDirs: use the
proper default for info and man paths on OpenBSD") introduced a typo.
2014-09-29 18:25:25 +02:00
Adam Strzelecki 84e3fde94d FindCUDA: Avoid if() auto-dereference in string comparisons
This silences possible CMP0054 warnings.
2014-09-24 10:10:42 -04:00
Brad King 405b92d031 Merge topic 'FindGettext-doc-update'
3919f254 FindGettext: Fix name of GETTEXT_PROCESS_POT_FILE in docs (#15162)
2014-09-22 09:13:14 -04:00
Brad King 3303b5f8b4 Merge topic 'FindProtobuf-depend-protoc'
e380d7c5 FindProtobuf: Make outputs depend on protoc executable
2014-09-22 09:13:07 -04:00
Brad King 2f3985c6a5 Merge topic 'FindOpenSceneGraph-pieces-not-found'
b683da3e FindOpenSceneGraph: Do not add unfound OSG libs if not required
2014-09-22 09:13:05 -04:00
Brad King d4713b84b7 Merge topic 'clang-compile-options-cxx14'
49b8140e Clang: Enable c++14 dialect flag with Clang 3.5.
0b80fc35 Clang: Don't overwrite c++11 compile option value with c++14 flag.
2014-09-22 09:12:56 -04:00
Brad King f28ebcbf1b Merge topic 'cleanup-CMP0054'
fa7d47ac Tests: Fix CMP0054 warnings
3b5ea54a CheckPrototypeDefinition: Avoid if() auto-dereference
c9b301cd ExternalProject: Fix CMP0054 warning in _ep_parse_arguments
2014-09-22 09:12:53 -04:00
Brad King 5eaa3e9025 Merge topic 'ExternalProject-retry'
30a94eec ExternalProject: Fix download retry logic
2014-09-22 09:12:50 -04:00
Brad King 3919f254e8 FindGettext: Fix name of GETTEXT_PROCESS_POT_FILE in docs (#15162)
Rename GETTEXT_PROCESS_POT to GETTEXT_PROCESS_POT_FILE.

Patch-by: maahnat@gmail.com
2014-09-18 09:39:49 -04:00
Michael Hanselmann e380d7c5ba FindProtobuf: Make outputs depend on protoc executable
After updating from Protocol Buffers 2.5.0 to 2.6.0 compilation of the
generated source failed: "This file was generated by an older version of
protoc which is incompatible with your Protocol Buffer headers. Please
regenerate this file with a newer version of protoc.".

Turns out the source and headers generated by way of
FindProtobuf.cmake:PROTOBUF_GENERATE_CPP aren't updated. Adding a
dependency on the compiler executable fixes this issue.
2014-09-18 09:16:27 -04:00
Mattias Helsing b683da3efa FindOpenSceneGraph: Do not add unfound OSG libs if not required 2014-09-18 09:06:58 -04:00
Stephen Kelly 49b8140e5d Clang: Enable c++14 dialect flag with Clang 3.5. 2014-09-17 14:57:07 +02:00
Stephen Kelly 0b80fc350a Clang: Don't overwrite c++11 compile option value with c++14 flag. 2014-09-17 14:56:16 +02:00
Brad King 3b5ea54a27 CheckPrototypeDefinition: Avoid if() auto-dereference
Convert from the old if(MATCHES) hack to if(DEFINED) to check whether
the result variable is already set.
2014-09-16 09:04:20 -04:00
Matt McCormick c9b301cd71 ExternalProject: Fix CMP0054 warning in _ep_parse_arguments
Fix the CMP0054 warning:

 CMake Warning (dev) at .../Modules/ExternalProject.cmake:242 (if):
   Policy CMP0054 is not set: Only interpret if() arguments as variables or
   keywords when unquoted.  Run "cmake --help-policy CMP0054" for policy
   details.  Use the cmake_policy command to set the policy and suppress this
   warning.

   Quoted keywords like "COMMAND" will no longer be interpreted as keywords
   when the policy is set to NEW.  Since the policy is not set the OLD
   behavior will be used.
 Call Stack (most recent call first):
   .../Modules/ExternalProject.cmake:1938 (_ep_parse_arguments)
   CMakeLists.txt:5 (ExternalProject_Add)

by avoiding a reference to "${key}" or "COMMAND" in quotes.
2014-09-15 15:56:37 -04:00
Brad King b234836637 Merge topic 'vs-generator-platform'
be6a555d Tests: Test setting a generator platform in a toolchain file
d506fee8 Tests: Use -A option to pass generator platform selection
11c9ddd6 ExternalProject: Use -A option to pass generator platform
29bd843e CTest: Use -A option to pass generator platform selection
eb7d8156 cmake: Add -A option to specify a generator platform
2014-09-15 10:27:38 -04:00
Brad King 9edf6903e6 Merge topic 'if-sanity'
858d5a0b Fix if() checks of CMAKE_SYSTEM_NAME on Cygwin
e177e7af FPHSA: Avoid if() dereferencing of quoted variable
425acc52 cmcurl: Use if(DEFINED) to simplify conditions
cede5cbd libarchive: Avoid depending on if() to dereference a quoted variable
2d97178b FindGTK2: Avoid depending on if() to dereference a quoted variable
0b12815d Modules/Test*.cmake: Use if(DEFINED) to simplify conditions
188a1f23 If: Introduce policy CMP0054 - don't dereference quoted variables in if()
b900c1cc If: Extract cmConditionEvaluator from if() implementation
2014-09-15 10:27:36 -04:00
Brad King 11c9ddd694 ExternalProject: Use -A option to pass generator platform
This is less verbose than defining CMAKE_GENERATOR_PLATFORM.
2014-09-15 10:26:59 -04:00
Ruslan Baratov 30a94eecdb ExternalProject: Fix download retry logic
Do not check file's hash in download script.  If hash will not match
command ``file(DOWNLOAD ...)`` will fail with FATAL_ERROR, ``cmake -P``
will exit with unsuccessful code, and the build will stop.  Leave hash
checking to the existing implementation in the verify step.
2014-09-15 09:08:33 -04:00
Brad King e177e7affb FPHSA: Avoid if() dereferencing of quoted variable
Legacy invocations may pass a variable name where "DEFAULT_MSG" belongs.
When comparing FPHSA_FAIL_MESSAGE to "DEFAULT_MSG", use a leading "x" on
both sides to avoid mistaking the value of the message for a variable
name.
2014-09-11 21:23:24 +02:00
Brad King 2d97178b30 FindGTK2: Avoid depending on if() to dereference a quoted variable
Explicitly dereference GTK2_${_var}CONFIG_INCLUDE_DIR and
GTK2_${_var}_INCLUDE_DIR when comparing their values.
2014-09-11 21:23:24 +02:00
Brad King 0b12815dc2 Modules/Test*.cmake: Use if(DEFINED) to simplify conditions
Replace old hacks of the form 'if("${VAR}" MATCHES "^${VAR}$")'
with the much simpler 'if(NOT DEFINED ${VAR})'.
2014-09-11 21:23:24 +02:00
Brad King b36a795163 Merge topic 'doc-check-results-cached'
908c7439 Help: Document that the CHECK_* macros create cache variables
2014-09-11 12:55:10 -04:00
Brad King efe093dcfd Merge topic 'fix-gnu-hurd-host-detection'
89d7a5a4 Fix CMAKE_HOST_SYSTEM_PROCESSOR detection on GNU/Hurd (#15147)
2014-09-11 12:55:05 -04:00
Sebastian Leske 908c74399a Help: Document that the CHECK_* macros create cache variables
Otherwise callers may expect to be able to re-use result variables.
2014-09-11 08:55:26 -04:00
Brad King 0a92b23c52 Merge topic 'vs-generator-platform'
09c8ad99 enable_language: Initialize system-specific generator info only once
09ab207c Tests: Add generator platform support
6944997b ExternalProject: Propagate the generator platform
8d332091 CTest: Add options to set generator platform
b97736a2 VS: Implement CMAKE_GENERATOR_PLATFORM for VS >= 8
0f1f1271 CMake: Add CMAKE_GENERATOR_PLATFORM option
4f7d0c42 Help: Document CMAKE_VS_PLATFORM_NAME variable
68d4280a VS: Refactor internal default platform name selection
ad2a4776 cmGlobalVisualStudio10Generator: Re-order some methods
03b7b6cd cmGlobalGenerator: Call SetGeneratorToolset even for empty toolset
2014-09-10 11:23:22 -04:00
Brad King 81b2a250dc Merge topic 'FindIce-updates'
2131aedd FindIce: Respect Ice_FIND_QUIETLY when printing messages
d5047ca1 FindIce: Remove unneeded search path modification
2014-09-10 11:23:17 -04:00
Felix Geyer 89d7a5a417 Fix CMAKE_HOST_SYSTEM_PROCESSOR detection on GNU/Hurd (#15147)
On Debian GNU/Hurd 'uname -p' prints "unknown", so use 'uname -m'
instead.
2014-09-10 09:06:33 -04:00
Roger Leigh 2131aeddaa FindIce: Respect Ice_FIND_QUIETLY when printing messages 2014-09-09 15:19:00 -04:00
Roger Leigh d5047ca1b2 FindIce: Remove unneeded search path modification
Drop code adding redundant "/opt/Ice-${ice_version}" paths.
2014-09-09 11:45:51 -04:00
Brad King 7b2e3cc63b Merge topic 'use-consistent-regex-for-info-strings'
3e84e78c Use a more reliable regex for extracting binary INFO strings
2014-09-09 11:23:34 -04:00
Brad King 371f06d005 Merge topic 'ExternalProject-download-loop'
9f49ac3d ExternalProject: Avoid infinite loop on file download hash mismatch
2014-09-09 11:23:30 -04:00
Brad King 0161761d68 Merge branch 'ExternalProject-download-loop' into release 2014-09-08 16:38:49 -04:00
Alan W. Irwin 9f49ac3df0 ExternalProject: Avoid infinite loop on file download hash mismatch
When the loop was added by commit v3.0.0-rc1~103^2~3 (ExternalProject:
Reattempt download when verification fails, 2015-01-15), we forgot to
actually increment the loop counter.  Add the increment line.
2014-09-08 16:36:35 -04:00
Brad King d11a19528e Merge topic 'fix-clang-cross-compile-find-binutils'
72d66818 Fix finding binutils when cross-compiling with Clang
2014-09-08 12:57:01 -04:00
Brad King 6944997bd6 ExternalProject: Propagate the generator platform
When the CMAKE_GENERATOR option is given to ExternalProject_Add, look
also for option CMAKE_GENERATOR_PLATFORM to pass on to cmake as a cache
definition.  When no CMAKE_GENERATOR option is given explicitly then use
the current project's CMAKE_GENERATOR_PLATFORM (since we already use its
CMAKE_GENERATOR).
2014-09-05 15:20:47 -04:00
Brad King d2364f15ae Merge branch 'fix-clang-cross-compile-find-binutils' into release 2014-09-05 12:06:52 -04:00
Brad King 72d6681826 Fix finding binutils when cross-compiling with Clang
Since commit v3.0.0-rc1~342^2~2 (Add compiler target compile options,
2013-05-19) we use CMAKE_<LANG>_COMPILER_TARGET as the binutils prefix
when cross-compiling with Clang.  Fix the implementation to use the
compiler target as the prefix only when it is set.  Otherwise toolchain
files not using CMAKE_<LANG>_COMPILER_TARGET cause the logic to use
a prefix of just "-" and of course cannot find "-ar" or "-ld".
2014-09-05 12:06:27 -04:00
Brad King 103ddca336 Merge topic 'fix-gtk2-missing-optional-includes'
cb8f0f7c FindGTK2: Fix missing optional include dirs.
2014-09-04 10:03:54 -04:00
Brad King 9651cb70ae Merge topic 'InstallRequiredSystemLibraries-vs-openmp'
d538c55e Help: Add notes for topic 'InstallRequiredSystemLibraries-vs-openmp'
bdb5007b InstallRequiredSystemLibraries: Install OpenMP runtime libs (#15117)
2014-09-04 09:48:17 -04:00
Chuck Atkins cb8f0f7c81 FindGTK2: Fix missing optional include dirs.
FindGTK2 was adding optional include directories to the
interface include dirs regardless of whether or not they
existed.  This ensures that the directories only get added
if they are actually found. This is particularly a problem
on Solaris where the gtk2 libs and headers might exist but
the FreeType2 headers might not.
2014-09-03 23:25:57 -04:00