From 6de27fe77a02509e8455e3fd1ee45e6620b15815 Mon Sep 17 00:00:00 2001 From: Matt Young Date: Tue, 20 Dec 2022 04:08:21 +0100 Subject: [PATCH 1/2] More tweaks to Mac build --- CMakeLists.txt | 64 +++++++++++++++++++++++++++++++++++--------------- 1 file changed, 45 insertions(+), 19 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 340f4428b..dc94ec4c4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -96,12 +96,25 @@ cmake_policy(VERSION 3.16) # numbers via it (rather than manually setting individual major/minor/patch vars). cmake_policy(SET CMP0048 NEW) +#======================================================================================================================= +#================================================ Other preliminaries ================================================= +#======================================================================================================================= +# Set the target binary architecture for targets on macOS +if(APPLE AND NOT CMAKE_OSX_ARCHITECTURES) + # Per https://cmake.org/cmake/help/latest/variable/CMAKE_OSX_ARCHITECTURES.html, "the value of this variable should + # be set prior to the first project() or enable_language() command invocation because it may influence configuration + # of the toolchain and flags". + set(CMAKE_OSX_ARCHITECTURES x86_64) # Build intel 64-bit binary. + #set(CMAKE_OSX_ARCHITECTURES i386 x86_64) # Build intel binary. + #set(CMAKE_OSX_ARCHITECTURES ppc i386 ppc64 x86_64) # Build universal binary. +endif() + #======================================================================================================================= #============================================== Project name and Version =============================================== #======================================================================================================================= # It's simplest to keep the project name all lower-case as it means we can use a lot more of the default settings for # Linux packaging (where directory names etc are expected to be all lower-case) -project(brewtarget VERSION 3.0.4 LANGUAGES CXX) +project(brewtarget VERSION 3.0.5 LANGUAGES CXX) message(STATUS "Building ${PROJECT_NAME} version ${PROJECT_VERSION}") message(STATUS "PROJECT_SOURCE_DIR is ${PROJECT_SOURCE_DIR}") # Sometimes we do need the capitalised version of the project name @@ -215,6 +228,11 @@ set(fileName_unitTestRunner "${PROJECT_NAME}_tests") #======================================================================================================================= # This is needed to enable the add_test() command enable_testing() +if (APPLE) + # On Mac we ask CMake to try to find static libraries when available -- because it's so painful shipping dynamic + # libraries in a Bundle. + set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) +endif() #======================================================================================================================= #=============================================== Installation Components =============================================== @@ -288,13 +306,6 @@ if(WIN32) set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++ -static") endif() -# Mac-specific compilation settings -if(APPLE AND NOT CMAKE_OSX_ARCHITECTURES) - set(CMAKE_OSX_ARCHITECTURES x86_64) # Build intel 64-bit binary. - #set(CMAKE_OSX_ARCHITECTURES i386 x86_64) # Build intel binary. - #set(CMAKE_OSX_ARCHITECTURES ppc i386 ppc64 x86_64) # Build universal binary. -endif() - if(APPLE) # As explained at https://stackoverflow.com/questions/5582211/what-does-define-gnu-source-imply, defining _GNU_SOURCE # gives access to various non-standard GNU/Linux extension functions and changes the behaviour of some POSIX @@ -461,15 +472,15 @@ if(WIN32) #================================================= Windows Qt Stuff ================================================= #==================================================================================================================== # .:TBD:. Not sure whether/why we need these additional Qt components on Windows - find_package(Qt5MultimediaWidgets REQUIRED) - find_package(Qt5OpenGL REQUIRED) + #find_package(Qt5MultimediaWidgets REQUIRED) + #find_package(Qt5OpenGL REQUIRED) +# get_target_property(QtMultimediaWidgets_location Qt5::MultimediaWidgets LOCATION_${CMAKE_BUILD_TYPE}) +# get_target_property(QtOpenGL_location Qt5::OpenGL LOCATION_${CMAKE_BUILD_TYPE}) get_target_property(QtCore_location Qt5::Core LOCATION_${CMAKE_BUILD_TYPE}) get_target_property(QtGui_location Qt5::Gui LOCATION_${CMAKE_BUILD_TYPE}) get_target_property(QtMultimedia_location Qt5::Multimedia LOCATION_${CMAKE_BUILD_TYPE}) - get_target_property(QtMultimediaWidgets_location Qt5::MultimediaWidgets LOCATION_${CMAKE_BUILD_TYPE}) get_target_property(QtNetwork_location Qt5::Network LOCATION_${CMAKE_BUILD_TYPE}) - get_target_property(QtOpenGL_location Qt5::OpenGL LOCATION_${CMAKE_BUILD_TYPE}) get_target_property(QtPrintSupport_location Qt5::PrintSupport LOCATION_${CMAKE_BUILD_TYPE}) get_target_property(QtQgif_location Qt5::QGifPlugin LOCATION_${CMAKE_BUILD_TYPE}) get_target_property(QtQico_location Qt5::QICOPlugin LOCATION_${CMAKE_BUILD_TYPE}) @@ -488,9 +499,9 @@ if(WIN32) set(Qt_DLLs ${QtCore_location} ${QtGui_location} ${QtMultimedia_location} - ${QtMultimediaWidgets_location} +# ${QtMultimediaWidgets_location} ${QtNetwork_location} - ${QtOpenGL_location} +# ${QtOpenGL_location} ${QtPrintSupport_location} ${QtSql_location} ${QtSvg_location} @@ -665,16 +676,21 @@ message("Backtrace libs " ${DL_LIBRARY} " | " ${Backtrace_LIBRARIES} " | " ${Boo find_package(XercesC REQUIRED) include_directories(${XercesC_INCLUDE_DIRS}) # Uncomment the next two lines if you want to find where Xerces headers and DLLs are on your system -#message("Xerces-C++ include directories: " ${XercesC_INCLUDE_DIRS}) -#message("Xerces-C++ libraries: " ${XercesC_LIBRARIES}) +message("Xerces-C++ include directories: ${XercesC_INCLUDE_DIRS}") +message("Xerces-C++ libraries: ${XercesC_LIBRARIES}") #==================================================== Find Xalan-C++ =================================================== # Same comments apply here as for Xerces above find_package(XalanC REQUIRED) include_directories(${XalanC_INCLUDE_DIRS}) # Uncomment the next two lines if you want to find where Xalan headers and DLLs are on your system -#message("Xalan-C++ include directories: " ${XalanC_INCLUDE_DIRS}) -#message("Xalan-C++ libraries: " ${XalanC_LIBRARIES}) +message("Xalan-C++ include directories: ${XalanC_INCLUDE_DIRS}") +message("Xalan-C++ libraries: ${XalanC_LIBRARIES}") + +if(APPLE) +# TBD: Is this also needed when static linking Xerces on MacOS? +find_package(CURL REQUIRED) +endif() #========================================= Find MinGW (only needed on Windows) ========================================= if(WIN32) @@ -1104,6 +1120,17 @@ set(appAndTestCommonLibraries ${XalanC_LIBRARIES} ${XercesC_LIBRARIES} ) +if(APPLE) + # Static linking Xerces and Xalan on MacOS means we have to explicitly say what libraries and frameworks they in turn + # depend on. It would be neat to find some automated tool that does this for us. + list(APPEND appAndTestCommonLibraries CURL::libcurl + "-framework CoreFoundation" + "-framework CoreServices" + "-framework Carbon" + "-framework Foundation" + "-framework Cocoa" + "-framework ApplicationServices") +endif() foreach(qtComponent IN LISTS qtCommonComponents) list(APPEND appAndTestCommonLibraries "Qt5::${qtComponent}") endforeach() @@ -1115,7 +1142,6 @@ target_link_libraries(${fileName_executable} ${appAndTestCommonLibraries}) # files in there (see below). add_executable(${fileName_unitTestRunner} ${repoDir}/src/unitTests/Testing.cpp - ${testing_MOC_SRCS} $) set_target_properties(${fileName_unitTestRunner} PROPERTIES RUNTIME_OUTPUT_DIRECTORY bin) From 8ff74657e815ea50b8bd4888ee0404ac69854748 Mon Sep 17 00:00:00 2001 From: Matt Young Date: Tue, 20 Dec 2022 08:56:21 +0100 Subject: [PATCH 2/2] Updated changelog for next patch release --- CHANGES.markdown | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/CHANGES.markdown b/CHANGES.markdown index 694cc7a1a..faab19d8e 100644 --- a/CHANGES.markdown +++ b/CHANGES.markdown @@ -11,6 +11,21 @@ format therein). * We'll list new features here... +## v3.0.5 +Minor bug fixes for the 3.0.4 release (ie bugs in 3.0.5 are fixed in this 3.0.5 release). + +### New Features + +* None + +### Bug Fixes +* macOS release v3.0.3 is damaged [#679](https://github.com/Brewtarget/brewtarget/issues/679) +* Boil Time not saved when you edit a copied recipe [#688](https://github.com/Brewtarget/brewtarget/issues/688) +* Imported recipes are inconsistent and inaccurate [#689](https://github.com/Brewtarget/brewtarget/issues/689) + +### Release Timestamp +Tue, 20 Dec 2022 09:03:12 +0100 + ## v3.0.4 Minor bug fixes for the 3.0.3 release (ie bugs in 3.0.3 are fixed in this 3.0.4 release).