Skip to content

Commit

Permalink
[GUI.Qt] Add find or fetch for qgl viewer (#4840)
Browse files Browse the repository at this point in the history
* Fetch QGLViewer fork

* revert changes removing QtGLViewer files

* Change the branch name
  • Loading branch information
bakpaul authored Aug 23, 2024
1 parent 596feb5 commit ac8f5c9
Show file tree
Hide file tree
Showing 67 changed files with 14 additions and 28,196 deletions.
18 changes: 14 additions & 4 deletions Sofa/GUI/Qt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,18 @@ if(Sofa.GL_FOUND)
option(SOFA_GUI_QT_ENABLE_QGLVIEWER "Compile the QGLViewer for the Qt GUI" ON)

if(SOFA_GUI_QT_ENABLE_QGLVIEWER)
find_package(QGLViewer)
if(NOT QGLViewer_FOUND)
add_subdirectory(libQGLViewer/QGLViewer)

find_package(QGLViewer QUIET)
if(NOT QGLViewer_FOUND AND SOFA_ALLOW_FETCH_DEPENDENCIES)
message("Sofa.GUI.Qt: DEPENDENCY QGLViewer NOT FOUND. SOFA_ALLOW_FETCH_DEPENDENCIES is ON, fetching QGLViewer...")
include(FetchContent)
FetchContent_Declare(QGLViewer
GIT_REPOSITORY https://github.com/sofa-framework/libQGLViewer/
GIT_TAG v2.8.1_SOFA
)
FetchContent_MakeAvailable(QGLViewer)
elseif (NOT QGLViewer_FOUND)
message(FATAL_ERROR "Sofa.GUI.Qt: DEPENDENCY QGLViewer NOT FOUND. SOFA_ALLOW_FETCH_DEPENDENCIES is OFF and thus cannot be fetched. Install QGLViewer (version=2.8.0), or enable SOFA_ALLOW_FETCH_DEPENDENCIES to fix this issue.")
endif()
endif()
else()
Expand Down Expand Up @@ -262,11 +271,11 @@ if(Sofa.GL_FOUND)
list(APPEND SOURCE_FILES ${SRC_ROOT}/viewer/qt/QtViewer.cpp)
endif()

# QGLViewer
if(SOFA_GUI_QT_ENABLE_QGLVIEWER)
list(APPEND MOC_HEADER_FILES ${SRC_ROOT}/viewer/qgl/QtGLViewer.h)
list(APPEND SOURCE_FILES ${SRC_ROOT}/viewer/qgl/QtGLViewer.cpp)
endif()

endif()

# QtCharts
Expand Down Expand Up @@ -348,6 +357,7 @@ if(Sofa.GL_FOUND)
target_link_libraries(${PROJECT_NAME} PUBLIC Sofa.GL)
if(SOFA_GUI_QT_ENABLE_QGLVIEWER)
target_link_libraries(${PROJECT_NAME} PUBLIC QGLViewer)
include_directories(${PROJECT_NAME} PUBLIC ${qglviewer_SOURCE_DIR})
endif()
endif()

Expand Down
80 changes: 0 additions & 80 deletions Sofa/GUI/Qt/libQGLViewer/GPL_exception.txt

This file was deleted.

134 changes: 0 additions & 134 deletions Sofa/GUI/Qt/libQGLViewer/QGLViewer/CMakeLists.txt

This file was deleted.

Loading

0 comments on commit ac8f5c9

Please sign in to comment.