Open mjvankampen opened 2 years ago
An easy fix on CMake >= 3.21 would be to add NO_CACHE
option to find_program
calls: https://cmake.org/cmake/help/latest/command/find_program.html. There should be no reason to store the path to Conan-built flatc in the CMake cache.
Otherwise, why is the find_program(... PATHS "${CMAKE_CURRENT_LIST_DIR}/../../bin/" NO_DEFAULT_PATH)
call even needed if we already know both the path and the executable name? I think it could be replaced with something like
set(FLATBUFFERS_FLATC_EXECUTABLE "${CMAKE_CURRENT_LIST_DIR}/../../bin/flatc${CMAKE_EXECUTABLE_SUFFIX}"
This is a regression since https://github.com/conan-io/conan-center-index/pull/9292, when the find_program
calls were introduced.
Package and Environment Details
Conan profile
No response
Steps to reproduce
Change between flatbuffer version without deleting cache. Updated flatbuffers package is detected, but the FLATBUFFERS_FLATC_EXECUTABLE is not updated. I guess as
flatbuffers::flatc
still exists.Logs
No response