CMAKE_ENABLE_EXPORTS.rst 1.1 KB

12345678910111213141516171819202122
  1. CMAKE_ENABLE_EXPORTS
  2. --------------------
  3. Specify whether an executable exports symbols for loadable modules.
  4. Normally an executable does not export any symbols because it is the
  5. final program. It is possible for an executable to export symbols to
  6. be used by loadable modules. When this property is set to true CMake
  7. will allow other targets to ``link`` to the executable with the
  8. :command:`TARGET_LINK_LIBRARIES` command. On all platforms a target-level
  9. dependency on the executable is created for targets that link to it.
  10. For DLL platforms an import library will be created for the exported
  11. symbols and then used for linking. All Windows-based systems
  12. including Cygwin are DLL platforms. For non-DLL platforms that
  13. require all symbols to be resolved at link time, such as OS X, the
  14. module will ``link`` to the executable using a flag like
  15. ``-bundle_loader``. For other non-DLL platforms the link rule is simply
  16. ignored since the dynamic loader will automatically bind symbols when
  17. the module is loaded.
  18. This variable is used to initialize the target property
  19. :prop_tgt:`ENABLE_EXPORTS` for executable targets.