summaryrefslogtreecommitdiffstats
path: root/Source/cmTarget.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Re-factor framework directory computation.Nicolas Despres2012-07-171-12/+14
|
* Re-factor Mac OS X content directory computation.Nicolas Despres2012-07-171-45/+62
|
* Ninja: Add support for CFBundle.Nicolas Despres2012-07-171-0/+13
| | | | This patch fixes test CFBundleTest on Darwin.
* Refactor generation of shared library flagsStephen Kelly2012-06-121-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Update the docs of IMPORTED_LOCATION_CONFIG to match the code.Stephen Kelly2012-05-251-3/+3
|
* Fix a few typos in NO_SONAME property description.Modestas Vainius2012-05-021-1/+1
|
* Support building shared libraries or modules without soname (#13155)Modestas Vainius2012-04-301-13/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* CMake: Clarify SUFFIX target property documentation.David Cole2012-04-021-2/+3
| | | | | Make it clear that the property applies to libs, modules and exes, not just libs.
* Merge topic 'object-library'David Cole2012-03-201-1/+43
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 93d5509 Merge branch 'ninja-object-library' into object-library 821037c Merge branch 'xcode-object-library' into object-library eb24c99 Merge branch 'object-library' into xcode-object-library 63d1be8 Xcode: Honor $<TARGET_OBJECTS:...> source expressions 020ba38 Merge branch 'object-library' into xcode-object-library e8ea615 Build object library targets in Xcode 8045e17 Pre-compute object file names before Xcode generation 247a132 Allow txt files as ExtraSources in object library targets b063599 Add a default source group for object files. be01f3b Xcode: Re-factor some existing methods into "FromPath" variants 2693dbe Merge branch 'object-library' into ninja-object-library 51997cb Ninja: Honor $<TARGET_OBJECTS:...> source expressions 23ec258 Merge branch 'object-library' into ninja-object-library 61124de Build object library targets in Ninja f5b06cd Pre-compute object file names before Ninja generation a2514f1 Simplify cmNinjaTargetGenerator using cmGeneratorTarget ...
| * Add $<TARGET_OBJECTS:...> expression to use an object libraryBrad King2012-03-161-1/+41
| | | | | | | | | | | | 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.
| * Add OBJECT_LIBRARY target typeBrad King2012-03-131-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * Merge branch 'cleanup-object-file-names' into object-libraryBrad King2012-03-091-59/+0
| |\
* | \ Merge topic 'doc-Fortran-mod-dir-issue-13034'Brad King2012-03-131-1/+6
|\ \ \ | | | | | | | | | | | | | | | | 54604ee Document Fortran_MODULE_DIRECTORY as OUTPUT only (#13034)
| * | | Document Fortran_MODULE_DIRECTORY as OUTPUT only (#13034)Brad King2012-03-121-1/+6
| |/ / | | | | | | | | | | | | | | | CMake does not automatically pass the Fortran module output directory location to the module search path. Add a note to the documentation that the location must also be specified by INCLUDE_DIRECTORIES.
* | | Merge topic 'cleanup-object-file-names'Brad King2012-03-131-59/+0
|\ \ \ | |/ / |/| / | |/ | | | | | | 0996f2a Hide Makefile local object info inside local generator 67734be VS: Simplify object name computation 4ae7f36 Remove unused partial OBJECT_FILES property implementation
| * Remove unused partial OBJECT_FILES property implementationBrad King2012-03-061-59/+0
| | | | | | | | | | | | | | Remove partial implementation added by commit ca0230a3 (check in initial conv library stuff, 2007-02-16) since it was never finished. It does not make sense for multi-configuration generators since no specific build configuration is processed at CMake time.
* | Merge topic 'target-include-directories'David Cole2012-03-081-0/+49
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | Update the documentation regarding INCLUDE_DIRECTORIES.David Cole2012-02-221-0/+20
| | | | | | | | | | | | | | | It is now a target property and is affected by the use of the include_directories command.
| * | Keep the INCLUDE_DIRECTORIES target property up to date.Stephen Kelly2012-02-221-0/+5
| | | | | | | | | | | | The directory level property changes need to be added to it.
| * | Add API to get the ordered includes for a target.Stephen Kelly2012-02-221-0/+24
| | |
* | | Merge topic 'skip-install-rpath'David Cole2012-03-061-2/+4
|\ \ \ | | | | | | | | | | | | | | | | 635bf50 Add an option to skip RPATH during installation.
| * | | Add an option to skip RPATH during installation.Stephen Kelly2012-03-051-2/+4
| | | |
* | | | Add default initializers for WIN32_EXECUTABLE and MACOSX_BUNDLEStephen Kelly2012-03-051-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows downstreams to use set(CMAKE_WIN32_EXECUTABLE ON) set(CMAKE_MACOSX_BUNDLE ON) to create executables with the WIN32_EXECUTABLE and MACOSX_BUNDLE properties set on by default.
* | | | Merge topic 'factor-install-type'David Cole2012-03-021-16/+0
|\ \ \ \ | |_|/ / |/| | / | | |/ | |/| 573fa3b Factor cmInstallType out of cmTarget::TargetType
| * | Factor cmInstallType out of cmTarget::TargetTypeBrad King2012-02-271-16/+0
| |/ | | | | | | | | | | The purpose of the TargetType enumeration was overloaded for install type because install rules were once recorded as targets. Factor the install types out into their own enumeration.
* | various typo and formatting fixes in manual pages (#12975)Modestas Vainius2012-02-181-4/+4
|/ | | | | | | | | | | | | | | | The patch fixes the following lintian warnings: W: cmake-data: manpage-has-errors-from-man usr/share/man/man1/cmakemodules.1.gz 2728: warning: macro `..' not defined I: cmake-data: spelling-error-in-manpage usr/share/man/man1/cmakemodules.1.gz overriden overridden I: cmake-data: spelling-error-in-manpage usr/share/man/man1/cmakemodules.1.gz overriden overridden I: cmake-data: spelling-error-in-manpage usr/share/man/man1/cmakemodules.1.gz explicitely explicitly I: cmake-data: spelling-error-in-manpage usr/share/man/man1/cmakemodules.1.gz jave java W: cmake-data: manpage-has-errors-from-man usr/share/man/man1/cmakeprops.1.gz 1040: warning [p 25, 3.7i]: can't break line W: cmake: manpage-has-errors-from-man usr/share/man/man1/cmake.1.gz 4233: warning [p 85, 1.3i]: can't break line I: cmake: spelling-error-in-manpage usr/share/man/man1/cmake.1.gz overriden overridden I: cmake: spelling-error-in-manpage usr/share/man/man1/cmake.1.gz overriden overridden I: cmake: spelling-error-in-manpage usr/share/man/man1/cmake.1.gz explicitely explicitly I: cmake: spelling-error-in-manpage usr/share/man/man1/cmake.1.gz jave java
* VS: Add support for WinRT project properties (#12930)Eugene Golushkov2012-02-031-0/+10
| | | | | | | | VS_WINRT_EXTENSIONS: Boolean property that correspond to "Enable Tailored Features" in Visual Studio 11 IDE. VS_WINRT_REFERENCES: Semicolon-delimited list of *.winmd references to add to the project, which creates a new <ItemGroup>.
* Clarify IMPORTED_ target property documentationBrad King2012-01-251-37/+29
| | | | | These properties are meant to be set to tell CMake something, not read to get information from CMake.
* automoc: default to strict mode, use CMAKE_AUTOMOC_RELAXED_MODEAlex Neundorf2011-12-131-1/+1
| | | | | | | | | automoc now defaults to strict mode, also with Qt4, i.e. it behaves as the documentation says by default. I also inverted the switch CMAKE_AUTOMOC_STRICT_MODE to CMAKE_AUTOMOC_RELAXED_MODE. Docs and test adapted accordingly. Alex
* Merge topic 'AutomocIncludedDotMocFileHandling'David Cole2011-12-071-2/+4
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2d11951 Merge branch 'master' into AutomocIncludedDotMocFileHandling 1eca18f automoc: add documentation for CMAKE_AUTOMOC_STRICT_MODE bc278ce automoc: fix line length 62e223e automoc: add variable CMAKE_AUTOMOC_STRICT_MODE, to enable strict parsing 40c5167 automoc: accept even more .moc files in non-strict mode c207f5d automoc: also accept other files when .moc is included in non-strict mode 9c0df72 automoc: add a StrictParseCppFile(), which is only qmake-compatible 174bf35 automoc: move the code for finding headers into separate function 8507eae automoc: fix handling of included _p.moc files 7ada172 automoc: some more linebreaks for the warnings for better readability 3b93e26 automoc: add extra check whether the header contains Q_PRIVATE_SLOT 4745715 Add a test case for the use of Q_PRIVATE_SLOT. bde4edb automoc: add special handling for including basename_p.moc, with test 74ab0f6 automoc: move some code from the big parsing loop into separate functions bc7560e automoc: add test for including a moc_abc_p.cpp file 30fd8e6 automoc: add test for including the moc file from another header ...
| * Merge branch 'master' into AutomocIncludedDotMocFileHandlingDavid Cole2011-12-071-12/+83
| |\ | | | | | | | | | | | | Conflicts: Source/cmTarget.cxx
| * | automoc: add documentation for CMAKE_AUTOMOC_STRICT_MODEAlex Neundorf2011-12-061-1/+4
| | | | | | | | | | | | Alex
* | | Merge topic 'refactor-versioned-lib-names'David Cole2011-12-071-40/+30
|\ \ \ | |_|/ |/| | | | | | | | 96f65ba cmTarget: Create helper method for versioned library names
| * | cmTarget: Create helper method for versioned library namesBrad King2011-12-061-40/+30
| | | | | | | | | | | | | | | Replace the duplicate logic for the realName and soName of versioned shared libraries with calls to a new ComputeVersionedName method.
* | | Merge topic 'GNU-to-MS'David Cole2011-12-061-0/+38
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ae62a1c Test CMAKE_GNUtoMS option in ExportImport on MinGW and MSys afb00fe Add CMAKE_GNUtoMS option to convert GNU .dll.a to MS .lib 61e8629 Factor makefile generator link rule lookup into helper function a603250 Load platform files that need to know the ABI when possible ecd8414 Fortran: Detect pointer size in gfortran on MinGW
| * | | Add CMAKE_GNUtoMS option to convert GNU .dll.a to MS .libBrad King2011-12-051-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | Factor out target location undefined behavior helper macroBrad King2011-12-011-11/+3
| |/ / |/| | | | | | | | | | | | | | Move CM_LOCATION_UNDEFINED_BEHAVIOR into a dedicated header. Add a parameter to describe the action that leads to the undefined target location.
* | | VS: Add support for three new project properties (#12586)Aaron Ten Clay2011-11-281-0/+23
|/ / | | | | | | | | | | | | | | | | | | | | VS_GLOBAL_PROJECT_TYPES: A string containing UUIDs to embed in the Visual Studio project file under <ProjectTypes>. VS_GLOBAL_KEYWORD: Allows specification of a keyword like "ManagedCProj" instead of the default "Win32Proj", under <Keyword> VS_DOTNET_REFERENCES: Semicolon-delimited list of .NET references to add to the project, which creates a new <ItemGroup>.
* | Merge topic 'AddMocOptionsToAutomoc'David Cole2011-11-081-1/+15
|\ \ | | | | | | | | | | | | | | | 2c648ab add documentation for the AUTOMOC_MOC_OPTIONS property 52719a1 automoc: fix #12541, support moc options
| * | add documentation for the AUTOMOC_MOC_OPTIONS propertyAlex Neundorf2011-11-011-1/+14
| | | | | | | | | | | | Alex
| * | automoc: fix #12541, support moc optionsAlex Neundorf2011-11-011-0/+1
| |/ | | | | | | | | | | | | | | This commit adds a new target property AUTOMOC_MOC_OPTIONS, which can be set to add extra options for the moc invocations done via automoc. This is equivalent to the OPTIONS parameter in the qt4_wrap_cpp() macro. Alex
* | VS: Add VS_SCC_AUXPATH target property (#12549)Robert Dailey2011-11-011-1/+6
|/ | | | Maps to SccAuxPath tag in VCPROJ files.
* Merge topic 'cmake-link-interface-libraries'David Cole2011-10-251-0/+4
|\ | | | | | | | | d9cbba7 Initialize LINK_INTERFACE_LIBRARIES target property with a variable
| * Initialize LINK_INTERFACE_LIBRARIES target property with a variableStephen Kelly2011-10-241-0/+4
| | | | | | | | | | | | | | | | | | | | | | Define variable CMAKE_LINK_INTERFACE_LIBRARIES to initialize the value of this property when a target is created. This allows authors to write set(CMAKE_LINK_INTERFACE_LIBRARIES "") to disable transitive linking to implementation dependencies of shared libraries on platforms where it is possible.
* | Refactor TargetTypeNames.Nicolas Despres2011-10-021-41/+31
|/ | | | | | 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 'effective-platform-name'David Cole2011-09-131-1/+5
|\ | | | | | | | | | | 64c9b31 Xcode: Add test to demonstrate iOS project in Xcode 59a2265 Xcode: Use EFFECTIVE_PLATFORM_NAME reference in ComputeOutputDir
| * Xcode: Use EFFECTIVE_PLATFORM_NAME reference in ComputeOutputDirDavid Cole2011-09-121-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Caveats apply: only valid when not overriding default value for output dir *and* there is a CMAKE_XCODE_EFFECTIVE_PLATFORMS value. For now, CMAKE_XCODE_EFFECTIVE_PLATFORMS must be defined in each project, or in the cache for a build. Code relying on value of LOCATION and similar properties may not work if it depends on file existence on disk since CMake will not evaluate $(EFFECTIVE_PLATFORM_NAME). This feature is only enabled for making it easier to build Xcode iOS projects where the developer wants to be able to switch easily between simulator and device builds.
* | Fortran: Add support for free- and fixed-form flagsBrad King2011-08-311-0/+12
| | | | | | | | | | | | | | Define a "Fortran_FORMAT" target and source file property. Initialize the target property from a "CMAKE_Fortran_FORMAT" variable. Interpret values "FIXED" and "FREE" to indicate the source file format. Append corresponding flags to the compiler command line.
* | Add documentation for AUTOMOC, add initialization via CMAKE_AUTOMOCAlex Neundorf2011-08-161-1/+24
| | | | | | | | Alex
* | Add support for Visual Studio project-specific globals (#8707)David Cole2011-07-291-0/+8
| | | | | | | | | | | | | | | | | | | | | | Thanks to Pau Garcia i Quiles for the inspiration for the patch. I've tweaked it a bit compared to what's in the bug tracker: this commit does not allow empty global variable names. I also added usage of the new feature to an existing test. Although it has no effect on the resulting Visual Studio projects, you can verify that the VSResource test produces a non-empty globals section in the generated .vcproj(x) files.