Skip to content

Commit

Permalink
Added support for exporting to RPTools MapTool (#2926)
Browse files Browse the repository at this point in the history
This new RpMap plugin adds support for exporting to the RPTools MapTool RpMap format.

Added `src/karchive` based on KArchive commit 0d55829a2ce093e83c68ac0d1cbef8b6a1814332.

The plugin is disabled when compiling with MSVC due to an unresolved linker error:

karchive.lib(karchive.cpp.obj) : error LNK2019: unresolved external symbol __imp_GetUserNameW referenced in function "class QString __cdecl getCurrentUserName(void)" (?getCurrentUserName@@ya?AVQString@@xz)
C:\projects\tiled\release\rpmap.bf8dc609\rpmap.dll : fatal error LNK1120: 1 unresolved externals

Closes #2922

Co-authored-by: Thorbjørn Lindeijer <[email protected]>
  • Loading branch information
cpetig and bjorn authored Nov 24, 2020
1 parent e6ca903 commit 308553d
Show file tree
Hide file tree
Showing 60 changed files with 12,668 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ on:
jobs:
analyse:
name: Analyse
runs-on: ubuntu-latest
runs-on: ubuntu-20.04

steps:
- name: Checkout repository
Expand Down Expand Up @@ -47,10 +47,10 @@ jobs:
- name: Setup qbs
run: |
qbs setup-toolchains --detect
qbs setup-qt --detect
qbs config defaultProfile gcc
- name: Build
run: qbs build profile:qt-5-9-5
run: qbs build

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
21 changes: 21 additions & 0 deletions src/karchive/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Ignore the following files
*~
*.diff
*.kate-swp
*.kdev4
.kdev_include_paths
*.kdevelop.pcs
*.moc
*.moc.cpp
*.orig
*.user
.*.swp
.swp.*
Doxyfile
Makefile
avail
random_seed
/build*/
CMakeLists.txt.user*
*.unc-backup*
.cmake/
10 changes: 10 additions & 0 deletions src/karchive/AUTHORS
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Maintainers:
Mario Bensi <[email protected]>
David Faure <[email protected]>

Many other contributors, see git log.

For questions about this package, email [email protected].

For bug reports, please use http://bugs.kde.org

109 changes: 109 additions & 0 deletions src/karchive/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
cmake_minimum_required(VERSION 3.5)

set(KF5_VERSION "5.76.0") # handled by release scripts
project(KArchive VERSION ${KF5_VERSION})

include(FeatureSummary)
find_package(ECM 5.75.0 NO_MODULE)
set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://commits.kde.org/extra-cmake-modules")
feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES)


set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})

include(KDEInstallDirs)
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
include(KDECMakeSettings)

include(ECMGenerateExportHeader)

set(REQUIRED_QT_VERSION 5.12.0)
find_package(Qt5Core ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE)

find_package(ZLIB)
set_package_properties(ZLIB PROPERTIES
URL "http://www.zlib.net"
DESCRIPTION "Support for gzip compressed files and data streams"
TYPE REQUIRED
PURPOSE "Required by the core KDE libraries and some critical kioslaves"
)

find_package(BZip2)
set_package_properties(BZip2 PROPERTIES
URL "https://sourceware.org/bzip2/"
DESCRIPTION "Support for BZip2 compressed files and data streams"
TYPE RECOMMENDED
PURPOSE "Support for BZip2 compressed files and data streams"
)

find_package(LibLZMA)
set_package_properties(LibLZMA PROPERTIES
URL "http://tukaani.org/xz/"
DESCRIPTION "Support for xz compressed files and data streams"
PURPOSE "Support for xz compressed files and data streams"
)
include_directories(
${ZLIB_INCLUDE_DIR}
)

include(ECMSetupVersion)
include(ECMGenerateHeaders)
include(ECMQtDeclareLoggingCategory)
include(ECMAddQch)

set(EXCLUDE_DEPRECATED_BEFORE_AND_AT 0 CACHE STRING "Control the range of deprecated API excluded from the build [default=0].")

option(BUILD_QCH "Build API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)" OFF)
add_feature_info(QCH ${BUILD_QCH} "API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)")

ecm_setup_version(PROJECT
VARIABLE_PREFIX KARCHIVE
VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/karchive_version.h"
PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5ArchiveConfigVersion.cmake"
SOVERSION 5)
add_definitions(-DQT_NO_FOREACH)
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050d00)

add_subdirectory(src)
if (BUILD_TESTING)
add_subdirectory(autotests)
add_subdirectory(tests)
endif()

# create a Config.cmake and a ConfigVersion.cmake file and install them
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5Archive")

if (BUILD_QCH)
ecm_install_qch_export(
TARGETS KF5Archive_QCH
FILE KF5ArchiveQchTargets.cmake
DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
COMPONENT Devel
)
set(PACKAGE_INCLUDE_QCHTARGETS "include(\"\${CMAKE_CURRENT_LIST_DIR}/KF5ArchiveQchTargets.cmake\")")
endif()

include(CMakePackageConfigHelpers)

configure_package_config_file(
"${CMAKE_CURRENT_SOURCE_DIR}/KF5ArchiveConfig.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/KF5ArchiveConfig.cmake"
INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR}
)

install(FILES ${CMAKE_CURRENT_BINARY_DIR}/karchive_version.h
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}
COMPONENT Devel)

install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/KF5ArchiveConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/KF5ArchiveConfigVersion.cmake"
DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
COMPONENT Devel)

install(EXPORT KF5ArchiveTargets
DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
FILE KF5ArchiveTargets.cmake
NAMESPACE KF5::)

feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
11 changes: 11 additions & 0 deletions src/karchive/KF5ArchiveConfig.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@PACKAGE_INIT@

include(CMakeFindDependencyMacro)
find_dependency(Qt5Core @REQUIRED_QT_VERSION@)


set(KArchive_HAVE_BZIP2 "@BZIP2_FOUND@")
set(KArchive_HAVE_LZMA "@LIBLZMA_FOUND@")

include("${CMAKE_CURRENT_LIST_DIR}/KF5ArchiveTargets.cmake")
@PACKAGE_INCLUDE_QCHTARGETS@
22 changes: 22 additions & 0 deletions src/karchive/LICENSES/BSD-2-Clause.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Copyright (c) <year> <owner>. All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Loading

0 comments on commit 308553d

Please sign in to comment.