summaryrefslogtreecommitdiffstats
path: root/Modules/Platform/Darwin.cmake
Commit message (Collapse)AuthorAgeFilesLines
* Do not link private dependent shared libraries on OS X > 10.4Brad King2011-12-151-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The default OS X 10.4 linker incorrectly searches for dependencies of linked shared libraries only under the -isysroot location. It fails to find dependencies of linked shared libraries in cases such as the ExportImport test. It produces errors like: /usr/libexec/gcc/i686-apple-darwin8/4.0.1/ld: warning can't open dynamic library: libtestLib3Imp.dylib referenced from: /.../ExportImport/Root/lib/libtestLib3lib.1.2.dylib (checking for undefined symbols may be affected) (No such file or directory, errno = 2) /usr/libexec/gcc/i686-apple-darwin8/4.0.1/ld: Undefined symbols: _testLib3Imp referenced from libtestLib3lib expected to be defined in libtestLib3Imp.dylib or with CMAKE_SKIP_RPATH off to enable install_name in the Export side: /usr/libexec/gcc/i686-apple-darwin8/4.0.1/ld: warning can't open dynamic library: /Developer/SDKs/MacOSX10.4u.sdk/.../ExportImport/Export/impl/libtestLib3Imp.dylib referenced from: /.../ExportImport/Export/libtestLib3lib.1.2.dylib (checking for undefined symbols may be affected) (No such file or directory, errno = 2) /usr/libexec/gcc/i686-apple-darwin8/4.0.1/ld: Undefined symbols:_testLib3Imp referenced from libtestLib3lib expected to be defined in /.../ExportImport/Export/impl/libtestLib3Imp.dylib Note how "/Developer/SDKs/MacOSX10.4u.sdk" is prepended to the dependent library path. Commit 2cff26fa (Support linking to shared libs with dependent libs, 2008-01-31) and commit 82fcaebe (Pass dependent library search path to linker on some platforms, 2008-02-01) worked around the problem by defining platform variable CMAKE_LINK_DEPENDENT_LIBRARY_FILES. It tells CMake to link to dependent libraries explicitly by their path thus telling the linker where to find them. Unfortunately the workaround had the side effect of linking dependent libraries and defeats most benefits of LINK_INTERFACE_LIBRARIES. Fortunately OS X 10.5 and above do not need to find transitive dependencies at all so we can avoid the workaround on Modern OS X.
* Strip trailing space from xcode-select output (#10723)David Cole2011-02-011-1/+2
| | | | | Otherwise, subsequent use of the output does not work as intended.
* Pass Mac linker flag through PGI compiler using "-Wl,"Brad King2010-11-221-4/+4
| | | | | | | The Mac linker defines -headerpad_max_install_names and the GCC front-end passes this flag through. The PGI compiler does not know about this flag, so we must use -Wl,-headerpad_max_install_names to pass it to the linker instead.
* Search MacPorts /opt/local prefix on MacBrad King2010-09-011-1/+4
| | | | | | Include this prefix in CMAKE_SYSTEM_PREFIX_PATH so that it will be used for all find* commands. Previously only find_library and find_path would look under /opt/local/lib and /opt/local/include, respectively.
* Fix issue #10155 - default value of CMAKE_OSX_DEPLOYMENT_TARGET should ↵David Cole2010-01-291-31/+16
| | | | always be the empty string. When the value of CMAKE_OSX_DEPLOYMENT_TARGET is the empty string, the -mmacosx-version-min flag should not show up on the compiler command line. The logic for selecting default value of CMAKE_OSX_SYSROOT is orthogonal to and independent of the value of the deployment target. The default value for CMAKE_OSX_SYSROOT is the SDK that corresponds to the current version of Mac OSX on which cmake is running.
* Fix issue with SDK not matching initial deployment target chosen by setting ↵David Cole2009-12-231-31/+37
| | | | the MACOSX_DEPLOYMENT_TARGET environment variable. The problem was that we were setting the initial SDK value based on our own internal default value for deplyment target rather than the user's environment variable choice. The solution is to base the default value for the SDK on the deployment target variable after initially caching the deployment target... Every time I'm in this code I think I leave it cleaner, only to be proven otherwise. Let's give this one a whirl. Bleh.
* Fix issues #9959 and #9898 - do not set CMAKE_OSX_DEPLOYMENT_TARGET if ↵David Cole2009-12-151-14/+29
| | | | | | CMAKE_OSX_SYSROOT is set. Default to "" for CMAKE_OSX_DEPLOYMENT_TARGET if CMAKE_OSX_SYSROOT is set. Also, add new error message to detect the case where there is a deployment target, but no SDK has been set. Fix args to STRING REGEX call so that it works even if _sdk_path variable is empty inside sanity check function.
* Reduce duplication in Platform/<os>.cmake filesBrad King2009-12-021-2/+0
| | | | | | | | | | | | | Several platform-wide linker flag variables are defined in Modules/Platform/<os>.cmake files for C and then copied by the Modules/CMake<lang>Information.cmake file for each language. We now use this approach for the variables CMAKE_EXE_EXPORTS_${lang}_FLAG CMAKE_SHARED_LIBRARY_SONAME_${lang}_FLAG CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS to avoid duplication for multiple languages in each platform file.
* Fix check for -isysroot on OS XBrad King2009-09-191-14/+0
| | | | | | | | | | | Previously we checked for this flag by parsing the version number of GCC out of 'gcc --version', but this is not reliable because the format can vary greatly. Now we run 'gcc -v --help' and look for '-isysroot' in the list of options. We also now store the result on a per-language basis in the per-compiler info file "CMake<LANG>Compiler.cmake". This is necessary to make it accessible from try-compile projects so that they generate correctly.
* Add detection of gcc versions that do not support isysroot option and do not ↵Bill Hoffman2009-09-181-0/+14
| | | | use it for them.
* Fix for bug #9466. Change the implementation of OSX arch lists. If no ↵Bill Hoffman2009-09-171-5/+1
| | | | ARCHs are specified by the user then no flags are set. We no longer use CMAKE_OSX_ARCHITECTURES_DEFAULT.
* BUG: Remove implicit include dir suppressionBrad King2009-02-241-1/+0
| | | | | | | We used to suppress generation of -I/usr/include (and on OSX also -I/usr/local/include). This behavior seems to cause more trouble than it's worth, so I'm removing it until someone encounters the original problem it fixed. See issue #8598.
* BUG: Allow third component of Mac OSX sw_vers output to be empty. Mac OSX ↵David Cole2009-02-171-1/+1
| | | | 10.5 was recently reinstalled on dashmacmini3 and pointed out the fact that this expression is faulty when the reported version is simply 10.5 rather than 10.5.x... for example. This fixes it.
* BUG: Remove unnecessary double quotes from SET statements. Hopefully ↵David Cole2009-01-291-8/+8
| | | | resolves the strange and difficult to diagnose (or reproduce) test failures on the dashmacmini2 Continuous dashboard.
* BUG: Fix OS X dylib version flags for more linkersBrad King2009-01-291-2/+2
| | | | | | | Some OS X linkers want a 'dylib_' prefix on the -compatiblity_version and -current_version flags while others do not. This passes the flags through gcc instead since it never wants the prefix and translates the flags for the linker correctly.
* BUG: Fix careless typo that only caused test failures on clean builds...David Cole2009-01-281-1/+1
|
* BUG: Try to fix the universal binary continuous dashboard on dashmacmini2. I ↵David Cole2009-01-271-6/+12
| | | | am deducing that the value of CMAKE_OSX_ARCHITECTURES_DEFAULT is responsible for the failure, although I cannot reproduce it on other builds or even by running the test via ctest interactively *on* the continuous dashboard's build...
* BUG: Only set CMAKE_OSX_DEPLOYMENT_TARGET on Mac OSX 10.4 or later. The gcc ↵David Cole2009-01-271-2/+4
| | | | that runs on 10.3 and earlier does not understand the compiler flag it maps to...
* BUG: Fix issue #6195. Add CMAKE_OSX_DEPLOYMENT_TARGET cache variable to ↵David Cole2009-01-271-33/+102
| | | | specify the target deployment runtime OS version of the built executables on Mac OSX. Thanks to Mike Jackson for the patch.
* BUG: Fix install_name_tool problem on the Mac when a PROJECT(... NONE) is ↵David Cole2008-12-301-1/+1
| | | | followed by multiple calls to ENABLE_LANGUAGE. Use find_program to set the CMAKE_INSTALL_NAME_TOOL variable so it gets saved in the cache as a full path to the install_name_tool executable rather than a simple set which eventually goes out of scope.
* BUG: fix for 6710 CMAKE_OSX_SYSROOT should be a PATHBill Hoffman2008-08-191-1/+1
|
* BUG: Fix dylib versioning flags for old OSX.Brad King2008-07-091-2/+2
| | | | | | - ld flags -dylib_compatibility_version and -dylib_current_version are libtool flags -compatibility_version and -current_version - OSX 10.3 does not like the dylib_ prefixes.
* ENH: Set version info for shared libs on OSX.Brad King2008-07-091-0/+5
| | | | | | - Map SOVERSION major.minor.patch to compatibility_version - Map VERSION major.minor.patch to current_version - See issue #4383.
* ENH: allow users to set sysrootBill Hoffman2008-04-281-0/+1
|
* ENH: Cleanup building of OS X bundle contentBrad King2008-02-151-2/+0
| | | | | | | | | | - Fixes repeated rebuild of bundles by Makefile generators - Add special rules to copy sources to their MACOSX_PACKAGE_LOCATION bundle directory - Remove MacOSX_Content language hack - Remove EXTRA_CONTENT property - Remove MACOSX_CONTENT - Remove corresponding special cases in object names
* ENH: Pass dependent library search path to linker on some platforms.Brad King2008-02-011-1/+1
| | | | | | | | | | | | | | | | - Move runtime path ordering out of cmComputeLinkInformation into its own class cmOrderRuntimeDirectories. - Create an instance of cmOrderRuntimeDirectories for runtime path ordering and another instance for dependent library path ordering. - Replace CMAKE_DEPENDENT_SHARED_LIBRARY_MODE with explicit CMAKE_LINK_DEPENDENT_LIBRARY_FILES boolean. - Create CMAKE_LINK_DEPENDENT_LIBRARY_DIRS boolean. - Create variables to specify -rpath-link flags: CMAKE_SHARED_LIBRARY_RPATH_LINK_<LANG>_FLAG CMAKE_EXECUTABLE_RPATH_LINK_<LANG>_FLAG - Enable -rpath-link flag on Linux and QNX. - Documentation and error message updates
* ENH: Support linking to shared libs with dependent libsBrad King2008-01-311-0/+6
| | | | | | | | | - Split IMPORTED_LINK_LIBRARIES into two parts: IMPORTED_LINK_INTERFACE_LIBRARIES IMPORTED_LINK_DEPENDENT_LIBRARIES - Add CMAKE_DEPENDENT_SHARED_LIBRARY_MODE to select behavior - Set mode to LINK for Darwin (fixes universal binary problem) - Update ExportImport test to account for changes
* ENH: Convert Modules/Platform specification of system search paths to use ↵Brad King2008-01-161-2/+1
| | | | CMAKE_SYSTEM_PREFIX_PATH when possible.
* ENH: add support for env var and better default for CMAKE_OSX_SYSROOTBill Hoffman2007-11-151-7/+13
|
* ENH: fix bug in default arch, it was using the environment variable which is ↵Bill Hoffman2007-11-081-1/+3
| | | | not a default
* BUG: Do not us the search_paths_first flag on older Mac OSX (10.2 and ↵David Cole2007-11-081-2/+29
| | | | earlier) systems.
* ENH: fix spelling errorBill Hoffman2007-10-221-2/+1
|
* ENH: try to fix boostrap on 10.5Bill Hoffman2007-10-221-1/+2
|
* ENH: do not always add -arch flagsBill Hoffman2007-10-201-0/+1
|
* ENH: use the correct flag for the linkerBill Hoffman2007-08-171-2/+2
|
* ENH: make sure osx searches static and shared libs like other platformsBill Hoffman2007-08-161-2/+2
|
* ENH: UNIX, CYGWIN, WIN32, APPLE, QNXNTO and BEOS are not longer set inAlexander Neundorf2007-08-091-0/+2
| | | | | | | | | | | | | | cmMakefile.cxx, but now in the platform files and are now valid for the target platform, not the host platform. New variables CMAKE_HOST_WIN32, CMAKE_HOST_UNIX, CMAKE_HOST_APPLE and CMAKE_HOST_CYGWIN have been added in cmMakefile.cxx (...and have now to be used in all cmake files which are executed before CMakeSystemSpecificInformation.cmake is loaded). For compatibility the old set is set to the new one in CMakeDetermineSystem.cmake and reset before the system platform files are loaded, so custom language or compiler modules which use these should still work. Alex
* ENH: determine typesize by compiling a file and reading strings from the ↵Alexander Neundorf2007-06-041-5/+0
| | | | | | | | | compiled output. Tested with various gcc, XCode, MSVC7, sdcc For OSX when doing TRY_COMPILE() CMAKE_OSX_ARCHITECTURES is used, if there are different results an error is generated. CMAKE_OSX_ARCHITECTURES can be overwritten for the TRY_COMPILES with CMAKE_TRY_COMPILE_OSX_ARCHITECTURES. Alex
* ENH: move hack to fix "new cmake on old build tree on OSX doesn't have ↵Alexander Neundorf2007-05-181-0/+9
| | | | | | | | CMAKE_INSTALL_NAME_TOOL in the cache" from cmInstallTargetGenerator.cxx to Darwin.cmake Alex
* ENH: initial support for creation of frameworks on MacBill Hoffman2007-05-081-0/+5
|
* ENH: Added CMAKE_SHARED_MODULE_LOADER_C_FLAG and ↵Brad King2007-04-171-0/+2
| | | | CMAKE_SHARED_MODULE_LOADER_CXX_FLAG to support linking plugins to executables.
* BUG: Propagate platform settings such as CMAKE_OSX_ARCHITECTURES to the try ↵Andy Cedilnik2007-03-021-0/+5
| | | | compile
* BUG: Do not enable -isystem support for Xcode generator until it is implemented.Brad King2006-10-061-0/+6
|
* BUG: fix for bug# 3584 missing SONAME for fortran on darwinBill Hoffman2006-10-041-0/+7
|
* ENH: add patch for finding applications on OSXBill Hoffman2006-04-131-0/+8
|
* ENH: use correct name for pathBill Hoffman2006-03-291-1/+1
|
* ENH: Add support for adding content to bundlesAndy Cedilnik2006-03-281-0/+2
|
* ENH: add support for universal binariesBill Hoffman2006-03-241-0/+23
|
* ENH: add support for removing language flags from shared library and shared ↵Bill Hoffman2006-03-141-0/+2
| | | | module link commands
* ENH: remove junkBill Hoffman2006-03-091-1/+1
|