summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefileTargetGenerator.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Create make rules for INTERFACE_LIBRARY targets.Stephen Kelly2013-10-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The result is that the depends of the target are created. So, add_library(somelib foo.cpp) add_library(anotherlib EXCLUDE_FROM_ALL foo.cpp) add_library(extra EXCLUDE_FROM_ALL foo.cpp) target_link_libraries(anotherlib extra) add_library(iface INTERFACE) target_link_libraries(iface INTERFACE anotherlib) Executing 'make iface' will result in the anotherlib and extra targets being made. Adding a regular executable to the INTERFACE of an INTERFACE_LIBRARY will not result in the executable being built with 'make iface' because of the logic in cmComputeTargetDepends::AddTargetDepend. So far, this is implemented only for the Makefile generator. Other generators will follow if this feature is possible for them. Make INTERFACE_LIBRARY targets part of the all target by default. Test this by building the all target and making the expected library EXCLUDE_FROM_ALL.
* OS X: Encode -F framework search flag in per-language platform variableBrad King2013-10-101-3/+11
| | | | | | | | | 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 'INTERFACE_LIBRARY-target-type'Brad King2013-10-081-1/+6
|\ | | | | | | | | | | | | 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-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Merge topic 'generate-modern-style'Brad King2013-10-071-7/+7
|\ \ | | | | | | | | | | | | | | | 027a020 Merge branch 'test-property-genex' into generate-modern-style 33055c4 Generate modern-style cmake code.
| * | Generate modern-style cmake code.Stephen Kelly2013-08-221-7/+7
| |/ | | | | | | | | | | | | | | | | | | | | 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.
* | Genex: Evaluate genexes for additional make clean files.Stephen Kelly2013-08-271-1/+9
|/ | | | | | | | | | | | | | | | | | | This is necessary because custom commands and targets may create custom files whose names are determined by generator expressions. For example, clang should be using $<TARGET_FILE> and $<TARGET_FILE_DIR> instead of reverse engineering the output file name: http://thread.gmane.org/gmane.comp.compilers.clang.scm/80523 However, that can only be done when ADDITIONAL_MAKE_CLEAN_FILES also accepts and evaluates generator expressions. Similarly, KDE uses the LOCATION property where $<TARGET_FILE> would also be better in KDE4_HANDLE_RPATH_FOR_EXECUTABLE but also appends the result to ADDITIONAL_MAKE_CLEAN_FILES. After this patch, both can be ported to generator expressions.
* Merge topic 'tid-system-argument'Brad King2013-07-161-1/+2
|\ | | | | | | | | | | | | | | | | | | 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-1/+2
| | | | | | | | | | The implementation can be modified later so that system includes can be determined on a per-target basis.
* | Merge topic 'compile-defs-debugging'Brad King2013-07-151-3/+2
|\ \ | | | | | | | | | | | | | | | | | | | | | 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-3/+2
| |/ | | | | | | Refactor to create AddCompileDefinitions.
* | Revert "Use --sysroot when cross compiling."Stephen Kelly2013-07-121-17/+0
|/ | | | | | | 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-46/+4
| | | | | | | | | | | | 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.
* Use --sysroot when cross compiling.Stephen Kelly2013-06-071-0/+17
| | | | | | | | | | 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.
* Merge topic 'VISIBILITY_PRESET-property'Brad King2013-06-051-0/+3
|\ | | | | | | | | | | cd1fa53 Add a COMPILE_OPTION for a VISIBILITY_INLINES_HIDDEN target property. 0e9f4bc Introduce target property <LANG>_VISIBILITY_PRESET
| * Introduce target property <LANG>_VISIBILITY_PRESETStephen Kelly2013-06-021-0/+3
| | | | | | | | | | | | 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.
* | Merge topic 'target-COMPILE_OPTIONS'Brad King2013-06-031-13/+19
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 24466f2 Add target_compile_options command. 80ca9c4 Add COMPILE_OPTIONS target property. 7cb2308 cmTarget: Rename LinkInterfaceIncludeDirectoriesEntries 47f80d9 cmTarget: Rename struct to be more re-usable. 1319a14 Add <LANG>_COMPILER_ID generator expressions. 3549676 Add cmLocalGenerator::GetCompileOptions. f3ad863 VS6: Rename some variables to correspond to config values.
| * | Add cmLocalGenerator::GetCompileOptions.Stephen Kelly2013-06-021-13/+19
| |/ | | | | | | | | | | 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.
* | Refactor how bundles and frameworks are supported.Clinton Stimpson2013-05-231-1/+1
|/ | | | | | | | | | | | | | | | Make handling of directory separators consistent between non-bundle and bundle code. Remove xcode specific flag from cmTarget when getting install_name. Add (more) consistent convenience functions in cmTarget to get directories inside of bundles and frameworks to add files to. This refactor also fixes bug #12263 where frameworks had the wrong install name when SKIP_BUILD_RPATH. Also make install_name for frameworks consistent between Makefile and Xcode generator.
* Merge topic 'fix-COMPILE_DEFINITIONS-config'Brad King2013-03-261-3/+0
|\ | | | | | | | | | | 1703b00 Test evaluation of per-config COMPILE_DEFINITIONS (#14037) a6286e9 Fix the evaluation of per-config COMPILE_DEFINITIONS (#14037)
| * Fix the evaluation of per-config COMPILE_DEFINITIONS (#14037)Stephen Kelly2013-03-251-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The API for retrieving per-config COMPILE_DEFINITIONS has long existed because of the COMPILE_DEFINITIONS_<CONFIG> style properties. Ensure that the provided configuration being generated is also used to evaluate the generator expressions in cmTarget::GetCompileDefinitions. Both the generic COMPILE_DEFINITIONS and the config-specific variant need to be evaluated with the requested configuration. This has the side-effect that the COMPILE_DEFINITIONS does not need to be additionally evaluated with no configuration, so the callers can be cleaned up a bit too.
* | Replace <TARGET> in CMAKE_<LANG>_COMPILE_OBJECT rule variablesBrad King2013-03-221-0/+8
|/ | | | | | | | | | | | In some languages the compiler may need to know the path of the final target file for which an object is being compiled. Honor the <TARGET> placeholder for compilation rules to support such cases. Note that this cannot work with OBJECT library targets because the final target path is not known during compilation (there can even be more than one final target). Suggested-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* Move GetCompileDefinitions to cmTarget.Stephen Kelly2013-01-291-2/+2
|
* Process the INTERFACE_PIC property from linked dependenciesStephen Kelly2013-01-101-1/+2
| | | | | | | | | This allows a dependee to inform a target that it should have its POSITION_INDEPENDENT_CODE property set to ON, or OFF. The value of the POSITION_INDEPENDENT_CODE property, if set, must be consistent with any INTERFACE_POSITION_INDEPENDENT_CODE properties on dependees. Add a test covering the consistency checks on platforms where they run.
* Makefile: Use modern link information for framework search pathsBrad King2012-12-071-11/+15
| | | | | | Use cmComputeLinkInformation::GetFrameworkPaths to get the list of framework paths needed by the linker. Drop the now unused framework information from the old-style cmTarget link dependency analysis.
* Revert "Move GetLinkInformation to cmGeneratorTarget"Stephen Kelly2012-11-211-4/+2
| | | | | | | As we can't move all linking related code from cmTarget, it makes sense to reverse the move in some cases. This reverts commit 4f5384e75c6a00d110d3fa3f555a3f6a4f31bb46.
* Fix config-specific INCLUDE_DIRECTORIES in multi-config generatorsStephen Kelly2012-10-171-4/+14
| | | | | | | | Commit 08cb4fa4 (Process generator expressions in the INCLUDE_DIRECTORIES property, 2012-09-18) contained an incorrect assumption that CMAKE_BUILD_TYPE was set on the makefile for each generated configuration in multi-config generators. Fix that by making the GetIncludeDirectories API depend on the config.
* Merge topic 'vs-pdb-output'Brad King2012-10-011-1/+1
|\ | | | | | | | | | | | | | | 2ccca05 Run PDBDirectoryAndName test on MSVC and Intel efc83b3 Document that PDB_(NAME|OUTPUT_DIRECTORY) are ignored for VS 6 b294457 Verify that PDB_(NAME|OUTPUT_DIRECTORY) are honored in test 3f60dbf Add PDB_OUTPUT_DIRECTORY and PDB_NAME target properties (#10830)
| * Add PDB_OUTPUT_DIRECTORY and PDB_NAME target properties (#10830)Yuchen Deng2012-09-251-1/+1
| | | | | | | | | | | | | | This enables changing the name and output folder of the debug symbol files produced by MS compilers. Inspired-by: Thomas Bernard <thomas.bernard@ipetronik.com>
* | Add a wrapper for accessing config-specific compile-definitions.Stephen Kelly2012-09-191-5/+4
| |
* | Append the COMPILE_DEFINITIONS from the Makefile to all targets.Stephen Kelly2012-09-191-4/+0
| | | | | | | | | | | | | | | | This way we don't need to check the definitions from the Makefile when generating later, and can more easily add generator expressions. Duplication is not a problem as the definitions are de-duplicated before generating.
* | Move GetIncludeDirectories to cmGeneratorTarget.Stephen Kelly2012-09-191-4/+8
| |
* | Make cmLocalGenerator::AddArchitectureFlags take a cmGeneratorTarget.Stephen Kelly2012-09-191-1/+1
| |
* | Move GetLinkInformation to cmGeneratorTargetStephen Kelly2012-09-191-2/+4
|/
* Don't duplicate -D defines sent to the compiler.Stephen Kelly2012-08-201-13/+21
| | | | | | | | | | | There is no need to do so. Be consistent with include directories and ensure uniqueness. This requires changing the API of the cmLocalGenerator::AppendDefines method, and changing the generators to match. The test unfortunately can't test for uniqueness, but it at least verifies that nothing gets lost.
* Ninja: remove warningsPeter Kümmel2012-07-181-10/+9
|
* Re-factor OS X content generator start up.Nicolas Despres2012-07-171-12/+2
|
* Re-factor bundle content copying rules generation.Nicolas Despres2012-07-171-35/+37
|
* Remove unused ivars to eliminate compiler warningsDavid Cole2012-06-201-4/+2
|
* Refactor generation of shared library flagsStephen Kelly2012-06-121-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | CMAKE_SHARED_LIBRARY_<lang>_FLAGS has flags on various platforms for a variety of purposes that are correlated with shared libraries but not exclusive to them. Refactor generation of these flags to use new purpose-specific platform variables CMAKE_<lang>_COMPILE_OPTIONS_DLL CMAKE_<lang>_COMPILE_OPTIONS_PIC CMAKE_<lang>_COMPILE_OPTIONS_PIE Activate the DLL flags specifically for shared libraries. Add a new POSITION_INDEPENDENT_CODE target property to activate PIC/PIE flags, and default to true for shared libraries to preserve default behavior. Initialize the new property from CMAKE_POSITION_INDEPENDENT_CODE to allow easy global configuration in projects. Although the default behavior is unchanged by this refactoring, the new approach ignores CMAKE_SHARED_LIBRARY_<lang>_FLAGS completely. We must leave it set in case projects reference the value. Furthermore, if a project modifies CMAKE_SHARED_LIBRARY_<lang>_FLAGS it expects the new value to be used. Add policy CMP0018 to handle compatibility with projects that modify this platform variable. Add a PositionIndependentCode test on platforms where we can get meaningful results.
* VS: Restore header files marked as OS X Framework content (#13196)Brad King2012-05-071-8/+18
| | | | | | | | | | | | | | | Header files listed in a target's PUBLIC_HEADER or similar properties are marked as OS X Framework content. Refactoring performed by commit 11d9b211 (Add cmGeneratorTarget to represent a target during generation, 2012-03-07) commit 45c2f932 (Simplify cmMakefileTargetGenerator using cmGeneratorTarget, 2012-03-07) commit 328c0f65 (Simplify cmVisualStudio10TargetGenerator source classification, 2012-03-19) and related commits accidentally removed such files from treatment as normal header files by the VS generator (generators other than Makefiles and Xcode). Move handling of such files out of cmGeneratorTarget and back to cmMakefileTargetGenerator. The central cmGeneratorTarget classification will always treat them as header or extra sources.
* Add $<TARGET_OBJECTS:...> expression to use an object libraryBrad King2012-03-161-0/+3
| | | | | | For now do not allow an OBJECT library to reference other object libraries. Teach cmTarget::ComputeLinkImplementation to include the languages of object libraries used by a target.
* Build object library targets in MakefilesBrad King2012-03-131-11/+19
| | | | | | Treat OBJECT libraries as STATIC libraries but leave out the archive step. The object files will be left behind for reference by other targets later.
* Pre-compute object file names before Makefile generationBrad King2012-03-091-10/+4
| | | | | | | Add a virtual cmGlobalGenerator::ComputeTargetObjects method invoked during cmGeneratorTarget construction. Implement it in the Makefile generator to pre-compute all object file names for each target. Use the results during generation instead of re-computing it later.
* Simplify cmMakefileTargetGenerator using cmGeneratorTargetBrad King2012-03-091-50/+40
| | | | | Replace the classification of source files in this generator using that computed by cmGeneratorTarget.
* Merge branch 'cleanup-object-file-names' into object-libraryBrad King2012-03-091-10/+2
|\
| * Hide Makefile local object info inside local generatorBrad King2012-03-081-10/+2
| | | | | | | | | | Make cmLocalUnixMakefileGenerator3::LocalObjectInfo private and add cmLocalUnixMakefileGenerator3::AddLocalObjectFile to create entries.
* | Extract and use the INCLUDE_DIRECTORIES target properties.Stephen Kelly2012-02-221-3/+32
| | | | | | | | | | | | | | | | | | Eliminate callers of cmMakefile::GetIncludeDirectories. All callers of GetIncludeDirectories should go through the local generator object. Only the local generator calls cmTarget::GetIncludeDirectories directly.
* | Refactor GetIncludeFlags to take includes instead of fetching themStephen Kelly2012-02-221-1/+5
|/
* Add CMAKE_GNUtoMS option to convert GNU .dll.a to MS .libBrad King2011-12-051-0/+10
| | | | | | | | | | | | | | | | Teach the Windows-GNU.cmake platform file to look for Visual Studio tools matching the target ABI. Add an extra step to the link command for shared libraries and executables that export symbols and on which a new GNUtoMS property is set (initialized by the CMAKE_GNUtoMS option). Tell the GNU linker to output a module definition (.def) file listing exported symbols in addition to the GNU-format import library (.dll.a). Pass the .def file to the MS "lib" tool to construct a MS-format DLL import library (.lib). Teach the install(TARGETS) command to install the MS import library next to the GNU one. Teach the install(EXPORT) and export() command to set the IMPORTED_IMPLIB property pointing at the import library to use the import library matching the tools in the importing project.