microsoft / vcpkg

C++ Library Manager for Windows, Linux, and MacOS
MIT License
22.94k stars 6.34k forks source link

[cgal] fails to compile with qt #36409

Closed acgetchell closed 8 months ago

acgetchell commented 8 months ago

Describe the bug CGAL/Qt/GraphicsViewerNavigation_impl.h fails to compile with "boost/format.hpp" file not found

Environment

To Reproduce Steps to reproduce the behavior:

  1. Update vcpkg to 7032c5759f823fc8699a5c37d5f7072464ccb9a8
  2. Run the build script.

Note:

https://github.com/acgetchell/CDT-plusplus/blob/develop/vcpkg.json

(CGAL has enabled qt on macOS)

Expected behavior Compiles and runs, as with previous commits to vcpkg.

Failure logs

adam@VVKVM625QC ~/projects/CDT-plusplus/scripts (develop) $ ./build.sh 
Preset CMake variables:

  CMAKE_BUILD_TYPE="RelWithDebInfo"
  CMAKE_CXX_EXTENSIONS="OFF"
  CMAKE_CXX_STANDARD="20"
  CMAKE_CXX_STANDARD_REQUIRED="ON"
  ENABLE_CACHE="ON"
  ENABLE_TESTING:BOOL="TRUE"

-- Running vcpkg install
Detecting compiler hash for triplet arm64-osx...
All requested packages are currently installed.
Total install time: 125 ns
eigen3 provides CMake targets:

  # this is heuristically generated, and may not be correct
  find_package(Eigen3 CONFIG REQUIRED)
  target_link_libraries(main PRIVATE Eigen3::Eigen)

eigen3 provides pkg-config modules:

    # A C++ template library for linear algebra: vectors, matrices, and related algorithms
    eigen3

The package cgal provides CMake targets:

    find_package(CGAL CONFIG REQUIRED)
    target_link_libraries(main PRIVATE CGAL::CGAL)

date provides CMake targets:

    find_package(date CONFIG REQUIRED)
    target_link_libraries(main PRIVATE date::date date::date-tz)

docopt provides CMake targets:

  # this is heuristically generated, and may not be correct
  find_package(docopt CONFIG REQUIRED)
  target_link_libraries(main PRIVATE docopt_s)

doctest provides CMake targets:

  # this is heuristically generated, and may not be correct
  find_package(doctest CONFIG REQUIRED)
  target_link_libraries(main PRIVATE doctest::doctest)

The package fmt provides CMake targets:

    find_package(fmt CONFIG REQUIRED)
    target_link_libraries(main PRIVATE fmt::fmt)

    # Or use the header-only version
    find_package(fmt CONFIG REQUIRED)
    target_link_libraries(main PRIVATE fmt::fmt-header-only)

ms-gsl provides CMake targets:

  # this is heuristically generated, and may not be correct
  find_package(Microsoft.GSL CONFIG REQUIRED)
  target_link_libraries(main PRIVATE Microsoft.GSL::GSL)

pcg is header-only and can be used from CMake via:

    find_path(PCG_INCLUDE_DIRS "pcg_extras.hpp")
    target_include_directories(main PRIVATE ${PCG_INCLUDE_DIRS})

The package spdlog provides CMake targets:

    find_package(spdlog CONFIG REQUIRED)
    target_link_libraries(main PRIVATE spdlog::spdlog)

    # Or use the header-only version
    find_package(spdlog CONFIG REQUIRED)
    target_link_libraries(main PRIVATE spdlog::spdlog_header_only)

tbb provides CMake targets:

  # this is heuristically generated, and may not be correct
  find_package(TBB CONFIG REQUIRED)
  target_link_libraries(main PRIVATE TBB::tbb TBB::tbbmalloc)

tbb provides pkg-config modules:

    # C++ library for parallel programming on multi-core processors.
    tbb

tl-expected provides CMake targets:

  # this is heuristically generated, and may not be correct
  find_package(tl-expected CONFIG REQUIRED)
  target_link_libraries(main PRIVATE tl::expected)

tl-function-ref is header-only and can be used from CMake via:

    find_path(TL_FUNCTION_REF_INCLUDE_DIRS "tl/function_ref.hpp")
    target_include_directories(main PRIVATE ${TL_FUNCTION_REF_INCLUDE_DIRS})

-- Running vcpkg install - done
-- The CXX compiler identification is AppleClang 15.0.0.15000100
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- ccache found and enabled
-- Using header-only CGAL
-- Targeting Ninja
-- Using /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ compiler.
CMake Warning (dev) at vcpkg_installed/arm64-osx/share/cgal/CGAL_GeneratorSpecificSettings.cmake:42 (exec_program):
  Policy CMP0153 is not set: The exec_program command should not be called.
  Run "cmake --help-policy CMP0153" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.

  Use execute_process() instead.
Call Stack (most recent call first):
  vcpkg_installed/arm64-osx/share/cgal/FindGMP.cmake:11 (include)
  /Users/adam/projects/vcpkg/scripts/buildsystems/vcpkg.cmake:859 (_find_package)
  vcpkg_installed/arm64-osx/share/cgal/CGAL_SetupGMP.cmake:24 (find_package)
  vcpkg_installed/arm64-osx/share/cgal/CGAL_SetupCGALDependencies.cmake:37 (include)
  vcpkg_installed/arm64-osx/share/cgal/CGALConfig.cmake:168 (include)
  /Users/adam/projects/vcpkg/scripts/buildsystems/vcpkg.cmake:859 (_find_package)
  CMakeLists.txt:79 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Running in macOS DARWIN_VERSION=23
-- Found GMP: /Users/adam/projects/CDT-plusplus/vcpkg_installed/arm64-osx/lib/libgmp.a  
-- Found MPFR: /Users/adam/projects/CDT-plusplus/vcpkg_installed/arm64-osx/lib/libmpfr.a  
-- Found Boost: /Users/adam/projects/CDT-plusplus/vcpkg_installed/arm64-osx/include (found suitable version "1.84.0", minimum required is "1.66")  
-- Boost include dirs: /Users/adam/projects/CDT-plusplus/vcpkg_installed/arm64-osx/include
-- Boost libraries:    
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Building tests. Look at /tests for unit tests.
-- Look at /tests/logs for spdlog results from unit tests.
These logs can get quite big in DEBUG mode if you run all tests.
-- Configuring done (7.9s)
-- Generating done (0.1s)
-- Build files have been written to: /Users/adam/projects/CDT-plusplus/build
[36/85] Building CXX object CMakeFiles/CGAL_Qt5_moc_and_resources.dir/CGAL_Qt5_moc_and_resources_autogen/mocs_compilation.cpp.o
FAILED: CMakeFiles/CGAL_Qt5_moc_and_resources.dir/CGAL_Qt5_moc_and_resources_autogen/mocs_compilation.cpp.o 
/opt/homebrew/bin/ccache /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -DCGAL_TRIANGULATION_NO_ASSERTIONS -DCGAL_TRIANGULATION_NO_POSTCONDITIONS -DCGAL_USE_GMPXX=1 -DEIGEN_HAS_STD_RESULT_OF=0 -DQT_ACCESSIBILITY_SUPPORT_LIB -DQT_CLIPBOARD_SUPPORT_LIB -DQT_CORE_LIB -DQT_FONTDATABASE_SUPPORT_LIB -DQT_GRAPHICS_SUPPORT_LIB -DQT_GUI_LIB -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_THEME_SUPPORT_LIB -DQT_WIDGETS_LIB -D_HAS_DEPRECATED_RESULT_OF=1 -I/Users/adam/projects/CDT-plusplus/build/CGAL_Qt5_moc_and_resources_autogen/include -I/Users/adam/projects/CDT-plusplus/include -I/Users/adam/projects/CDT-plusplus/build -isystem /Users/adam/projects/CDT-plusplus/vcpkg_installed/arm64-osx/include -isystem /Users/adam/projects/CDT-plusplus/vcpkg_installed/arm64-osx/include/qt5 -isystem /Users/adam/projects/CDT-plusplus/vcpkg_installed/arm64-osx/include/qt5/QtWidgets -isystem /Users/adam/projects/CDT-plusplus/vcpkg_installed/arm64-osx/include/qt5/QtGui -isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/System/Library/Frameworks/OpenGL.framework/Headers -isystem /Users/adam/projects/CDT-plusplus/vcpkg_installed/arm64-osx/include/qt5/QtCore -isystem /Users/adam/projects/CDT-plusplus/vcpkg_installed/arm64-osx/tools/qt5/mkspecs/macx-clang -isystem /Users/adam/projects/CDT-plusplus/vcpkg_installed/arm64-osx/include/qt5/QtAccessibilitySupport -isystem /Users/adam/projects/CDT-plusplus/vcpkg_installed/arm64-osx/include/qt5/QtThemeSupport -isystem /Users/adam/projects/CDT-plusplus/vcpkg_installed/arm64-osx/include/qt5/QtFontDatabaseSupport -isystem /Users/adam/projects/CDT-plusplus/vcpkg_installed/arm64-osx/include/qt5/QtGraphicsSupport -isystem /Users/adam/projects/CDT-plusplus/vcpkg_installed/arm64-osx/include/qt5/QtPrintSupport -isystem /Users/adam/projects/CDT-plusplus/vcpkg_installed/arm64-osx/include/qt5/QtClipboardSupport -isystem /Users/adam/projects/CDT-plusplus/vcpkg_installed/arm64-osx/include/qt5/QtSvg -isystem /Users/adam/projects/CDT-plusplus/vcpkg_installed/arm64-osx/include/qt5/QtOpenGL -O2 -g -DNDEBUG -std=c++20 -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk -fPIC -fPIC -MD -MT CMakeFiles/CGAL_Qt5_moc_and_resources.dir/CGAL_Qt5_moc_and_resources_autogen/mocs_compilation.cpp.o -MF CMakeFiles/CGAL_Qt5_moc_and_resources.dir/CGAL_Qt5_moc_and_resources_autogen/mocs_compilation.cpp.o.d -o CMakeFiles/CGAL_Qt5_moc_and_resources.dir/CGAL_Qt5_moc_and_resources_autogen/mocs_compilation.cpp.o -c /Users/adam/projects/CDT-plusplus/build/CGAL_Qt5_moc_and_resources_autogen/mocs_compilation.cpp
In file included from /Users/adam/projects/CDT-plusplus/build/CGAL_Qt5_moc_and_resources_autogen/mocs_compilation.cpp:2:
In file included from /Users/adam/projects/CDT-plusplus/build/CGAL_Qt5_moc_and_resources_autogen/A466UN3NGB/moc_DemosMainWindow.cpp:10:
In file included from /Users/adam/projects/CDT-plusplus/build/CGAL_Qt5_moc_and_resources_autogen/A466UN3NGB/../../../vcpkg_installed/arm64-osx/include/CGAL/Qt/DemosMainWindow.h:130:
In file included from /Users/adam/projects/CDT-plusplus/vcpkg_installed/arm64-osx/include/CGAL/Qt/DemosMainWindow_impl.h:23:
In file included from /Users/adam/projects/CDT-plusplus/vcpkg_installed/arm64-osx/include/CGAL/Qt/GraphicsViewNavigation.h:69:
/Users/adam/projects/CDT-plusplus/vcpkg_installed/arm64-osx/include/CGAL/Qt/GraphicsViewNavigation_impl.h:27:10: fatal error: 'boost/format.hpp' file not found
#include <boost/format.hpp>
         ^~~~~~~~~~~~~~~~~~
1 error generated.
[47/85] Building CXX object src/CMakeFiles/cdt-viewer.dir/cdt-viewer.cpp.o
ninja: build stopped: subcommand failed.

Additional context This has worked on previous commits.

JonLiu1993 commented 8 months ago

confirm:

ces_autogen/mocs_compilation.cpp
In file included from /Users/vcpkg/Jon/CDT-plusplus/build/CGAL_Qt5_moc_and_resources_autogen/mocs_compilation.cpp:2:
In file included from /Users/vcpkg/Jon/CDT-plusplus/build/CGAL_Qt5_moc_and_resources_autogen/A466UN3NGB/moc_DemosMainWindow.cpp:10:
In file included from /Users/vcpkg/Jon/CDT-plusplus/build/CGAL_Qt5_moc_and_resources_autogen/A466UN3NGB/../../../vcpkg_installed/arm64-osx/include/CGAL/Qt/DemosMainWindow.h:130:
In file included from /Users/vcpkg/Jon/CDT-plusplus/vcpkg_installed/arm64-osx/include/CGAL/Qt/DemosMainWindow_impl.h:23:
In file included from /Users/vcpkg/Jon/CDT-plusplus/vcpkg_installed/arm64-osx/include/CGAL/Qt/GraphicsViewNavigation.h:69:
/Users/vcpkg/Jon/CDT-plusplus/vcpkg_installed/arm64-osx/include/CGAL/Qt/GraphicsViewNavigation_impl.h:27:10: fatal error: 'boost/format.hpp' file not found
#include <boost/format.hpp>
         ^~~~~~~~~~~~~~~~~~
1 error generated.
[18/85] Building CXX object tests/CMakeFiles/CDT_unit_tests.dir/Manifold_test.cpp.o
ninja: build stopped: subcommand failed.
Test project /Users/vcpkg/Jon/CDT-plusplus/build
      Start  1: cdt-unit-tests
Could not find executable /Users/vcpkg/Jon/CDT-plusplus/build/tests/CDT_unit_tests
Looked in the following places:
acgetchell commented 8 months ago

Thanks, I can verify it's fixed in 710677da49b03885c65c8b5ca43072d4b1acde75