aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArttu Tarkiainen <arttu.tarkiainen@qt.io>2023-01-24 19:12:04 +0200
committerArttu Tarkiainen <arttu.tarkiainen@qt.io>2023-02-01 10:30:59 +0000
commit27bde8c963be0a09b9c0b362419b008e4c1e9a10 (patch)
treeb51ef79a5f5a7226af7e9f7812bedccb31bb4967
parent4d25ca7b13ebbf89a7c728ba01064f399913f11a (diff)
Refactor project structure
Add new 'qlicenseservice' static library, which now contains most of the code shared between the different tool executables, and link the the tools against it. After this the sub-project for the main 'qtlicd' binary contains only the platform specific daemon sources. This makes the code more testable, as auto-tests to-be-added in the future only need to link against the 'qlicenseservice' library in most cases, without recompiling the sources of referenced symbols. Same should also help with the included tools that have previously shared common code. Move the source files so that all sources for standalone binaries are located in 'src/<toolname>' directories and for libraries in 'src/libs/<libname>'. Also some minor shuffling of other project files around - the built binaries and libraries will now be outputted to 'bin' and 'lib' subdirs, the distributed config and service files in 'dist' directory. Change-Id: I0de57a86e05e03d26126e083da93d36d8ff6b682 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
-rw-r--r--CMakeLists.txt58
-rwxr-xr-xbuild_linux.sh20
-rw-r--r--build_windows.bat12
-rwxr-xr-xdist/linux_service_scripts/installer.sh (renamed from linux_service_scripts/installer.sh)0
-rw-r--r--dist/linux_service_scripts/qtlicd.service (renamed from linux_service_scripts/qtlicd.service)0
-rwxr-xr-xdist/linux_service_scripts/uninstaller.sh (renamed from linux_service_scripts/uninstaller.sh)0
-rw-r--r--dist/qtlicd.ini (renamed from qtlicd.ini)0
-rw-r--r--src/CMakeLists.txt9
-rw-r--r--src/libs/3rdparty/CMakeLists.txt6
-rw-r--r--src/libs/3rdparty/curl/include/curl/curl.h (renamed from 3rdparty/curl/include/curl/curl.h)0
-rw-r--r--src/libs/3rdparty/curl/include/curl/curlver.h (renamed from 3rdparty/curl/include/curl/curlver.h)0
-rw-r--r--src/libs/3rdparty/curl/include/curl/easy.h (renamed from 3rdparty/curl/include/curl/easy.h)0
-rw-r--r--src/libs/3rdparty/curl/include/curl/header.h (renamed from 3rdparty/curl/include/curl/header.h)0
-rw-r--r--src/libs/3rdparty/curl/include/curl/mprintf.h (renamed from 3rdparty/curl/include/curl/mprintf.h)0
-rw-r--r--src/libs/3rdparty/curl/include/curl/multi.h (renamed from 3rdparty/curl/include/curl/multi.h)0
-rw-r--r--src/libs/3rdparty/curl/include/curl/options.h (renamed from 3rdparty/curl/include/curl/options.h)0
-rw-r--r--src/libs/3rdparty/curl/include/curl/stdcheaders.h (renamed from 3rdparty/curl/include/curl/stdcheaders.h)0
-rw-r--r--src/libs/3rdparty/curl/include/curl/system.h (renamed from 3rdparty/curl/include/curl/system.h)0
-rw-r--r--src/libs/3rdparty/curl/include/curl/typecheck-gcc.h (renamed from 3rdparty/curl/include/curl/typecheck-gcc.h)0
-rw-r--r--src/libs/3rdparty/curl/include/curl/urlapi.h (renamed from 3rdparty/curl/include/curl/urlapi.h)0
-rw-r--r--src/libs/3rdparty/curl/lib/libcurl.lib (renamed from 3rdparty/curl/lib/libcurl.lib)bin2178578 -> 2178578 bytes
-rw-r--r--src/libs/3rdparty/dirent/dirent.h (renamed from 3rdparty/dirent/dirent.h)0
-rw-r--r--src/libs/3rdparty/hmac_sha256/CMakeLists.txt (renamed from 3rdparty/hmac_sha256/CMakeLists.txt)0
-rw-r--r--src/libs/3rdparty/hmac_sha256/LICENSE (renamed from 3rdparty/hmac_sha256/LICENSE)0
-rw-r--r--src/libs/3rdparty/hmac_sha256/README.md (renamed from 3rdparty/hmac_sha256/README.md)0
-rw-r--r--src/libs/3rdparty/hmac_sha256/hmac_sha256.c (renamed from 3rdparty/hmac_sha256/hmac_sha256.c)0
-rw-r--r--src/libs/3rdparty/hmac_sha256/hmac_sha256.h (renamed from 3rdparty/hmac_sha256/hmac_sha256.h)0
-rw-r--r--src/libs/3rdparty/hmac_sha256/sha256.c (renamed from 3rdparty/hmac_sha256/sha256.c)0
-rw-r--r--src/libs/3rdparty/hmac_sha256/sha256.h (renamed from 3rdparty/hmac_sha256/sha256.h)0
-rw-r--r--src/libs/CMakeLists.txt7
-rw-r--r--src/libs/qlicenseservice/CMakeLists.txt51
-rw-r--r--src/libs/qlicenseservice/clienthandler.cpp (renamed from src/clienthandler.cpp)0
-rw-r--r--src/libs/qlicenseservice/commonsetup.h (renamed from include/commonsetup.h)0
-rw-r--r--src/libs/qlicenseservice/daemon_clients/clienthandler.h (renamed from src/daemon_clients/clienthandler.h)0
-rw-r--r--src/libs/qlicenseservice/daemon_clients/clitoolhandler.h (renamed from src/daemon_clients/clitoolhandler.h)0
-rw-r--r--src/libs/qlicenseservice/daemon_clients/cocohandler.h (renamed from src/daemon_clients/cocohandler.h)0
-rw-r--r--src/libs/qlicenseservice/daemon_clients/mochandler.h (renamed from src/daemon_clients/mochandler.h)0
-rw-r--r--src/libs/qlicenseservice/daemon_clients/pluginhandler.h (renamed from src/daemon_clients/pluginhandler.h)0
-rw-r--r--src/libs/qlicenseservice/daemon_clients/squishhandler.h (renamed from src/daemon_clients/squishhandler.h)0
-rw-r--r--src/libs/qlicenseservice/daemon_clients/squishidehandler.h (renamed from src/daemon_clients/squishidehandler.h)0
-rw-r--r--src/libs/qlicenseservice/httpclient.cpp (renamed from src/httpclient.cpp)0
-rw-r--r--src/libs/qlicenseservice/httpclient.h (renamed from include/httpclient.h)0
-rw-r--r--src/libs/qlicenseservice/jsonhandler.cpp (renamed from src/jsonhandler.cpp)0
-rw-r--r--src/libs/qlicenseservice/jsonhandler.h (renamed from include/jsonhandler.h)0
-rw-r--r--src/libs/qlicenseservice/licdsetup.cpp (renamed from src/licdsetup.cpp)0
-rw-r--r--src/libs/qlicenseservice/licdsetup.h (renamed from include/licdsetup.h)0
-rw-r--r--src/libs/qlicenseservice/licenser.cpp (renamed from src/licenser.cpp)0
-rw-r--r--src/libs/qlicenseservice/licenser.h (renamed from include/licenser.h)0
-rw-r--r--src/libs/qlicenseservice/tcpclient.cpp (renamed from src/tcpclient.cpp)0
-rw-r--r--src/libs/qlicenseservice/tcpclient.h (renamed from include/tcpclient.h)0
-rw-r--r--src/libs/qlicenseservice/tcpserver.cpp (renamed from src/tcpserver.cpp)0
-rw-r--r--src/libs/qlicenseservice/tcpserver.h (renamed from include/tcpserver.h)0
-rw-r--r--src/libs/qlicenseservice/utils.cpp (renamed from src/utils.cpp)0
-rw-r--r--src/libs/qlicenseservice/utils.h (renamed from include/utils.h)0
-rw-r--r--src/libs/qlicenseservice/version.h (renamed from include/version.h)0
-rw-r--r--src/licheck/CMakeLists.txt14
-rw-r--r--src/licheck/dummy_licheck.cpp (renamed from src/dummy_licheck.cpp)0
-rw-r--r--src/linux_daemon/linuxdaemon.cpp (renamed from linux_daemon/linuxdaemon.cpp)0
-rw-r--r--src/mocwrapper/CMakeLists.txt (renamed from mocwrapper/CMakeLists.txt)14
-rw-r--r--src/mocwrapper/mocwrapper.cpp (renamed from mocwrapper/mocwrapper.cpp)0
-rw-r--r--src/mocwrapper/mocwrapper.h (renamed from mocwrapper/mocwrapper.h)0
-rw-r--r--src/qtlicensetool/CMakeLists.txt (renamed from qtlicensetool/CMakeLists.txt)14
-rw-r--r--src/qtlicensetool/qtlicensetool.cpp (renamed from qtlicensetool/qtlicensetool.cpp)0
-rw-r--r--src/qtlicensetool/qtlicensetool.h (renamed from qtlicensetool/qtlicensetool.h)0
-rw-r--r--src/windows_daemon/windowsdaemon.cpp (renamed from 3rdparty/windowsdaemon/windowsdaemon.cpp)0
65 files changed, 130 insertions, 75 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a016ef0..d341013 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (C) 2022 The Qt Company Ltd.
+# Copyright (C) 2023 The Qt Company Ltd.
#
# Published under GPL-3.0 with Qt-GPL-exception-1.0
#
@@ -12,67 +12,43 @@ cmake_policy(SET CMP0042 NEW)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
+set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
+
ADD_DEFINITIONS(-DUNICODE)
ADD_DEFINITIONS(-D_UNICODE)
-list(APPEND targetSrc
- ${CMAKE_CURRENT_LIST_DIR}/src/licenser.cpp
- ${CMAKE_CURRENT_LIST_DIR}/src/tcpserver.cpp
- ${CMAKE_CURRENT_LIST_DIR}/src/httpclient.cpp
- ${CMAKE_CURRENT_LIST_DIR}/src/jsonhandler.cpp
- ${CMAKE_CURRENT_LIST_DIR}/src/utils.cpp
- ${CMAKE_CURRENT_LIST_DIR}/src/licdsetup.cpp
- ${CMAKE_CURRENT_LIST_DIR}/src/clienthandler.cpp
-)
-list(APPEND includes
- ${CMAKE_CURRENT_LIST_DIR}/include
- ${CMAKE_CURRENT_LIST_DIR}/src/daemon_clients
- ${CMAKE_CURRENT_LIST_DIR}/3rdparty
-)
-
-list(APPEND libs hmac_sha256)
-
-include(GNUInstallDirs)
-
-
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
-set(BUILD_SHARED_LIBS OFF)
- set(CURL_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/3rdparty/curl/include)
- set(CURL_LIBRARY ${CMAKE_SOURCE_DIR}/3rdparty/curl/lib/libcurl.lib)
+ set(BUILD_SHARED_LIBS OFF)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
- add_definitions(-DCURL_STATICLIB)
- list(APPEND includes
- ${CURL_INCLUDE_DIR}
- )
list(APPEND targetSrc
- ${CMAKE_CURRENT_LIST_DIR}/3rdparty/windowsdaemon/windowsdaemon.cpp
+ ${CMAKE_CURRENT_LIST_DIR}/src/windows_daemon/windowsdaemon.cpp
)
- list(APPEND libs
- ws2_32.lib crypt32.lib wldap32.lib normaliz.lib
- ${CURL_LIBRARY}
- )
-else()
+else ()
list(APPEND targetSrc
- ${CMAKE_CURRENT_LIST_DIR}/linux_daemon/linuxdaemon.cpp
+ ${CMAKE_CURRENT_LIST_DIR}/src/linux_daemon/linuxdaemon.cpp
)
- list(APPEND libs curl)
endif ()
-find_package(CURL REQUIRED)
+add_subdirectory(src)
+
+list(APPEND includes ${CMAKE_CURRENT_LIST_DIR}/src/libs/qlicenseservice)
+list(APPEND libs qlicenseservice)
+
+include(GNUInstallDirs)
message("Compiler: ${CMAKE_CXX_COMPILER_ID}")
message("System: ${CMAKE_SYSTEM}")
message("Libs: ${libs}")
-add_subdirectory(3rdparty/hmac_sha256)
-add_subdirectory(qtlicensetool)
-add_subdirectory(mocwrapper)
-add_executable(licheck src/dummy_licheck.cpp)
add_executable(${PROJECT_NAME} ${targetSrc})
+
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
target_link_options(${PROJECT_NAME} PRIVATE "/NODEFAULTLIB:LIBCMT")
target_link_options(${PROJECT_NAME} PRIVATE "/NODEFAULTLIB:MSVCRTD")
endif ()
+
target_include_directories(${PROJECT_NAME} PUBLIC ${includes})
target_link_libraries(${PROJECT_NAME} ${libs} )
diff --git a/build_linux.sh b/build_linux.sh
index 0297dcb..91d7765 100755
--- a/build_linux.sh
+++ b/build_linux.sh
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
-# Copyright (C) 2022 The Qt Company Ltd.
+# Copyright (C) 2023 The Qt Company Ltd.
#
# SPDX-License-Identifier: GPL-3.0-only WITH Qt-GPL-exception-1.0
#
@@ -65,7 +65,7 @@ if [ $? != 0 ]; then
exit_fail "Build failed"
fi
-chmod +x ${name} licheck qtlicensetool/qtlicensetool mocwrapper/mocwrapper
+chmod +x bin/${name} bin/licheck bin/qtlicensetool bin/mocwrapper
cd ..
# Copy files for deployment dir (first create it)
mkdir -p ${deploy_dir}
@@ -73,14 +73,14 @@ if [ $? != 0 ]; then
exit_fail "Failed to create deploy dir"
fi
-cp build/${name} ${deploy_dir}/
-cp build/licheck ${deploy_dir}/
-cp build/qtlicensetool/qtlicensetool ${deploy_dir}/
-cp build/mocwrapper/mocwrapper ${deploy_dir}/
-cp ${name}.ini ${deploy_dir}/
-cp linux_service_scripts/${name}.service ${deploy_dir}/
-cp linux_service_scripts/installer.sh ${deploy_dir}/
-cp linux_service_scripts/uninstaller.sh ${deploy_dir}/
+cp build/bin/${name} ${deploy_dir}/
+cp build/bin/licheck ${deploy_dir}/
+cp build/bin/qtlicensetool ${deploy_dir}/
+cp build/bin/mocwrapper ${deploy_dir}/
+cp dist/${name}.ini ${deploy_dir}/
+cp dist/linux_service_scripts/${name}.service ${deploy_dir}/
+cp dist/linux_service_scripts/installer.sh ${deploy_dir}/
+cp dist/linux_service_scripts/uninstaller.sh ${deploy_dir}/
#
# Install & start the daemon
diff --git a/build_windows.bat b/build_windows.bat
index 0b48a43..8ca6113 100644
--- a/build_windows.bat
+++ b/build_windows.bat
@@ -1,4 +1,4 @@
-:: Copyright (C) 2022 The Qt Company Ltd.
+:: Copyright (C) 2023 The Qt Company Ltd.
::
:: SPDX-License-Identifier: GPL-3.0-only WITH Qt-GPL-exception-1.0
::
@@ -8,15 +8,15 @@
mkdir build
mkdir deploy
-copy qtlicd.ini deploy\
+copy dist\qtlicd.ini deploy\
cd build
cmake .. -G "Visual Studio 17 2022"
cmake --build .
-copy Debug\qtlicd.exe ..\deploy\
-copy Debug\licheck.exe ..\deploy\
-copy mocwrapper\Debug\mocwrapper.exe ..\deploy\
-copy qtlicensetool\Debug\qtlicensetool.exe ..\deploy\
+copy bin\Debug\qtlicd.exe ..\deploy\
+copy bin\Debug\licheck.exe ..\deploy\
+copy bin\Debug\mocwrapper.exe ..\deploy\
+copy bin\Debug\qtlicensetool.exe ..\deploy\
cd ..
diff --git a/linux_service_scripts/installer.sh b/dist/linux_service_scripts/installer.sh
index ae6e1db..ae6e1db 100755
--- a/linux_service_scripts/installer.sh
+++ b/dist/linux_service_scripts/installer.sh
diff --git a/linux_service_scripts/qtlicd.service b/dist/linux_service_scripts/qtlicd.service
index 89cef48..89cef48 100644
--- a/linux_service_scripts/qtlicd.service
+++ b/dist/linux_service_scripts/qtlicd.service
diff --git a/linux_service_scripts/uninstaller.sh b/dist/linux_service_scripts/uninstaller.sh
index 8a28233..8a28233 100755
--- a/linux_service_scripts/uninstaller.sh
+++ b/dist/linux_service_scripts/uninstaller.sh
diff --git a/qtlicd.ini b/dist/qtlicd.ini
index b7ae804..b7ae804 100644
--- a/qtlicd.ini
+++ b/dist/qtlicd.ini
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
new file mode 100644
index 0000000..02067fe
--- /dev/null
+++ b/src/CMakeLists.txt
@@ -0,0 +1,9 @@
+# Copyright (C) 2023 The Qt Company Ltd.
+#
+# Published under GPL-3.0 with Qt-GPL-exception-1.0
+#
+
+add_subdirectory(libs)
+add_subdirectory(licheck)
+add_subdirectory(mocwrapper)
+add_subdirectory(qtlicensetool)
diff --git a/src/libs/3rdparty/CMakeLists.txt b/src/libs/3rdparty/CMakeLists.txt
new file mode 100644
index 0000000..c1fc1db
--- /dev/null
+++ b/src/libs/3rdparty/CMakeLists.txt
@@ -0,0 +1,6 @@
+# Copyright (C) 2023 The Qt Company Ltd.
+#
+# Published under GPL-3.0 with Qt-GPL-exception-1.0
+#
+
+add_subdirectory(hmac_sha256)
diff --git a/3rdparty/curl/include/curl/curl.h b/src/libs/3rdparty/curl/include/curl/curl.h
index 7a1b561..7a1b561 100644
--- a/3rdparty/curl/include/curl/curl.h
+++ b/src/libs/3rdparty/curl/include/curl/curl.h
diff --git a/3rdparty/curl/include/curl/curlver.h b/src/libs/3rdparty/curl/include/curl/curlver.h
index 8bceb53..8bceb53 100644
--- a/3rdparty/curl/include/curl/curlver.h
+++ b/src/libs/3rdparty/curl/include/curl/curlver.h
diff --git a/3rdparty/curl/include/curl/easy.h b/src/libs/3rdparty/curl/include/curl/easy.h
index 9c7e63a..9c7e63a 100644
--- a/3rdparty/curl/include/curl/easy.h
+++ b/src/libs/3rdparty/curl/include/curl/easy.h
diff --git a/3rdparty/curl/include/curl/header.h b/src/libs/3rdparty/curl/include/curl/header.h
index 6af29c0..6af29c0 100644
--- a/3rdparty/curl/include/curl/header.h
+++ b/src/libs/3rdparty/curl/include/curl/header.h
diff --git a/3rdparty/curl/include/curl/mprintf.h b/src/libs/3rdparty/curl/include/curl/mprintf.h
index cb948dc..cb948dc 100644
--- a/3rdparty/curl/include/curl/mprintf.h
+++ b/src/libs/3rdparty/curl/include/curl/mprintf.h
diff --git a/3rdparty/curl/include/curl/multi.h b/src/libs/3rdparty/curl/include/curl/multi.h
index 3010492..3010492 100644
--- a/3rdparty/curl/include/curl/multi.h
+++ b/src/libs/3rdparty/curl/include/curl/multi.h
diff --git a/3rdparty/curl/include/curl/options.h b/src/libs/3rdparty/curl/include/curl/options.h
index c8ac827..c8ac827 100644
--- a/3rdparty/curl/include/curl/options.h
+++ b/src/libs/3rdparty/curl/include/curl/options.h
diff --git a/3rdparty/curl/include/curl/stdcheaders.h b/src/libs/3rdparty/curl/include/curl/stdcheaders.h
index 82e1b5f..82e1b5f 100644
--- a/3rdparty/curl/include/curl/stdcheaders.h
+++ b/src/libs/3rdparty/curl/include/curl/stdcheaders.h
diff --git a/3rdparty/curl/include/curl/system.h b/src/libs/3rdparty/curl/include/curl/system.h
index 8d56b8a..8d56b8a 100644
--- a/3rdparty/curl/include/curl/system.h
+++ b/src/libs/3rdparty/curl/include/curl/system.h
diff --git a/3rdparty/curl/include/curl/typecheck-gcc.h b/src/libs/3rdparty/curl/include/curl/typecheck-gcc.h
index 2dabcb4..2dabcb4 100644
--- a/3rdparty/curl/include/curl/typecheck-gcc.h
+++ b/src/libs/3rdparty/curl/include/curl/typecheck-gcc.h
diff --git a/3rdparty/curl/include/curl/urlapi.h b/src/libs/3rdparty/curl/include/curl/urlapi.h
index e15c213..e15c213 100644
--- a/3rdparty/curl/include/curl/urlapi.h
+++ b/src/libs/3rdparty/curl/include/curl/urlapi.h
diff --git a/3rdparty/curl/lib/libcurl.lib b/src/libs/3rdparty/curl/lib/libcurl.lib
index 06f6bcd..06f6bcd 100644
--- a/3rdparty/curl/lib/libcurl.lib
+++ b/src/libs/3rdparty/curl/lib/libcurl.lib
Binary files differ
diff --git a/3rdparty/dirent/dirent.h b/src/libs/3rdparty/dirent/dirent.h
index d135596..d135596 100644
--- a/3rdparty/dirent/dirent.h
+++ b/src/libs/3rdparty/dirent/dirent.h
diff --git a/3rdparty/hmac_sha256/CMakeLists.txt b/src/libs/3rdparty/hmac_sha256/CMakeLists.txt
index 8a50340..8a50340 100644
--- a/3rdparty/hmac_sha256/CMakeLists.txt
+++ b/src/libs/3rdparty/hmac_sha256/CMakeLists.txt
diff --git a/3rdparty/hmac_sha256/LICENSE b/src/libs/3rdparty/hmac_sha256/LICENSE
index fdddb29..fdddb29 100644
--- a/3rdparty/hmac_sha256/LICENSE
+++ b/src/libs/3rdparty/hmac_sha256/LICENSE
diff --git a/3rdparty/hmac_sha256/README.md b/src/libs/3rdparty/hmac_sha256/README.md
index a8bf2c7..a8bf2c7 100644
--- a/3rdparty/hmac_sha256/README.md
+++ b/src/libs/3rdparty/hmac_sha256/README.md
diff --git a/3rdparty/hmac_sha256/hmac_sha256.c b/src/libs/3rdparty/hmac_sha256/hmac_sha256.c
index d23a6e2..d23a6e2 100644
--- a/3rdparty/hmac_sha256/hmac_sha256.c
+++ b/src/libs/3rdparty/hmac_sha256/hmac_sha256.c
diff --git a/3rdparty/hmac_sha256/hmac_sha256.h b/src/libs/3rdparty/hmac_sha256/hmac_sha256.h
index 976b6c1..976b6c1 100644
--- a/3rdparty/hmac_sha256/hmac_sha256.h
+++ b/src/libs/3rdparty/hmac_sha256/hmac_sha256.h
diff --git a/3rdparty/hmac_sha256/sha256.c b/src/libs/3rdparty/hmac_sha256/sha256.c
index 95def0b..95def0b 100644
--- a/3rdparty/hmac_sha256/sha256.c
+++ b/src/libs/3rdparty/hmac_sha256/sha256.c
diff --git a/3rdparty/hmac_sha256/sha256.h b/src/libs/3rdparty/hmac_sha256/sha256.h
index ddedf9f..ddedf9f 100644
--- a/3rdparty/hmac_sha256/sha256.h
+++ b/src/libs/3rdparty/hmac_sha256/sha256.h
diff --git a/src/libs/CMakeLists.txt b/src/libs/CMakeLists.txt
new file mode 100644
index 0000000..f3f60f8
--- /dev/null
+++ b/src/libs/CMakeLists.txt
@@ -0,0 +1,7 @@
+# Copyright (C) 2023 The Qt Company Ltd.
+#
+# Published under GPL-3.0 with Qt-GPL-exception-1.0
+#
+
+add_subdirectory(3rdparty)
+add_subdirectory(qlicenseservice)
diff --git a/src/libs/qlicenseservice/CMakeLists.txt b/src/libs/qlicenseservice/CMakeLists.txt
new file mode 100644
index 0000000..44511c0
--- /dev/null
+++ b/src/libs/qlicenseservice/CMakeLists.txt
@@ -0,0 +1,51 @@
+# Copyright (C) 2023 The Qt Company Ltd.
+#
+# Published under GPL-3.0 with Qt-GPL-exception-1.0
+#
+
+cmake_minimum_required(VERSION 3.5)
+
+project(qlicenseservice LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_CXX_STANDARD 14)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
+
+list(APPEND sources
+ ${CMAKE_CURRENT_LIST_DIR}/licenser.cpp
+ ${CMAKE_CURRENT_LIST_DIR}/tcpserver.cpp
+ ${CMAKE_CURRENT_LIST_DIR}/tcpclient.cpp
+ ${CMAKE_CURRENT_LIST_DIR}/httpclient.cpp
+ ${CMAKE_CURRENT_LIST_DIR}/jsonhandler.cpp
+ ${CMAKE_CURRENT_LIST_DIR}/utils.cpp
+ ${CMAKE_CURRENT_LIST_DIR}/licdsetup.cpp
+ ${CMAKE_CURRENT_LIST_DIR}/clienthandler.cpp
+)
+list(APPEND includes
+ ${CMAKE_CURRENT_LIST_DIR}/daemon_clients
+ ${CMAKE_CURRENT_LIST_DIR}/../3rdparty
+)
+list(APPEND libs hmac_sha256)
+
+if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
+ set(CURL_INCLUDE_DIR ${CMAKE_CURRENT_LIST_DIR}/../3rdparty/curl/include)
+ set(CURL_LIBRARY ${CMAKE_CURRENT_LIST_DIR}/../3rdparty/curl/lib/libcurl.lib)
+
+ add_definitions(-DCURL_STATICLIB)
+
+ list(APPEND includes ${CURL_INCLUDE_DIR})
+ list(APPEND libs
+ ws2_32.lib crypt32.lib wldap32.lib normaliz.lib
+ ${CURL_LIBRARY}
+ )
+else ()
+ list(APPEND libs curl)
+endif ()
+
+find_package(CURL REQUIRED)
+
+add_library(${PROJECT_NAME} ${sources})
+
+target_include_directories(${PROJECT_NAME} PUBLIC ${includes})
+target_link_libraries(${PROJECT_NAME} ${libs} )
diff --git a/src/clienthandler.cpp b/src/libs/qlicenseservice/clienthandler.cpp
index 1c1c6c9..1c1c6c9 100644
--- a/src/clienthandler.cpp
+++ b/src/libs/qlicenseservice/clienthandler.cpp
diff --git a/include/commonsetup.h b/src/libs/qlicenseservice/commonsetup.h
index d0f403b..d0f403b 100644
--- a/include/commonsetup.h
+++ b/src/libs/qlicenseservice/commonsetup.h
diff --git a/src/daemon_clients/clienthandler.h b/src/libs/qlicenseservice/daemon_clients/clienthandler.h
index 8d04be8..8d04be8 100644
--- a/src/daemon_clients/clienthandler.h
+++ b/src/libs/qlicenseservice/daemon_clients/clienthandler.h
diff --git a/src/daemon_clients/clitoolhandler.h b/src/libs/qlicenseservice/daemon_clients/clitoolhandler.h
index ce3429e..ce3429e 100644
--- a/src/daemon_clients/clitoolhandler.h
+++ b/src/libs/qlicenseservice/daemon_clients/clitoolhandler.h
diff --git a/src/daemon_clients/cocohandler.h b/src/libs/qlicenseservice/daemon_clients/cocohandler.h
index 48494e0..48494e0 100644
--- a/src/daemon_clients/cocohandler.h
+++ b/src/libs/qlicenseservice/daemon_clients/cocohandler.h
diff --git a/src/daemon_clients/mochandler.h b/src/libs/qlicenseservice/daemon_clients/mochandler.h
index acf1228..acf1228 100644
--- a/src/daemon_clients/mochandler.h
+++ b/src/libs/qlicenseservice/daemon_clients/mochandler.h
diff --git a/src/daemon_clients/pluginhandler.h b/src/libs/qlicenseservice/daemon_clients/pluginhandler.h
index 27eae11..27eae11 100644
--- a/src/daemon_clients/pluginhandler.h
+++ b/src/libs/qlicenseservice/daemon_clients/pluginhandler.h
diff --git a/src/daemon_clients/squishhandler.h b/src/libs/qlicenseservice/daemon_clients/squishhandler.h
index 04d1abb..04d1abb 100644
--- a/src/daemon_clients/squishhandler.h
+++ b/src/libs/qlicenseservice/daemon_clients/squishhandler.h
diff --git a/src/daemon_clients/squishidehandler.h b/src/libs/qlicenseservice/daemon_clients/squishidehandler.h
index 30f3447..30f3447 100644
--- a/src/daemon_clients/squishidehandler.h
+++ b/src/libs/qlicenseservice/daemon_clients/squishidehandler.h
diff --git a/src/httpclient.cpp b/src/libs/qlicenseservice/httpclient.cpp
index 07d13ea..07d13ea 100644
--- a/src/httpclient.cpp
+++ b/src/libs/qlicenseservice/httpclient.cpp
diff --git a/include/httpclient.h b/src/libs/qlicenseservice/httpclient.h
index a587c67..a587c67 100644
--- a/include/httpclient.h
+++ b/src/libs/qlicenseservice/httpclient.h
diff --git a/src/jsonhandler.cpp b/src/libs/qlicenseservice/jsonhandler.cpp
index 41a0c81..41a0c81 100644
--- a/src/jsonhandler.cpp
+++ b/src/libs/qlicenseservice/jsonhandler.cpp
diff --git a/include/jsonhandler.h b/src/libs/qlicenseservice/jsonhandler.h
index 3755f19..3755f19 100644
--- a/include/jsonhandler.h
+++ b/src/libs/qlicenseservice/jsonhandler.h
diff --git a/src/licdsetup.cpp b/src/libs/qlicenseservice/licdsetup.cpp
index 45addda..45addda 100644
--- a/src/licdsetup.cpp
+++ b/src/libs/qlicenseservice/licdsetup.cpp
diff --git a/include/licdsetup.h b/src/libs/qlicenseservice/licdsetup.h
index d4c7d84..d4c7d84 100644
--- a/include/licdsetup.h
+++ b/src/libs/qlicenseservice/licdsetup.h
diff --git a/src/licenser.cpp b/src/libs/qlicenseservice/licenser.cpp
index 3bd5f6b..3bd5f6b 100644
--- a/src/licenser.cpp
+++ b/src/libs/qlicenseservice/licenser.cpp
diff --git a/include/licenser.h b/src/libs/qlicenseservice/licenser.h
index 7799e09..7799e09 100644
--- a/include/licenser.h
+++ b/src/libs/qlicenseservice/licenser.h
diff --git a/src/tcpclient.cpp b/src/libs/qlicenseservice/tcpclient.cpp
index 1922b76..1922b76 100644
--- a/src/tcpclient.cpp
+++ b/src/libs/qlicenseservice/tcpclient.cpp
diff --git a/include/tcpclient.h b/src/libs/qlicenseservice/tcpclient.h
index 383b913..383b913 100644
--- a/include/tcpclient.h
+++ b/src/libs/qlicenseservice/tcpclient.h
diff --git a/src/tcpserver.cpp b/src/libs/qlicenseservice/tcpserver.cpp
index 79948e1..79948e1 100644
--- a/src/tcpserver.cpp
+++ b/src/libs/qlicenseservice/tcpserver.cpp
diff --git a/include/tcpserver.h b/src/libs/qlicenseservice/tcpserver.h
index a031b88..a031b88 100644
--- a/include/tcpserver.h
+++ b/src/libs/qlicenseservice/tcpserver.h
diff --git a/src/utils.cpp b/src/libs/qlicenseservice/utils.cpp
index 2c58847..2c58847 100644
--- a/src/utils.cpp
+++ b/src/libs/qlicenseservice/utils.cpp
diff --git a/include/utils.h b/src/libs/qlicenseservice/utils.h
index 163836e..163836e 100644
--- a/include/utils.h
+++ b/src/libs/qlicenseservice/utils.h
diff --git a/include/version.h b/src/libs/qlicenseservice/version.h
index 15bdcbd..15bdcbd 100644
--- a/include/version.h
+++ b/src/libs/qlicenseservice/version.h
diff --git a/src/licheck/CMakeLists.txt b/src/licheck/CMakeLists.txt
new file mode 100644
index 0000000..58fc657
--- /dev/null
+++ b/src/licheck/CMakeLists.txt
@@ -0,0 +1,14 @@
+# Copyright (C) 2023 The Qt Company Ltd.
+#
+# SPDX-License-Identifier: GPL-3.0-only WITH Qt-GPL-exception-1.0
+#
+
+cmake_minimum_required(VERSION 3.5)
+project(licheck LANGUAGES C CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_CXX_STANDARD 14)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
+
+add_executable(licheck dummy_licheck.cpp)
diff --git a/src/dummy_licheck.cpp b/src/licheck/dummy_licheck.cpp
index e38c627..e38c627 100644
--- a/src/dummy_licheck.cpp
+++ b/src/licheck/dummy_licheck.cpp
diff --git a/linux_daemon/linuxdaemon.cpp b/src/linux_daemon/linuxdaemon.cpp
index 0b8a10a..0b8a10a 100644
--- a/linux_daemon/linuxdaemon.cpp
+++ b/src/linux_daemon/linuxdaemon.cpp
diff --git a/mocwrapper/CMakeLists.txt b/src/mocwrapper/CMakeLists.txt
index 0189642..35d2044 100644
--- a/mocwrapper/CMakeLists.txt
+++ b/src/mocwrapper/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (C) 2022 The Qt Company Ltd.
+# Copyright (C) 2023 The Qt Company Ltd.
#
# SPDX-License-Identifier: GPL-3.0-only WITH Qt-GPL-exception-1.0
#
@@ -13,13 +13,9 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
include_directories (
./
- ../include/
- ../3rdparty/
+ ${CMAKE_CURRENT_LIST_DIR}/../libs/qlicenseservice/
)
-add_executable(mocwrapper
- mocwrapper.cpp
- ../src/tcpclient.cpp
- ../src/utils.cpp
- ../src/licdsetup.cpp
-)
+add_executable(mocwrapper mocwrapper.cpp)
+
+target_link_libraries(mocwrapper PUBLIC qlicenseservice)
diff --git a/mocwrapper/mocwrapper.cpp b/src/mocwrapper/mocwrapper.cpp
index 830d894..830d894 100644
--- a/mocwrapper/mocwrapper.cpp
+++ b/src/mocwrapper/mocwrapper.cpp
diff --git a/mocwrapper/mocwrapper.h b/src/mocwrapper/mocwrapper.h
index 6c4deaa..6c4deaa 100644
--- a/mocwrapper/mocwrapper.h
+++ b/src/mocwrapper/mocwrapper.h
diff --git a/qtlicensetool/CMakeLists.txt b/src/qtlicensetool/CMakeLists.txt
index c2f5c21..f061700 100644
--- a/qtlicensetool/CMakeLists.txt
+++ b/src/qtlicensetool/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (C) 2022 The Qt Company Ltd.
+# Copyright (C) 2023 The Qt Company Ltd.
#
# SPDX-License-Identifier: GPL-3.0-only WITH Qt-GPL-exception-1.0
#
@@ -12,8 +12,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
include_directories (
./
- ${CMAKE_CURRENT_LIST_DIR}/../include/
- ${CMAKE_CURRENT_LIST_DIR}/../3drparty/
+ ${CMAKE_CURRENT_LIST_DIR}/../libs/qlicenseservice/
)
#if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
@@ -22,9 +21,6 @@ include_directories (
# )
#endif()
-add_executable(qtlicensetool
- qtlicensetool.cpp
- ../src/tcpclient.cpp
- ../src/utils.cpp
- ../src/licdsetup.cpp
-)
+add_executable(qtlicensetool qtlicensetool.cpp)
+
+target_link_libraries(qtlicensetool PUBLIC qlicenseservice)
diff --git a/qtlicensetool/qtlicensetool.cpp b/src/qtlicensetool/qtlicensetool.cpp
index 6c0bbc9..6c0bbc9 100644
--- a/qtlicensetool/qtlicensetool.cpp
+++ b/src/qtlicensetool/qtlicensetool.cpp
diff --git a/qtlicensetool/qtlicensetool.h b/src/qtlicensetool/qtlicensetool.h
index 25ef04b..25ef04b 100644
--- a/qtlicensetool/qtlicensetool.h
+++ b/src/qtlicensetool/qtlicensetool.h
diff --git a/3rdparty/windowsdaemon/windowsdaemon.cpp b/src/windows_daemon/windowsdaemon.cpp
index 296f4b1..296f4b1 100644
--- a/3rdparty/windowsdaemon/windowsdaemon.cpp
+++ b/src/windows_daemon/windowsdaemon.cpp