summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Add target property debugging for COMPILE_DEFINITIONSStephen Kelly2013-07-121-0/+41
| | | | | | | Use constructs similar to those for COMPILE_OPTIONS. This is a little different because there is a command to remove_definitions(), so we can't populate the equivalent target property until generate-time in cmGlobalGenerator.
* cmMakefile: Track configured files so we can regenerate them (#13582)Robert Maynard2013-06-251-0/+1
| | | | | | | Currently when a configured file is removed from the build directory, running the build command will not regenerate the file. Now detect this and will rerun cmake properly when a user issues the build command.
* cmMakefile: Refactor AddCMakeDependFile and AddCMakeOutputFile.Robert Maynard2013-06-241-1/+1
| | | | | | AddCMakeDependFile and AddCMakeOutputFile both store as std::string and all calling sites use std::string. So instead of creating more temporary objects, lets just use std::strings.
* Merge topic 'cleanups'Brad King2013-06-051-6/+6
|\ | | | | | | | | | | 9efe359 Add some spaces to the INCLUDE_DIRECTORIES documentation. db15713 Remove unused cmAddDefinitionsCommand::ParseDefinition method.
| * Add some spaces to the INCLUDE_DIRECTORIES documentation.Stephen Kelly2013-06-041-6/+6
| |
* | Introduce add_compile_options command.Stephen Kelly2013-06-041-0/+60
|/ | | | | | | | | | | | | | | | | This command is similar to add_definitions, in that it affects the compile options of all targets which follow it. The implementation is similar to the implementation of the include_directories command, in that it is based on populating a COMPILE_OPTIONS directory property and using that to initialize the same property on targets. Unlike the include_directories command however, the add_compile_options command does not affect previously defined targets. That is, in the following code, foo will not be compiled with -Wall, but bar will be: add_library(foo ...) add_compile_options(-Wall) add_library(bar ...)
* Fix spelling and typos (non-binary)Andreas Mohr2013-05-071-1/+1
|
* Fix spelling and typos (affecting binary data / module messages)Andreas Mohr2013-05-071-3/+3
|
* Fix clearing of the INCLUDE_DIRECTORIES DIRECTORY property.Stephen Kelly2013-04-101-0/+4
| | | | | This was broken by commit 18a3195a (Keep track of INCLUDE_DIRECTORIES as a vector of structs., 2012-11-19).
* Rename the IncludeDirectoriesEntry to be more generic.Stephen Kelly2013-02-121-6/+6
|
* Merge topic 'minor-fixes'Brad King2013-02-111-3/+18
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ba48e63 Generate config-specific interface link libraries propeties. deb51a7 Remove unused forward declarations. 9712362 Don't allow utility or global targets in the LINKED expression. faa927e Make sure INTERFACE properties work with OBJECT libraries. 510fdcb Whitelist target types in target_{include_directories,compile_definitions} 4de7178 Ensure that the build interface includes have been added. df74bc3 Only append build interface include dirs to particular targets. d4e5c67 Don't keep track of content determined by target property values. 1fb545a Move a special case for PIC from the genex to the cmTarget code. 57175d5 Only use early evaluation termination for transitive properties. 4cf161a Fix determination of evaluating link libraries. 3a298c0 Fix generation of COMPILE_DEFINITIONS in DependInfo.cmake. 655e98b Ensure type specific compatible interface properties do not intersect. 46e2896 The COMPATIBLE_INTERFACE does not affect the target it is set on. 5f926a5 Test printing origin of include dirs from tll(). 7c0ec75 De-duplicate validation of genex target names. ...
| * Process generator expressions for 'system' include directories.Stephen Kelly2013-02-071-3/+18
| | | | | | | | | | | | | | | | | | | | Since commit 08cb4fa4 (Process generator expressions in the INCLUDE_DIRECTORIES property., 2012-09-18), it is possible to use generator expressions with the include_directories command. As that command can also have a SYSTEM argument, ensure that the result of using that argument with generator expressions gives a sane result.
* | Merge branch 'master' into generator-toolsetBrad King2013-02-071-10/+27
|\ \ | |/ | | | | We need the latest Tests/CMakeLists.txt so we can refactor all tests.
| * Merge topic 'cmMakefile-comment-typos'Brad King2013-01-241-3/+3
| |\ | | | | | | | | | | | | 3853a6c spell: fix a few typos in comments
| | * spell: fix a few typos in commentsYury G. Kudryashov2013-01-231-3/+3
| | |
| * | Only output includes once after the start of 'generate-time' when debugging.Stephen Kelly2013-01-211-0/+1
| | | | | | | | | | | | | | | | | | During configure-time, GetIncludeDirectories may be called too, for example if using the export() command. As the content can be different, it should be output each time then.
| * | Store includes from the same include_directories call together.Stephen Kelly2013-01-211-7/+23
| |/ | | | | | | | | | | Otherwise, we get a separate IncludeDirectoriesEntry for each include, and that causes unnecessary and confusing splitting in the output when debugging the INCLUDE_DIRECTORIES property.
* | CMake: Add -T option to choose a generator toolsetBrad King2013-02-071-0/+1
|/ | | | | | | | | | | | Reject the option by default. It will be implemented on a per-generator basis. Pass the setting into try_compile project generation. Add cache entry CMAKE_GENERATOR_TOOLSET and associated variable documentation to hold the value persistently. Add a RunCMake.GeneratorToolset test to cover basic "-T" option cases. Verify that CMAKE_GENERATOR_TOOLSET is empty without -T, that -T is rejected when the generator doesn't support it, and that two -T options are always rejected.
* Keep track of INCLUDE_DIRECTORIES as a vector of structs.Stephen Kelly2013-01-031-44/+46
| | | | | The struct can keep track of where the include came from, which gives us proper backtraces.
* Add policy CMP0019 to skip include/link variable re-expansionBrad King2012-12-071-12/+63
| | | | | | | | | | | | | | | | | | | | | | | | | Historically CMake has always expanded ${} variable references in the values given to include_directories(), link_directories(), and link_libraries(). This has been unnecessary since general ${} evaluation syntax was added to the language a LONG time ago, but has remained for compatibility with VERY early CMake versions. For a long time the re-expansion was a lightweight operation because it was only processed once at the directory level and the fast-path of cmMakefile::ExpandVariablesInString was usually taken because values did not have any '$' in them. Then commit d899eb71 (Call ExpandVariablesInString for each target's INCLUDE_DIRECTORIES, 2012-02-22) made the operation a bit heavier because the expansion is now needed on a per-target basis. In the future we will support generator expressions in INCLUDE_DIRECTORIES with $<> syntax, so the fast-path in cmMakefile::ExpandVariablesInString will no longer be taken and re-expansion will be very expensive. Add policy CMP0019 to skip the re-expansion altogether in NEW behavior. In OLD behavior perform the expansion but improve the fast-path heuristic to match ${} but not $<>. If the policy is not set then warn if expansion actually does anything. We expect this to be encountered very rarely in practice.
* Define properties VS_GLOBAL_SECTION_*Petr Kmoch2012-11-161-0/+40
| | | | | Add definition and documentation of properties VS_GLOBAL_SECTION_PRE_<section> and VS_GLOBAL_SECTION_POST_<section>.
* Add convenience for getting a cmGeneratorTarget to use.Stephen Kelly2012-09-191-0/+6
|
* Ninja: suppress cmcldeps only for source file signature try_compilesPeter Kümmel2012-09-051-0/+12
|
* Merge topic 'module-no-soname'David Cole2012-06-211-2/+6
|\ | | | | | | | | 56148fd Do not crash on SHARED library without language (#13324)
| * Do not crash on SHARED library without language (#13324)Brad King2012-06-201-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | Since commit e1409ac5 (Support building shared libraries or modules without soname, 2012-04-22) CMake crashes on the code add_library(foo SHARED foo.nolang) because the logic to lookup the language's soname flag was moved from cmTarget::GetLibraryNames to cmMakefile::GetSONameFlag without its check for a NULL language. Restore the check for NULL. Add RunCMake.Languages test to cover language error cases like this one.
* | Print any evaluated 'elseif'/'else' commands in trace mode (#13220)Brian Helba2012-05-161-12/+18
|/ | | | | | In trace mode ('--trace'), any 'elseif' or 'else' commands that are evaluated as part of a conditional block will be printed. Previously, only the opening 'if' command of a conditional block was printed.
* Merge topic 'module-no-soname'David Cole2012-05-011-0/+8
|\ | | | | | | | | | | fdb3f87 Test NO_SONAME property (#13155) e1409ac Support building shared libraries or modules without soname (#13155)
| * Support building shared libraries or modules without soname (#13155)Modestas Vainius2012-04-301-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a boolean target property NO_SONAME which may be used to disable soname for the specified shared library or module even if the platform supports it. This property should be useful for private shared libraries or various plugins which live in private directories and have not been designed to be found or loaded globally. Replace references to <CMAKE_SHARED_LIBRARY_SONAME_${LANG}_FLAG> and hard-coded -install_name flags with a conditional <SONAME_FLAG> which is expanded to the value of the CMAKE_SHARED_LIBRARY_SONAME_${LANG}_FLAG definition as long as soname supports is enabled for the target in question. Keep expanding CMAKE_SHARED_LIBRARY_SONAME_${LANG}_FLAG in rules in case third party projects still use it. Such projects would not yet use NO_SONAME so the adjacent <TARGET_SONAME> will always be expanded. Make <TARGET_INSTALLNAME_DIR> NO_SONAME aware as well. Since -install_name is soname on OS X, this should not be a problem if this variable is expanded only if soname is enabled. The Ninja generator performs rule variable substitution only once globally per rule to put its own placeholders. Final substitution is performed by ninja at build time. Therefore we cannot conditionally replace the soname placeholders on a per-target basis. Rather than omitting $SONAME from rules.ninja, simply do not write its contents for targets which have NO_SONAME. Since 3 variables are affected by NO_SONAME ($SONAME, $SONAME_FLAG, $INSTALLNAME_DIR), set them only if soname is enabled.
* | Factor out custom command .rule file path generationBrad King2012-04-181-10/+4
| | | | | | | | | | | | | | Add cmGlobalGenerator::GenerateRuleFile to compute a generator-specific rule file location. This will allow specific generators to override the location of .rule files without changing the behavior of other generators.
* | Cleanup custom command .rule file internal handlingBrad King2012-04-181-18/+18
|/ | | | | | | | Teach cmMakefile::AddCustomCommandToOutput to return the cmSourceFile instance to which the custom command is attached. Use the return value instead of separately adding a .rule extension and searching for the source. Mark CMake-generated .rule files explicitly with a property instead of trusting the file extension.
* Classify known header file extensions as headersBrad King2012-03-281-2/+1
| | | | | | | | | | Commit 328c0f65 (Simplify cmVisualStudio10TargetGenerator source classification, 2012-03-19) introduced the first use of source classification from cmGeneratorTarget (which originated as Makefile generator logic) in a Visual Studio generator for handling of header files. Fix classification of header files to match known header extensions instead of only the HEADER_FILE_ONLY property. Make it consistent with the "Header Files" source group.
* Add a default source group for object files.David Cole2012-03-161-0/+1
|
* Add OBJECT_LIBRARY target typeBrad King2012-03-131-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | This library type can compile sources to object files but does not link or archive them. It will be useful to reference from executable and normal library targets for direct inclusion of object files in them. Diagnose and reject the following as errors: * An OBJECT library may not be referenced in target_link_libraries. * An OBJECT library may contain only compiling sources and supporting headers and custom commands. Other source types that are not normally ignored are not allowed. * An OBJECT library may not have PRE_BUILD, PRE_LINK, or POST_BUILD commands. * An OBJECT library may not be installed, exported, or imported. Some of these cases may be supported in the future but are not for now. Teach the VS generator that OBJECT_LIBRARY targets are "linkable" just like STATIC_LIBRARY targets for the LinkLibraryDependencies behavior.
* Rename/constify build-time config placeholder lookupBrad King2012-03-091-2/+2
| | | | | | Rename cmGlobalGenerator::GetCMakeCFG{InitDirectory => IntDir} to have a shorter name without a typo. Add a 'const' qualifier since the method is only for lookup and never needs to modify anything.
* Merge topic 'target-include-directories'David Cole2012-03-081-71/+83
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | d662dff Fix shadowed variable warning on dashboard results f66e735 Fix compiler warning reported on older Borland dashboard. d90eed4 Fix compiler error reported on older Borland dashboard. 8233636 Update the documentation regarding INCLUDE_DIRECTORIES. d899eb7 Call ExpandVariablesInString for each target's INCLUDE_DIRECTORIES c21db87 Make search paths ordered and unique 22021f0 Remove cmMakefile::GetIncludeDirectories 9106b56 Extract and use the INCLUDE_DIRECTORIES target properties. 840509b Keep the INCLUDE_DIRECTORIES target property up to date. a4d5f7b Add API to get the ordered includes for a target. 8adaee2 CMake: Eliminate cmMakefile::IncludeDirectories 7620932 Remove include flags memoization. 97a5faa Make it safe to call this method without creating duplicates. edd5303 Refactor GetIncludeFlags to take includes instead of fetching them
| * Fix shadowed variable warning on dashboard resultsDavid Cole2012-02-231-1/+1
| |
| * Update the documentation regarding INCLUDE_DIRECTORIES.David Cole2012-02-221-3/+16
| | | | | | | | | | It is now a target property and is affected by the use of the include_directories command.
| * Call ExpandVariablesInString for each target's INCLUDE_DIRECTORIESDavid Cole2012-02-221-0/+14
| | | | | | | | | | | | For strict backwards compatibility only. This should be unnecessary at this point, but introducing a policy to deprecate it properly is a whole different topic branch...
| * Remove cmMakefile::GetIncludeDirectoriesDavid Cole2012-02-221-24/+0
| | | | | | | | | | After making the changes to use the new target level INCLUDE_DIRECTORIES property, there are no more callers of this method.
| * Keep the INCLUDE_DIRECTORIES target property up to date.Stephen Kelly2012-02-221-0/+9
| | | | | | | | The directory level property changes need to be added to it.
| * CMake: Eliminate cmMakefile::IncludeDirectoriesDavid Cole2012-02-221-66/+66
| | | | | | | | Instead, re-implement it in terms of the directory property INCLUDE_DIRECTORIES.
* | Rename UsedCommands to FinalPassCommandsYury G. Kudryashov2012-02-291-5/+5
|/ | | | | When I read 'UsedCommands' I thought that it holds all commands used in the file, not only those that have FinalPass().
* Optionally allow IMPORTED targets to be globally visibleBrad King2012-01-251-2/+7
| | | | | | | | | | | | Consider the case motivating commit e01cce28 (Allow add_dependencies() on imported targets, 2010-11-19). An imported target references a file generated at build time by a custom target on which it depends. Had the file been built directly using add_library or add_executable its target name would have been visible globally. Therefore the imported target representing the file should be globally visible also. Teach the IMPORTED signature of add_(executable|library) to accept a new "GLOBAL" option to make the imported target visible globally.
* Add NEWLINE_STYLE option to configure_file (#3957)Peter Kuemmel2011-11-281-3/+15
|
* Refactor TargetTypeNames.Nicolas Despres2011-10-021-1/+1
| | | | | | Make it a static method instead of an array. It is safer for the type checking and if we add a new target type we will be warned to add a case to the switch.
* Merge topic 'UsingCMakeLikePkgConfig2'David Cole2011-08-251-5/+14
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 59238dc Fix --find-package mode on Cygwin, where enable_language(RC) is called 98472e4 Require the current cmake version in --find-package mode a6ccf3c Use $(CXXFLAGS) and $(LDFLAGS) in the --find-package test Makefile 4386918 Fix line length 7d69310 Only enable the test when using GNU make 3011149 Make the test harder by always having a space in the include dirs ab57ff6 Make the --find-package test harder 626fc71 Much improved test, should now be executed on all UNIXes ec6982d Disable any STATUS output in --find-package mode e552ae7 Dont check for -isysroot and -mmacosx-version on OSX in --find-package mode e589589 Rename helper macros print_compile_flags() to set_compile_flags_var() aecfc1f Fix test on OpenBSD with BSD make 6bb4ca3 The makefile for the test was kindof wrong fd15b5e Only run the test if we are using a makefile generator under UNIX 9fc87c6 Add a test for the new --find-package mode d3ae0ff Improve documentation for --find-package mode bf07375 Add a cmake.m4 for using cmake in autoconf projects instead of pkgconfig b0e3578 Use the file-utility to test for 64bit if there is no /usr/lib64 53edfb2 Better support for lib64 and Debian multiarch b8fdaa1 Fix copyright notice in new CMakeFindPackageMode.cmake 7690edf Replace cmake::GetScriptMode() with GetWorkingMode() e4f603b Implement find-package mode of cmake a91d662 Add find-package mode, which does nothing yet b976e70 Make clLocalGenerator::GetTargetFlags() public
| * Disable any STATUS output in --find-package modeAlex Neundorf2011-08-151-2/+9
| | | | | | | | | | | | | | | | | | Any STATUS output will be fed directly to the compiler, which will not understand any status messages. Error messages are fine, since they are errors and it is ok if the compiler fails in such cases. Alex
| * Replace cmake::GetScriptMode() with GetWorkingMode()Alex Neundorf2011-08-091-4/+4
| | | | | | | | | | | | | | GetWorkingMode() returns a new enum WorkingMode, which is one of NORMAL_MODE, SCRIPT_MODE and FIND_PACKAGE_MODE. Alex
| * Add find-package mode, which does nothing yetAlex Neundorf2011-07-021-1/+3
| | | | | | | | | | | | | | | | -add command line argument --find-package and handle it, i.e. call an empty function cmake::FindPackage() -add basic help Alex
* | Add AUTOMOC to the add_library() commandAlex Neundorf2011-08-141-1/+2
| | | | | | | | Alex