Skip to content

Commit

Permalink
build/cmake/createCMakeLists.py - for MAMBA_BUILD do not search for p…
Browse files Browse the repository at this point in the history
…ackages
  • Loading branch information
mike-dixon committed Nov 11, 2024
1 parent fbcd4fb commit 552fe42
Show file tree
Hide file tree
Showing 7 changed files with 183 additions and 189 deletions.
89 changes: 44 additions & 45 deletions build/cmake/createCMakeLists.py
Original file line number Diff line number Diff line change
Expand Up @@ -607,11 +607,11 @@ def writeCMakeListsCodebase(dir):

fo.write('if (DEFINED MAMBA_BUILD)\n')
fo.write('# MAMBA builds ignore system includes and libs, use mamba dirs\n')
fo.write(' set(MAMBA_INCLUDE_PATH ${MINIFORGE_ROOT}/include)\n')
fo.write(' set(MAMBA_LIBRARY_PATH ${MINIFORGE_ROOT}/lib)\n')
fo.write(' set(QT_HOST_PATH ${MINIFORGE_ROOT})\n')
fo.write(' set(CMAKE_FIND_USE_CMAKE_SYSTEM_PATH FALSE)\n')
fo.write(' set(CMAKE_SYSTEM_IGNORE_PREFIX_PATH "/usr;/usr/local;/usr/lib64;/lib;/lib64;/opt/homebrew")\n')
fo.write('set(MAMBA_INCLUDE_PATH ${MINIFORGE_ROOT}/include)\n')
fo.write('set(MAMBA_LIBRARY_PATH ${MINIFORGE_ROOT}/lib)\n')
fo.write('set(QT_HOST_PATH ${MINIFORGE_ROOT})\n')
fo.write('set(CMAKE_FIND_USE_CMAKE_SYSTEM_PATH FALSE)\n')
fo.write('set(CMAKE_SYSTEM_IGNORE_PREFIX_PATH "/usr;/usr/local;/usr/lib64;/lib;/lib64;/opt/homebrew")\n')
fo.write("endif(DEFINED MAMBA_BUILD)\n")
fo.write('\n')

Expand All @@ -623,6 +623,8 @@ def writeCMakeListsCodebase(dir):
fo.write('\n')

if (globalNeedQt):
fo.write('if (NOT DEFINED MAMBA_BUILD)\n')
fo.write('# MAMBA builds ignore system libs, use mamba libs\n')
fo.write('# Finding Qt\n')
fo.write('\n')
fo.write('find_package (Qt6 COMPONENTS Core QUIET)\n')
Expand All @@ -639,23 +641,21 @@ def writeCMakeListsCodebase(dir):
fo.write('\n')

fo.write('if(APPLE)\n')
fo.write(' if (DEFINED MAMBA_BUILD)\n')
fo.write('# MAMBA builds ignore system libs, use mamba libs\n')
fo.write(' if (Qt5_FOUND)\n')
fo.write(' find_path(Qt5_DIR NAMES Qt5Config.cmake qt5-config.cmake HINTS ${MINIFORGE_ROOT} NO_DEFAULT_PATH)\n')
fo.write(' elseif (Qt6_FOUND)\n')
fo.write(' find_path(Qt6_DIR NAMES Qt6Config.cmake qt6-config.cmake HINTS ${MINIFORGE_ROOT} NO_DEFAULT_PATH)\n')
fo.write(' endif(Qt5_FOUND)\n')
fo.write(' else ()\n')
fo.write(' if (Qt5_FOUND)\n')
fo.write(' find_path(Qt5_DIR NAMES Qt5Config.cmake qt5-config.cmake HINTS /usr/local/Cellar/qt/*/lib/cmake/Qt5 /opt/homebrew/Cellar/qt/*/lib/cmake/Qt5 $ENV{HOME}/homebrew/Cellar/qt/*/lib/cmake/Qt5 NO_DEFAULT_PATH)\n')
fo.write(' elseif (Qt6_FOUND)\n')
fo.write(' find_path(Qt6_DIR NAMES Qt6Config.cmake qt6-config.cmake HINTS /usr/local/Cellar/qt/*/lib/cmake/Qt6 /opt/homebrew/Cellar/qt/*/lib/cmake/Qt6 $ENV{HOME}/homebrew/Cellar/qt/*/lib/cmake/Qt6 NO_DEFAULT_PATH)\n')
fo.write(' endif(Qt5_FOUND)\n')
fo.write(' endif(DEFINED MAMBA_BUILD)\n')
fo.write(' if (Qt5_FOUND)\n')
fo.write(' find_path(Qt5_DIR NAMES Qt5Config.cmake qt5-config.cmake HINTS ${MINIFORGE_ROOT} NO_DEFAULT_PATH)\n')
fo.write(' elseif (Qt6_FOUND)\n')
fo.write(' find_path(Qt6_DIR NAMES Qt6Config.cmake qt6-config.cmake HINTS ${MINIFORGE_ROOT} NO_DEFAULT_PATH)\n')
fo.write(' endif(Qt5_FOUND)\n')
fo.write('else ()\n')
fo.write(' if (Qt5_FOUND)\n')
fo.write(' find_path(Qt5_DIR NAMES Qt5Config.cmake qt5-config.cmake HINTS /usr/local/Cellar/qt/*/lib/cmake/Qt5 /opt/homebrew/Cellar/qt/*/lib/cmake/Qt5 $ENV{HOME}/homebrew/Cellar/qt/*/lib/cmake/Qt5 NO_DEFAULT_PATH)\n')
fo.write(' elseif (Qt6_FOUND)\n')
fo.write(' find_path(Qt6_DIR NAMES Qt6Config.cmake qt6-config.cmake HINTS /usr/local/Cellar/qt/*/lib/cmake/Qt6 /opt/homebrew/Cellar/qt/*/lib/cmake/Qt6 $ENV{HOME}/homebrew/Cellar/qt/*/lib/cmake/Qt6 NO_DEFAULT_PATH)\n')
fo.write(' endif(Qt5_FOUND)\n')
fo.write('endif(APPLE)\n')
fo.write('endif(NOT DEFINED MAMBA_BUILD)\n')
fo.write('\n')

fo.write('find_package (HDF5)\n')
fo.write('\n')

Expand Down Expand Up @@ -1601,6 +1601,7 @@ def writeCMakeListsApp(appName, appDir, appCompileFileList,

def addFindQt(fo):

fo.write('if (NOT DEFINED MAMBA_BUILD)\n')
fo.write('#Finding Qt\n')
fo.write('find_package (Qt6 COMPONENTS Core QUIET)\n')
fo.write('if (NOT Qt6_FOUND)\n')
Expand All @@ -1615,52 +1616,50 @@ def addFindQt(fo):
fo.write('endif(Qt5_FOUND)\n')

fo.write('if(APPLE)\n')
fo.write(' if (DEFINED MAMBA_BUILD)\n')
fo.write('# MAMBA builds ignore system libs, use mamba libs\n')
fo.write(' if (Qt5_FOUND)\n')
fo.write(' find_path(Qt5_DIR NAMES Qt5Config.cmake qt5-config.cmake HINTS ${MINIFORGE_ROOT} NO_DEFAULT_PATH)\n')
fo.write(' elseif (Qt6_FOUND)\n')
fo.write(' find_path(Qt6_DIR NAMES Qt6Config.cmake qt6-config.cmake HINTS ${MINIFORGE_ROOT} NO_DEFAULT_PATH)\n')
fo.write(' endif(Qt5_FOUND)\n')
fo.write(' else()\n')
fo.write(' if (Qt5_FOUND)\n')
fo.write(' find_path(Qt5_DIR NAMES Qt5Config.cmake qt5-config.cmake HINTS /usr/local/Cellar/qt/*/lib/cmake/Qt5 /opt/homebrew/Cellar/qt/*/lib/cmake/Qt5 $ENV{HOME}/homebrew/Cellar/qt/*/lib/cmake/Qt5 NO_DEFAULT_PATH)\n')
fo.write(' elseif (Qt6_FOUND)\n')
fo.write(' find_path(Qt6_DIR NAMES Qt6Config.cmake qt6-config.cmake HINTS /usr/local/Cellar/qt/*/lib/cmake/Qt6 /opt/homebrew/Cellar/qt/*/lib/cmake/Qt6 $ENV{HOME}/homebrew/Cellar/qt/*/lib/cmake/Qt6 NO_DEFAULT_PATH)\n')
fo.write(' endif(Qt5_FOUND)\n')
fo.write(' endif(DEFINED MAMBA_BUILD)\n')
fo.write(' if (Qt5_FOUND)\n')
fo.write(' find_path(Qt5_DIR NAMES Qt5Config.cmake qt5-config.cmake HINTS ${MINIFORGE_ROOT} NO_DEFAULT_PATH)\n')
fo.write(' elseif (Qt6_FOUND)\n')
fo.write(' find_path(Qt6_DIR NAMES Qt6Config.cmake qt6-config.cmake HINTS ${MINIFORGE_ROOT} NO_DEFAULT_PATH)\n')
fo.write(' endif(Qt5_FOUND)\n')
fo.write('else()\n')
fo.write(' if (Qt5_FOUND)\n')
fo.write(' find_path(Qt5_DIR NAMES Qt5Config.cmake qt5-config.cmake HINTS /usr/local/Cellar/qt/*/lib/cmake/Qt5 /opt/homebrew/Cellar/qt/*/lib/cmake/Qt5 $ENV{HOME}/homebrew/Cellar/qt/*/lib/cmake/Qt5 NO_DEFAULT_PATH)\n')
fo.write(' elseif (Qt6_FOUND)\n')
fo.write(' find_path(Qt6_DIR NAMES Qt6Config.cmake qt6-config.cmake HINTS /usr/local/Cellar/qt/*/lib/cmake/Qt6 /opt/homebrew/Cellar/qt/*/lib/cmake/Qt6 $ENV{HOME}/homebrew/Cellar/qt/*/lib/cmake/Qt6 NO_DEFAULT_PATH)\n')
fo.write(' endif(Qt5_FOUND)\n')
fo.write('endif(APPLE)\n')
fo.write('endif(NOT DEFINED MAMBA_BUILD)\n')

fo.write("set (CMAKE_INCLUDE_CURRENT_DIR ON)\n")
fo.write("set (CMAKE_AUTOMOC ON)\n")
fo.write("set (CMAKE_AUTORCC ON)\n")
fo.write("set (CMAKE_AUTOUIC ON)\n")

fo.write('if (NOT DEFINED MAMBA_BUILD)\n')
fo.write('if (Qt5_FOUND)\n')
fo.write("#QT5\n")
fo.write(' if (DEFINED MAMBA_BUILD)\n')
fo.write(" find_package (Qt5 COMPONENTS Widgets Network Qml REQUIRED PATHS ${MINIFORGE_ROOT} NO_DEFAULT_PATH)\n")
fo.write(' else()\n')
fo.write(" find_package (Qt5 COMPONENTS Widgets Network Qml REQUIRED PATHS /usr /usr/local/opt/qt NO_DEFAULT_PATH)\n")
fo.write(' endif(DEFINED MAMBA_BUILD)\n')
fo.write("# QT5\n")
fo.write("# find_package (Qt5 COMPONENTS Widgets Network Qml REQUIRED PATHS ${MINIFORGE_ROOT} NO_DEFAULT_PATH)\n")
fo.write('#else()\n')
fo.write(" find_package (Qt5 COMPONENTS Widgets Network Qml REQUIRED PATHS /usr /usr/local/opt/qt NO_DEFAULT_PATH)\n")
fo.write(" pkg_search_module(Qt5Core REQUIRED)\n")
fo.write(" pkg_search_module(Qt5Gui REQUIRED)\n")
fo.write(" pkg_search_module(Qt5Widgets REQUIRED)\n")
fo.write(" pkg_search_module(Qt5Network REQUIRED)\n")
fo.write(" pkg_search_module(Qt5Qml REQUIRED)\n")
fo.write('else()\n')
fo.write("#QT6\n")
fo.write(' if (DEFINED MAMBA_BUILD)\n')
fo.write(" find_package (Qt6 COMPONENTS Widgets Network Qml REQUIRED PATHS ${MINIFORGE_ROOT} NO_DEFAULT_PATH)\n")
fo.write(' else()\n')
fo.write(" find_package (Qt6 COMPONENTS Widgets Network Qml REQUIRED PATHS /usr /usr/local/opt/qt NO_DEFAULT_PATH)\n")
fo.write(' endif(DEFINED MAMBA_BUILD)\n')
fo.write('# if (DEFINED MAMBA_BUILD)\n')
fo.write("# find_package (Qt6 COMPONENTS Widgets Network Qml REQUIRED PATHS ${MINIFORGE_ROOT} NO_DEFAULT_PATH)\n")
fo.write('# else()\n')
fo.write(" find_package (Qt6 COMPONENTS Widgets Network Qml REQUIRED PATHS /usr /usr/local/opt/qt NO_DEFAULT_PATH)\n")
fo.write('# endif(DEFINED MAMBA_BUILD)\n')
fo.write(" pkg_search_module(Qt6Core REQUIRED)\n")
fo.write(" pkg_search_module(Qt6Gui REQUIRED)\n")
fo.write(" pkg_search_module(Qt6Widgets REQUIRED)\n")
fo.write(" pkg_search_module(Qt6Network REQUIRED)\n")
fo.write(" pkg_search_module(Qt6Qml REQUIRED)\n")
fo.write('endif(Qt5_FOUND)\n')
fo.write('endif(NOT DEFINED MAMBA_BUILD)\n')
fo.write("\n")

########################################################################
Expand Down
38 changes: 19 additions & 19 deletions codebase/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,20 @@ endif()

if (DEFINED MAMBA_BUILD)
# MAMBA builds ignore system includes and libs, use mamba dirs
set(MAMBA_INCLUDE_PATH ${MINIFORGE_ROOT}/include)
set(MAMBA_LIBRARY_PATH ${MINIFORGE_ROOT}/lib)
set(QT_HOST_PATH ${MINIFORGE_ROOT})
set(CMAKE_FIND_USE_CMAKE_SYSTEM_PATH FALSE)
set(CMAKE_SYSTEM_IGNORE_PREFIX_PATH "/usr;/usr/local;/usr/lib64;/lib;/lib64;/opt/homebrew")
set(MAMBA_INCLUDE_PATH ${MINIFORGE_ROOT}/include)
set(MAMBA_LIBRARY_PATH ${MINIFORGE_ROOT}/lib)
set(QT_HOST_PATH ${MINIFORGE_ROOT})
set(CMAKE_FIND_USE_CMAKE_SYSTEM_PATH FALSE)
set(CMAKE_SYSTEM_IGNORE_PREFIX_PATH "/usr;/usr/local;/usr/lib64;/lib;/lib64;/opt/homebrew")
endif(DEFINED MAMBA_BUILD)

find_package (X11)
if (DEFINED X11_X11_LIB)
get_filename_component(X11_LIB_DIR ${X11_X11_LIB} DIRECTORY)
endif()

if (NOT DEFINED MAMBA_BUILD)
# MAMBA builds ignore system libs, use mamba libs
# Finding Qt

find_package (Qt6 COMPONENTS Core QUIET)
Expand All @@ -75,21 +77,19 @@ else ()
endif(Qt5_FOUND)

if(APPLE)
if (DEFINED MAMBA_BUILD)
# MAMBA builds ignore system libs, use mamba libs
if (Qt5_FOUND)
find_path(Qt5_DIR NAMES Qt5Config.cmake qt5-config.cmake HINTS ${MINIFORGE_ROOT} NO_DEFAULT_PATH)
elseif (Qt6_FOUND)
find_path(Qt6_DIR NAMES Qt6Config.cmake qt6-config.cmake HINTS ${MINIFORGE_ROOT} NO_DEFAULT_PATH)
endif(Qt5_FOUND)
else ()
if (Qt5_FOUND)
find_path(Qt5_DIR NAMES Qt5Config.cmake qt5-config.cmake HINTS /usr/local/Cellar/qt/*/lib/cmake/Qt5 /opt/homebrew/Cellar/qt/*/lib/cmake/Qt5 $ENV{HOME}/homebrew/Cellar/qt/*/lib/cmake/Qt5 NO_DEFAULT_PATH)
elseif (Qt6_FOUND)
find_path(Qt6_DIR NAMES Qt6Config.cmake qt6-config.cmake HINTS /usr/local/Cellar/qt/*/lib/cmake/Qt6 /opt/homebrew/Cellar/qt/*/lib/cmake/Qt6 $ENV{HOME}/homebrew/Cellar/qt/*/lib/cmake/Qt6 NO_DEFAULT_PATH)
endif(Qt5_FOUND)
endif(DEFINED MAMBA_BUILD)
if (Qt5_FOUND)
find_path(Qt5_DIR NAMES Qt5Config.cmake qt5-config.cmake HINTS ${MINIFORGE_ROOT} NO_DEFAULT_PATH)
elseif (Qt6_FOUND)
find_path(Qt6_DIR NAMES Qt6Config.cmake qt6-config.cmake HINTS ${MINIFORGE_ROOT} NO_DEFAULT_PATH)
endif(Qt5_FOUND)
else ()
if (Qt5_FOUND)
find_path(Qt5_DIR NAMES Qt5Config.cmake qt5-config.cmake HINTS /usr/local/Cellar/qt/*/lib/cmake/Qt5 /opt/homebrew/Cellar/qt/*/lib/cmake/Qt5 $ENV{HOME}/homebrew/Cellar/qt/*/lib/cmake/Qt5 NO_DEFAULT_PATH)
elseif (Qt6_FOUND)
find_path(Qt6_DIR NAMES Qt6Config.cmake qt6-config.cmake HINTS /usr/local/Cellar/qt/*/lib/cmake/Qt6 /opt/homebrew/Cellar/qt/*/lib/cmake/Qt6 $ENV{HOME}/homebrew/Cellar/qt/*/lib/cmake/Qt6 NO_DEFAULT_PATH)
endif(Qt5_FOUND)
endif(APPLE)
endif(NOT DEFINED MAMBA_BUILD)

find_package (HDF5)

Expand Down
49 changes: 24 additions & 25 deletions codebase/apps/radar/src/HawkEdit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ set (SRCS
FunctionEditor.cc
)

if (NOT DEFINED MAMBA_BUILD)
#Finding Qt
find_package (Qt6 COMPONENTS Core QUIET)
if (NOT Qt6_FOUND)
Expand All @@ -99,50 +100,48 @@ else ()
message(FATAL_ERROR, "Qt not found.")
endif(Qt5_FOUND)
if(APPLE)
if (DEFINED MAMBA_BUILD)
# MAMBA builds ignore system libs, use mamba libs
if (Qt5_FOUND)
find_path(Qt5_DIR NAMES Qt5Config.cmake qt5-config.cmake HINTS ${MINIFORGE_ROOT} NO_DEFAULT_PATH)
elseif (Qt6_FOUND)
find_path(Qt6_DIR NAMES Qt6Config.cmake qt6-config.cmake HINTS ${MINIFORGE_ROOT} NO_DEFAULT_PATH)
endif(Qt5_FOUND)
else()
if (Qt5_FOUND)
find_path(Qt5_DIR NAMES Qt5Config.cmake qt5-config.cmake HINTS /usr/local/Cellar/qt/*/lib/cmake/Qt5 /opt/homebrew/Cellar/qt/*/lib/cmake/Qt5 $ENV{HOME}/homebrew/Cellar/qt/*/lib/cmake/Qt5 NO_DEFAULT_PATH)
elseif (Qt6_FOUND)
find_path(Qt6_DIR NAMES Qt6Config.cmake qt6-config.cmake HINTS /usr/local/Cellar/qt/*/lib/cmake/Qt6 /opt/homebrew/Cellar/qt/*/lib/cmake/Qt6 $ENV{HOME}/homebrew/Cellar/qt/*/lib/cmake/Qt6 NO_DEFAULT_PATH)
endif(Qt5_FOUND)
endif(DEFINED MAMBA_BUILD)
if (Qt5_FOUND)
find_path(Qt5_DIR NAMES Qt5Config.cmake qt5-config.cmake HINTS ${MINIFORGE_ROOT} NO_DEFAULT_PATH)
elseif (Qt6_FOUND)
find_path(Qt6_DIR NAMES Qt6Config.cmake qt6-config.cmake HINTS ${MINIFORGE_ROOT} NO_DEFAULT_PATH)
endif(Qt5_FOUND)
else()
if (Qt5_FOUND)
find_path(Qt5_DIR NAMES Qt5Config.cmake qt5-config.cmake HINTS /usr/local/Cellar/qt/*/lib/cmake/Qt5 /opt/homebrew/Cellar/qt/*/lib/cmake/Qt5 $ENV{HOME}/homebrew/Cellar/qt/*/lib/cmake/Qt5 NO_DEFAULT_PATH)
elseif (Qt6_FOUND)
find_path(Qt6_DIR NAMES Qt6Config.cmake qt6-config.cmake HINTS /usr/local/Cellar/qt/*/lib/cmake/Qt6 /opt/homebrew/Cellar/qt/*/lib/cmake/Qt6 $ENV{HOME}/homebrew/Cellar/qt/*/lib/cmake/Qt6 NO_DEFAULT_PATH)
endif(Qt5_FOUND)
endif(APPLE)
endif(NOT DEFINED MAMBA_BUILD)
set (CMAKE_INCLUDE_CURRENT_DIR ON)
set (CMAKE_AUTOMOC ON)
set (CMAKE_AUTORCC ON)
set (CMAKE_AUTOUIC ON)
if (NOT DEFINED MAMBA_BUILD)
if (Qt5_FOUND)
#QT5
if (DEFINED MAMBA_BUILD)
find_package (Qt5 COMPONENTS Widgets Network Qml REQUIRED PATHS ${MINIFORGE_ROOT} NO_DEFAULT_PATH)
else()
find_package (Qt5 COMPONENTS Widgets Network Qml REQUIRED PATHS /usr /usr/local/opt/qt NO_DEFAULT_PATH)
endif(DEFINED MAMBA_BUILD)
# QT5
# find_package (Qt5 COMPONENTS Widgets Network Qml REQUIRED PATHS ${MINIFORGE_ROOT} NO_DEFAULT_PATH)
#else()
find_package (Qt5 COMPONENTS Widgets Network Qml REQUIRED PATHS /usr /usr/local/opt/qt NO_DEFAULT_PATH)
pkg_search_module(Qt5Core REQUIRED)
pkg_search_module(Qt5Gui REQUIRED)
pkg_search_module(Qt5Widgets REQUIRED)
pkg_search_module(Qt5Network REQUIRED)
pkg_search_module(Qt5Qml REQUIRED)
else()
#QT6
if (DEFINED MAMBA_BUILD)
find_package (Qt6 COMPONENTS Widgets Network Qml REQUIRED PATHS ${MINIFORGE_ROOT} NO_DEFAULT_PATH)
else()
find_package (Qt6 COMPONENTS Widgets Network Qml REQUIRED PATHS /usr /usr/local/opt/qt NO_DEFAULT_PATH)
endif(DEFINED MAMBA_BUILD)
# if (DEFINED MAMBA_BUILD)
# find_package (Qt6 COMPONENTS Widgets Network Qml REQUIRED PATHS ${MINIFORGE_ROOT} NO_DEFAULT_PATH)
# else()
find_package (Qt6 COMPONENTS Widgets Network Qml REQUIRED PATHS /usr /usr/local/opt/qt NO_DEFAULT_PATH)
# endif(DEFINED MAMBA_BUILD)
pkg_search_module(Qt6Core REQUIRED)
pkg_search_module(Qt6Gui REQUIRED)
pkg_search_module(Qt6Widgets REQUIRED)
pkg_search_module(Qt6Network REQUIRED)
pkg_search_module(Qt6Qml REQUIRED)
endif(Qt5_FOUND)
endif(NOT DEFINED MAMBA_BUILD)

# include directories

Expand Down
49 changes: 24 additions & 25 deletions codebase/apps/radar/src/HawkEye/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ set (SRCS
TimeScaleWidget.cc
)

if (NOT DEFINED MAMBA_BUILD)
#Finding Qt
find_package (Qt6 COMPONENTS Core QUIET)
if (NOT Qt6_FOUND)
Expand All @@ -76,50 +77,48 @@ else ()
message(FATAL_ERROR, "Qt not found.")
endif(Qt5_FOUND)
if(APPLE)
if (DEFINED MAMBA_BUILD)
# MAMBA builds ignore system libs, use mamba libs
if (Qt5_FOUND)
find_path(Qt5_DIR NAMES Qt5Config.cmake qt5-config.cmake HINTS ${MINIFORGE_ROOT} NO_DEFAULT_PATH)
elseif (Qt6_FOUND)
find_path(Qt6_DIR NAMES Qt6Config.cmake qt6-config.cmake HINTS ${MINIFORGE_ROOT} NO_DEFAULT_PATH)
endif(Qt5_FOUND)
else()
if (Qt5_FOUND)
find_path(Qt5_DIR NAMES Qt5Config.cmake qt5-config.cmake HINTS /usr/local/Cellar/qt/*/lib/cmake/Qt5 /opt/homebrew/Cellar/qt/*/lib/cmake/Qt5 $ENV{HOME}/homebrew/Cellar/qt/*/lib/cmake/Qt5 NO_DEFAULT_PATH)
elseif (Qt6_FOUND)
find_path(Qt6_DIR NAMES Qt6Config.cmake qt6-config.cmake HINTS /usr/local/Cellar/qt/*/lib/cmake/Qt6 /opt/homebrew/Cellar/qt/*/lib/cmake/Qt6 $ENV{HOME}/homebrew/Cellar/qt/*/lib/cmake/Qt6 NO_DEFAULT_PATH)
endif(Qt5_FOUND)
endif(DEFINED MAMBA_BUILD)
if (Qt5_FOUND)
find_path(Qt5_DIR NAMES Qt5Config.cmake qt5-config.cmake HINTS ${MINIFORGE_ROOT} NO_DEFAULT_PATH)
elseif (Qt6_FOUND)
find_path(Qt6_DIR NAMES Qt6Config.cmake qt6-config.cmake HINTS ${MINIFORGE_ROOT} NO_DEFAULT_PATH)
endif(Qt5_FOUND)
else()
if (Qt5_FOUND)
find_path(Qt5_DIR NAMES Qt5Config.cmake qt5-config.cmake HINTS /usr/local/Cellar/qt/*/lib/cmake/Qt5 /opt/homebrew/Cellar/qt/*/lib/cmake/Qt5 $ENV{HOME}/homebrew/Cellar/qt/*/lib/cmake/Qt5 NO_DEFAULT_PATH)
elseif (Qt6_FOUND)
find_path(Qt6_DIR NAMES Qt6Config.cmake qt6-config.cmake HINTS /usr/local/Cellar/qt/*/lib/cmake/Qt6 /opt/homebrew/Cellar/qt/*/lib/cmake/Qt6 $ENV{HOME}/homebrew/Cellar/qt/*/lib/cmake/Qt6 NO_DEFAULT_PATH)
endif(Qt5_FOUND)
endif(APPLE)
endif(NOT DEFINED MAMBA_BUILD)
set (CMAKE_INCLUDE_CURRENT_DIR ON)
set (CMAKE_AUTOMOC ON)
set (CMAKE_AUTORCC ON)
set (CMAKE_AUTOUIC ON)
if (NOT DEFINED MAMBA_BUILD)
if (Qt5_FOUND)
#QT5
if (DEFINED MAMBA_BUILD)
find_package (Qt5 COMPONENTS Widgets Network Qml REQUIRED PATHS ${MINIFORGE_ROOT} NO_DEFAULT_PATH)
else()
find_package (Qt5 COMPONENTS Widgets Network Qml REQUIRED PATHS /usr /usr/local/opt/qt NO_DEFAULT_PATH)
endif(DEFINED MAMBA_BUILD)
# QT5
# find_package (Qt5 COMPONENTS Widgets Network Qml REQUIRED PATHS ${MINIFORGE_ROOT} NO_DEFAULT_PATH)
#else()
find_package (Qt5 COMPONENTS Widgets Network Qml REQUIRED PATHS /usr /usr/local/opt/qt NO_DEFAULT_PATH)
pkg_search_module(Qt5Core REQUIRED)
pkg_search_module(Qt5Gui REQUIRED)
pkg_search_module(Qt5Widgets REQUIRED)
pkg_search_module(Qt5Network REQUIRED)
pkg_search_module(Qt5Qml REQUIRED)
else()
#QT6
if (DEFINED MAMBA_BUILD)
find_package (Qt6 COMPONENTS Widgets Network Qml REQUIRED PATHS ${MINIFORGE_ROOT} NO_DEFAULT_PATH)
else()
find_package (Qt6 COMPONENTS Widgets Network Qml REQUIRED PATHS /usr /usr/local/opt/qt NO_DEFAULT_PATH)
endif(DEFINED MAMBA_BUILD)
# if (DEFINED MAMBA_BUILD)
# find_package (Qt6 COMPONENTS Widgets Network Qml REQUIRED PATHS ${MINIFORGE_ROOT} NO_DEFAULT_PATH)
# else()
find_package (Qt6 COMPONENTS Widgets Network Qml REQUIRED PATHS /usr /usr/local/opt/qt NO_DEFAULT_PATH)
# endif(DEFINED MAMBA_BUILD)
pkg_search_module(Qt6Core REQUIRED)
pkg_search_module(Qt6Gui REQUIRED)
pkg_search_module(Qt6Widgets REQUIRED)
pkg_search_module(Qt6Network REQUIRED)
pkg_search_module(Qt6Qml REQUIRED)
endif(Qt5_FOUND)
endif(NOT DEFINED MAMBA_BUILD)

# include directories

Expand Down
Loading

0 comments on commit 552fe42

Please sign in to comment.