On 4/29/21 4:36 PM Bob Tolbert wrote:
> I just cloned from github and checked out the 1.3 branch. With the
> renamed VERSION file, everything builds great on macOS
>
> I tested the build on an M1 Mac as well. Looks great and the few apps I
> tried run really well.
Thanks for the feedback and this additional test.
> There is a single change people can make on macOS to allow building a
> "universal" app. I added this one line in "cmake/Setup.cmake"
> $ git diff
> ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
> modified: CMake/setup.cmake
> ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
> @ CMake/setup.cmake:25 @
> set (EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/bin)
> set (LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/lib)
> set (ARCHIVE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/lib)
> *set (CMAKE_OSX_ARCHITECTURES "arm64;x86_64")*
>
> # Search for modules in the FLTK source dir first
> set (CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake")
>
> and after a rebuild, you can see the results are fat binaries:
> ...
Thanks for this hint as well.
Setting CMAKE_OSX_ARCHITECTURES is the right variable but I do /not/
recommend to change setup.cmake and such a change will not be
incorporated in the official sources (because it would overwrite the
cache variable).
A better way to achieve this is to set the cache variable
CMAKE_OSX_ARCHITECTURES either in the CMake GUI or on the commandline:
Comments are owned by the poster. All other content is copyright 1998-2025 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.