CMake/Tests/ExportImport/Export
Stephen Kelly 77d2646784 Allow generator expressions in LINK_INTERFACE_LIBRARIES.
The Config and IMPORTED_ variants may also contain generator
expressions.

If 'the implementation is the interface', then the result of
evaluating the expressions at generate time is used to populate
the IMPORTED_LINK_INTERFACE_LIBRARIES property.

1) In the case of non-static libraries, this is fine because the
  user still has the option to populate the LINK_INTERFACE_LIBRARIES
  with generator expressions if that is what is wanted.

2) In the case of static libraries, this prevents a footgun,
  enforcing that the interface and the implementation are really
  the same.

  Otherwise, the LINK_LIBRARIES could contain a generator
  expression which is evaluated with a different context at build
  time, and when used as an imported target. That would mean that the
  result of evaluating the INTERFACE_LINK_LIBRARIES property for
  a static library would not necessarily be the 'link implementation'.

  For example:

    add_library(libone STATIC libone.cpp)
    add_library(libtwo STATIC libtwo.cpp)
    add_library(libthree STATIC libthree.cpp)

    target_link_libraries(libtwo
      $<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,STATIC_LIBRARY>:libone>)
    target_link_libraries(libthree libtwo)

  If the LINK_LIBRARIES content was simply copied to the
  IMPORTED_LINK_INTERFACE_LIBRARIES, then libthree links to libone, but
  executables linking to libthree will not link to libone.

3) As the 'implementation is the interface' concept is to be
  deprecated in the future anyway, this should be fine.
2013-01-10 23:04:06 +01:00
..
CMakeLists.txt Allow generator expressions in LINK_INTERFACE_LIBRARIES. 2013-01-10 23:04:06 +01:00
testExe1.c COMP: Convert C function prototypes to use (void) instead of (). 2008-02-03 08:57:58 -05:00
testExe1lib.c COMP: Convert C function prototypes to use (void) instead of (). 2008-02-03 08:57:58 -05:00
testExe2.c ENH: Added ExportImport test to test new export/import features. 2008-01-28 08:40:21 -05:00
testExe2lib.c ENH: Updated ExportImport test to try LINK_INTERFACE_LIBRARIES. 2008-01-30 17:26:09 -05:00
testExe2libImp.c ENH: Updated ExportImport test to try LINK_INTERFACE_LIBRARIES. 2008-01-30 17:26:09 -05:00
testExe3.c ENH: Support exporting/importing of AppBundle targets. 2008-01-28 14:46:16 -05:00
testLib1.c COMP: Convert C function prototypes to use (void) instead of (). 2008-02-03 08:57:58 -05:00
testLib2.c COMP: Convert C function prototypes to use (void) instead of (). 2008-02-03 08:57:58 -05:00
testLib3.c ENH: Updated ExportImport test to try LINK_INTERFACE_LIBRARIES. 2008-01-30 17:26:09 -05:00
testLib3Imp.c Follow all dependencies of shared library private dependencies 2011-12-14 11:33:01 -05:00
testLib3ImpDep.c Follow all dependencies of shared library private dependencies 2011-12-14 11:33:01 -05:00
testLib4.c ENH: Added framework to ExportImport test. 2008-01-28 13:06:17 -05:00
testLib4lib.c ENH: Test target_link_libraries INTERFACE option 2008-08-11 16:23:10 -04:00
testLib4libdbg.c ENH: Test target_link_libraries INTERFACE option 2008-08-11 16:23:10 -04:00
testLib4libdbg1.c BUG: Fix ExportImport test on VS6 2008-08-12 17:27:48 -04:00
testLib4libopt.c ENH: Test target_link_libraries INTERFACE option 2008-08-11 16:23:10 -04:00
testLib4libopt1.c BUG: Fix ExportImport test on VS6 2008-08-12 17:27:48 -04:00
testLib5.c ENH: Allow IMPORTED_IMPLIB w/o IMPORTED_LOCATION 2009-04-08 16:29:04 -04:00
testLib6.cxx ENH: Test export/import of link interface languages 2009-07-11 10:10:51 -04:00
testLib6c.c COMP: Fix ExportImport testLib6 on VS6 2009-07-13 09:20:36 -04:00
testLibCycleA1.c Test link multiplicity export/import 2009-09-01 10:38:36 -04:00
testLibCycleA2.c Test link multiplicity export/import 2009-09-01 10:38:36 -04:00
testLibCycleA3.c Test link multiplicity export/import 2009-09-01 10:38:36 -04:00
testLibCycleB1.c Test link multiplicity export/import 2009-09-01 10:38:36 -04:00
testLibCycleB2.c Test link multiplicity export/import 2009-09-01 10:38:36 -04:00
testLibCycleB3.c Test link multiplicity export/import 2009-09-01 10:38:36 -04:00
testLibDepends.c Handle INTERFACE properties transitively for includes and defines. 2013-01-05 01:18:37 +01:00
testLibRequired.c exports: add a test for exporting dependent targets 2012-09-30 10:27:02 -04:00
testSharedLibDepends.cpp Allow generator expressions in LINK_INTERFACE_LIBRARIES. 2013-01-10 23:04:06 +01:00
testSharedLibDepends.h Allow generator expressions in LINK_INTERFACE_LIBRARIES. 2013-01-10 23:04:06 +01:00
testSharedLibRequired.cpp Allow generator expressions in LINK_INTERFACE_LIBRARIES. 2013-01-10 23:04:06 +01:00
testSharedLibRequired.h Allow generator expressions in LINK_INTERFACE_LIBRARIES. 2013-01-10 23:04:06 +01:00