summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGenerator.cxx
Commit message (Collapse)AuthorAgeFilesLines
* stringapi: Use strings in Convert methods in LocalGeneratorBen Boeckel2014-03-081-17/+19
| | | | | The C strings were turned into std::strings internally anyways and most callers used .c_str().
* stringapi: Use strings for the languagesBen Boeckel2014-03-081-26/+29
|
* stringapi: Use strings for variable namesBen Boeckel2014-03-081-1/+1
| | | | Variable names are always generated by CMake and should never be NULL.
* stringapi: Use strings for property namesBen Boeckel2014-03-081-6/+10
| | | | Property names are always generated by CMake and should never be NULL.
* cmLocalGenerator: Add response file option to OutputLinkLibrariesBrad King2014-03-041-9/+14
| | | | | Response files require different path conversion to be threaded through construction of the link libraries flags.
* cmLocalGenerator: Simplify GetIncludeFlags output formattingBrad King2014-03-041-12/+4
| | | | Use the output format argument to ConvertToIncludeReference.
* cmLocalGenerator: Add format option to ConvertToLinkReferenceBrad King2014-03-041-3/+4
| | | | Replace the hard-coded SHELL output format with an optional argument.
* cmLocalGenerator: Add format option to ConvertToIncludeReferenceBrad King2014-03-041-2/+3
| | | | Replace the hard-coded SHELL output format with an optional argument.
* cmLocalGenerator: Add format option to ConvertToOutputForExistingBrad King2014-03-041-8/+11
| | | | Replace the hard-coded SHELL output format with an optional argument.
* MSVC: Add properties to configure compiler PDB files (#14762)Brad King2014-02-261-0/+7
| | | | | | | | | | Since commit v2.8.12~437^2~2 (VS: Separate compiler and linker PDB files 2013-04-05) we no longer set /Fd with the PDB_NAME or PDB_OUTPUT_DIRECTORY properties. Those properties now exclusively handle linker PDB files. Since STATIC libraries do not link their compiler PDB file becomes more important. Add new target properties "COMPILE_PDB_NAME[_<CONFIG>]" and "COMPILE_PDB_OUTPUT_DIRECTORY[_<CONFIG>]" to specify the compiler PDB file location and pass the value to the MSVC /Fd option.
* OS X: Escape path given to -isysroot flagBrad King2014-02-121-1/+1
| | | | | Ensure that paths containing spaces or other special characters are escaped correctly on the command line.
* cmVersion: Fix CMake_VERSION_ENCODE for date in patch levelBrad King2014-02-101-2/+2
| | | | | | | | | Use a uint64_t to store encoded version numbers so we have plenty of bits available. Encode with room for up to 1000 minor releases between major releases and to encode dates until the year 10000 in the patch level. This is necessary because CMake development versions prior to release 2.8.0 used the date in the patch level, and this practice may be restored after the 3.0 release.
* VisibilityInlinesHidden: only apply -fvisibility-inlines-hidden to C++ sourcesNils Gladitz2014-02-011-1/+5
|
* Allow projects to specify extra inputs to CMakeBrad King2014-01-211-0/+2
| | | | | | | Define a new 'CMAKE_CONFIGURE_DEPENDS' directory property that projects can use to specify input files to the CMake configuration process. Extend the RunCMake.Configure test to verify that the build system re-runs CMake when this input changes.
* cmMakefile: make some methods take const std::string& instead of const char*Rolf Eike Beer2014-01-161-1/+1
| | | | | | | | Most callers already have a std::string, on which they called c_str() to pass it into these methods, which internally converted it back to std::string. Pass a std::string directly to these methods now, avoiding all these conversions. Those methods that only pass in a const char* will get the conversion to std::string now only once.
* cmTarget: Make GetSourceFiles populate an out-vector parameter.Stephen Kelly2014-01-091-2/+4
| | | | | In a future patch, this will also be populated with extra sources from the linked dependencies.
* 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.