Skip to content

Commit

Permalink
Fix packaging for linux and build on Qt6
Browse files Browse the repository at this point in the history
  • Loading branch information
VSRonin committed Oct 13, 2021
1 parent c043b0b commit 013e922
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 16 deletions.
20 changes: 13 additions & 7 deletions cmake/modules/package.cmake
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
include("shared-Release/CPackConfig.cmake")

set(CPACK_INSTALL_CMAKE_PROJECTS
shared-Debug <PROJ> ALL /
shared-Release <PROJ> ALL /
static-Debug <PROJ> ALL /
static-Release <PROJ> ALL /
)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(CPACK_INSTALL_CMAKE_PROJECTS
shared-Release <PROJ> ALL /
static-Release <PROJ> ALL /
)
else()
set(CPACK_INSTALL_CMAKE_PROJECTS
shared-Debug <PROJ> ALL /
shared-Release <PROJ> ALL /
static-Debug <PROJ> ALL /
static-Release <PROJ> ALL /
)
endif()
10 changes: 5 additions & 5 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,6 @@ if(modelutilities_SRCS)
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${modelutilities_PlatformDir}/lib"
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${modelutilities_PlatformDir}/bin"
)
include(CMakePackageConfigHelpers)
write_basic_package_version_file("QtModelUtilitiesConfigVersion.cmake"
VERSION ${VERSION_SHORT}
COMPATIBILITY SameMajorVersion
)
install(FILES ${modelutilities_INSTALL_INCLUDE} "${CMAKE_CURRENT_BINARY_DIR}/globaldefs/modelutilities_global.h"
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
COMPONENT QtModelUtilities_Development
Expand Down Expand Up @@ -198,6 +193,11 @@ if(modelutilities_SRCS)
NAMELINK_ONLY
)
endif()
include(CMakePackageConfigHelpers)
write_basic_package_version_file("QtModelUtilitiesConfigVersion.cmake"
VERSION ${VERSION_SHORT}
COMPATIBILITY SameMajorVersion
)
install(EXPORT QtModelUtilitiesTargets
FILE QtModelUtilitiesTargets.cmake
NAMESPACE QtModelUtilities::
Expand Down
2 changes: 1 addition & 1 deletion src/private/abstractstringserialiser_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class AbstractStringSerialiserPrivate : public AbstractModelSerialiserPrivate
QVariant loadVariant(int type, const QString &val) const;
QString saveVariant(const QVariant &val) const;
static int guessDecimals(double val);
static QString guessDecimalsString(double val, QLocale *loca = Q_NULLPTR);
static QString guessDecimalsString(double val, QLocale *loca = nullptr);
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
QTextCodec *m_textCodec;
#endif
Expand Down
6 changes: 3 additions & 3 deletions src/rolemaskproxymodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -778,13 +778,13 @@ void RoleMaskProxyModel::multiData(const QModelIndex &index, QModelRoleDataSpan
Q_D(const RoleMaskProxyModel);
const QModelIndex sourceIndex = mapToSource(index);
sourceModel()->multiData(sourceIndex, roleDataSpan);
const RolesContainer *idxData = d->dataForIndex(sourceIndex);
const FlaggedRolesContainer *idxData = d->dataForIndex(sourceIndex);
for (QModelRoleData &roleData : roleDataSpan) {
int role = roleData.role();
if (d->m_mergeDisplayEdit && role == Qt::EditRole)
role = Qt::DisplayRole;
const auto roleIter = idxData->constFind(role);
if (roleIter != idxData->constEnd())
const auto roleIter = idxData->roles.constFind(role);
if (roleIter != idxData->roles.constEnd())
roleData.setData(roleIter.value());
else if (!d->m_transparentIfEmpty && d->m_maskedRoles.contains(role))
roleData.setData(d->m_defaultValues.value(role, QVariant()));
Expand Down

0 comments on commit 013e922

Please sign in to comment.