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

[Build failure] MacOS: cmake error with FindBoost module #187

Open
jzw95 opened this issue Nov 10, 2024 · 0 comments
Open

[Build failure] MacOS: cmake error with FindBoost module #187

jzw95 opened this issue Nov 10, 2024 · 0 comments

Comments

@jzw95
Copy link

jzw95 commented Nov 10, 2024

I am trying to build MagicSetEditor2 on MacOS 15.1. I've tried following the instructions in the readme for building on MacOS but have had several issues which ultimately resulted in a build failure. So I'm going back to try and work through the warnings earlier on in the process in the hope that will result in a successful build. The first warning results from running cmake -DCMAKE_BUILD_TYPE=Release .. :

CMake Warning (dev) at CMakeLists.txt:9 (find_package):
  Policy CMP0167 is not set: The FindBoost module is removed.  Run "cmake
  --help-policy CMP0167" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

For context, the full output is:

-- The C compiler identification is AppleClang 16.0.0.16000026
-- The CXX compiler identification is AppleClang 16.0.0.16000026
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found wxWidgets: -L/opt/homebrew/lib;;;-framework IOKit;-framework Carbon;-framework Cocoa;-framework QuartzCore;-framework AudioToolbox;-framework System;-framework OpenGL;-lwx_osx_cocoau_core-3.2;-lwx_baseu-3.2;-lwx_baseu_net-3.2;-lwx_osx_cocoau_html-3.2 (found suitable version "3.2.6", minimum required is "3")
CMake Warning (dev) at CMakeLists.txt:9 (find_package):
  Policy CMP0167 is not set: The FindBoost module is removed.  Run "cmake
  --help-policy CMP0167" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found Boost: /opt/homebrew/lib/cmake/Boost-1.86.0/BoostConfig.cmake (found version "1.86.0") found components: regex
-- Found PkgConfig: /opt/homebrew/bin/pkg-config (found version "0.29.2")
-- Checking for module 'hunspell'
--   Found hunspell, version 1.7.2
-- Configuring done (1.4s)
-- Generating done (0.0s)
-- Build files have been written to: /Users/Jolin/Downloads/MagicSetEditor2-2.1.2/build

I ran cmake --help-policy CMP016 and got the following:

CMP0167
-------

.. versionadded:: 3.30

The ``FindBoost`` module is removed.

CMake 3.29 and below provide a ``FindBoost`` module, but it needs constant
updates to keep up with upstream Boost releases.  Upstream Boost 1.70
and above provide a ``BoostConfig.cmake`` package configuration file.
``find_package(Boost CONFIG)`` finds the upstream package directly,
without the find module.

CMake 3.30 and above prefer to not provide the ``FindBoost`` module
so that ``find_package(Boost)`` calls, without the ``CONFIG`` or
``NO_MODULE`` options, find the upstream ``BoostConfig.cmake`` directly.
This policy provides compatibility for projects that have not been ported
to use the upstream Boost package.

The ``OLD`` behavior of this policy is for ``find_package(Boost)`` to
load CMake's ``FindBoost`` module.  The ``NEW`` behavior is for
``find_package(Boost)`` to search for the upstream ``BoostConfig.cmake``.

This policy was introduced in CMake version 3.30.
It may be set by ``cmake_policy()`` or ``cmake_minimum_required()``.
If it is not set, CMake warns, and uses ``OLD`` behavior.

.. note::
  The ``OLD`` behavior of a policy is
  ``deprecated by definition``
  and may be removed in a future version of CMake.

This is now way beyond my comprehension, but my rough understanding is that the cmake config in MagicSetEditor2 is outdated for the way current versions of cmake include boost. For reference I'm using the following versions (installed using brew):

cmake: stable 3.31.0
wxwidgets: stable 3.2.6
boost: stable 1.86.0
hunspell: stable 1.7.2

For further context, when I ignore the warning and got around some directory issues in the instructions, the build failed with:

error: implicit instantiation of undefined template 'boost::hash<int>'

Which is why I think I need to sort out this warning before proceeding.

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

No branches or pull requests

1 participant