summaryrefslogtreecommitdiffstats
path: root/Tests/ExportImport/Import
Commit message (Collapse)AuthorAgeFilesLines
* Allow OBJECT libraries to be installed, exported, and importedRobert Maynard2017-04-182-0/+18
| | | | | | | | 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>
* Tests: ExportImport C code should use explicit (void) in prototypesRobert Maynard2017-04-181-12/+12
|
* Revise C++ coding style using clang-formatKitware Robot2016-05-168-21/+17
| | | | | | | | | | | | | 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>
* Tests: Use a less strict regular expression to look for "SONAME"Raphael Kubo da Costa2015-09-012-2/+2
| | | | | | | | | | | | | | | | | | | Commit 899458ab (Tests: Cover NO_SONAME property for SHARED libraries, 2015-08-20) introduced a few new ExportImport tests, and the check_lib_{no}soname.cmake scripts that parse readelf(1)'s output. Make the regular expression matching the SONAME line output by readelf less strict, as the output format varies across implementations: GNU binutils' readelf is the only one to write each ELF header within parentheses (which the previous regular expression expected). The new tests were thus failing when either Fedora's elfutils (eu-readelf) or elftoolchain's readelf (present on recent FreeBSD versions) were being used, as they both list the headers without parentheses. The same issue also affected Tests/Plugin's check_mod_soname.cmake, so fix that one as well -- the only reason the test was not failing is that it tested that the regular expression did not match, which was always the case with a non-binutils readelf.
* Tests: Cover NO_SONAME property for SHARED librariesBrad King2015-08-203-0/+58
| | | | | | | | 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-1/+14
| | | | | | | 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-1/+4
|
* Export: Escape exported property values when writing CMake language filesBrad King2015-06-241-0/+11
| | | | | | | | 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>
* Tests: Fix ExportImport on AIX with GCCBrad King2015-04-231-0/+1
| | | | | | | | | | | | | | | | | | | | | The iface_test_bld gets the excludedFromAll include directory with "-isystem" because it is added indirectly through an imported target. On AIX with GCC the -isystem flag causes sources to be preprocessed as: # 3 "/.../excludedFromAll.h" 2 3 4 The flags after the file name are documented here: https://gcc.gnu.org/onlinedocs/cpp/Preprocessor-Output.html and the "4" flag says that following content is extern "C". This causes the excludedFromAll function to be declared as a C symbol and not mangled for C++, which fails to link later because the symbol is really provided as C++. Work around this by setting the NO_SYSTEM_FROM_IMPORTED target property on iface_test_bld. Somehow iface_test_exp does not end up with -isystem so we do not need this workaround for that target.
* install: Allow generator expressions in TARGETS DESTINATION (#14317)Brad King2015-02-112-0/+4
| | | | | | | | | | | | This will allow per-config destinations for targets in EXPORT sets. Using multiple install(TARGETS) with separate CONFIGURATIONS is rejected as a target appearing more than once in an export set. Now instead one can write install(TARGETS foo EXPORT exp DESTINATION lib/$<CONFIG>) to get a single logical membership of the target in the export set while still having a per-config destination.
* Allow export of targets with INTERFACE_SOURCES.Stephen Kelly2015-02-102-0/+15
| | | | | | Use the same rules for paths in source and binary dirs in installed INTERFACE_SOURCES as are used for INTERFACE_INCLUDE_DIRECTORIES.
* try_run: Add tests for LINK_LIBRARIES with mock libraries.Matt McCormick2015-01-261-0/+30
| | | | | Extend the ExportImport test to try using an imported library with try_run.
* install: Allow absolute EXPORT destination with relative targets (#15258)Brad King2014-12-152-0/+25
| | | | | | | | | | | | | | | | | When install(EXPORT) is given an absolute destination we cannot compute the install prefix relative to the installed export file location. Previously we disallowed installation of targets in such exports with a relative destination, but did not enforce this for target property values besides the location of the main target file. This could lead to broken installations when the EXPORT is installed to an absolute path but usage requirements are specified relative to the install prefix. Since an EXPORT installed to an absolute destination cannot be relocated we can just hard-code the value of CMAKE_INSTALL_PREFIX as the base for relative paths. This will allow absolute install(EXPORT) destinations to work with relative destinations for targets and usage requirements. Extend the ExportImport test with a case covering this behavior.
* Features: Extend concept to C language.Stephen Kelly2014-05-141-0/+21
| | | | | | | | | | | Add properties and variables corresponding to CXX equivalents. Add features for c_function_prototypes (C90), c_restrict (C99), c_variadic_macros (C99) and c_static_assert (C11). This feature set can be extended later. Add a <PREFIX>_RESTRICT symbol define to WriteCompilerDetectionHeader to conditionally represent the c_restrict feature.
* Tests: Fix name of cache variable.Stephen Kelly2014-05-071-2/+2
|
* Export: Populate INTERFACE_COMPILE_FEATURES property.Stephen Kelly2014-04-082-0/+18
|
* install: Support generator expressions in FILES and PROGRAMS modeBrad King2014-02-212-0/+17
| | | | | | | | Teach the install(FILES) and install(PROGRAMS) commands to evaluate generator expressions in the list of files. Extend the ExportImport test to cover installation cases involving generator expressions.
* Export: Prefix relative items with genexes in INSTALL_INTERFACE.Stephen Kelly2013-11-261-0/+1
| | | | | | | | | | | | | | Code such as target_include_directories(foo INTERFACE $<INSTALL_INTERFACE:include$<FOO>> ) should be treated as a relative directory, despite the genex, after the INSTALL_INTERFACE is stripped away. Previously, this would generate a relative directory on export, which would be an error on import, so no policy is needed.
* Export: Process INSTALL_INTERFACE in INCLUDES DESTINATION.Stephen Kelly2013-11-261-0/+3
| | | | | | | | | | Code such as install(TARGETS ... INCLUDES DESTINATION $<INSTALL_INTERFACE:include> ) should behave as if the INSTALL_INTERFACE wrapper were not present.
* Export: Process relative includes after genex evaluation.Stephen Kelly2013-11-261-0/+2
| | | | | | | | | | | | | In code such as install(TARGETS ... INCLUDES DESTINATION $<FOO>include ) the generator expressions are evaluated at generate-time. Delay determining whether each entry is a relative path until after the generator expressions are evaluated. Such relative paths are based relative to the CMAKE_INSTALL_PREFIX.
* Consider targets with double colons to be IMPORTED or ALIAS targets.Stephen Kelly2013-10-211-9/+9
| | | | | | | | Introduce a policy to control the behavior. The AliasTargets unit test already tests that using a double-semicolon in the name is not an error. Change the ExportImport test to use a namespace with a double-semicolon too.
* Merge topic 'INTERFACE_LIBRARY-target-type'Brad King2013-10-084-0/+95
|\ | | | | | | | | | | | | 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.
| * install: Teach EXPORT option to handle INTERFACE_LIBRARY targetsStephen Kelly2013-10-081-0/+13
| |
| * export: Add support for INTERFACE_LIBRARY targetsStephen Kelly2013-10-084-0/+82
| |
* | Always consider includes from IMPORTED targets to be SYSTEM.Stephen Kelly2013-09-242-0/+56
|/ | | | | | | Introduce a target property to control this behavior variable to set the default value for the target property. This does not affect try_compile runs.
* try_compile: Extract IMPORTED targets from INTERFACE_LINK_LIBRARIESStephen Kelly2013-08-261-0/+15
|
* try_compile: Extract IMPORTED targets from LINK_DEPENDENT_LIBRARIESStephen Kelly2013-08-261-6/+6
|
* Merge topic 'install-interface-relative'Brad King2013-07-261-0/+1
|\ | | | | | | | | d777b8e Genex: Allow relative paths in INSTALL_INTERFACE.
| * Genex: Allow relative paths in INSTALL_INTERFACE.Stephen Kelly2013-07-251-0/+1
| | | | | | | | | | | | | | These paths can be prepended with the ${_IMPORT_PREFIX} generated in the export file. Such relative paths were previously an error.
* | Merge topic 'install-interface-includes'Brad King2013-07-261-0/+3
|\ \ | |/ | | | | | | 650e61f Add a convenient way to add the includes install dir to the INTERFACE.
| * Add a convenient way to add the includes install dir to the INTERFACE.Stephen Kelly2013-07-241-0/+3
| | | | | | | | | | | | | | Export the INCLUDES DESTINATION without appending to the INTERFACE_INCLUDE_DIRECTORIES of the target itself. That way, a target can be exported multiple times with different INCLUDES DESTINATION without unintended cross-pollution of export sets.
* | Use linked frameworks as a source of include directories.Stephen Kelly2013-07-243-0/+19
|/
* Merge topic 'INTERFACE_LINK_LIBRARIES-prop'Brad King2013-07-157-0/+38
|\ | | | | | | | | | | | | | | | | 3e30d9e TLL: Don't populate old link interface if CMP0022 is NEW. 574fec9 Export: Generate INTERFACE_LINK_LIBRARIES property on targets. d0a76ea Introduce the INTERFACE_LINK_LIBRARIES property. ddde61c Introduce the LINK_ONLY generator expression. 5aa9731 GenexEval: Add abstracted access to link interface for a target.
| * Export: Generate INTERFACE_LINK_LIBRARIES property on targets.Stephen Kelly2013-07-087-0/+38
| | | | | | | | | | | | | | | | | | | | This property is generated only for targets which have recorded policy CMP0022 as NEW, and a compatibility mode is added to additionally export the old interfaces in that case too. If the old interfaces are not exported, the generated export files require CMake 2.8.12. Because the unit tests use a version which is not yet called 2.8.12, temporarily require a lower version.
* | Merge topic 'IMPORTED-build-dependencies'Brad King2013-07-155-0/+62
|\ \ | |/ |/| | | | | | | 4f7ceb5 Test non-IMPORTED libraries in the INTERFACE of IMPORTED libraries. 3405351 Add entire link interface transitive closure as target depends.
| * Test non-IMPORTED libraries in the INTERFACE of IMPORTED libraries.Stephen Kelly2013-07-025-0/+62
| | | | | | | | | | | | | | | | | | | | If a non-IMPORTED library is added to the INTERFACE_LINK_LIBRARIES of a IMPORTED target, the non-IMPORTED target needs to become a target dependency and link dependency of the consuming target. This is already the case since commit 30962029 (Make targets depend on the link interface of their dependees, 2012-12-26), and fixed in the parent commit, so test that it works.
* | Generate INTERFACE_COMPILE_OPTIONS on export.Stephen Kelly2013-06-102-0/+19
|/ | | | | This was missing from commit 80ca9c4b (Add COMPILE_OPTIONS target property., 2013-05-16).
* Add EXPORT_NAME property.Stephen Kelly2013-05-183-1/+17
| | | | | | This allows for example, the buildsystem to use names like 'boost_any' instead of the overly generic 'any', and still be able to generate IMPORTED targets called 'boost::any'.
* Handle targets in the LINK_LIBRARIES of try_compile.Stephen Kelly2013-02-222-0/+23
| | | | | | | | | | Imported targets are re-exported so that they can be used by the try_compile generated code with target_link_libraries. This makes the use of the cmake_expand_imported_targets macro obsolete. The macro is not able to expand the generator expressions which may appear in the IMPORTED_LINK_INTERFACE_LIBRARIES content. Instead it just sees them as 'not a target'.
* Revert "Add a way to exclude INTERFACE properties from exported targets."Stephen Kelly2013-02-134-76/+0
| | | | | | | | This reverts commit 2c3654c3de718fe822f8960063373774fc019494. The removal of some tests added in commit 77cecb77 (Add includes and compile definitions with target_link_libraries., 2012-11-05) are also squashed into this commit.
* Add includes and compile definitions with target_link_libraries.Stephen Kelly2013-01-315-13/+77
| | | | | | | | This establishes that linking is used to propagate usage-requirements between targets in CMake code. The use of the target_link_libraries command as the API for this is chosen because introducing a new command would introduce confusion due to multiple commands which differ only in a subtle way.
* Export targets to a targets file, not a Config file.Stephen Kelly2013-01-311-2/+2
|
* Don't allow targets args in the new target commands.Stephen Kelly2013-01-291-6/+13
|
* Add the COMPATIBLE_INTERFACE_STRING property.Stephen Kelly2013-01-242-0/+6
|
* Export the COMPATIBLE_INTERFACE_BOOL content propertiesStephen Kelly2013-01-212-0/+6
|
* Make INTERFACE determined properties readable in generator expressions.Stephen Kelly2013-01-202-1/+10
| | | | | The properties are evaluated as link-dependent interface properties when evaluating the generator expressions.
* Export the INTERFACE_PIC property.Stephen Kelly2013-01-152-0/+24
|
* Make the BUILD_INTERFACE of export()ed targets work.Stephen Kelly2013-01-152-4/+18
| | | | | The existing BUILD_INTERFACE code is executed at generate time, which is too late for export().
* Add a test for the interfaces in targets exported from the build tree.Stephen Kelly2013-01-151-16/+13
|