Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STIRConfig.cmake Find Boost package versioning error #1541

Closed
robbietuk opened this issue Nov 20, 2024 · 2 comments · Fixed by #1543
Closed

STIRConfig.cmake Find Boost package versioning error #1541

robbietuk opened this issue Nov 20, 2024 · 2 comments · Fixed by #1543
Assignees
Labels
Milestone

Comments

@robbietuk
Copy link
Collaborator

Build a project that uses STIR as a package via find_package(STIR 6.0 REQUIRED CONFIG) I get the following error:

CMake Error at C:/Program Files/JetBrains/CLion 2024.1.5/bin/cmake/win/x64/share/cmake-3.29/Modules/FindBoost.cmake:1654 (message):
  When requesting a specific version of Boost, you must provide at least the
  major and minor version numbers, e.g., 1.34
Call Stack (most recent call first):
  ${STIR_out}/install/x64-Release/lib/cmake/STIR-6.2/STIRConfig.cmake:106 (find_package)
  CMakeLists.txt:49 (find_package)


CMake Error at C:/Program Files/JetBrains/CLion 2024.1.5/bin/cmake/win/x64/share/cmake-3.29/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find Boost (missing: Boost_INCLUDE_DIR) (Required is at least
  version "108200")
Call Stack (most recent call first):
  C:/Program Files/JetBrains/CLion 2024.1.5/bin/cmake/win/x64/share/cmake-3.29/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
  C:/Program Files/JetBrains/CLion 2024.1.5/bin/cmake/win/x64/share/cmake-3.29/Modules/FindBoost.cmake:2393 (find_package_handle_standard_args)
  ${STIR_out}/install/x64-Release/lib/cmake/STIR-6.2/STIRConfig.cmake:106 (find_package)
  CMakeLists.txt:49 (find_package)


-- Configuring incomplete, errors 

It seems the issue stems from

find_package(Boost @Boost_VERSION@ REQUIRED)

which was introduced by #1536

The line at lib/cmake/STIR-6.2/STIRConfig.cmake:106 is set to find_package(Boost 108200 REQUIRED) which has the wrong version formatting.

Replacing the line in the installed STIRConfig.cmake file with find_package(Boost 1.82.0 REQUIRED) allows the project to compile.

It seems the variable in find_package(Boost @Boost_VERSION@ REQUIRED) is incorrect.

@KrisThielemans
Copy link
Collaborator

Can you try @Boost_VERSION_STRING?

@robbietuk
Copy link
Collaborator Author

Can you try @Boost_VERSION_STRING?

Thank you. See #1543

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants