summaryrefslogtreecommitdiffstats
path: root/Tests/ExportImport/Export
Commit message (Collapse)AuthorAgeFilesLines
* EXPORT_PACKAGE_DEPENDENCIES: Add experimental feature gateBrad King2024-03-121-0/+1
| | | | | | | Some design concerns have been raised after trying the 3.29 release candidates. Avoid committing to a stable public interface for now. Issue: #25767
* install(EXPORT): Export find_dependency() callsKyle Edwards2023-11-131-1/+4
| | | | | | Issue: #20511 Co-Authored-by: Brad King <brad.king@kitware.com> Co-Authored-by: Robert Maynard <rmaynard@nvidia.com>
* Tests: Fix clang -Wstrict-prototypes warningsBrad King2023-10-261-1/+1
|
* cmGeneratorExpressionNode: implement `COMPILE_ONLY` genexRobert Maynard2023-05-042-0/+14
| | | | | | | | | This generator expression is the inverse of `LINK_ONLY` and only coveys usage requirements for the purposes of compilation. Its intended use is to avoid needing to export targets that do not have link usage requirements (e.g., header-only libraries) when used by another target. See: #15415
* Add EXPORT_NO_SYSTEM target property, deprecate IMPORTED_NO_SYSTEMDa Quexian2022-06-171-0/+11
| | | | | | Issue: #18040 Signed-off-by: Da Quexian <daquexian566@gmail.com>
* export: Fix TARGET_NAME lookup for out-of-dir linkingBrad King2022-04-011-1/+4
| | | | | | | Improve the logic added by commit f0e67da061 (target_link_libraries: Fix out-of-dir linking of a list of targets, 2020-01-14, v3.17.0-rc1~149^2) to, while exporting targets, look up referenced target names in the correct directory.
* Add usage requirements to update direct link dependenciesBrad King2022-01-291-0/+16
| | | | | | | | | | | | | | | | | Link line construction starts with `LINK_LIBRARIES` and appends dependencies from the transitive closure of `INTERFACE_LINK_LIBRARIES`. Only the entries of `LINK_LIBRARIES` are considered direct link dependencies. In some advanced use cases, particularly involving static libraries and static plugins, usage requirements need to update the list of direct link dependencies. This may mean adding new items, removing existing items, or both. Add target properties to encode these usage requirements: * INTERFACE_LINK_LIBRARIES_DIRECT * INTERFACE_LINK_LIBRARIES_DIRECT_EXCLUDE Fixes: #22496
* LCC: Add policy CMP0129 regarding interpreting LCC as GNUmakise-homura2021-10-211-0/+3
| | | | | | | | | | Due to MCST LCC compiler identification is now changed to LCC, there should be a way for old projects to still identify it as GNU, as it was before. This commits adds the policy: CMP0129: Compiler id for MCST LCC compilers is now LCC, not GNU. This policy controls such a behavior. OLD behaivior is to treat LCC as GNU, NEW is to treat is as LCC.
* Merge topic 'lcc-compiler'Brad King2021-10-191-0/+1
|\ | | | | | | | | | | | | | | | | | | | | 02b2607a5c Help: Add release note for MCST LCC compiler support e5d9fce03f LCC: Add dedicated support for MCST LCC compiler 2b9ef77944 CPack/DEB: deal with broken dpkg-shlibdeps on E2K architecture 0995c75301 Tests/RPM: skip tests tat rely on debugedit if it's not found ea55ac9a51 Tests/RunCMake/CommandLine: Deal with locales that are different from English Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6608
| * LCC: Add dedicated support for MCST LCC compilermakise-homura2021-10-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Divert LCC compiler as a new one, instead of treating it as GNU. Since old times, Elbrus C/C++/Fortran Compiler (LCC) by MCST has been passing checks for GNU compilers, so it has been identified as GNU. Now, with intent of seriously upstreaming its support, it has been added as a separate LCC compiler, and its version displays not a supported GCC version, but LCC version itself (e.g. LCC 1.25.19 instead of GNU 7.3.0). This commit adds its support for detection, and also converts basically every check like 'is this compiler GNU?' to 'is this compiler GNU or LCC?'. The only places where this check is untouched, is where it regards other platforms where LCC is unavailable (primarily non-Linux), and where it REALLY differs from GNU compiler. Note: this transition may break software that are already ported to Elbrus, but hardly relies that LCC will be detected as GNU; still such software is not known.
* | export: Propagate IMPORTED_NO_SYSTEM target property to consumersBrad King2021-10-152-0/+16
|/ | | | | | | | | Enabling `IMPORTED_NO_SYSTEM` on a target built within the project has no effect on the build system, but it is still a useful way to set the property on imported targets generated by `install(EXPORT)` and `export()`. Issue: #17364
* Tests: Add tests for new optionsKyle Edwards2021-06-043-0/+56
|
* install(): Add IMPORTED_RUNTIME_ARTIFACTS modeKyle Edwards2021-05-311-0/+6
|
* install(EXPORT): Fix exporting target w/ source named using CONFIG genexDeniz Bahadir2020-09-221-0/+15
| | | | Fixes: #21203
* Add INTERFACE libraries to generated buildsystem if they have SOURCESBrad King2020-08-072-3/+24
| | | | | | | | | | | | | | | | | | | | | | | | INTERFACE libraries were created with the intention of collecting usage requirements for use by other targets via `target_link_libraries`. Therefore they were not allowed to have SOURCES and were not included in the generated buildsystem. In practice, this has become limiting: * Header-only libraries do have sources, they just do not compile. Developers should be able to edit those sources (the header files) in their IDE. * Header-only libraries may need to generate some of their header files via custom commands. Some projects work around these limitations by pairing each interface library with an `add_custom_target` that makes the header files and custom commands appear in the generated buildsystem and in IDEs. Lift such limitations by allowing INTERFACE libraries to have SOURCES. For those with sources, add a corresponding build target to the generated buildsystem. Fixes: #19145
* target_link_libraries: Fix out-of-dir linking of a list of targetsBrad King2020-01-161-1/+1
| | | | | | | | | | | | | | In a case like target_link_libraries(targetInOtherDir PUBLIC "$<1:a;b>") then all entries in the list need to be looked up in the caller's scope. Previously our `::@(directory-id)` suffix would apply only to the last entry. Instead surround the entire entry by a pair `::@(directory-id);...;::@` so that the `::@` syntax can encode a directory lookup scope change evaluated as the list is processed. Fixes: #20204
* Tests: Enable CMP0022 in ExportImport out-of-dir linking caseBrad King2020-01-141-0/+1
| | | | | | Since out-of-dir linking is enabled by CMP0079, which is newer than CMP0022, it is likely that both will be set in practice when out-of-dir linking is used.
* Add set_property option: DEPRECATIONJoseph Snyder2020-01-021-0/+6
| | | | | | | | | | | | Add a new property flag for a target which contains a message regarding deprecation status. Add a warning at "Generate" time if a linked target is marked as deprecated. Expand ExportImport test to ensure that new property is being set and passed correctly. Ensure that the message is shown during the "Generate" step run of the ExportImport test.
* CUDA: Add cuda meta-features (e.g. ``cuda_std_11``) supportRobert Maynard2019-12-101-0/+12
|
* install,export: Do not treat language names as target namesBrad King2019-10-161-0/+5
| | | | | | | When generating `IMPORTED_LINK_INTERFACE_LANGUAGES`, do not treat the entries as target names. Fixes: #19846
* install,export: Fix export of a genex following $<INSTALL_PREFIX>Brad King2019-10-041-1/+4
| | | | | | | | | The relative path check added by commit 5838aba1aa (Export: Report error on relative include with genex., 2013-11-26, v3.0.0-rc1~285^2) was added one condition too early. If the value starts in `${_IMPORT_PREFIX}` (which comes from `$<INSTALL_PREFIX>`) then it is an absolute path. Fixes: #19791
* Revise include order using clang-format-6.0Kitware Robot2019-10-012-4/+2
| | | | | Run the `clang-format.bash` script to update our C and C++ code to a new include order `.clang-format`. Use `clang-format` version 6.0.
* PCH: Propagate INTERFACE_PRECOMPILE_HEADERS in install(EXPORT)Brad King2019-09-252-1/+12
| | | | | | | | | This was accidentally left out of commit 0467a2f91b (PCH: add PRECOMPILE_HEADERS to special properties, 2015-03-12). Also add a test case for `install(EXPORT)` and `export()` propagation of precompiled headers. Fixes: #19741
* InterfaceLibrary: Whitelist EXPORT_PROPERTIES propertyBrad King2019-05-171-0/+2
| | | | Fixes: #19261
* LINK_DIRECTORIES: Add new properties and commandsMarc Chevrier2018-09-251-0/+12
| | | | | | | | | | | | These new capabilities enable to manage link directories Two new properties: * target properties: LINK_DIRECTORIES and INTERFACE_LINK_DIRECTORIES One new command * target_link_directories(): to populate target properties Fixes: #17215
* target_link_libraries: Allow use with targets in other directoriesBrad King2018-09-125-0/+41
| | | | | | | | | | | | | | | | | | | | | Previously the command did not allow naming targets on the LHS that were not created in the calling directory. Lift this restriction to enable more flexible use by projects. Targets named on the RHS will need to be looked up during generation in the scope of the call site rather than the scope of the LHS target. Introduce an internal syntax in `[INTERFACE_]LINK_LIBRARIES` properties to specify target names that need to be looked up in a directory other than that containing the target on which the property is set. Add minimal documentation of the syntax to help users that encounter it. Unfortunately CMake previously did allow such calls in the case that only `INTERFACE` libraries are specified, but those libraries would be looked up in the target's directory rather than the caller's. Add policy `CMP0079` to enable the new behavior with new lookup scope in a compatible way. Fixes: #17943
* Tests: Add test for $<0:...> in ExportImportKyle Edwards2018-07-171-3/+3
| | | | | This test case already includes test cases for $<1...> and $<0...>, but this commit adds a few $<0:...>'s in cases where it was missing.
* LINK_DEPENDS: add support for property INTERFACE_LINK_DEPENDSMarc Chevrier2018-06-271-0/+14
| | | | Fixes: #17997
* LINK_OPTIONS: Add new family of propertiesMarc Chevrier2018-06-061-0/+10
| | | | | | | | | | | | | | This family enable to manage link flags Three new properties: * directory property: LINK_OPTIONS * target properties: LINK_OPTIONS and INTERFACE_LINK_OPTIONS Two new commands * add_link_options(): to populate directory property * target_link_options(): to populate target properties Fixes: #16543
* Revise C++ coding style using clang-format-6.0Kitware Robot2018-06-0114-36/+36
| | | | | | | | | | | | Run the `clang-format.bash` script to update all our C and C++ code to a new style defined by `.clang-format`. Use `clang-format` version 6.0. * If you reached this commit for a line in `git blame`, re-run the blame operation starting at the parent of this commit to see older history for the content. * See the parent commit for instructions to rebase a change across this style transition commit.
* Export: allow exporting of additional propertiesWouter Klouwen2018-03-161-0/+8
| | | | | | | | | This change introduces an additional property that may be set on a target to allow additional properties to be exported. Normally only a limited number of properties are exported. Additional properties may be exported by simply setting the `EXPORT_PROPERTIES` property on a target that is exported.
* Tests: Add cases for usage requirements of linked object libsBrad King2018-03-016-7/+48
| | | | | | | Add tests to cover transitive usage requirements on installation and export of targets that link to object libraries. Issue: #14778
* install,export: Maybe transform OBJECT libraries to INTERFACE librariesBrad King2018-02-282-5/+17
| | | | | | | | | | | Teach the `install` and `export` commands to support installing and exporting `OBJECT` libraries without their object files. Transform them to `INTERFACE` libraries in such cases. For `install(TARGETS)`, activate this when no destination for the object files is specified. For `export`, activate this only under Xcode with multiple architectures when we have no well-defined object file locations to give to clients.
* Tests: Make function name not match SONAMECraig Scott2017-05-181-1/+1
| | | | | | | | We look for `SONAME` in the output of `readelf` to check whether the binary contains the field. Do not provide a symbol that may accidentally match. Fixes: #16894
* Allow OBJECT libraries to be installed, exported, and importedRobert Maynard2017-04-184-1/+24
| | | | | | | | Teach install() and export() to handle the actual object files. Disallow this on Xcode with multiple architectures because it still cannot be cleanly supported there. Co-Author: Brad King <brad.king@kitware.com>
* Revise C++ coding style using clang-formatKitware Robot2016-05-1631-95/+156
| | | | | | | | | | | | | Run the `Utilities/Scripts/clang-format.bash` script to update all our C++ code to a new style defined by `.clang-format`. Use `clang-format` version 3.8. * If you reached this commit for a line in `git blame`, re-run the blame operation starting at the parent of this commit to see older history for the content. * See the parent commit for instructions to rebase a change across this style transition commit.
* Format include directive blocks and ordering with clang-formatBrad King2016-04-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sort include directives within each block (separated by a blank line) in lexicographic order (except to prioritize `sys/types.h` first). First run `clang-format` with the config file: --- SortIncludes: false ... Commit the result temporarily. Then run `clang-format` again with: --- SortIncludes: true IncludeCategories: - Regex: 'sys/types.h' Priority: -1 ... Commit the result temporarily. Start a new branch and cherry-pick the second commit. Manually resolve conflicts to preserve indentation of re-ordered includes. This cleans up the include ordering without changing any other style. Use the following command to run `clang-format`: $ git ls-files -z -- \ '*.c' '*.cc' '*.cpp' '*.cxx' '*.h' '*.hh' '*.hpp' '*.hxx' | egrep -z -v '(Lexer|Parser|ParserHelper)\.' | egrep -z -v '^Source/cm_sha2' | egrep -z -v '^Source/(kwsys|CursesDialog/form)/' | egrep -z -v '^Utilities/(KW|cm).*/' | egrep -z -v '^Tests/Module/GenerateExportHeader' | egrep -z -v '^Tests/RunCMake/CommandLine/cmake_depends/test_UTF-16LE.h' | xargs -0 clang-format -i This selects source files that do not come from a third-party. Inspired-by: Daniel Pfeifer <daniel@pfeifer-mail.de>
* Drop Visual Studio 6 generatorBrad King2016-03-093-10/+2
| | | | | | This generator has been deprecated since CMake 3.3. Remove it. Update documentation, modules, and tests to drop content specific to this generator.
* Fix export of STATIC library PRIVATE dependencies with CMP0022 NEWBrad King2016-01-153-1/+13
| | | | | | | | | | | | | | The target_link_libraries command records the PRIVATE dependencies of a STATIC library in INTERFACE_LINK_LIBRARIES as "$<LINK_ONLY:dep>". This hides the target name from export namespacing logic inside a generator expression. When user-written generator expressions reference a target name they must put it inside a "$<TARGET_NAME:dep>" expression to allow the export logic to rename the target. In the case that the private dependency is not already a generator expression, target_link_libraries must use "$<LINK_ONLY:$<TARGET_NAME:dep>>" to allow the export logic to rename the target. Reported-by: Tamás Kenéz <tamas.kenez@gmail.com>
* Tests: Use CMP0022 NEW behavior in some ExportImport casesBrad King2016-01-151-0/+3
|
* Tests: Isolate policy changes in ExportImport testBrad King2016-01-151-2/+5
| | | | Use cmake_policy(PUSH/POP) to isolate CMP0022 policy changes.
* install: Allow generator expressions in DIRECTORYYves Frederix2016-01-131-1/+1
| | | | | Teach install(DIRECTORY) to support generator expressions in the list of directories, much like install(FILES) already supports.
* Merge topic 'test-fix-C-comments'Brad King2015-09-281-11/+11
|\ | | | | | | | | 4eb77a1c Tests: Use C-Style comments in C sources and headers
| * Tests: Use C-Style comments in C sources and headersMarc Chevrier2015-09-251-11/+11
| | | | | | | | | | Not all C compilers tolerate C++-style comments in C code, so do not use them in our tests.
* | install: Allow generator expressions in DIRECTORY DESTINATIONRobert Goulet2015-09-241-1/+1
|/
* Tests: Cover install(FILES) with a genex DESTINATIONBrad King2015-09-231-2/+2
|
* Tests: Cover NO_SONAME property for SHARED librariesBrad King2015-08-202-0/+12
| | | | | | | | This property was added by commit v2.8.9~204^2~2 (Support building shared libraries or modules without soname, 2012-04-22). A test for using the property on MODULE libraries was added by commit v2.8.9~204^2~1 (Test NO_SONAME property, 2012-04-23). Add such a test for SHARED libraries too.
* Add generator expression support to OUTPUT_DIRECTORY target propertiesRobert Goulet2015-08-122-2/+39
| | | | | | | If {ARCHIVE,LIBRARY,RUNTIME}_OUTPUT_DIRECTORY is set with a genex then do not add the per-config subdirectory on multi-config generators. This will allow projects to use $<CONFIG> to place the per-config part of the directory path somewhere other than the end.
* Add generator expression support to OUTPUT_NAME target propertyRobert Goulet2015-07-092-2/+9
|
* Export: Escape exported property values when writing CMake language filesBrad King2015-06-241-0/+4
| | | | | | | | When writing export files, correctly encode property values that contain characters special to the CMake language parser. We must ensure that they parse correctly when loaded on the consuming side. Reported-by: Dan Liew <dan@su-root.co.uk>