find_package prevent usage of this tools ?
On a project with find_package, this tool provides:
[glow@arch ~/tmp/cmake_min_version]$ python cmake_min_version.py ~/dev/f3d/f3d/src/examples/
Found 25 CMake binaries from directory tools
[ 0%] CMake 3.13.5 ✘ error
CMakeLists.txt:5 (find_package)
[ 17%] CMake 3.19.8 ✘ error
CMakeLists.txt:5 (find_package)
[ 33%] CMake 3.22.6 ✘ error
CMakeLists.txt:5 (find_package)
[ 50%] CMake 3.24.3 ✘ error
CMakeLists.txt:5 (find_package)
[ 80%] CMake 3.25.2 ✘ error
CMakeLists.txt:5 (find_package)
[100%] ERROR: Could not find working version.
Not sure if this is an issue or a limitation.
It's not designed not to work, so this is a bug. Do you have any example project that exhibits this bug? Which OS are you using?
I've been try to use it an any simple project like this one:
project(check-engine)
cmake_minimum_required(VERSION 3.1)
find_package(f3d REQUIRED)
add_executable(check-engine main.cxx)
target_link_libraries(check-engine f3d::libf3d)
# make sure the libf3d API is compatible with C++11
set_target_properties(check-engine PROPERTIES CXX_STANDARD 11)
it fails on find_package
It might not be the same problem as @mwestphal, but I encountered something similar with FindPkgConfig.cmake when trying to use cmake_min_version. In my case some packages were not installed in default system locations and explicitly setting the CMAKE_PREFIX_PATH environment variable fixed the problem for me:
CMAKE_PREFIX_PATH=~/projects/foobar/prefix venv/bin/python cmake_min_version.py ~/projects/foobar/repo
Even though this worked for my case, it would be nice to be able to control what gets passed to the underlying CMakes explicitly with a script option or similar.
Even though this worked for my case, it would be nice to be able to control what gets passed to the underlying
CMakes explicitly with a script option or similar.
Do you mean command-line options or environment variables?