1. 25 Jun, 2015 1 commit
    • Brad King's avatar
      cmTarget: Fix diagnostic of target_link_libraries in wrong directory (#15626) · 30c2e1dd
      Brad King authored
      Since commit v3.3.0-rc1~62^2~5 (cmTarget: Store only cmListFileContext
      for CMP0023 handling, 2015-05-18) a call to target_link_libraries on a
      target that was defined in another (non-ancestor) directory crashes
      because no execution context is left active.  Fix this by getting the
      execution context from the actual cmMakefile where the current
      target_link_libraries call takes place.  Test this by verifying that
      such calls correctly produce an error diagnostic instead of crashing.
  2. 04 May, 2015 1 commit
  3. 12 Apr, 2015 1 commit
  4. 11 Jan, 2015 1 commit
  5. 03 Apr, 2014 1 commit
  6. 31 Mar, 2014 1 commit
  7. 11 Mar, 2014 1 commit
    • Stephen Kelly's avatar
      Remove some c_str() calls. · 21c573f6
      Stephen Kelly authored
      Use the clang RemoveCStrCalls tool to automatically migrate the
      code. This was only run on linux, so does not have any positive or
      negative effect on other platforms.
  8. 08 Mar, 2014 2 commits
  9. 16 Jan, 2014 1 commit
    • Rolf Eike Beer's avatar
      cmMakefile: make some methods take const std::string& instead of const char* · c768e398
      Rolf Eike Beer authored and Brad King's avatar Brad King committed
      Most callers already have a std::string, on which they called c_str() to pass it
      into these methods, which internally converted it back to std::string. Pass a
      std::string directly to these methods now, avoiding all these conversions.
      Those methods that only pass in a const char* will get the conversion to
      std::string now only once.
  10. 07 Nov, 2013 1 commit
  11. 02 Nov, 2013 2 commits
    • Brad King's avatar
      CMP0022: Plain target_link_libraries must populate link interface · ef10b87c
      Brad King authored
      The CMP0022 NEW behavior is that the INTERFACE_LINK_LIBRARIES property
      exactly defines the link interface.  The plain target_link_libraries
      signature says linking is transitive by default, so it should populate
      the property.
      Teach the target_link_libraries plain signature to populate the
      INTERFACE_LINK_LIBRARIES regardless of the CMP0022 setting.  Refactor
      the cmTarget::ComputeLinkInterface checks that warn when the policy is
      not set to compare the new property to either the explicitly set old
      link interface properties or the link implementation fallback for all
      linkable target types, not just static libraries.
      This fixes a regression in that caused target_link_libraries to
      not implement transitive linking in the plain signature once the policy
      CMP0022 is set to NEW.
    • Brad King's avatar
      target_link_libraries: Revert accidental change · 4064d6f2
      Brad King authored
      In commit c4373b33 (cmTarget: Make GetProperty() const, 2013-10-29)
      we accidentally changed the cmTargetLinkLibrariesCommand.cxx logic
      in a way that looks like a local experiment leftover that went
      unnoticed due to the size of the other changes in the commit.
      Revert it.
  12. 31 Oct, 2013 1 commit
    • Stephen Kelly's avatar
      cmTarget: Make GetProperty() const. · c4373b33
      Stephen Kelly authored
      This has follow-on effects for other methods and classes. Further
      work on making the use of const cmTarget pointers common can be
      done, particularly with a view to generate-time methods.
  13. 26 Oct, 2013 1 commit
    • Stephen Kelly's avatar
      Don't add invalid content to static lib INTERFACE_LINK_LIBRARIES. · 239b0c6b
      Stephen Kelly authored and Brad King's avatar Brad King committed
      Only valid target names or generator expressions may appear in
      the target field of a LINK_ONLY expression.
      Other content like link flags should still be added to that property
      (wrapped in config-specific generator expressions), but not wrapped
      in LINK_ONLY. Otherwise undue warnings would be issued for the
      policy CMP0022.
      The LINK_ONLY expression only has an effect for actual target
      names anyway, so there is no logical deficit.
  14. 17 Oct, 2013 1 commit
  15. 07 Oct, 2013 1 commit
    • Stephen Kelly's avatar
      Add the INTERFACE_LIBRARY target type. · fe732264
      Stephen Kelly authored and Brad King's avatar Brad King committed
      This target type only contains INTERFACE_* properties, so it can be
      used as a structural node. The target-specific commands enforce
      that they may only be used with the INTERFACE keyword when used
      with INTERFACE_LIBRARY targets. The old-style target properties
      matching LINK_INTERFACE_LIBRARIES_<CONFIG> are always ignored for
      this target type.
      The name of the INTERFACE_LIBRARY must match a validity generator
      expression. The validity is similar to that of an ALIAS target,
      but with the additional restriction that it may not contain
      double colons. Double colons will carry the meaning of IMPORTED
      or ALIAS targets in CMake 2.8.13.
      An ALIAS target may be created for an INTERFACE library.
      At this point it can not be exported and does not appear in the
      buildsystem and project files are not created for them. That may
      be added as a feature in a later commit.
      The generators need some changes to handle the INTERFACE_LIBRARY
      targets returned by cmComputeLinkInterface::GetItems. The Ninja
      generator does not use that API, so it doesn't require changes
      related to that.
  16. 02 Aug, 2013 1 commit
    • Stephen Kelly's avatar
      Add the ALIAS target concept for libraries and executables. · 370bf554
      Stephen Kelly authored
      * The ALIAS name must match a validity regex.
      * Executables and libraries may be aliased.
      * An ALIAS acts immutable. It can not be used as the lhs
        of target_link_libraries or other commands.
      * An ALIAS can be used with add_custom_command, add_custom_target,
        and add_test in the same way regular targets can.
      * The target of an ALIAS can be retrieved with the ALIASED_TARGET
        target property.
      * An ALIAS does not appear in the generated buildsystem. It
        is kept separate from cmMakefile::Targets for that reason.
      * A target may have multiple aliases.
      * An ALIAS target may not itself have an alias.
      * An IMPORTED target may not have an alias.
      * An ALIAS may not be exported or imported.
  17. 24 Jul, 2013 1 commit
  18. 08 Jul, 2013 1 commit
    • Stephen Kelly's avatar
      TLL: Don't populate old link interface if CMP0022 is NEW. · 3e30d9ed
      Stephen Kelly authored
      Always populate the INTERFACE_LINK_LIBRARIES for interface
      entries. Don't populate the old interface properties
      if CMP0022 is NEW.
      Because the INTERFACE_LINK_LIBRARIES property is now populated by
      the target_link_libraries when operating on a static library,
      make an equivalent change which populates the property with
      the same value when the old link_libraries() command is used. This
      silences the policy warning in that case.
  19. 06 May, 2013 1 commit
  20. 13 Feb, 2013 2 commits
    • Stephen Kelly's avatar
      Don't populate INTERFACE includes and defines properties in tll. · e1f90801
      Stephen Kelly authored
      This is a partial revert of commit 77cecb77 (Add includes and compile
      definitions with target_link_libraries., 2012-11-05).
      As the interface includes and defines are now determined by the link
      closure, there is no need to populate the corresponding properties
    • Stephen Kelly's avatar
      Use the link information as a source of compile definitions and includes. · a1c4905f
      Stephen Kelly authored
      After evaluating the INTERFACE_INCLUDE_DIRECTORIES, of a target in a
      generator expression, also read the INTERFACE_INCLUDE_DIRECTORIES of
      its link interface dependencies.
      That means that code such as this will result in the 'user' target
      using /bar/include and /foo/include:
       add_library(foo ...)
       target_include_directories(foo INTERFACE /foo/include)
       add_library(bar ...)
       target_include_directories(bar INTERFACE /bar/include)
       target_link_libraries(bar LINK_PUBLIC foo)
       add_executable(user ...)
       target_include_directories(user PRIVATE
      Also process the interface include directories from direct link
      dependencies for in-build targets.
      The situation is similar for the INTERFACE_COMPILE_DEFINITIONS. The
      include directories related code is currently more complex because
      we also need to store a backtrace at configure-time for the purpose
      of debugging includes. The compile definitions related code will use
      the same pattern in the future.
      This is not a change in behavior, as existing code has the same effect,
      but that existing code will be removed in follow-up commits.
  21. 07 Feb, 2013 2 commits
  22. 31 Jan, 2013 1 commit
    • Stephen Kelly's avatar
      Add includes and compile definitions with target_link_libraries. · 77cecb77
      Stephen Kelly authored
      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.
  23. 21 Jan, 2013 1 commit
    • Stephen Kelly's avatar
      Revert "Allow target_link_libraries with IMPORTED targets." · 48a4cf21
      Stephen Kelly authored
      This reverts commit 9cfe4f1b.
      It turns out that correctly adding the content to
      the IMPORTED_LINK_INTERFACE_LIBARIES_<CONFIG> of an upstream target
      from the buildsystem of a downstream project is not simple.
      If upstream had added the INTERFACE content, the config-specific
      properties would  be determined by the DEBUG_CONFIGURATIONS of
      As downstream, we don't have any information about what
      the DEBUG_CONFIGURATIONS of upstream were, so we can't determine
      which configuration-specific properties to populate. The best we can do
      is add it to all of them or add it to the ones downstream considers to
      be DEBUG_CONFIGURATIONS, neither of which is a good solution.
      So, removing the porcelain API for that is the best approach. A human
      can still determine which properties to populate and use
      the set_property API to populate the desired properies.
      Another solution to this would be for upstream targets to publish
      what they consider DEBUG_CONFIGURATIONS, but that can be added in
      a future release.
  24. 08 Jan, 2013 1 commit
  25. 29 Sep, 2012 1 commit
    • Stephen Kelly's avatar
      Fix minor typos. · 50b1ea5b
      Stephen Kelly authored
      nothe -> note
      than -> that
      duplicat -> duplicate
      directory -> directly
      Wipe wipe -> Wipe
  26. 13 Mar, 2012 1 commit
    • Brad King's avatar
      Add OBJECT_LIBRARY target type · b87d7a60
      Brad King authored
      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
      * 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.
  27. 22 Nov, 2011 2 commits
  28. 28 Aug, 2010 1 commit
  29. 26 Aug, 2010 3 commits
  30. 01 Oct, 2009 1 commit
  31. 28 Sep, 2009 1 commit
    • Brad King's avatar
      Convert CMake to OSI-approved BSD License · 96afb120
      Brad King authored
      This converts the CMake license to a pure 3-clause OSI-approved BSD
      License.  We drop the previous license clause requiring modified
      versions to be plainly marked.  We also update the CMake copyright to
      cover the full development time range.
  32. 04 Sep, 2008 1 commit
  33. 18 Aug, 2008 1 commit
    • Brad King's avatar
      ENH: Make link interface mode more distinct · 94c1fe83
      Brad King authored
      Rename the recently added INTERFACE mode of the target_link_libraries()
      command to LINK_INTERFACE_LIBRARIES.  This makes it much more distinct
      from a normal call to the command, and clearly states its connection to
      the property of the same name.  Also require the option to appear
      immediately after the target name to make it a mode rather than an