FindPython doesn't create Python2::Python target when configuring during build (Windows, 3.14 rc2)
First encountered at my colleague's PC at work, then reproduced by myself at home. MWE:
cmake_minimum_required(VERSION 3.12)
project(xxx)
find_package(Python2 COMPONENTS Development REQUIRED)
if(NOT TARGET Python2::Python)
message(FATAL_ERROR "NOT FOUND")
endif()
add_library(x x.cpp)
If I change CMakeLists and do a simple configure via cmake .
- everything is OK. However, if I change it and do cmake --build .
instead -- there will be no target Python2::Python
. Other find-modules seem to work just fine.
Happens to me only with 3.14 rc2 on Windows -- on ArchLinux I couldn't reproduce it neither with pre-built binaries from the website, nor with cmake-git
AUR package. Downgrading to 3.13.4 on Windows fixes the problem.