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

Backport commits from dev to jan24_patches #558

Open
wants to merge 4 commits into
base: jan24_patches
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion FairSoftConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# Where to install the packages contained in FairSoft. FairRoot may find this FairSoft
# via the environment variable SIMPATH.
#
set(CMAKE_INSTALL_PREFIX "${CMAKE_SOURCE_DIR}/install" CACHE PATH "Install prefix" FORCE)
set(CMAKE_INSTALL_PREFIX "${CMAKE_SOURCE_DIR}/install" CACHE PATH "Install prefix")
# set(CMAKE_INSTALL_PREFIX "/some/other/path" CACHE PATH "Install prefix" FORCE)

# Note: Defaults are effective even if the option is not set explicitely in this file.
Expand Down
11 changes: 10 additions & 1 deletion cmake/legacy.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -374,13 +374,19 @@ else()
unset(root_cocoa)
set(root_x11 ON)
endif()
find_package(nlohmann_json 3.9)
if(nlohmann_json_FOUND)
set(root_builtin_nlohmannjson "-Dbuiltin_nlohmannjson=OFF")
else()
set(root_builtin_nlohmannjson "-Dbuiltin_nlohmannjson=ON")
endif()

ExternalProject_Add(root
GIT_REPOSITORY https://github.com/root-project/root/ GIT_TAG v${root_version_gittag}
GIT_SHALLOW 1
${CMAKE_DEFAULT_ARGS} CMAKE_ARGS
"-Daqua=ON"
"-Dasimage=ON"
"-Dbuiltin_nlohmannjson=ON"
"-Dcintex=OFF"
"-Ddavix=OFF"
"-Dfftw3=ON"
Expand All @@ -394,6 +400,7 @@ ExternalProject_Add(root
"-Dmlp=ON"
"-Dpyroot=ON"
"-Dpythia6=ON"
"-Dpythia8=ON"
"-Dreflex=OFF"
"-Droofit=ON"
"-Druntime_cxxmodules=OFF"
Expand All @@ -410,9 +417,11 @@ ExternalProject_Add(root
${cmake_python_config}
${cmake_python_config_old}
${root_builtin_glew}
${root_builtin_nlohmannjson}
${root_cocoa}
UPDATE_DISCONNECTED ON
PATCH_COMMAND ${patch} -p1 -i "${CMAKE_SOURCE_DIR}/legacy/root/fix_macos_sdk_mismatch.patch"
COMMAND ${patch} -p1 -i "${CMAKE_SOURCE_DIR}/legacy/root/fix_macosx_findOpenGL.patch"
DEPENDS pythia6 pythia8 vc ${extract_source_cache_target}
${LOG_TO_FILE}
)
Expand Down
32 changes: 32 additions & 0 deletions legacy/root/fix_macosx_findOpenGL.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
diff --git a/cmake/modules/SearchInstalledSoftware.cmake b/cmake/modules/SearchInstalledSoftware.cmake
index 682de46f27..57addbc948 100644
--- a/cmake/modules/SearchInstalledSoftware.cmake
+++ b/cmake/modules/SearchInstalledSoftware.cmake
@@ -565,6 +565,17 @@ find_package(Python3 3.8 COMPONENTS ${python_components})
#---Check for OpenGL installation-------------------------------------------------------
if(opengl)
message(STATUS "Looking for OpenGL")
+ # Search for the OpenGL installation first in the system.
+ # OpenGL installed via brew (mesa, mesa-glu) and X11 seems not to work
+ # properly so it is needed to use the system version.
+ # CMAKE_FIND_FRAMEWORK defines the search order on macosx which as
+ # default is search first for frameworks.
+ # ROOT changes the order to search last for the framework.
+ # Temporarely change the search order for OpenGL.
+ if(APPLE)
+ set(frame_temp ${CMAKE_FIND_FRAMEWORK})
+ set(CMAKE_FIND_FRAMEWORK FIRST)
+ endif()
find_package(OpenGL)
if(NOT OPENGL_FOUND OR NOT OPENGL_GLU_FOUND)
if(fail-on-missing)
@@ -574,6 +585,9 @@ if(opengl)
set(opengl OFF CACHE BOOL "Disabled because OpenGL (with GLU) not found (${opengl_description})" FORCE)
endif()
endif()
+ if (APPLE)
+ set(CMAKE_FIND_FRAMEWORK ${frame_temp})
+ endif()
endif()
# OpenGL should be working only with x11 (Linux),
# in case when -Dall=ON -Dx11=OFF, we will just disable opengl.