UCL / UCL/STIR

CMake 3.13 and SWIG Policy CMP0078 is not set

Open
#298 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
160
Forks
113
Avg merge
12d 15h
Merged PRs (30d)
1

Description

we now get a warning

Starting with CMake 3.13, ``UseSWIG`` generates now standard target
names. This policy provides compatibility with projects that expect the legacy
behavior.

The ``OLD`` behavior for this policy relies on
``UseSWIG_TARGET_NAME_PREFERENCE`` variable that can be used to specify an
explicit preference.  The value may be one of:

* ``LEGACY``: legacy strategy is applied. Variable
  ``SWIG_MODULE_<name>_REAL_NAME`` must be used to get real target name.
  This is the default if not specified.
* ``STANDARD``: target name matches specified name.

This policy was introduced in CMake version 3.13.  CMake version
3.13.0 warns when the policy is not set and uses ``OLD`` behavior.
Use the ``cmake_policy()`` command to set it to ``OLD`` or ``NEW``
explicitly.

we can set the policy to OLD, but need to investigate if the new mechanism will actually renaming the output.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the project's CMake configuration that uses UseSWIG and inspect the generated target names under the current policy behavior. Compare the legacy and standard naming mechanisms, then determine whether setting CMP0078 to NEW preserves the expected output names; done means the CMake warning is resolved without breaking those names.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.