diff --git a/.cmake-format.py b/.cmake-format.py new file mode 100644 index 00000000..d0101f7e --- /dev/null +++ b/.cmake-format.py @@ -0,0 +1,241 @@ +# ---------------------------------- +# Options affecting listfile parsing +# ---------------------------------- +with section("parse"): + + # Specify structure for custom cmake functions + additional_commands = {'foo': {'flags': ['BAR', 'BAZ'], + 'kwargs': {'DEPENDS': '*', 'HEADERS': '*', 'SOURCES': '*'}}} + + # Override configurations per-command where available + override_spec = {} + + # Specify variable tags. + vartags = [] + + # Specify property tags. + proptags = [] + +# ----------------------------- +# Options affecting formatting. +# ----------------------------- +with section("format"): + + # Disable formatting entirely, making cmake-format a no-op + disable = False + + # How wide to allow formatted cmake files + line_width = 120 + + # How many spaces to tab for indent + tab_size = 4 + + # If true, lines are indented using tab characters (utf-8 0x09) instead of + # space characters (utf-8 0x20). In cases where the layout would + # require a fractional tab character, the behavior of the fractional + # indentation is governed by + use_tabchars = False + + # If is True, then the value of this variable indicates how + # fractional indentions are handled during whitespace replacement. If set to + # 'use-space', fractional indentation is left as spaces (utf-8 0x20). If set + # to `round-up` fractional indentation is replaced with a single tab character + # (utf-8 0x09) effectively shifting the column to the next tabstop + fractional_tab_policy = 'use-space' + + # If an argument group contains more than this many sub-groups (parg or kwarg + # groups) then force it to a vertical layout. + max_subgroups_hwrap = 2 + + # If a positional argument group contains more than this many arguments, then + # force it to a vertical layout. + max_pargs_hwrap = 4 + + # If a cmdline positional group consumes more than this many lines without + # nesting, then invalidate the layout (and nest) + max_rows_cmdline = 2 + + # If true, separate flow control names from their parentheses with a space + separate_ctrl_name_with_space = False + + # If true, separate function names from parentheses with a space + separate_fn_name_with_space = False + + # If a statement is wrapped to more than one line, than dangle the closing + # parenthesis on its own line. + dangle_parens = True + + # If the trailing parenthesis must be 'dangled' on its on line, then align it + # to this reference: `prefix`: the start of the statement, `prefix-indent`: + # the start of the statement, plus one indentation level, `child`: align to + # the column of the arguments + dangle_align = 'prefix' + + # If the statement spelling length (including space and parenthesis) is + # smaller than this amount, then force reject nested layouts. + min_prefix_chars = 4 + + # If the statement spelling length (including space and parenthesis) is larger + # than the tab width by more than this amount, then force reject un-nested + # layouts. + max_prefix_chars = 10 + + # If a candidate layout is wrapped horizontally but it exceeds this many + # lines, then reject the layout. + max_lines_hwrap = 2 + + # What style line endings to use in the output. + line_ending = 'unix' + + # Format command names consistently as 'lower' or 'upper' case + command_case = 'lower' + + # Format keywords consistently as 'lower' or 'upper' case + keyword_case = 'upper' + + # A list of command names which should always be wrapped + always_wrap = ["add_executable", "add_library", + "target_link_libraries", "target_include_directories", "install"] + + # If true, the argument lists which are known to be sortable will be sorted + # lexicographicall + enable_sort = True + + # If true, the parsers may infer whether or not an argument list is sortable + # (without annotation). + autosort = True + + # By default, if cmake-format cannot successfully fit everything into the + # desired linewidth it will apply the last, most agressive attempt that it + # made. If this flag is True, however, cmake-format will print error, exit + # with non-zero status code, and write-out nothing + require_valid_layout = False + + # A dictionary mapping layout nodes to a list of wrap decisions. See the + # documentation for more information. + layout_passes = {} + +# ------------------------------------------------ +# Options affecting comment reflow and formatting. +# ------------------------------------------------ +with section("markup"): + + # What character to use for bulleted lists + bullet_char = '*' + + # What character to use as punctuation after numerals in an enumerated list + enum_char = '.' + + # If comment markup is enabled, don't reflow the first comment block in each + # listfile. Use this to preserve formatting of your copyright/license + # statements. + first_comment_is_literal = False + + # If comment markup is enabled, don't reflow any comment block which matches + # this (regex) pattern. Default is `None` (disabled). + literal_comment_pattern = None + + # Regular expression to match preformat fences in comments default= + # ``r'^\s*([`~]{3}[`~]*)(.*)$'`` + fence_pattern = '^\\s*([`~]{3}[`~]*)(.*)$' + + # Regular expression to match rulers in comments default= + # ``r'^\s*[^\w\s]{3}.*[^\w\s]{3}$'`` + ruler_pattern = '^\\s*[^\\w\\s]{3}.*[^\\w\\s]{3}$' + + # If a comment line matches starts with this pattern then it is explicitly a + # trailing comment for the preceeding argument. Default is '#<' + explicit_trailing_pattern = '#<' + + # If a comment line starts with at least this many consecutive hash + # characters, then don't lstrip() them off. This allows for lazy hash rulers + # where the first hash char is not separated by space + hashruler_min_length = 10 + + # If true, then insert a space between the first hash char and remaining hash + # chars in a hash ruler, and normalize its length to fill the column + canonicalize_hashrulers = True + + # enable comment markup parsing and reflow + enable_markup = False + +# ---------------------------- +# Options affecting the linter +# ---------------------------- +with section("lint"): + + # a list of lint codes to disable + disabled_codes = [] + + # regular expression pattern describing valid function names + function_pattern = '[0-9a-z_]+' + + # regular expression pattern describing valid macro names + macro_pattern = '[0-9a-z_]+' + + # regular expression pattern describing valid names for variables with global + # (cache) scope + global_var_pattern = '[A-Z][0-9A-Z_]+' + + # regular expression pattern describing valid names for variables with global + # scope (but internal semantic) + internal_var_pattern = '[A-Z][0-9A-Z_]+' + + # regular expression pattern describing valid names for variables with local + # scope + local_var_pattern = '[_A-Za-z][A-Za-z0-9_]+' + + # regular expression pattern describing valid names for privatedirectory + # variables + private_var_pattern = '[0-9a-z_]+' + + # regular expression pattern describing valid names for public directory + # variables + public_var_pattern = '.*' + + # regular expression pattern describing valid names for function/macro + # arguments and loop variables. + argument_var_pattern = '[a-z_][a-z0-9_]+' + + # regular expression pattern describing valid names for keywords used in + # functions or macros + keyword_pattern = '[A-Z][0-9A-Z_]+' + + # In the heuristic for C0201, how many conditionals to match within a loop in + # before considering the loop a parser. + max_conditionals_custom_parser = 2 + + # Require at least this many newlines between statements + min_statement_spacing = 1 + + # Require no more than this many newlines between statements + max_statement_spacing = 2 + max_returns = 6 + max_branches = 15 + max_arguments = 10 + max_localvars = 15 + max_statements = 50 + +# ------------------------------- +# Options affecting file encoding +# ------------------------------- +with section("encode"): + + # If true, emit the unicode byte-order mark (BOM) at the start of the file + emit_byteorder_mark = False + + # Specify the encoding of the input file. Defaults to utf-8 + input_encoding = 'utf-8' + + # Specify the encoding of the output file. Defaults to utf-8. Note that cmake + # only claims to support utf-8 so be careful when using anything else + output_encoding = 'utf-8' + +# ------------------------------------- +# Miscellaneous configurations options. +# ------------------------------------- +with section("misc"): + + # A dictionary containing any per-command configuration overrides. Currently + # only `command_case` is supported. + per_command = {} diff --git a/.krazy b/.krazy index 8ed1429e..4bbb9418 100644 --- a/.krazy +++ b/.krazy @@ -32,6 +32,7 @@ SKIP KDSoapConfig\.cmake\.in #skip other cmake SKIP FindKDSoap\.cmake|KDSoapMacros\.cmake SKIP Doxyfile.cmake|/genignore.py +SKIP \.cmake-format\.py #skip the borrowed code in the cmake subdir SKIP /cmake/InstallLocation.cmake|/cmake/ECM/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a89c6875..4ac01ee5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,5 +1,6 @@ # See https://pre-commit.com for more information # See https://pre-commit.com/hooks.html for more hooks +exclude: ^(cmake/ECM/|cmake/KDAB/) repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v3.2.0 @@ -18,13 +19,20 @@ repos: rev: v2.12.2 hooks: - id: pylint - exclude: ^(conan/conanfile.py|scripts/genignore.py) + exclude: ^(.cmake-format.py|conan/conanfile.py|scripts/genignore.py) - repo: https://github.com/pre-commit/mirrors-autopep8 rev: v1.6.0 hooks: - id: autopep8 - exclude: ^(conan/conanfile.py) + exclude: ^(.cmake-format.py|conan/conanfile.py) - repo: https://github.com/codespell-project/codespell rev: v2.1.0 hooks: - id: codespell +- repo: https://github.com/cheshirekow/cmake-format-precommit + rev: v0.6.13 + hooks: + - id: cmake-lint + exclude: (.py.cmake|Doxyfile.cmake) + - id: cmake-format + exclude: (.py.cmake|Doxyfile.cmake) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4276c76b..c2325d86 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,33 +40,38 @@ cmake_minimum_required(VERSION 3.3) if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/kdwsdl2cpp/libkode/common") - message(FATAL_ERROR "Please do git submodule update --init --recursive") + message(FATAL_ERROR "Please do git submodule update --init --recursive") endif() # Just to fix warnings with --warn-uninitialized if(NOT DEFINED USE_DEFAULT_INSTALL_LOCATION) - set(USE_DEFAULT_INSTALL_LOCATION FALSE) + set(USE_DEFAULT_INSTALL_LOCATION FALSE) endif() if(NOT DEFINED CMAKE_INSTALL_PREFIX) - set(CMAKE_INSTALL_PREFIX "") + set(CMAKE_INSTALL_PREFIX "") endif() # Allow using a non-KDAB install location set(KDAB_INSTALL True) if((NOT DEFINED ${USE_DEFAULT_INSTALL_LOCATION}) OR (NOT ${USE_DEFAULT_INSTALL_LOCATION})) - if(NOT "${CMAKE_INSTALL_PREFIX}" STREQUAL "") - set(KDAB_INSTALL False) - endif() - set(USE_DEFAULT_INSTALL_LOCATION ${KDAB_INSTALL} CACHE INTERNAL "Install to default KDAB Location" FORCE) + if(NOT "${CMAKE_INSTALL_PREFIX}" STREQUAL "") + set(KDAB_INSTALL False) + endif() + set(USE_DEFAULT_INSTALL_LOCATION + ${KDAB_INSTALL} + CACHE INTERNAL "Install to default KDAB Location" FORCE + ) endif() if(${CMAKE_VERSION} VERSION_LESS "3.12.0") - project(KDSoap LANGUAGES CXX) + project(KDSoap LANGUAGES CXX) else() - project(KDSoap - DESCRIPTION "A Qt-based client-side and server-side SOAP component" - HOMEPAGE_URL "https://github.com/KDAB/KDSoap" - LANGUAGES CXX) + project( + KDSoap + DESCRIPTION "A Qt-based client-side and server-side SOAP component" + HOMEPAGE_URL "https://github.com/KDAB/KDSoap" + LANGUAGES CXX + ) endif() list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") @@ -84,43 +89,56 @@ option(${PROJECT_NAME}_QT6 "Build against Qt 6" OFF) set(${PROJECT_NAME}_VERSION_MAJOR 2) set(${PROJECT_NAME}_VERSION_MINOR 1) set(${PROJECT_NAME}_VERSION_PATCH 0) -set(${PROJECT_NAME}_VERSION ${${PROJECT_NAME}_VERSION_MAJOR}.${${PROJECT_NAME}_VERSION_MINOR}.${${PROJECT_NAME}_VERSION_PATCH}) +set(${PROJECT_NAME}_VERSION + ${${PROJECT_NAME}_VERSION_MAJOR}.${${PROJECT_NAME}_VERSION_MINOR}.${${PROJECT_NAME}_VERSION_PATCH} +) set(PROJECT_VERSION ${${PROJECT_NAME}_VERSION}) #needed for ECM set(${PROJECT_NAME}_SOVERSION ${${PROJECT_NAME}_VERSION_MAJOR}) find_path(BOOST_OPTIONAL_DIR NAMES boost/optional.hpp) if(BOOST_OPTIONAL_DIR) - message(STATUS "Found boost/optional.hpp in ${BOOST_OPTIONAL_DIR}") - include_directories(${BOOST_OPTIONAL_DIR}) - add_definitions(-DBOOST_OPTIONAL_FOUND) # I'd really prefer using configure_file but this is more compatible with qmake + message(STATUS "Found boost/optional.hpp in ${BOOST_OPTIONAL_DIR}") + include_directories(${BOOST_OPTIONAL_DIR}) + add_definitions(-DBOOST_OPTIONAL_FOUND + )# I'd really prefer using configure_file but this is more compatible with qmake endif() # Set a default build type if none was specified set(default_build_type "Release") if(EXISTS "${CMAKE_SOURCE_DIR}/.git" OR ${PROJECT_NAME}_DEVELOPER_MODE) - set(default_build_type "Debug") + set(default_build_type "Debug") endif() if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) - message(STATUS "Setting build type to ${default_build_type} as none was specified.") - set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE STRING "Choose the type of build." FORCE) - # Set the possible values of build type for cmake-gui - set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo") + message(STATUS "Setting build type to ${default_build_type} as none was specified.") + set(CMAKE_BUILD_TYPE + "${default_build_type}" + CACHE STRING "Choose the type of build." FORCE + ) + # Set the possible values of build type for cmake-gui + set_property( + CACHE CMAKE_BUILD_TYPE + PROPERTY STRINGS + "Debug" + "Release" + "MinSizeRel" + "RelWithDebInfo" + ) endif() if(${PROJECT_NAME}_QT6) - set(Qt_VERSION_MAJOR 6) - set(QT_MIN_VERSION "6.0.0") - find_package(Qt6 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS Core Network) - list(APPEND QT_LIBRARIES Qt6::Core Qt6::Network) - set(${PROJECT_NAME}_LIBRARY_QTID "-qt6") - set(libkode_QT6 ON) + set(Qt_VERSION_MAJOR 6) + set(QT_MIN_VERSION "6.0.0") + find_package(Qt6 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS Core Network) + list(APPEND QT_LIBRARIES Qt6::Core Qt6::Network) + set(${PROJECT_NAME}_LIBRARY_QTID "-qt6") + set(libkode_QT6 ON) else() - set(Qt_VERSION_MAJOR 5) - # Qt 5.9 required for QNetworkRequest::NoLessSafeRedirectPolicy - set(QT_MIN_VERSION "5.9.0") - find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS Core Network) - list(APPEND QT_LIBRARIES Qt5::Core Qt5::Network) - set(${PROJECT_NAME}_LIBRARY_QTID "") + set(Qt_VERSION_MAJOR 5) + # Qt 5.9 required for QNetworkRequest::NoLessSafeRedirectPolicy + set(QT_MIN_VERSION "5.9.0") + find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS Core Network) + list(APPEND QT_LIBRARIES Qt5::Core Qt5::Network) + set(${PROJECT_NAME}_LIBRARY_QTID "") endif() # setup default install locations @@ -134,7 +152,7 @@ set(CMAKE_AUTORCC ON) set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(TARGET Qt6::Core) - set(CMAKE_CXX_STANDARD 17) + set(CMAKE_CXX_STANDARD 17) endif() # Default to hidden visibility for symbols @@ -145,154 +163,178 @@ set(CMAKE_VISIBILITY_INLINES_HIDDEN 1) add_definitions(-DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_FROM_BYTEARRAY -DQURL_NO_CAST_FROM_STRING) add_definitions(-DUSE_EXCEPTIONS -DQT_FATAL_ASSERT -DQT_NO_FOREACH) if(MSVC) - add_definitions(-D_SCL_SECURE_NO_WARNINGS) + add_definitions(-D_SCL_SECURE_NO_WARNINGS) endif() if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") - include(CheckCXXCompilerFlag) - check_cxx_compiler_flag(-Wsuggest-override HAVE_GXX_SUGGEST_OVERRIDE) - if(HAVE_GXX_SUGGEST_OVERRIDE) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wsuggest-override") - endif() + include(CheckCXXCompilerFlag) + check_cxx_compiler_flag(-Wsuggest-override HAVE_GXX_SUGGEST_OVERRIDE) + if(HAVE_GXX_SUGGEST_OVERRIDE) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wsuggest-override") + endif() endif() if(${PROJECT_NAME}_STATIC) - set(${PROJECT_NAME}_LIBRARY_MODE "STATIC") + set(${PROJECT_NAME}_LIBRARY_MODE "STATIC") else() - set(${PROJECT_NAME}_LIBRARY_MODE "SHARED") + set(${PROJECT_NAME}_LIBRARY_MODE "SHARED") endif() if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR) - set(${PROJECT_NAME}_IS_ROOT_PROJECT TRUE) + set(${PROJECT_NAME}_IS_ROOT_PROJECT TRUE) + + if(CMAKE_BUILD_TYPE MATCHES "Release") + add_definitions(-DNDEBUG) + endif() + + if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE + "Debug" + CACHE STRING "" FORCE + ) + endif() + + if(USE_DEFAULT_INSTALL_LOCATION) + if(UNIX) + set(CMAKE_INSTALL_PREFIX "/usr/local/KDAB/${PROJECT_NAME}-${${PROJECT_NAME}_VERSION}") + elseif(WIN32) + set(CMAKE_INSTALL_PREFIX "C:\\KDAB\\${PROJECT_NAME}-${${PROJECT_NAME}_VERSION}") + endif() + endif() - if(CMAKE_BUILD_TYPE MATCHES "Release") - add_definitions(-DNDEBUG) - endif() + message( + STATUS + "Building ${PROJECT_NAME} ${${PROJECT_NAME}_VERSION} in ${CMAKE_BUILD_TYPE} mode. Installing to ${CMAKE_INSTALL_PREFIX}" + ) - if(NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "" FORCE) - endif() + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin") + set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/lib") + set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/lib") - if(USE_DEFAULT_INSTALL_LOCATION) - if(UNIX) - set(CMAKE_INSTALL_PREFIX "/usr/local/KDAB/${PROJECT_NAME}-${${PROJECT_NAME}_VERSION}") - elseif(WIN32) - set(CMAKE_INSTALL_PREFIX "C:\\KDAB\\${PROJECT_NAME}-${${PROJECT_NAME}_VERSION}") + install(FILES README.md README-commercial.txt DESTINATION ${INSTALL_DOC_DIR}) + if(NOT ${PROJECT_NAME}_QT6) + install(FILES kdsoap.pri kdwsdl2cpp.pri DESTINATION ${INSTALL_DOC_DIR}) endif() - endif() - - message(STATUS "Building ${PROJECT_NAME} ${${PROJECT_NAME}_VERSION} in ${CMAKE_BUILD_TYPE} mode. Installing to ${CMAKE_INSTALL_PREFIX}") - - set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin") - set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/lib") - set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/lib") - - install(FILES README.md README-commercial.txt DESTINATION ${INSTALL_DOC_DIR}) - if(NOT ${PROJECT_NAME}_QT6) - install(FILES kdsoap.pri kdwsdl2cpp.pri DESTINATION ${INSTALL_DOC_DIR}) - endif() - install(DIRECTORY LICENSES DESTINATION ${INSTALL_DOC_DIR}) - - # Generate library version files - include(ECMSetupVersion) - ecm_setup_version( - ${${PROJECT_NAME}_VERSION} - VARIABLE_PREFIX KDSOAP - VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kdsoap_version.h" - PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KDSoap/KDSoap${${PROJECT_NAME}_LIBRARY_QTID}ConfigVersion.cmake" - SOVERSION ${${PROJECT_NAME}_SOVERSION} - COMPATIBILITY AnyNewerVersion - ) - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/kdsoap_version.h" DESTINATION ${INSTALL_INCLUDE_DIR}/KDSoapClient) - - configure_file( - "${CMAKE_CURRENT_SOURCE_DIR}/KDSoapConfig-buildtree.cmake.in" - "${CMAKE_CURRENT_BINARY_DIR}/KDSoap/KDSoap${${PROJECT_NAME}_LIBRARY_QTID}Config.cmake" - @ONLY - ) - configure_file( - "${CMAKE_CURRENT_SOURCE_DIR}/KDSoapMacros.cmake.in" - "${CMAKE_CURRENT_BINARY_DIR}/KDSoap/KDSoapMacros.cmake" - @ONLY - ) - configure_package_config_file( - "${CMAKE_CURRENT_SOURCE_DIR}/KDSoapConfig.cmake.in" - "${CMAKE_CURRENT_BINARY_DIR}/install/KDSoap${${PROJECT_NAME}_LIBRARY_QTID}Config.cmake" - INSTALL_DESTINATION "${INSTALL_LIBRARY_DIR}/cmake/KDSoap${${PROJECT_NAME}_LIBRARY_QTID}" - PATH_VARS INSTALL_INCLUDE_DIR - ) - - install(FILES - "${CMAKE_CURRENT_BINARY_DIR}/install/KDSoap${${PROJECT_NAME}_LIBRARY_QTID}Config.cmake" - "${CMAKE_CURRENT_BINARY_DIR}/KDSoap/KDSoap${${PROJECT_NAME}_LIBRARY_QTID}ConfigVersion.cmake" - "${CMAKE_CURRENT_BINARY_DIR}/KDSoap/KDSoapMacros.cmake" - DESTINATION "${INSTALL_LIBRARY_DIR}/cmake/KDSoap${${PROJECT_NAME}_LIBRARY_QTID}" - ) - - install(EXPORT KDSoapTargets NAMESPACE KDSoap:: - DESTINATION "${INSTALL_LIBRARY_DIR}/cmake/KDSoap${${PROJECT_NAME}_LIBRARY_QTID}" - ) - - #Install the kdsoap features file for qmake users - add_subdirectory(features) - - # Generate .pri file for qmake users - #TODO: ECM does not support Qt6 yet - if(Qt_VERSION_MAJOR EQUAL 5 AND - CMAKE_VERSION VERSION_GREATER "3.11.99" AND NOT CMAKE_CONFIGURATION_TYPES) # Not working with VS generator or older cmake versions - include(ECMGeneratePriFile) - ecm_generate_pri_file(BASE_NAME KDSoapClient - LIB_NAME kdsoap - FILENAME_VAR pri_client_filename + install(DIRECTORY LICENSES DESTINATION ${INSTALL_DOC_DIR}) + + # Generate library version files + include(ECMSetupVersion) + ecm_setup_version( + ${${PROJECT_NAME}_VERSION} + VARIABLE_PREFIX + KDSOAP + VERSION_HEADER + "${CMAKE_CURRENT_BINARY_DIR}/kdsoap_version.h" + PACKAGE_VERSION_FILE + "${CMAKE_CURRENT_BINARY_DIR}/KDSoap/KDSoap${${PROJECT_NAME}_LIBRARY_QTID}ConfigVersion.cmake" + SOVERSION + ${${PROJECT_NAME}_SOVERSION} + COMPATIBILITY + AnyNewerVersion + ) + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/kdsoap_version.h" DESTINATION ${INSTALL_INCLUDE_DIR}/KDSoapClient) + + configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/KDSoapConfig-buildtree.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/KDSoap/KDSoap${${PROJECT_NAME}_LIBRARY_QTID}Config.cmake" @ONLY + ) + configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/KDSoapMacros.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/KDSoap/KDSoapMacros.cmake" + @ONLY + ) + configure_package_config_file( + "${CMAKE_CURRENT_SOURCE_DIR}/KDSoapConfig.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/install/KDSoap${${PROJECT_NAME}_LIBRARY_QTID}Config.cmake" + INSTALL_DESTINATION "${INSTALL_LIBRARY_DIR}/cmake/KDSoap${${PROJECT_NAME}_LIBRARY_QTID}" + PATH_VARS INSTALL_INCLUDE_DIR + ) + + install( + FILES "${CMAKE_CURRENT_BINARY_DIR}/install/KDSoap${${PROJECT_NAME}_LIBRARY_QTID}Config.cmake" + "${CMAKE_CURRENT_BINARY_DIR}/KDSoap/KDSoap${${PROJECT_NAME}_LIBRARY_QTID}ConfigVersion.cmake" + "${CMAKE_CURRENT_BINARY_DIR}/KDSoap/KDSoapMacros.cmake" + DESTINATION "${INSTALL_LIBRARY_DIR}/cmake/KDSoap${${PROJECT_NAME}_LIBRARY_QTID}" ) - ecm_generate_pri_file(BASE_NAME KDSoapServer - LIB_NAME kdsoap-server - FILENAME_VAR pri_server_filename + + install( + EXPORT KDSoapTargets + NAMESPACE KDSoap:: + DESTINATION "${INSTALL_LIBRARY_DIR}/cmake/KDSoap${${PROJECT_NAME}_LIBRARY_QTID}" ) - install(FILES ${pri_client_filename} ${pri_server_filename} DESTINATION ${ECM_MKSPECS_INSTALL_DIR}) - endif() + + #Install the kdsoap features file for qmake users + add_subdirectory(features) + + # Generate .pri file for qmake users + #TODO: ECM does not support Qt6 yet + if(Qt_VERSION_MAJOR EQUAL 5 + AND CMAKE_VERSION VERSION_GREATER "3.11.99" + AND NOT CMAKE_CONFIGURATION_TYPES + ) # Not working with VS generator or older cmake versions + include(ECMGeneratePriFile) + ecm_generate_pri_file( + BASE_NAME + KDSoapClient + LIB_NAME + kdsoap + FILENAME_VAR + pri_client_filename + ) + ecm_generate_pri_file( + BASE_NAME + KDSoapServer + LIB_NAME + kdsoap-server + FILENAME_VAR + pri_server_filename + ) + install(FILES ${pri_client_filename} ${pri_server_filename} DESTINATION ${ECM_MKSPECS_INSTALL_DIR}) + endif() else() - #Always disable tests, examples, docs when used as a submodule - set(${PROJECT_NAME}_IS_ROOT_PROJECT FALSE) - set(${PROJECT_NAME}_TESTS FALSE) - set(${PROJECT_NAME}_EXAMPLES FALSE) - set(${PROJECT_NAME}_DOCS FALSE) + #Always disable tests, examples, docs when used as a submodule + set(${PROJECT_NAME}_IS_ROOT_PROJECT FALSE) + set(${PROJECT_NAME}_TESTS FALSE) + set(${PROJECT_NAME}_EXAMPLES FALSE) + set(${PROJECT_NAME}_DOCS FALSE) endif() if(${PROJECT_NAME}_TESTS) - enable_testing() + enable_testing() endif() add_subdirectory(src) add_subdirectory(kdwsdl2cpp) if(${PROJECT_NAME}_IS_ROOT_PROJECT) - export(TARGETS kdsoap kdsoap-server kdwsdl2cpp NAMESPACE KDSoap:: - FILE "${CMAKE_CURRENT_BINARY_DIR}/KDSoap/KDSoapTargets.cmake" - ) + export( + TARGETS kdsoap kdsoap-server kdwsdl2cpp + NAMESPACE KDSoap:: + FILE "${CMAKE_CURRENT_BINARY_DIR}/KDSoap/KDSoapTargets.cmake" + ) endif() if(${PROJECT_NAME}_TESTS) - add_subdirectory(testtools) - add_subdirectory(unittests) + add_subdirectory(testtools) + add_subdirectory(unittests) endif() if(${PROJECT_NAME}_EXAMPLES) - add_subdirectory(examples) + add_subdirectory(examples) endif() if(${PROJECT_NAME}_DOCS) - add_subdirectory(docs) # needs to go last, in case there are build source files + add_subdirectory(docs) # needs to go last, in case there are build source files endif() if(${PROJECT_NAME}_IS_ROOT_PROJECT) - if(NOT ${PROJECT_NAME}_DOCS) - add_custom_target(docs - COMMAND ${CMAKE_COMMAND} -E echo "Sorry, there is no docs target since KDSoap_DOCS=OFF." - "Re-run cmake with the -DKSoap_DOCS=True option if you want to generate the documentation.") - endif() - # Add uninstall target (not for submodules since parent projects typically have uninstall too) - include(ECMUninstallTarget) + if(NOT ${PROJECT_NAME}_DOCS) + add_custom_target( + docs COMMAND ${CMAKE_COMMAND} -E echo "Sorry, there is no docs target since KDSoap_DOCS=OFF." + "Re-run cmake with the -DKSoap_DOCS=True option if you want to generate the documentation." + ) + endif() + # Add uninstall target (not for submodules since parent projects typically have uninstall too) + include(ECMUninstallTarget) endif() feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/FindKDSoap.cmake b/FindKDSoap.cmake index 38d2a418..724e37b3 100644 --- a/FindKDSoap.cmake +++ b/FindKDSoap.cmake @@ -13,18 +13,30 @@ include(FindPackageHandleStandardArgs) -find_library(KDSoap_LIBRARIES - NAMES KDSoap kdsoap - PATH_SUFFIXES bin) +find_library( + KDSoap_LIBRARIES + NAMES KDSoap kdsoap + PATH_SUFFIXES bin +) -find_path(KDSoap_INCLUDE_DIR - NAMES KDSoapClient/KDSoapValue.h - PATH_SUFFIXES include src) +find_path( + KDSoap_INCLUDE_DIR + NAMES KDSoapClient/KDSoapValue.h + PATH_SUFFIXES include src +) -find_program(KDSoap_CODEGENERATOR - NAMES kdwsdl2cpp - PATH_SUFFIXES bin) +find_program( + KDSoap_CODEGENERATOR + NAMES kdwsdl2cpp + PATH_SUFFIXES bin +) mark_as_advanced(KDSoap_LIBRARIES KDSoap_INCLUDE_DIR KDSoap_CODEGENERATOR) -find_package_handle_standard_args(KDSoap DEFAULT_MSG KDSoap_LIBRARIES KDSoap_INCLUDE_DIR KDSoap_CODEGENERATOR) +find_package_handle_standard_args( + KDSoap + DEFAULT_MSG + KDSoap_LIBRARIES + KDSoap_INCLUDE_DIR + KDSoap_CODEGENERATOR +) diff --git a/cmake/InstallLocation.cmake b/cmake/InstallLocation.cmake index 29b86a74..5ff9326c 100644 --- a/cmake/InstallLocation.cmake +++ b/cmake/InstallLocation.cmake @@ -9,31 +9,31 @@ include(GNUInstallDirs) if(NOT INSTALL_RUNTIME_DIR) - set(INSTALL_RUNTIME_DIR ${CMAKE_INSTALL_BINDIR}) + set(INSTALL_RUNTIME_DIR ${CMAKE_INSTALL_BINDIR}) endif() if(NOT INSTALL_LIBRARY_DIR) - set(INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}) + set(INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}) endif() if(NOT INSTALL_ARCHIVE_DIR) - set(INSTALL_ARCHIVE_DIR ${CMAKE_INSTALL_LIBDIR}) + set(INSTALL_ARCHIVE_DIR ${CMAKE_INSTALL_LIBDIR}) endif() if(NOT INSTALL_INCLUDE_DIR) - if(${PROJECT_NAME}_QT6) - set(INSTALL_INCLUDE_DIR ${CMAKE_INSTALL_INCLUDEDIR}/KDSoap-qt6) - else() - set(INSTALL_INCLUDE_DIR ${CMAKE_INSTALL_INCLUDEDIR}) - endif() + if(${PROJECT_NAME}_QT6) + set(INSTALL_INCLUDE_DIR ${CMAKE_INSTALL_INCLUDEDIR}/KDSoap-qt6) + else() + set(INSTALL_INCLUDE_DIR ${CMAKE_INSTALL_INCLUDEDIR}) + endif() endif() if(NOT INSTALL_DATADIR) - set(INSTALL_DATADIR ${CMAKE_INSTALL_DATADIR}) + set(INSTALL_DATADIR ${CMAKE_INSTALL_DATADIR}) endif() if(NOT INSTALL_DOC_DIR) - set(INSTALL_DOC_DIR ${CMAKE_INSTALL_DOCDIR}${${PROJECT_NAME}_LIBRARY_QTID}) + set(INSTALL_DOC_DIR ${CMAKE_INSTALL_DOCDIR}${${PROJECT_NAME}_LIBRARY_QTID}) endif() set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) -if (APPLE) - set(CMAKE_MACOSX_RPATH ON) +if(APPLE) + set(CMAKE_MACOSX_RPATH ON) else() - set(CMAKE_INSTALL_RPATH "$ORIGIN/../${INSTALL_LIBRARY_DIR}") + set(CMAKE_INSTALL_RPATH "$ORIGIN/../${INSTALL_LIBRARY_DIR}") endif() diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt index 64dcb07d..1e53987c 100644 --- a/docs/CMakeLists.txt +++ b/docs/CMakeLists.txt @@ -13,13 +13,14 @@ # Doxygen find_package(Doxygen) -set_package_properties(Doxygen PROPERTIES - TYPE OPTIONAL - DESCRIPTION "API Documentation system" - URL "https://www.doxygen.org" - PURPOSE "Needed to build the API documentation." +set_package_properties( + Doxygen PROPERTIES + TYPE OPTIONAL + DESCRIPTION "API Documentation system" + URL "https://www.doxygen.org" + PURPOSE "Needed to build the API documentation." ) if(DOXYGEN_FOUND) - add_subdirectory(api) + add_subdirectory(api) endif() diff --git a/docs/api/CMakeLists.txt b/docs/api/CMakeLists.txt index 4d729179..28608065 100644 --- a/docs/api/CMakeLists.txt +++ b/docs/api/CMakeLists.txt @@ -13,68 +13,83 @@ # dot should come with Doxygen find_package(Doxygen) if(DOXYGEN_DOT_EXECUTABLE) - set(HAVE_DOT "YES") + set(HAVE_DOT "YES") else() - set(HAVE_DOT "NO") - message(STATUS "Unable to provide inheritance diagrams for the API documentation. To fix, install the graphviz project from https://www.graphviz.org") + set(HAVE_DOT "NO") + message( + STATUS + "Unable to provide inheritance diagrams for the API documentation. To fix, install the graphviz project from https://www.graphviz.org" + ) endif() # latex set(HAVE_LATEX "NO") find_package(LATEX) -set_package_properties(LATEX PROPERTIES - TYPE OPTIONAL - DESCRIPTION "A document preparation system" - URL "https://www.latex-project.org" - PURPOSE "Provides for building a PS or PDF version of the API documentation" +set_package_properties( + LATEX PROPERTIES + TYPE OPTIONAL + DESCRIPTION "A document preparation system" + URL "https://www.latex-project.org" + PURPOSE "Provides for building a PS or PDF version of the API documentation" ) if(LATEX_FOUND) - if(MAKEINDEX_COMPILER) - set(HAVE_LATEX "YES") - else() - message(STATUS "The LaTeX makeindex compiler could not be located. Unable to generate the buildsystem for LaTex documentation generation.") - endif() + if(MAKEINDEX_COMPILER) + set(HAVE_LATEX "YES") + else() + message( + STATUS + "The LaTeX makeindex compiler could not be located. Unable to generate the buildsystem for LaTex documentation generation." + ) + endif() endif() # qhelpgenerator -find_program(QHELPGEN_EXECUTABLE qhelpgenerator - HINTS ${QT_INSTALL_BINS} -) +find_program(QHELPGEN_EXECUTABLE qhelpgenerator HINTS ${QT_INSTALL_BINS}) if(QHELPGEN_EXECUTABLE) - set(HAVE_QHELPGEN "YES") + set(HAVE_QHELPGEN "YES") else() - set(HAVE_QHELPGEN "NO") - message(STATUS "Unable to generate the API documentation in qch format. To fix, install the qthelpgenerator program which comes with Qt.") + set(HAVE_QHELPGEN "NO") + message( + STATUS + "Unable to generate the API documentation in qch format. To fix, install the qthelpgenerator program which comes with Qt." + ) endif() -find_file(QDOC_QTCORE_TAG qtcore.tags - HINTS ${QT_INSTALL_DOCS}/qtcore - HINTS ${QT_INSTALL_DATA}/doc/qtcore +find_file( + QDOC_QTCORE_TAG qtcore.tags + HINTS ${QT_INSTALL_DOCS}/qtcore + HINTS ${QT_INSTALL_DATA}/doc/qtcore ) set(QDOC_TAG_DIR "") if(QDOC_QTCORE_TAG) - get_filename_component(QDOC_TAG_DIR ${QDOC_QTCORE_TAG} DIRECTORY) - get_filename_component(QDOC_TAG_DIR ${QDOC_TAG_DIR} DIRECTORY) + get_filename_component(QDOC_TAG_DIR ${QDOC_QTCORE_TAG} DIRECTORY) + get_filename_component(QDOC_TAG_DIR ${QDOC_TAG_DIR} DIRECTORY) endif() file(GLOB _dox_deps *.dox *.html) set(DOXYGEN_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}) #apidox generation using doxygen -configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.cmake - ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile -) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.cmake ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile) add_custom_command( - OUTPUT ${DOXYGEN_OUTPUT_DIR}/qch/kdsoap-api.qch - COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile - DEPENDS ${_dox_deps} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile - WORKING_DIRECTORY ${CMAKE_BINARY_DIR} + OUTPUT ${DOXYGEN_OUTPUT_DIR}/qch/kdsoap-api.qch + COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile + DEPENDS ${_dox_deps} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} ) add_custom_target(kdsoap-api.qch ALL DEPENDS ${DOXYGEN_OUTPUT_DIR}/qch/kdsoap-api.qch) add_custom_target(docs DEPENDS kdsoap-api.qch) -set(QCH_INSTALL_DIR ${INSTALL_DOC_DIR} CACHE STRING "Install location of Qt Assistant help files.") -install(FILES ${DOXYGEN_OUTPUT_DIR}/qch/kdsoap-api.qch DESTINATION ${QCH_INSTALL_DIR}) -install(FILES ${DOXYGEN_OUTPUT_DIR}/kdsoap.tags DESTINATION ${INSTALL_DOC_DIR}) +set(QCH_INSTALL_DIR + ${INSTALL_DOC_DIR} + CACHE STRING "Install location of Qt Assistant help files." +) +install( + FILES ${DOXYGEN_OUTPUT_DIR}/qch/kdsoap-api.qch + DESTINATION ${QCH_INSTALL_DIR} +) +install( + FILES ${DOXYGEN_OUTPUT_DIR}/kdsoap.tags + DESTINATION ${INSTALL_DOC_DIR} +) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 2e544364..ca2c0c30 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -11,7 +11,11 @@ ## Contact info@kdab.com if any conditions of this licensing are not clear to you. ## -find_package(Qt${Qt_VERSION_MAJOR} ${QT_MIN_VERSION} COMPONENTS Widgets CONFIG REQUIRED) +find_package( + Qt${Qt_VERSION_MAJOR} ${QT_MIN_VERSION} + COMPONENTS Widgets CONFIG + REQUIRED +) list(APPEND QT_LIBRARIES Qt${Qt_VERSION_MAJOR}::Widgets) include(${CMAKE_BINARY_DIR}/KDSoap/KDSoapMacros.cmake) diff --git a/examples/bank_gui/CMakeLists.txt b/examples/bank_gui/CMakeLists.txt index 9d79348e..7a3f328a 100644 --- a/examples/bank_gui/CMakeLists.txt +++ b/examples/bank_gui/CMakeLists.txt @@ -15,7 +15,12 @@ project(bank_gui) set(bank_gui_SRCS bank_gui.cpp mainwindow.cpp) -KDSOAP_GENERATE_WSDL(bank_gui_SRCS BLZService.wsdl) +kdsoap_generate_wsdl(bank_gui_SRCS BLZService.wsdl) -add_executable(bank_gui ${bank_gui_SRCS} resources.qrc) -target_link_libraries(bank_gui ${QT_LIBRARIES} kdsoap) +add_executable( + bank_gui + ${bank_gui_SRCS} resources.qrc +) +target_link_libraries( + bank_gui ${QT_LIBRARIES} kdsoap +) diff --git a/examples/bank_wsdl/CMakeLists.txt b/examples/bank_wsdl/CMakeLists.txt index 14942e3a..c9854091 100644 --- a/examples/bank_wsdl/CMakeLists.txt +++ b/examples/bank_wsdl/CMakeLists.txt @@ -11,11 +11,16 @@ ## Contact info@kdab.com if any conditions of this licensing are not clear to you. ## -project( bank_wsdl ) +project(bank_wsdl) set(bank_wsdl_SRCS bank_wsdl.cpp) -KDSOAP_GENERATE_WSDL(bank_wsdl_SRCS BLZService.wsdl) +kdsoap_generate_wsdl(bank_wsdl_SRCS BLZService.wsdl) -add_executable(bank_wsdl ${bank_wsdl_SRCS}) -target_link_libraries(bank_wsdl ${QT_LIBRARIES} kdsoap) +add_executable( + bank_wsdl + ${bank_wsdl_SRCS} +) +target_link_libraries( + bank_wsdl ${QT_LIBRARIES} kdsoap +) diff --git a/examples/helloworld_client/CMakeLists.txt b/examples/helloworld_client/CMakeLists.txt index 2becd42b..e4337488 100644 --- a/examples/helloworld_client/CMakeLists.txt +++ b/examples/helloworld_client/CMakeLists.txt @@ -15,7 +15,12 @@ project(helloworld_client) set(helloworld_client_SRCS main.cpp helloworld_client.h) -KDSOAP_GENERATE_WSDL(helloworld_client_SRCS ../helloworld_server/helloworld.wsdl) +kdsoap_generate_wsdl(helloworld_client_SRCS ../helloworld_server/helloworld.wsdl) -add_executable(helloworld_client ${helloworld_client_SRCS}) -target_link_libraries(helloworld_client ${QT_LIBRARIES} kdsoap) +add_executable( + helloworld_client + ${helloworld_client_SRCS} +) +target_link_libraries( + helloworld_client ${QT_LIBRARIES} kdsoap +) diff --git a/examples/helloworld_server/CMakeLists.txt b/examples/helloworld_server/CMakeLists.txt index 22291f45..860c8a29 100644 --- a/examples/helloworld_server/CMakeLists.txt +++ b/examples/helloworld_server/CMakeLists.txt @@ -16,7 +16,12 @@ project(helloworld_server) set(KSWSDL2CPP_OPTION "-server") set(helloworld_server_SRCS main.cpp helloworld_serverobject.cpp) -KDSOAP_GENERATE_WSDL(helloworld_server_SRCS helloworld.wsdl) +kdsoap_generate_wsdl(helloworld_server_SRCS helloworld.wsdl) -add_executable(helloworld_server ${helloworld_server_SRCS}) -target_link_libraries(helloworld_server ${QT_LIBRARIES} kdsoap kdsoap-server) +add_executable( + helloworld_server + ${helloworld_server_SRCS} +) +target_link_libraries( + helloworld_server ${QT_LIBRARIES} kdsoap kdsoap-server +) diff --git a/features/CMakeLists.txt b/features/CMakeLists.txt index 80ea786e..db6b8045 100644 --- a/features/CMakeLists.txt +++ b/features/CMakeLists.txt @@ -11,5 +11,5 @@ ## Contact info@kdab.com if any conditions of this licensing are not clear to you. ## if(NOT ${PROJECT_NAME}_QT6) - install(FILES kdsoap.prf DESTINATION ${INSTALL_DATADIR}/mkspecs/features) + install(FILES kdsoap.prf DESTINATION ${INSTALL_DATADIR}/mkspecs/features) endif() diff --git a/kdwsdl2cpp/CMakeLists.txt b/kdwsdl2cpp/CMakeLists.txt index f189b699..cd5b1860 100644 --- a/kdwsdl2cpp/CMakeLists.txt +++ b/kdwsdl2cpp/CMakeLists.txt @@ -11,7 +11,11 @@ ## Contact info@kdab.com if any conditions of this licensing are not clear to you. ## -find_package(Qt${Qt_VERSION_MAJOR} ${QT_MIN_VERSION} COMPONENTS Xml CONFIG REQUIRED) #libkode requires Xml +find_package( + Qt${Qt_VERSION_MAJOR} ${QT_MIN_VERSION} + COMPONENTS Xml CONFIG + REQUIRED +) #libkode requires Xml list(APPEND QT_LIBRARIES Qt${Qt_VERSION_MAJOR}::Xml) include_directories(libkode) @@ -19,75 +23,87 @@ include_directories(libkode) remove_definitions(-DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_FROM_BYTEARRAY -DQT_NO_FOREACH) set(SOURCES_LIB - libkode/common/fileprovider.cpp - libkode/common/messagehandler.cpp - libkode/common/nsmanager.cpp - libkode/common/parsercontext.cpp - libkode/common/qname.cpp - libkode/code_generation/class.cpp - libkode/code_generation/code.cpp - libkode/code_generation/enum.cpp - libkode/code_generation/license.cpp - libkode/code_generation/file.cpp - libkode/code_generation/function.cpp - libkode/code_generation/include.cpp - libkode/code_generation/membervariable.cpp - libkode/code_generation/printer.cpp - libkode/code_generation/statemachine.cpp - libkode/code_generation/style.cpp - libkode/code_generation/typedef.cpp - libkode/code_generation/variable.cpp - libkode/schema/annotation.cpp - libkode/schema/attribute.cpp - libkode/schema/complextype.cpp - libkode/schema/element.cpp - libkode/schema/parser.cpp - libkode/schema/simpletype.cpp - libkode/schema/types.cpp - libkode/schema/xmlelement.cpp - libkode/schema/xsdtype.cpp - libkode/schema/attributegroup.cpp - libkode/schema/compositor.cpp - libkode/schema/group.cpp - wsdl/binding.cpp - wsdl/bindingoperation.cpp - wsdl/definitions.cpp - wsdl/element.cpp - wsdl/fault.cpp - wsdl/import.cpp - wsdl/message.cpp - wsdl/operation.cpp - wsdl/param.cpp - wsdl/part.cpp - wsdl/port.cpp - wsdl/porttype.cpp - wsdl/service.cpp - wsdl/soapbinding.cpp - wsdl/type.cpp - wsdl/wsdl.cpp - src/compiler.cpp - src/converter.cpp - src/converter_clientstub.cpp - src/converter_complextype.cpp - src/converter_serverstub.cpp - src/converter_simpletype.cpp - src/creator.cpp - src/elementargumentserializer.cpp - src/namemapper.cpp - src/settings.cpp - src/typemap.cpp + libkode/common/fileprovider.cpp + libkode/common/messagehandler.cpp + libkode/common/nsmanager.cpp + libkode/common/parsercontext.cpp + libkode/common/qname.cpp + libkode/code_generation/class.cpp + libkode/code_generation/code.cpp + libkode/code_generation/enum.cpp + libkode/code_generation/license.cpp + libkode/code_generation/file.cpp + libkode/code_generation/function.cpp + libkode/code_generation/include.cpp + libkode/code_generation/membervariable.cpp + libkode/code_generation/printer.cpp + libkode/code_generation/statemachine.cpp + libkode/code_generation/style.cpp + libkode/code_generation/typedef.cpp + libkode/code_generation/variable.cpp + libkode/schema/annotation.cpp + libkode/schema/attribute.cpp + libkode/schema/complextype.cpp + libkode/schema/element.cpp + libkode/schema/parser.cpp + libkode/schema/simpletype.cpp + libkode/schema/types.cpp + libkode/schema/xmlelement.cpp + libkode/schema/xsdtype.cpp + libkode/schema/attributegroup.cpp + libkode/schema/compositor.cpp + libkode/schema/group.cpp + wsdl/binding.cpp + wsdl/bindingoperation.cpp + wsdl/definitions.cpp + wsdl/element.cpp + wsdl/fault.cpp + wsdl/import.cpp + wsdl/message.cpp + wsdl/operation.cpp + wsdl/param.cpp + wsdl/part.cpp + wsdl/port.cpp + wsdl/porttype.cpp + wsdl/service.cpp + wsdl/soapbinding.cpp + wsdl/type.cpp + wsdl/wsdl.cpp + src/compiler.cpp + src/converter.cpp + src/converter_clientstub.cpp + src/converter_complextype.cpp + src/converter_serverstub.cpp + src/converter_simpletype.cpp + src/creator.cpp + src/elementargumentserializer.cpp + src/namemapper.cpp + src/settings.cpp + src/typemap.cpp ) set(SOURCES_EXE src/main.cpp) -add_library(kdwsdl2cpp_lib STATIC ${SOURCES_LIB} schemas/schemas.qrc) -target_link_libraries(kdwsdl2cpp_lib ${QT_LIBRARIES}) +add_library( + kdwsdl2cpp_lib STATIC + ${SOURCES_LIB} schemas/schemas.qrc +) +target_link_libraries( + kdwsdl2cpp_lib ${QT_LIBRARIES} +) -add_executable(kdwsdl2cpp ${SOURCES_EXE}) -target_link_libraries(kdwsdl2cpp kdwsdl2cpp_lib ${QT_LIBRARIES}) +add_executable( + kdwsdl2cpp + ${SOURCES_EXE} +) +target_link_libraries( + kdwsdl2cpp kdwsdl2cpp_lib ${QT_LIBRARIES} +) set_target_properties(kdwsdl2cpp PROPERTIES OUTPUT_NAME kdwsdl2cpp${${PROJECT_NAME}_LIBRARY_QTID}) -install(TARGETS kdwsdl2cpp EXPORT "KDSoapTargets" - RUNTIME DESTINATION ${INSTALL_RUNTIME_DIR} - BUNDLE DESTINATION . +install( + TARGETS kdwsdl2cpp + EXPORT "KDSoapTargets" + RUNTIME DESTINATION ${INSTALL_RUNTIME_DIR} + BUNDLE DESTINATION . ) diff --git a/src/KDSoapClient/CMakeLists.txt b/src/KDSoapClient/CMakeLists.txt index 2628d4ec..289b9b40 100644 --- a/src/KDSoapClient/CMakeLists.txt +++ b/src/KDSoapClient/CMakeLists.txt @@ -12,111 +12,123 @@ ## set(SOURCES - KDSoapMessage.cpp - KDSoapClientInterface.cpp - KDSoapPendingCall.cpp - KDSoapPendingCallWatcher.cpp - KDSoapClientThread.cpp - KDSoapValue.cpp - KDSoapAuthentication.cpp - KDSoapNamespaceManager.cpp - KDSoapMessageWriter.cpp - KDSoapMessageReader.cpp - KDDateTime.cpp - KDSoapNamespacePrefixes.cpp - KDSoapJob.cpp - KDSoapSslHandler.cpp - KDSoapReplySslHandler.cpp - KDSoapFaultException.cpp - KDSoapMessageAddressingProperties.cpp - KDSoapEndpointReference.cpp - KDQName.cpp - KDSoapUdpClient.cpp + KDSoapMessage.cpp + KDSoapClientInterface.cpp + KDSoapPendingCall.cpp + KDSoapPendingCallWatcher.cpp + KDSoapClientThread.cpp + KDSoapValue.cpp + KDSoapAuthentication.cpp + KDSoapNamespaceManager.cpp + KDSoapMessageWriter.cpp + KDSoapMessageReader.cpp + KDDateTime.cpp + KDSoapNamespacePrefixes.cpp + KDSoapJob.cpp + KDSoapSslHandler.cpp + KDSoapReplySslHandler.cpp + KDSoapFaultException.cpp + KDSoapMessageAddressingProperties.cpp + KDSoapEndpointReference.cpp + KDQName.cpp + KDSoapUdpClient.cpp ) -add_library(kdsoap ${KDSoap_LIBRARY_MODE} ${SOURCES}) +add_library( + kdsoap + ${KDSoap_LIBRARY_MODE} ${SOURCES} +) set_target_properties(kdsoap PROPERTIES OUTPUT_NAME "kdsoap${${PROJECT_NAME}_LIBRARY_QTID}") if(${PROJECT_NAME}_STATIC) - target_compile_definitions(kdsoap PUBLIC KDSOAP_STATICLIB) + target_compile_definitions(kdsoap PUBLIC KDSOAP_STATICLIB) else() - target_compile_definitions(kdsoap PRIVATE KDSOAP_BUILD_KDSOAP_LIB) + target_compile_definitions(kdsoap PRIVATE KDSOAP_BUILD_KDSOAP_LIB) endif() -target_link_libraries(kdsoap ${QT_LIBRARIES}) -target_include_directories(kdsoap INTERFACE "$") -set_target_properties(kdsoap PROPERTIES - SOVERSION ${${PROJECT_NAME}_SOVERSION} - VERSION ${${PROJECT_NAME}_VERSION} +target_link_libraries( + kdsoap ${QT_LIBRARIES} +) +target_include_directories( + kdsoap + INTERFACE "$" ) +set_target_properties(kdsoap PROPERTIES SOVERSION ${${PROJECT_NAME}_SOVERSION} VERSION ${${PROJECT_NAME}_VERSION}) #version libraries on Windows if(WIN32) - set(postfix ${${PROJECT_NAME}_SOVERSION}) - string(TOUPPER ${CMAKE_BUILD_TYPE} UPPER_BUILD_TYPE) - if(${UPPER_BUILD_TYPE} MATCHES "^DEBUG") - string(CONCAT postfix ${postfix} "d") - set_target_properties(kdsoap PROPERTIES DEBUG_POSTFIX ${postfix}) - else() - set_target_properties(kdsoap PROPERTIES ${UPPER_BUILD_TYPE}_POSTFIX ${postfix}) - endif() + set(postfix ${${PROJECT_NAME}_SOVERSION}) + string(TOUPPER ${CMAKE_BUILD_TYPE} UPPER_BUILD_TYPE) + if(${UPPER_BUILD_TYPE} MATCHES "^DEBUG") + string(CONCAT postfix ${postfix} "d") + set_target_properties(kdsoap PROPERTIES DEBUG_POSTFIX ${postfix}) + else() + set_target_properties(kdsoap PROPERTIES ${UPPER_BUILD_TYPE}_POSTFIX ${postfix}) + endif() endif() if(KDSoap_IS_ROOT_PROJECT) - include(ECMGenerateHeaders) - ecm_generate_headers(client_HEADERS - ORIGINAL - CAMELCASE - HEADER_NAMES - KDSoapGlobal - KDSoapMessage,KDSoapHeaders - KDSoap - KDDateTime - KDSoapJob - KDSoapClientInterface - KDSoapNamespaceManager - KDSoapSslHandler - KDSoapValue,KDSoapValueList - KDSoapPendingCallWatcher - KDSoapFaultException - KDSoapMessageAddressingProperties - KDSoapEndpointReference - KDSoapPendingCall - KDSoapAuthentication - KDQName - KDSoapUdpClient - COMMON_HEADER - KDSoapClient - ) + include(ECMGenerateHeaders) + ecm_generate_headers( + client_HEADERS + ORIGINAL + CAMELCASE + HEADER_NAMES + KDSoapGlobal + KDSoapMessage,KDSoapHeaders + KDSoap + KDDateTime + KDSoapJob + KDSoapClientInterface + KDSoapNamespaceManager + KDSoapSslHandler + KDSoapValue,KDSoapValueList + KDSoapPendingCallWatcher + KDSoapFaultException + KDSoapMessageAddressingProperties + KDSoapEndpointReference + KDSoapPendingCall + KDSoapAuthentication + KDQName + KDSoapUdpClient + COMMON_HEADER + KDSoapClient + ) - install(FILES - ${client_HEADERS} - KDSoapMessage.h - KDSoapClientInterface.h - KDSoapPendingCall.h - KDSoapPendingCallWatcher.h - KDSoapValue.h - KDSoapGlobal.h - KDSoapJob.h - KDSoapAuthentication.h - KDSoapNamespaceManager.h - KDDateTime.h - KDSoap.h - KDSoapSslHandler.h - KDSoapFaultException.h - KDSoapMessageAddressingProperties.h - KDSoapEndpointReference.h - KDQName.h - KDSoapUdpClient.h - DESTINATION ${INSTALL_INCLUDE_DIR}/KDSoapClient - ) + install( + FILES ${client_HEADERS} + KDSoapMessage.h + KDSoapClientInterface.h + KDSoapPendingCall.h + KDSoapPendingCallWatcher.h + KDSoapValue.h + KDSoapGlobal.h + KDSoapJob.h + KDSoapAuthentication.h + KDSoapNamespaceManager.h + KDDateTime.h + KDSoap.h + KDSoapSslHandler.h + KDSoapFaultException.h + KDSoapMessageAddressingProperties.h + KDSoapEndpointReference.h + KDQName.h + KDSoapUdpClient.h + DESTINATION ${INSTALL_INCLUDE_DIR}/KDSoapClient + ) - install(TARGETS kdsoap EXPORT KDSoapTargets - RUNTIME DESTINATION ${INSTALL_RUNTIME_DIR} - LIBRARY DESTINATION ${INSTALL_LIBRARY_DIR} - ARCHIVE DESTINATION ${INSTALL_ARCHIVE_DIR} - ) + install( + TARGETS kdsoap + EXPORT KDSoapTargets + RUNTIME DESTINATION ${INSTALL_RUNTIME_DIR} + LIBRARY DESTINATION ${INSTALL_LIBRARY_DIR} + ARCHIVE DESTINATION ${INSTALL_ARCHIVE_DIR} + ) - if(MSVC AND NOT ${PROJECT_NAME}_STATIC) - install(FILES "$/$" DESTINATION ${INSTALL_LIBRARY_DIR} CONFIGURATIONS Debug RelWithDebInfo) - endif() + if(MSVC AND NOT ${PROJECT_NAME}_STATIC) + install( + FILES "$/$" + DESTINATION ${INSTALL_LIBRARY_DIR} + CONFIGURATIONS Debug RelWithDebInfo + ) + endif() endif() diff --git a/src/KDSoapServer/CMakeLists.txt b/src/KDSoapServer/CMakeLists.txt index f05db7b2..129f7789 100644 --- a/src/KDSoapServer/CMakeLists.txt +++ b/src/KDSoapServer/CMakeLists.txt @@ -14,88 +14,102 @@ include_directories(.. ../KDSoapClient) set(SOURCES - KDSoapDelayedResponseHandle.cpp - KDSoapServer.cpp - KDSoapServerObjectInterface.cpp - KDSoapServerSocket.cpp - KDSoapServerThread.cpp - KDSoapServerThread.cpp - KDSoapServerThread.cpp - KDSoapServerAuthInterface.cpp - KDSoapServerRawXMLInterface.cpp - KDSoapServerCustomVerbRequestInterface.cpp - KDSoapSocketList.cpp - KDSoapThreadPool.cpp + KDSoapDelayedResponseHandle.cpp + KDSoapServer.cpp + KDSoapServerObjectInterface.cpp + KDSoapServerSocket.cpp + KDSoapServerThread.cpp + KDSoapServerThread.cpp + KDSoapServerThread.cpp + KDSoapServerAuthInterface.cpp + KDSoapServerRawXMLInterface.cpp + KDSoapServerCustomVerbRequestInterface.cpp + KDSoapSocketList.cpp + KDSoapThreadPool.cpp ) set_source_files_properties(KDSoapServerObjectInterface.cpp PROPERTIES SKIP_AUTOMOC TRUE) -add_library(kdsoap-server ${KDSoap_LIBRARY_MODE} ${SOURCES}) +add_library( + kdsoap-server + ${KDSoap_LIBRARY_MODE} ${SOURCES} +) set_target_properties(kdsoap-server PROPERTIES OUTPUT_NAME "kdsoap-server${${PROJECT_NAME}_LIBRARY_QTID}") if(${PROJECT_NAME}_STATIC) - target_compile_definitions(kdsoap-server PUBLIC KDSOAPSERVER_STATICLIB) + target_compile_definitions(kdsoap-server PUBLIC KDSOAPSERVER_STATICLIB) else() - target_compile_definitions(kdsoap-server PRIVATE KDSOAP_BUILD_KDSOAPSERVER_LIB) + target_compile_definitions(kdsoap-server PRIVATE KDSOAP_BUILD_KDSOAPSERVER_LIB) endif() -target_link_libraries(kdsoap-server kdsoap ${QT_LIBRARIES}) -target_include_directories(kdsoap-server INTERFACE "$") -set_target_properties(kdsoap-server PROPERTIES - SOVERSION ${${PROJECT_NAME}_SOVERSION} - VERSION ${${PROJECT_NAME}_VERSION} +target_link_libraries( + kdsoap-server kdsoap ${QT_LIBRARIES} +) +target_include_directories( + kdsoap-server + INTERFACE "$" +) +set_target_properties( + kdsoap-server PROPERTIES SOVERSION ${${PROJECT_NAME}_SOVERSION} VERSION ${${PROJECT_NAME}_VERSION} ) #version libraries on Windows if(WIN32) - set(postfix ${${PROJECT_NAME}_SOVERSION}) - string(TOUPPER ${CMAKE_BUILD_TYPE} UPPER_BUILD_TYPE) - if(${UPPER_BUILD_TYPE} MATCHES "^DEBUG") - string(CONCAT postfix ${postfix} "d") - set_target_properties(kdsoap-server PROPERTIES DEBUG_POSTFIX ${postfix}) - else() - set_target_properties(kdsoap-server PROPERTIES ${UPPER_BUILD_TYPE}_POSTFIX ${postfix}) - endif() + set(postfix ${${PROJECT_NAME}_SOVERSION}) + string(TOUPPER ${CMAKE_BUILD_TYPE} UPPER_BUILD_TYPE) + if(${UPPER_BUILD_TYPE} MATCHES "^DEBUG") + string(CONCAT postfix ${postfix} "d") + set_target_properties(kdsoap-server PROPERTIES DEBUG_POSTFIX ${postfix}) + else() + set_target_properties(kdsoap-server PROPERTIES ${UPPER_BUILD_TYPE}_POSTFIX ${postfix}) + endif() endif() if(KDSoap_IS_ROOT_PROJECT) - include(ECMGenerateHeaders) - ecm_generate_headers(server_HEADERS - ORIGINAL - CAMELCASE - HEADER_NAMES - KDSoapDelayedResponseHandle - KDSoapServerGlobal - KDSoapThreadPool - KDSoapServerObjectInterface - KDSoapServerAuthInterface - KDSoapServerRawXMLInterface - KDSoapServerCustomVerbRequestInterface - COMMON_HEADER - KDSoapServer - ) + include(ECMGenerateHeaders) + ecm_generate_headers( + server_HEADERS + ORIGINAL + CAMELCASE + HEADER_NAMES + KDSoapDelayedResponseHandle + KDSoapServerGlobal + KDSoapThreadPool + KDSoapServerObjectInterface + KDSoapServerAuthInterface + KDSoapServerRawXMLInterface + KDSoapServerCustomVerbRequestInterface + COMMON_HEADER + KDSoapServer + ) - set(COMBINED_H ${CMAKE_CURRENT_BINARY_DIR}/KDSoapServer) - file(APPEND ${COMBINED_H} "#include \"KDSoapServer.h\"\n") + set(COMBINED_H ${CMAKE_CURRENT_BINARY_DIR}/KDSoapServer) + file(APPEND ${COMBINED_H} "#include \"KDSoapServer.h\"\n") - install(FILES - ${server_HEADERS} - KDSoapServer.h - KDSoapServerAuthInterface.h - KDSoapServerRawXMLInterface.h - KDSoapServerCustomVerbRequestInterface.h - KDSoapDelayedResponseHandle.h - KDSoapServerObjectInterface.h - KDSoapServerGlobal.h - KDSoapThreadPool.h - DESTINATION ${INSTALL_INCLUDE_DIR}/KDSoapServer - ) + install( + FILES ${server_HEADERS} + KDSoapServer.h + KDSoapServerAuthInterface.h + KDSoapServerRawXMLInterface.h + KDSoapServerCustomVerbRequestInterface.h + KDSoapDelayedResponseHandle.h + KDSoapServerObjectInterface.h + KDSoapServerGlobal.h + KDSoapThreadPool.h + DESTINATION ${INSTALL_INCLUDE_DIR}/KDSoapServer + ) - install(TARGETS kdsoap-server EXPORT KDSoapTargets - RUNTIME DESTINATION ${INSTALL_RUNTIME_DIR} - LIBRARY DESTINATION ${INSTALL_LIBRARY_DIR} - ARCHIVE DESTINATION ${INSTALL_ARCHIVE_DIR} - ) + install( + TARGETS kdsoap-server + EXPORT KDSoapTargets + RUNTIME DESTINATION ${INSTALL_RUNTIME_DIR} + LIBRARY DESTINATION ${INSTALL_LIBRARY_DIR} + ARCHIVE DESTINATION ${INSTALL_ARCHIVE_DIR} + ) - if(MSVC AND NOT ${PROJECT_NAME}_STATIC) - install(FILES "$/$" DESTINATION ${INSTALL_LIBRARY_DIR} CONFIGURATIONS Debug RelWithDebInfo) - endif() + if(MSVC AND NOT ${PROJECT_NAME}_STATIC) + install( + FILES "$/$" + DESTINATION ${INSTALL_LIBRARY_DIR} + CONFIGURATIONS Debug RelWithDebInfo + ) + endif() endif() diff --git a/testtools/CMakeLists.txt b/testtools/CMakeLists.txt index ec030dea..d01fdba5 100644 --- a/testtools/CMakeLists.txt +++ b/testtools/CMakeLists.txt @@ -11,15 +11,24 @@ ## Contact info@kdab.com if any conditions of this licensing are not clear to you. ## -find_package(Qt${Qt_VERSION_MAJOR} ${QT_MIN_VERSION} COMPONENTS Xml CONFIG REQUIRED) +find_package( + Qt${Qt_VERSION_MAJOR} ${QT_MIN_VERSION} + COMPONENTS Xml CONFIG + REQUIRED +) list(APPEND QT_LIBRARIES Qt${Qt_VERSION_MAJOR}::Xml) include_directories(.. ../src/KDSoapClient) set(testtools_srcs httpserver_p.cpp testtools.qrc) -add_library(testtools STATIC ${testtools_srcs}) -target_link_libraries(testtools ${QT_LIBRARIES}) +add_library( + testtools STATIC + ${testtools_srcs} +) +target_link_libraries( + testtools ${QT_LIBRARIES} +) if(Qt5_POSITION_INDEPENDENT_CODE) - set_target_properties(testtools PROPERTIES POSITION_INDEPENDENT_CODE TRUE) + set_target_properties(testtools PROPERTIES POSITION_INDEPENDENT_CODE TRUE) endif() diff --git a/unittests/CMakeLists.txt b/unittests/CMakeLists.txt index 5baee306..bbd91bc2 100644 --- a/unittests/CMakeLists.txt +++ b/unittests/CMakeLists.txt @@ -11,39 +11,54 @@ ## Contact info@kdab.com if any conditions of this licensing are not clear to you. ## -find_package(Qt${Qt_VERSION_MAJOR} ${QT_MIN_VERSION} COMPONENTS Test CONFIG REQUIRED) +find_package( + Qt${Qt_VERSION_MAJOR} ${QT_MIN_VERSION} + COMPONENTS Test CONFIG + REQUIRED +) list(APPEND QT_LIBRARIES Qt${Qt_VERSION_MAJOR}::Test) -include_directories(../src/ ../src/KDSoapClient/ ../src/KDSoapServer/ ../testtools/ ../kdwsdl2cpp/ ../kdwsdl2cpp/src/ ../kdwsdl2cpp/libkode/code_generation/ ../kdwsdl2cpp/libkode/ ../kdwsdl2cpp/libkode/schema/ ../kdwsdl2cpp/wsdl/) +include_directories( + ../src/ + ../src/KDSoapClient/ + ../src/KDSoapServer/ + ../testtools/ + ../kdwsdl2cpp/ + ../kdwsdl2cpp/src/ + ../kdwsdl2cpp/libkode/code_generation/ + ../kdwsdl2cpp/libkode/ + ../kdwsdl2cpp/libkode/schema/ + ../kdwsdl2cpp/wsdl/ +) include(${CMAKE_BINARY_DIR}/KDSoap/KDSoapMacros.cmake) remove_definitions(-DQT_NO_CAST_FROM_ASCII) macro(add_unittest _source) - set(_test ${_source}) - get_filename_component(_name ${_source} NAME_WE) + set(_test ${_source}) + get_filename_component(_name ${_source} NAME_WE) - if(WSDL_FILES) - if(NOT DEFINED KSWSDL2CPP_OPTION) - set(KSWSDL2CPP_OPTION -use-local-files-only) - else() - set(KSWSDL2CPP_OPTION ${KSWSDL2CPP_OPTION} -use-local-files-only) + if(WSDL_FILES) + if(NOT DEFINED KSWSDL2CPP_OPTION) + set(KSWSDL2CPP_OPTION -use-local-files-only) + else() + set(KSWSDL2CPP_OPTION ${KSWSDL2CPP_OPTION} -use-local-files-only) + endif() + kdsoap_generate_wsdl(_test ${WSDL_FILES}) endif() - kdsoap_generate_wsdl(_test ${WSDL_FILES}) - endif() - add_executable(${_name} ${_source} ${_test}) + add_executable(${_name} ${_source} ${_test}) - add_test(NAME kdsoap-${_name} COMMAND ${_name}) - target_link_libraries(${_name} ${QT_LIBRARIES} kdsoap testtools) - if(EXTRA_LIBS) - target_link_libraries(${_name} ${EXTRA_LIBS}) - endif() + add_test(NAME kdsoap-${_name} COMMAND ${_name}) + target_link_libraries(${_name} ${QT_LIBRARIES} kdsoap testtools) + if(EXTRA_LIBS) + target_link_libraries(${_name} ${EXTRA_LIBS}) + endif() endmacro() if(MSVC) - #with msvc, cribis requires the /bigobj option - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj") + #with msvc, cribis requires the /bigobj option + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj") endif() add_subdirectory(basic) @@ -93,8 +108,8 @@ add_subdirectory(webcalls) add_subdirectory(webcalls_wsdl) if(BOOST_OPTIONAL_DIR) - add_subdirectory(optionaltype_boost_optional) - add_subdirectory(default_attribute_value_wsdl) + add_subdirectory(optionaltype_boost_optional) + add_subdirectory(default_attribute_value_wsdl) endif() add_subdirectory(test_calc) diff --git a/unittests/import_definition/CMakeLists.txt b/unittests/import_definition/CMakeLists.txt index 82c381a0..3f0733c9 100644 --- a/unittests/import_definition/CMakeLists.txt +++ b/unittests/import_definition/CMakeLists.txt @@ -12,6 +12,5 @@ ## set(import_definition_SRCS test_import_definition.cpp) -set(WSDL_FILES import_definition.wsdl -import_definition_wsdl.wsdl) +set(WSDL_FILES import_definition.wsdl import_definition_wsdl.wsdl) add_unittest(${import_definition_SRCS})