Skip to content

Commit

Permalink
Update Advanced Docking System (#423)
Browse files Browse the repository at this point in the history
* Update ADS to 4.2.1 from 4.0.1

* More verbose version messages

* Set ManiVault version in cmake
  • Loading branch information
alxvth authored Dec 7, 2023
1 parent 9946c5c commit 2e4a978
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 17 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,7 @@ install/

.DS_Store

*.aps
*.aps

# This file is automatically generated from ManiVaultVersion.h.in
HDPS/src/ManiVaultVersion.h
54 changes: 40 additions & 14 deletions HDPS/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,13 @@ cmake_minimum_required(VERSION 3.17)
# Project: ManiVault-core
# -----------------------------------------------------------------------------
set(MV_CORE "mv-core")
project(${MV_CORE})
set(version 1.0.0)

set(MV_VERSION_MAJOR 0)
set(MV_VERSION_MINOR 9)
set(MV_VERSION_PATCH 0)
set(MV_VERSION "${MV_VERSION_MAJOR}.${MV_VERSION_MINOR}.${MV_VERSION_PATCH}")

project(${MV_CORE} VERSION ${MV_VERSION})

# These three targets defined in this CMakeLists.txt
set(MV_APPLICATION_NAME "ManiVault Studio") # Name of the executable
Expand All @@ -18,6 +23,7 @@ if(MSVC)
set(LINK_TYPE STATIC)
endif(MSVC)

message(STATUS "ManiVault version ${MV_VERSION}")
message(STATUS "ManiVault Install dir: ${MV_INSTALL_DIR}")

# -----------------------------------------------------------------------------
Expand All @@ -38,6 +44,9 @@ include(CMakePackageConfigHelpers)
# Test hardware avx capabilities
include(CMakeCheckSetAVX)

# create a file that defines MV_VERSION_MAJOR, etc
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/ManiVaultVersion.h.in" "${CMAKE_CURRENT_SOURCE_DIR}/src/ManiVaultVersion.h" @ONLY)

# -----------------------------------------------------------------------------
# Apple settings
# -----------------------------------------------------------------------------
Expand Down Expand Up @@ -99,17 +108,21 @@ endif(MSVC)
# Dependencies
# -----------------------------------------------------------------------------

# Qt
find_package(Qt6 6.3 COMPONENTS Core Widgets OpenGL OpenGLWidgets WebEngineWidgets REQUIRED)

add_definitions(-DQT_MESSAGELOGCONTEXT)
add_compile_definitions(QT_DISABLE_DEPRECATED_BEFORE=0x050F00)

# Qt Advanced docking system, set version manually
set(ADS_VERSION 4.0.1)
message(STATUS "Using Qt version ${Qt6Widgets_VERSION}")

# Qt Advanced docking system
set(ADS_VERSION 4.2.1)
message(STATUS "Using Qt Advanced Docking System version ${ADS_VERSION}")
set(BUILD_EXAMPLES OFF CACHE BOOL "Qt-ads examples")
add_subdirectory(external/advanced_docking)

# File compression LIBRARY
# File compression: ZLib
if (WIN32)
if(NOT DEFINED ZLIB_ROOT)
message(FATAL_ERROR "You need to define ZLIB_ROOT, pointing to a zlib installation")
Expand All @@ -125,14 +138,22 @@ elseif (APPLE)

else()
find_package(ZLIB REQUIRED)
message(STATUS "Using zlib at ${ZLIB_INCLUDE_DIRS}")
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.26")
message(STATUS "Using zlib version ${ZLIB_VERSION}")
else()
message(STATUS "Using zlib version ${ZLIB_VERSION_STRING}")
endif()
endif()

# File compression: QuaZip
set(QUAZIP_QT_MAJOR_VERSION 6)
set(QUAZIP_BZIP2 OFF CACHE BOOL "Enables BZIP2 compression") # we use ZLIB, not BZIP
set(CMAKE_MESSAGE_LOG_LEVEL "WARNING") # prevent some status messages from quazip
add_subdirectory(external/quazip)


set(CMAKE_MESSAGE_LOG_LEVEL "STATUS")
get_target_property(QuaZip_VERSION QuaZip VERSION)
message(STATUS "Using QuaZip version ${QuaZip_VERSION}")

# -----------------------------------------------------------------------------
# Source files
# -----------------------------------------------------------------------------
Expand All @@ -155,6 +176,8 @@ set_target_properties(${MV_PUBLIC_LIB} PROPERTIES PROJECT_LABEL "MV_Public")
# Set the library output name different to the target name
set_target_properties(${MV_PUBLIC_LIB} PROPERTIES OUTPUT_NAME "MV_Public")

set_target_properties(${MV_PUBLIC_LIB} PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR})

target_include_directories(${MV_PUBLIC_LIB} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src)

target_compile_features(${MV_PUBLIC_LIB} PRIVATE cxx_std_17)
Expand Down Expand Up @@ -182,14 +205,14 @@ target_link_libraries(${MV_PRIVATE_LIB} PRIVATE Qt6::Widgets)
target_link_libraries(${MV_PRIVATE_LIB} PRIVATE Qt6::WebEngineWidgets)
target_link_libraries(${MV_PRIVATE_LIB} PRIVATE Qt6::OpenGL)
target_link_libraries(${MV_PRIVATE_LIB} PRIVATE Qt6::OpenGLWidgets)
target_link_libraries(${MV_PRIVATE_LIB} PRIVATE qtadvanceddocking)
target_link_libraries(${MV_PRIVATE_LIB} PRIVATE qt6advanceddocking)
target_link_libraries(${MV_PRIVATE_LIB} PRIVATE QuaZip)
target_link_libraries(${MV_PRIVATE_LIB} PRIVATE ${MV_PUBLIC_LIB})

# Use avx if enabled and available
check_and_set_AVX(${MV_PRIVATE_LIB} ${MV_USE_AVX})

add_dependencies(${MV_PRIVATE_LIB} ${MV_PUBLIC_LIB} QuaZip qtadvanceddocking)
add_dependencies(${MV_PRIVATE_LIB} ${MV_PUBLIC_LIB} QuaZip qt6advanceddocking)

# -----------------------------------------------------------------------------
# Target MV_EXE
Expand All @@ -202,6 +225,9 @@ add_executable(${MV_EXE} MACOSX_BUNDLE WIN32
)

set_target_properties(${MV_EXE} PROPERTIES OUTPUT_NAME ${MV_APPLICATION_NAME})

set_target_properties(${MV_EXE} PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR})

target_compile_features(${MV_EXE} PRIVATE cxx_std_17)

# find libraries relative to the executable in the macOS .app tree
Expand All @@ -215,7 +241,7 @@ target_link_libraries(${MV_EXE} PRIVATE Qt6::Widgets)
target_link_libraries(${MV_EXE} PRIVATE Qt6::WebEngineWidgets)
target_link_libraries(${MV_EXE} PRIVATE Qt6::OpenGL)
target_link_libraries(${MV_EXE} PRIVATE Qt6::OpenGLWidgets)
target_link_libraries(${MV_EXE} PRIVATE qtadvanceddocking)
target_link_libraries(${MV_EXE} PRIVATE qt6advanceddocking)
target_link_libraries(${MV_EXE} PRIVATE QuaZip)

target_link_libraries(${MV_EXE} PRIVATE ${MV_PUBLIC_LIB})
Expand All @@ -224,7 +250,7 @@ target_link_libraries(${MV_EXE} PRIVATE ${MV_PRIVATE_LIB})
# Use avx if enabled and available
check_and_set_AVX(${MV_EXE} ${MV_USE_AVX})

add_dependencies(${MV_EXE} ${MV_PUBLIC_LIB} ${MV_PRIVATE_LIB} QuaZip qtadvanceddocking)
add_dependencies(${MV_EXE} ${MV_PUBLIC_LIB} ${MV_PRIVATE_LIB} QuaZip qt6advanceddocking)

if(MSVC)
set_target_properties(${MV_EXE} PROPERTIES
Expand Down Expand Up @@ -254,7 +280,7 @@ if(APPLE)
# RESULT_VARIABLE retval
COMMAND ${CMAKE_COMMAND} -E make_directory \"${BUNDLE_DIR}/Contents/Frameworks\"
COMMAND ${CMAKE_COMMAND} -E copy_if_different
\"${MV_INSTALL_DIR}/$<CONFIGURATION>/lib/libqtadvanceddocking.${ADS_VERSION}.dylib\"
\"${MV_INSTALL_DIR}/$<CONFIGURATION>/lib/libqt6advanceddocking.${ADS_VERSION}.dylib\"
\"${BUNDLE_DIR}/Contents/Frameworks/\"
COMMAND ${CMAKE_COMMAND} -E copy_if_different
\"$<TARGET_FILE:${MV_PUBLIC_LIB}>\"
Expand Down Expand Up @@ -448,7 +474,7 @@ add_custom_command(TARGET ${MV_EXE} POST_BUILD
# on windows, the DLLs should be placed in the same directory as the executable
add_custom_command(TARGET ${MV_EXE} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E echo "Installing: dependency runtime libraries"
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:qtadvanceddocking> ${MV_INSTALL_DIR}/$<CONFIGURATION>$<IF:$<CXX_COMPILER_ID:MSVC>,,/lib/>
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:qt6advanceddocking> ${MV_INSTALL_DIR}/$<CONFIGURATION>$<IF:$<CXX_COMPILER_ID:MSVC>,,/lib/>
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:QuaZip> ${MV_INSTALL_DIR}/$<CONFIGURATION>$<IF:$<CXX_COMPILER_ID:MSVC>,,/lib/>
)

Expand Down
12 changes: 12 additions & 0 deletions HDPS/cmake/ManiVaultVersion.h.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#ifndef MANIVAULTVERSION_H_IN_H
#define MANIVAULTVERSION_H_IN_H

#include <cstdint>

// Set ManiVault versions as defined in core/HDPS/CMakeList.txt

constexpr std::int32_t MV_VERSION_MAJOR = @PROJECT_VERSION_MAJOR@;
constexpr std::int32_t MV_VERSION_MINOR = @PROJECT_VERSION_MINOR@;
constexpr std::int32_t MV_VERSION_PATCH = @PROJECT_VERSION_PATCH@;

#endif //MANIVAULTVERSION_H_IN_H
2 changes: 1 addition & 1 deletion HDPS/external/advanced_docking
Submodule advanced_docking updated 119 files
3 changes: 2 additions & 1 deletion HDPS/src/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "BackgroundTask.h"
#include "ForegroundTask.h"
#include "AbstractManager.h"
#include "ManiVaultVersion.h"

#include "util/IconFonts.h"
#include "util/FontAwesome.h"
Expand All @@ -28,7 +29,7 @@ namespace mv {
Application::Application(int& argc, char** argv) :
QApplication(argc, argv),
_core(nullptr),
_version({ 0, 9 }),
_version({ MV_VERSION_MAJOR, MV_VERSION_MINOR }),
_iconFonts(),
_settings(),
_serializationTemporaryDirectory(),
Expand Down

0 comments on commit 2e4a978

Please sign in to comment.