Skip to content
Merged
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
25 changes: 24 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,18 @@ if (NOT Qt6Core_FOUND)
find_package(Qt5 COMPONENTS Core QUIET)
endif()

# Qt versions installed by conda packages include some extra dependencies
if(QT_LIBINFIX STREQUAL "_conda")
message("Found Qt installed by conda package. Getting specific extra dependencies...")
# Qt5 and Qt6 dependencies
sofa_find_package(ZSTD REQUIRED) # required by Qt5::Core_conda
sofa_find_package(PCRE2 COMPONENTS 16BIT REQUIRED) # required by Qt5::Core_conda
sofa_find_package(PNG REQUIRED) # required by Qt5::Gui_conda
if(SOFA_BUILD_RELEASE_PACKAGE AND CMAKE_SYSTEM_NAME STREQUAL Windows)
sofa_install_libraries(TARGETS ZSTD::ZSTD PNG::PNG PCRE2::16BIT)
endif()
endif()

if (Qt6Core_FOUND)
message("${PROJECT_NAME}: will use Qt6")
find_package(Qt6 COMPONENTS Gui GuiTools Widgets WidgetsTools OpenGLWidgets REQUIRED)
Expand Down Expand Up @@ -89,7 +101,18 @@ if(Sofa.GL_FOUND)
if(SOFA_QT_ENABLE_QGLVIEWER)

find_package(QGLViewer QUIET)
if(NOT QGLViewer_FOUND AND SOFA_ALLOW_FETCH_DEPENDENCIES)
if(QGLViewer_FOUND)
# NOTE @olivier-roussel : Don't get why we don't have to force Qt Xml installation on windows
# when QGLViewer is fetched
if(SOFA_BUILD_RELEASE_PACKAGE AND CMAKE_SYSTEM_NAME STREQUAL Windows)
sofa_install_libraries(TARGETS QGLViewer)
if (Qt5Core_FOUND)
sofa_install_libraries(TARGETS Qt5::Xml)
elseif (Qt6Core_FOUND)
sofa_install_libraries(TARGETS Qt::Xml)
endif()
endif()
elseif(NOT QGLViewer_FOUND AND SOFA_ALLOW_FETCH_DEPENDENCIES)
message("Sofa.Qt: DEPENDENCY QGLViewer NOT FOUND. SOFA_ALLOW_FETCH_DEPENDENCIES is ON, fetching QGLViewer...")
sofa_fetch_dependency(QGLViewer
GIT_REPOSITORY https://github.com/sofa-framework/libQGLViewer/
Expand Down
2 changes: 2 additions & 0 deletions Sofa.QtConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ if(SOFA_QT_HAVE_QT5)
find_package(Qt5 QUIET REQUIRED WebEngine WebEngineWidgets)
endif()
if(SOFA_QT_ENABLE_QGLVIEWER)
find_package(Qt5 QUIET REQUIRED Xml)
find_package(QGLViewer QUIET REQUIRED)
endif()
elseif(SOFA_QT_HAVE_QT6)
Expand All @@ -46,6 +47,7 @@ elseif(SOFA_QT_HAVE_QT6)
find_package(Qt6 QUIET REQUIRED Positioning WebChannel WebEngineCore WebEngineWidgets)
endif()
if(SOFA_QT_ENABLE_QGLVIEWER)
find_package(Qt6 QUIET REQUIRED Xml)
find_package(QGLViewer QUIET REQUIRED)
endif()
endif()
Expand Down
67 changes: 0 additions & 67 deletions cmake/Modules/FindQGLViewer.cmake

This file was deleted.

Loading