summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGenerator.cxx
Commit message (Collapse)AuthorAgeFilesLines
* cmLocalGenerator: Remove VTK include hack (#11338).Stephen Kelly2013-12-201-21/+0
| | | | | This exists for pre-CMake 2.4 compatibility. All such compatibility code was removed for CMake 3.0, so remove this too.
* Merge topic 'minor-cleanup'Brad King2013-12-191-0/+8
|\ | | | | | | | | | | e2cb3e7 Help: Note that COMPATIBLE_INTERFACE_ properties may be origin-debugged. 41e48c4 Avoid certain actions on IMPORTED targets.
| * Avoid certain actions on IMPORTED targets.Stephen Kelly2013-12-111-0/+8
| | | | | | | | | | | | | | As we're iterating over IMPORTED targets now, handle them in the loop body. The existing behavior is harmless because generally nothing is done anyway for IMPORTED targets in these code paths, because they do not have sources for example.
* | cmLocalGenerator: Constify target definitions accessStephen Kelly2013-12-111-1/+1
|/
* CTest: filter /showIncludes output from ninja compile launcherNils Gladitz2013-12-031-0/+1
| | | | | Teach "ctest --launch" a new "--filter-prefix" option. Set it using the CMAKE_CL_SHOWINCLUDES_PREFIX value with the Ninja generator.
* INTERFACE_LIBRARY: Avoid codepaths which set unneeded properties.Stephen Kelly2013-11-251-0/+9
| | | | | | | | | | | | | As an INTERFACE_LIBRARY has no direct link dependencies, we can short-circuit in cmGeneratorExpressionEvaluator and in cmGlobalGenerator::CheckLocalGenerators. As they do not generate any output directly, any generate- or install- related code acn also be short-circuited. Many of the local generators already do this. Because only INTERFACE related properties make sense on INTERFACE_LIBRARY targets, avoid setting other properties, for example via defaults.
* Introduce CMAKE_STAGING_PREFIX variable.Stephen Kelly2013-11-211-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | This variable can be useful in cross-compiling contexts where the sysroot is read-only or where the sysroot should otherwise remain pristine. If the new CMAKE_STAGING_PREFIX variable is set, it is used instead of CMAKE_INSTALL_PREFIX when generating the installation rules in cmake_install.cmake. This way, the CMAKE_INSTALL_PREFIX variable always refers to the installation prefix on the target device, regardless of whether host==target. If any -rpath paths passed to the linker contain the CMAKE_STAGING_PREFIX, the matching path fragments are replaced with the CMAKE_INSTALL_PREFIX. Matching paths in the -rpath-link are not transformed. The cross-prefix usr-move workaround is assumed not to require extension regarding CMAKE_STAGING_PREFIX. The staging area is a single prefix, so there is no scope for cross-prefix symlinks. The CMAKE_INSTALL_PREFIX is still used to determine the workaround path, and that variable remains the relevant one even if CMAKE_STAGING_PREFIX is used. If the generated export files are deployed to the target, the workaround will still be in place, and still be employed if required.
* Add CMAKE_SYSROOT variable to set --sysroot when cross compiling.Stephen Kelly2013-11-191-1/+19
| | | | | | | | | | As CMAKE_ROOT_FIND_PATH can be a list, a new CMAKE_SYSROOT is introduced, which is never a list. The contents of this variable is passed to supporting compilers as --sysroot. It is also accounted for when processing implicit link directories reported by the compiler, and when generating RPATH information.
* Allow toolchain files to specify an external toolchain.Stephen Kelly2013-11-191-0/+16
| | | | | | | | | Clang can compile code, but uses the gcc tools for other tasks such as linking. The -gcc-toolchain option can be used for that, but generalize so that other compilers can be treated the same. If such a location is specified, use it as a hint for finding the binutils executables.
* Add compiler target compile options.Stephen Kelly2013-11-191-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | For clang, this allows passing -target <triple> to the compiler, and for qcc, -V<arch> using toolchain files containing something like set(triple arm-linux-gnueabihf) set(CMAKE_C_COMPILER "/usr/bin/clang") set(CMAKE_C_COMPILER_TARGET ${triple}) set(CMAKE_CXX_COMPILER "/usr/bin/clang++") set(CMAKE_CXX_COMPILER_TARGET ${triple}) or set(arch gcc_ntoarmv7le) set(CMAKE_C_COMPILER /opt/qnx650/host/linux/x86/usr/bin/qcc) set(CMAKE_C_COMPILER_TARGET ${arch}) set(CMAKE_CXX_COMPILER /opt/qnx650/host/linux/x86/usr/bin/QCC) set(CMAKE_CXX_COMPILER_TARGET ${arch}) Both clang and qcc are inherently cross compiler( driver)s. When cross-compiling with clang, use the CMAKE_${lang}_COMPILER_TARGET as the _CMAKE_TOOLCHAIN_PREFIX to find the appropriate binutils. When cross-compiling with QNX qcc, use the CMAKE_${lang}_COMPILER_TARGET to set the appropriate _CMAKE_TOOLCHAIN_PREFIX.
* Move TraceDependencies to cmGeneratorTarget.Stephen Kelly2013-10-301-3/+4
|
* Move GenerateTargetManifest to cmGeneratorTarget.Stephen Kelly2013-10-271-3/+4
|
* Drop compatibility with CMake < 2.4Brad King2013-10-231-12/+3
| | | | | | | | | | | | Drop all behavior activated by setting CMAKE_BACKWARDS_COMPATIBILITY to a value lower than 2.4, and generate an error when projects or the user attempt to do so. In the error suggest using a CMake 2.8.x release. Teach cmake_minimum_required to warn about projects that do not require at least CMake 2.4. They are not supported by CMake >= 3.0. Replace the documentation of CMAKE_BACKWARDS_COMPATIBILITY with a reference to policy CMP0001.
* OS X: Encode -F framework search flag in per-language platform variableBrad King2013-10-101-9/+23
| | | | | | | | | Compilers for languages other than C and C++ on OS X may not understand the -F framework search flag. Create a new platform information variable CMAKE_<LANG>_FRAMEWORK_SEARCH_FLAG to hold the flag, and set it for C and CXX lanugages in the Platform/Darwin module. Reported-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* Merge topic 'haiku-updates'Brad King2013-10-091-5/+7
|\ | | | | | | | | | | | | | | 54ef2be Haiku: Include files cleanup in cmCTest 38d5555 Haiku: Remove outdated preprocessor checks 1dc61f8 Haiku: Remove use of B_COMMON_DIRECTORY 7ebc1cb Haiku: Several fixes to platform module
| * Haiku: Remove use of B_COMMON_DIRECTORYAdrien Destugues2013-10-081-5/+7
| | | | | | | | | | | | | | The common directory was removed in Haiku. Applications are now installed in the system directory. Applied-by: Rolf Eike Beer <eike@sf-mail.de>
* | Merge topic 'INTERFACE_LIBRARY-target-type'Brad King2013-10-081-0/+8
|\ \ | |/ |/| | | | | | | | | ce0c303 install: Teach EXPORT option to handle INTERFACE_LIBRARY targets 435c912 export: Add support for INTERFACE_LIBRARY targets fe73226 Add the INTERFACE_LIBRARY target type.
| * Add the INTERFACE_LIBRARY target type.Stephen Kelly2013-10-071-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This target type only contains INTERFACE_* properties, so it can be used as a structural node. The target-specific commands enforce that they may only be used with the INTERFACE keyword when used with INTERFACE_LIBRARY targets. The old-style target properties matching LINK_INTERFACE_LIBRARIES_<CONFIG> are always ignored for this target type. The name of the INTERFACE_LIBRARY must match a validity generator expression. The validity is similar to that of an ALIAS target, but with the additional restriction that it may not contain double colons. Double colons will carry the meaning of IMPORTED or ALIAS targets in CMake 2.8.13. An ALIAS target may be created for an INTERFACE library. At this point it can not be exported and does not appear in the buildsystem and project files are not created for them. That may be added as a feature in a later commit. The generators need some changes to handle the INTERFACE_LIBRARY targets returned by cmComputeLinkInterface::GetItems. The Ninja generator does not use that API, so it doesn't require changes related to that.
* | Generate modern-style cmake code.Stephen Kelly2013-08-221-37/+38
|/ | | | | | | | | | | The commits 9db31162 (Remove CMake-language block-end command arguments, 2012-08-13) and 77543bde (Convert CMake-language commands to lower case, 2012-08-13) changed most cmake code to use lowercase commands and no parameters in termination commands. However, those changes excluded cmake code generated in c++ by cmake. Make a similar style change to code generated by cmake.
* Revert "Add compiler target compile options."Stephen Kelly2013-08-091-14/+0
| | | | This reverts commit 2d9ec1dadfdd10043a98d425abb25d0aef117699.
* Add support for CMAKE_STATIC_LINKER_FLAGSPatrick Gansterer2013-07-311-0/+7
| | | | | Add the content of this variable to the target specific linker flags as we do with the other CMAKE_*_LINKER_FLAGS variables already.
* Unify the way the flags of a static library are readPatrick Gansterer2013-07-311-20/+13
| | | | | Introduce cmLocalGenerator::GetStaticLibraryFlags() to have a central function for getting the linker flags for a given target.
* Remove TODO to uniq COMPILE_OPTIONSStephen Kelly2013-07-181-1/+1
| | | | | Compile options should not be passed through a uniq filter because repeated use of an option may have siginificance.
* Merge topic 'drop-old-vs-dependency'Brad King2013-07-161-7/+1
|\ | | | | | | | | 4bb6e24 VS,Xcode: Drop incorrect legacy dependency trace (#14291)
| * VS,Xcode: Drop incorrect legacy dependency trace (#14291)Brad King2013-07-151-7/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Drop the "vsProjectFile" argument from cmTarget::TraceDependencies. It appears to be the modern equivalent to a hunk added in commit ba68f771 (...added new custom command support, 2003-06-03): + name = libName; + name += ".dsp.cmake"; + srcFilesToProcess.push(name); but was broken by refactoring at some point. The current behavior tries to trace dependencies on a source file named the same as a target, which makes no sense. Furthermore, in code of the form add_executable(foo foo.c) add_custom_command(OUTPUT "${somewhere}/foo" ... DEPENDS foo) the "vsProjectFile" value "foo" matches source "${somewhere}/foo.rule" generated to hold the custom command and causes the command to be added to the "foo" target incorrectly. Simply drop the incorrect source file trace and supporting logic.
* | Merge topic 'tid-system-argument'Brad King2013-07-161-4/+4
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | 9cf3547 Add the INTERFACE_SYSTEM_INCLUDE_DIRECTORIES target property. 1925cff Add a SYSTEM parameter to target_include_directories (#14180) 286f227 Extend the cmTargetPropCommandBase interface property handling. 83498d4 Store system include directories in the cmTarget. f1fcbe3 Add Target API to determine if an include is a system include. 2679a34 Remove unused variable.
| * | Add Target API to determine if an include is a system include.Stephen Kelly2013-07-021-3/+4
| | | | | | | | | | | | | | | The implementation can be modified later so that system includes can be determined on a per-target basis.
| * | Remove unused variable.Stephen Kelly2013-07-021-1/+0
| |/
* | Merge topic 'compile-defs-debugging'Brad King2013-07-151-0/+17
|\ \ | | | | | | | | | | | | | | | | | | | | | d7dd010 Add target property debugging for COMPILE_DEFINITIONS 1841215 Refactor cmTarget::GetCompileDefinitions to use an out-vector, not a string. afc9243 Add an overload of cmIDEOptions::AddDefines taking a vector of strings. d95651e Overload cmLocalGenerator::AppendDefines to add a list.
| * | Refactor cmTarget::GetCompileDefinitions to use an out-vector, not a string.Stephen Kelly2013-07-111-0/+11
| | | | | | | | | | | | Refactor to create AddCompileDefinitions.
| * | Overload cmLocalGenerator::AppendDefines to add a list.Stephen Kelly2013-07-101-0/+6
| |/
* | Revert "Use --sysroot when cross compiling."Stephen Kelly2013-07-121-5/+1
|/ | | | | | | This reverts commit de4da665d3205afa239749c41513a315c3831f51. This feature is not yet ready for release. It needs to be merged with the CMAKE_OSX_SYSROOT feature.
* Refactor target COMPILE_OPTIONS and COMPILE_FLAGS handlingBrad King2013-06-271-12/+40
| | | | | | | | | | | | Replace the cmLocalGenerator GetCompileOptions method with an AddCompileOptions method since all call sites of the former simply append the result to a flags string anyway. Add a "lang" argument to AddCompileOptions and move the CMAKE_<LANG>_FLAGS_REGEX filter into it. Move the call sites in each generator to a location that has both the language and configuration available. In the Makefile generator this also moves the flags from build.make to flags.make where they belong.
* Escape target flags taken from COMPILE_OPTIONSBrad King2013-06-271-3/+10
| | | | | | | | | | | | Factor appending of individual flags out into an AppendFlagEscape method in cmLocalGenerator and teach it to use EscapeForShell. Update all COMPILE_OPTIONS handling to use AppendFlagEscape. Override the method in the Xcode generator to use its custom escape implementation. Teach the CompileOptions test to add an option that requires escaping everywhere instead of just with the GNU tools.
* Merge topic 'COMPILER_TARGET'Brad King2013-06-261-0/+14
|\ | | | | | | | | 2d9ec1d Add compiler target compile options.
| * Add compiler target compile options.Stephen Kelly2013-06-111-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For clang, this allows passing -target <triple> to the compiler, and for qcc, -V<arch> using toolchain files containing something like set(triple arm-linux-gnueabihf) set(CMAKE_C_COMPILER "/usr/bin/clang") set(CMAKE_C_COMPILER_TARGET ${triple}) set(CMAKE_CXX_COMPILER "/usr/bin/clang++") set(CMAKE_CXX_COMPILER_TARGET ${triple}) or set(arch gcc_ntoarmv7le) set(CMAKE_C_COMPILER /opt/qnx650/host/linux/x86/usr/bin/qcc) set(CMAKE_C_COMPILER_TARGET ${arch}) set(CMAKE_CXX_COMPILER /opt/qnx650/host/linux/x86/usr/bin/QCC) set(CMAKE_CXX_COMPILER_TARGET ${arch}) Both clang and qcc are inherently cross compiler( driver)s.
* | Merge topic 'set-sysroot'Brad King2013-06-241-1/+5
|\ \ | | | | | | | | | | | | de4da66 Use --sysroot when cross compiling.
| * | Use --sysroot when cross compiling.Stephen Kelly2013-06-071-1/+5
| |/ | | | | | | | | | | | | | | | | | | As CMAKE_ROOT_FIND_PATH can be a list, a new CMAKE_SYSROOT is introduced, which is never a list. The contents of this variable is passed to supporting compilers as --sysroot. It is also accounted for when processing implicit link directories reported by the compiler, and when generating RPATH information.
* | Add whitespace after colons in error messages.Stephen Kelly2013-06-211-2/+2
|/
* Merge topic 'VISIBILITY_PRESET-property'Brad King2013-06-051-0/+75
|\ | | | | | | | | | | cd1fa53 Add a COMPILE_OPTION for a VISIBILITY_INLINES_HIDDEN target property. 0e9f4bc Introduce target property <LANG>_VISIBILITY_PRESET
| * Add a COMPILE_OPTION for a VISIBILITY_INLINES_HIDDEN target property.Stephen Kelly2013-06-021-20/+47
| | | | | | | | | | | | | | This corresponds to the g++ and clang++ option -fvisibility-inlines-hidden on linux. On Windows with MinGW, this corresponds to -fno-keep-inline-dllexport. That option is not supported by clang currently.
| * Introduce target property <LANG>_VISIBILITY_PRESETStephen Kelly2013-06-021-0/+48
| | | | | | | | | | | | This is initialized by CMAKE_<LANG>_VISIBILITY_PRESET. The target property is used as the operand to the -fvisibility= compile option with GNU compilers and clang.
* | Add COMPILE_OPTIONS target property.Stephen Kelly2013-06-021-0/+8
| | | | | | | | | | | | This method reads generator expressions from the COMPILE_OPTIONS target property, as well as INTERFACE_COMPILE_OPTIONS from linked dependents.
* | Add cmLocalGenerator::GetCompileOptions.Stephen Kelly2013-06-021-0/+12
|/ | | | | | Currently it only adds the contents of the COMPILE_FLAGS target property, but it can be extended to handle a new COMPILE_OPTIONS generator expression enabled property.
* Merge topic 'unused-cleanup'Brad King2013-05-211-2/+0
|\ | | | | | | | | | | | | 994dc70 Remove unused vector population. 44258cc Remove unused typedef. 0a4d7d8 Remove unused marker for a variable which is now used.
| * Remove unused vector population.Stephen Kelly2013-05-201-2/+0
| | | | | | | | The call to GetEnabledLanguages does not have side-effects.
* | Merge topic 'fix-style'Brad King2013-05-211-2/+2
|\ \ | | | | | | | | | | | | | | | 3c7c332 Fix brace indentation. c70b9b5 Fix style.
| * | Fix brace indentation.Stephen Kelly2013-05-181-2/+2
| |/
* | Fix spelling and typos (affecting binary data / module messages)Andreas Mohr2013-05-071-1/+1
|/
* Automoc: append implicit includes after user-specified dirsStephen Kelly2013-03-191-13/+24
| | | | | | | | | | | | | | | | | | | | | The commit d2536579 (Automoc: fix regression #13667, broken build in phonon, 2012-11-19) changed Automoc to try to re-add the Qt header dir if it was stripped out as an implicit include from the moc command line. When invoking a compiler, those directories are stripped out because they are built-in, but for moc, there are no built-in directories. The follow-up commit acc22400 (Automoc: get include dirs without stripping implicit include dirs off, 2012-12-07) went further by not removing the implicit include dirs, if they were specified specifically by the user. This had the remaining problem that the implicit include dirs appeared in a different order of precedence for moc compared to the compiler. Resolve that by stripping out the include dirs, where specified for the moc command line to, and then appending them at the end. Note that the order of the appended implicit include directories is the order they are specified in the CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES, not the order specified by the user.