Why do I get "not finding compatible version with requested version ''"?

I’m trying to build tesseract repo on Windows 10 22H2.

I was told to use colcon to build the repo. I’m new to colcon and cmake. I cloned the repo to C:\Temp\colcon_ws\src and ran colcon build from x64 Native Tools Command Prompt for VS 2022 terminal. But, I get the cmake error below.
Even if I use Cmake-Gui I still get that error message.

What could be wrong?

C:\Temp\colcon_ws>call install\local_setup.bat
C:\Temp\colcon_ws>colcon build
Starting >>> ros_industrial_cmake_boilerplate
Finished <<< ros_industrial_cmake_boilerplate [0.81s]
Starting >>> tesseract_common
--- stderr: tesseract_common
CMake Error at CMakeLists.txt:4 (find_package):
  Could not find a configuration file for package
  "ros_industrial_cmake_boilerplate" that is compatible with requested
  version "".

  The following configuration files were considered but not accepted:

    C:/Temp/colcon_ws/install/ros_industrial_cmake_boilerplate/lib/cmake/ros_industrial_cmake_boilerplate/ros_industrial_cmake_boilerplate-config.cmake, version: 0.4.6 (64bit)

Failed   <<< tesseract_common [0.20s, exited with code 1]

Summary: 1 package finished [1.50s]
  1 package failed: tesseract_common
  1 package had stderr output: tesseract_common
  10 packages not processed
WNDPROC return value cannot be converted to LRESULT
TypeError: WPARAM is simple, so must be an int object (got NoneType)


FYI, I was, however, able to build that repo on Linux. So, the problem has to be with how I use the cmake on Windows.

I think you’re probably in a 32bit build and it finds a 64bit build and (rightly) rejects it. Can you confirm that you’re trying to build your code in 64bit.

But, I start x64 Native Tools Command Prompt for VS 2022 terminal which is x64. What am I missing?

I see that, but can you check to see what CMake ends up finding? It should be the 64-bit version, but maybe something else in the env is confusing it.

Another thing to try is passing --debug-find to CMake. Maybe that will help?

I added --debug-find flag to CMake-GUI (instead of x64 Native Tools Command Prompt for VS 2022 terminal) and it still gives me the same message. No new verbos text. To add --debug-find flag in CMake-GUI CMAKE_MESSAGE_LOG_LEVEL and CMAKE_DEBUG_FIND_PACKAGE entries as shown in the image.
How do I check to see what CMake ends up finding?

The logs can be downloaded here

Maybe, use “project()” before “find_package()” will fix this? Idk the reason, but I solved this problem, at least for now.

Oh, that’s probably on the CMAKE_SIZEOF_VOID_P check that (I think) gets generated in the compatibility checks for packages.