CMake: reorder Python detection