diff --git a/.github/workflows/cmake-single-platform.yml b/.github/workflows/cmake-single-platform.yml index bdecd4ae..8240449c 100644 --- a/.github/workflows/cmake-single-platform.yml +++ b/.github/workflows/cmake-single-platform.yml @@ -19,15 +19,6 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Install Qt - uses: jurplel/install-qt-action@v4 - with: - version: '6.3.*' - host: 'linux' - target: 'desktop' - arch: 'gcc_64' - install-deps : 'true' - - name: Install Axomae dependencies run: | cd ${{github.workspace}} && ./scripts/update_deps.sh @@ -37,7 +28,7 @@ jobs: sudo apt-get install -y libgl1-mesa-dev libglew-dev - name: Configure CMake - run: cmake -B ${{github.workspace}}/../build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DAXOMAE_BUILD_TESTS:BOOL=${{env.BUILD_TESTS}} -DAXOMAE_LUT_MEDIUMP:BOOL=ON + run: cmake -B ${{github.workspace}}/../build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DAXOMAE_BUILD_TESTS:BOOL=${{env.BUILD_TESTS}} -DAXOMAE_LUT_MEDIUMP:BOOL=ON -DAXOMAE_FROMSOURCE_QT_BUILD=ON - name: Build run: cmake --build ${{github.workspace}}/../build --config ${{env.BUILD_TYPE}} diff --git a/.gitmodules b/.gitmodules index 72a99067..b7584146 100644 --- a/.gitmodules +++ b/.gitmodules @@ -64,17 +64,19 @@ path = vendor/SDL_image url = https://github.com/libsdl-org/SDL_image branch = SDL2 + ignore = all fetchRecurseSubmodules = true [submodule "vendor/SDL"] path = vendor/SDL url = https://github.com/libsdl-org/SDL branch = SDL2 + ignore = all fetchRecurseSubmodules = true [submodule "vendor/qt"] path = vendor/qt url = https://code.qt.io/qt/qt5.git - branch = 6.7.2 + branch = 6.8.0 ignore = all fetchRecurseSubmodules = false diff --git a/CMakeLists.txt b/CMakeLists.txt index bd28f8b8..bc4925fc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,9 +34,16 @@ option(AXOMAE_LUT_HIGHP "Enable high precision when computing lookup tables." OF option(AXOMAE_LUT_MEDIUMP "Enable medium precision when computing lookup tables." ON) option(AXOMAE_LUT_LOWP "Enable low precision when computing lookup tables." OFF) option(AXOMAE_BUILD_TESTS "Build unit tests." ON) - +option(AXOMAE_FROMSOURCE_QT_BUILD "Build QT from source." ON) #**************************************************************************************************** # Dependencies +if(AXOMAE_FROMSOURCE_QT_BUILD) + include(cmake/BuildQt6.cmake) +else() + find_package(Qt6 COMPONENTS Gui REQUIRED) + find_package(Qt6 COMPONENTS OpenGLWidgets REQUIRED) + find_package(Qt6 COMPONENTS Widgets REQUIRED) +endif() include(cmake/FindDependencies.cmake) if(NOT CUDAToolkit_FOUND) diff --git a/Documentation/Requirements.txt b/Documentation/Requirements.txt new file mode 100644 index 00000000..07cc1c08 --- /dev/null +++ b/Documentation/Requirements.txt @@ -0,0 +1,6 @@ +Ninja (only for building QT6 from source) +QT6 +GCC (version depends on desired cuda version if gpgpu used) +Opengl +Glew +Cuda (if AXOMAE_USE_CUDA set to ON) \ No newline at end of file diff --git a/cmake/BuildQt6.cmake b/cmake/BuildQt6.cmake index 377f8c25..11adf08e 100644 --- a/cmake/BuildQt6.cmake +++ b/cmake/BuildQt6.cmake @@ -1,12 +1,65 @@ -set(QT_BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}/qt) -set(QT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/qt) +set(QT_BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}/vendor/qt) +set(QT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/vendor/qt) set(QTBASE_BUILD_DIR ${QT_BUILD_DIR}/qtbase) set(QTBASE_SOURCE_DIR ${QT_SOURCE_DIR}/qtbase) -message(STATUS "Building QT from source in ${QT_BUILD_DIR}") -message(STATUS "Configuring QT6 core library...") -file(MAKE_DIRECTORY ${QTBASE_BUILD_DIR}) -execute_process(COMMAND ${QTBASE_SOURCE_DIR}/configure --prefix ${QTBASE_BUILD_DIR} - WORKING_DIRECTORY ${QTBASE_BUILD_DIR} +message(STATUS "Building QT from source : ${QT_SOURCE_DIR}") +message(STATUS "Build directory is : ${QT_BUILD_DIR}") + +message(STATUS "Initializing qt repository ...") + +message(STATUS "Configuring qtbase...") +if(NOT EXISTS "${QT_BUILD_DIR}") + file(MAKE_DIRECTORY ${QT_BUILD_DIR}) +endif() +execute_process(COMMAND bash ${QT_SOURCE_DIR}/configure + -submodules qtbase + -prefix ${QT_BUILD_DIR} + + WORKING_DIRECTORY ${QT_BUILD_DIR} + ERROR_VARIABLE ERROR_MSG ) + +message(STATUS ${ERROR_MSG}) + +message(STATUS "Building qtbase ...") +execute_process(COMMAND cmake --build . --parallel 4 + WORKING_DIRECTORY ${QT_BUILD_DIR} +) + +message(STATUS "Installing qtbase ...") +execute_process(COMMAND cmake --install . + WORKING_DIRECTORY ${QT_BUILD_DIR} +) + + +list(APPEND CMAKE_MODULE_PATH ${QT_BUILD_DIR}/lib/cmake) +list(APPEND CMAKE_PREFIX_PATH ${QT_BUILD_DIR}/lib/cmake) +message(STATUS "Setting up local qt build path ...") +find_package(Qt6 + COMPONENTS Gui OpenGLWidgets Widgets + REQUIRED + PATHS ${CMAKE_PREFIX_PATH} + CONFIG + NO_DEFAULT_PATH +) + +message(STATUS "Qt6_DIR: ${Qt6_DIR}") +message(STATUS "Qt6Gui_DIR: ${Qt6Gui_DIR}") +message(STATUS "Qt6OpenGLWidgets_DIR: ${Qt6OpenGLWidgets_DIR}") +message(STATUS "Qt6Widgets_DIR: ${Qt6Widgets_DIR}") + + + + + + + + + + + + + + diff --git a/cmake/FindDependencies.cmake b/cmake/FindDependencies.cmake index ad257e40..355eb07d 100644 --- a/cmake/FindDependencies.cmake +++ b/cmake/FindDependencies.cmake @@ -1,6 +1,3 @@ -find_package(Qt6 COMPONENTS Gui REQUIRED) -find_package(Qt6 COMPONENTS OpenGLWidgets REQUIRED) -find_package(Qt6 COMPONENTS Widgets REQUIRED) find_package(GLEW REQUIRED) find_package(OpenGL REQUIRED) find_package(CUDAToolkit) diff --git a/scripts/update_deps.sh b/scripts/update_deps.sh index ed8e192a..6eee4828 100755 --- a/scripts/update_deps.sh +++ b/scripts/update_deps.sh @@ -1,3 +1,15 @@ #!/bin/bash -git submodule update --init --force +ROOT="$(pwd)" +echo 'Downloading dependencies ...' +git submodule update --init --remote + +if [ -d "$ROOT/vendor/qt" ]; then + cd $ROOT/vendor/qt || exit +else + echo 'Error: The QT directory has not been created by submodule update ...' +fi +echo 'Dependencies downloaded ...' + +echo 'Setting up required QT submodules ...' +./init-repository.pl --force --module-subset=qtbase