Skip to content

fix: unset imported config mappings before finding Python - #161

Open
Illustar0 wants to merge 1 commit into
ModOrganizer2:masterfrom
Illustar0:fix/python-imported-config-mapping
Open

Illustar0 wants to merge 1 commit into
ModOrganizer2:masterfrom
Illustar0:fix/python-imported-config-mapping

Conversation

@Illustar0

Copy link
Copy Markdown

I ran into a build failure when building plugin_python with RelWithDebInfo:

LINK : fatal error LNK1104: cannot open file 'Python::Module-NOTFOUND.obj'

CMake also reported CMP0111 warnings for Python::Module and Python::Python, indicating that their imported locations were not available for the RelWithDebInfo configuration.

The existing code temporarily clears CMAKE_MAP_IMPORTED_CONFIG_* before calling find_package(Python). This change uses unset() instead of assigning an empty string, so those variables are not defined while the Python imported targets are created.

With this change, the plugin_python build succeeds in my environment.

Tested with:

  • CMake 4.4.3
  • Python 3.13.15
  • Visual Studio 2022 / v143
  • RelWithDebInfo

I'm not sure whether this affects other CMake/Python combinations, but this seems to better match the intent of temporarily disabling the imported configuration mappings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant