This repository has been archived by the owner on Feb 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 241
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
45 changed files
with
814 additions
and
596 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
Ľubomír Carik <[email protected]> Ľubomír Carik <[email protected]> | ||
Ľubomír Carik <[email protected]> Ľubomír Carik <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
cmake_minimum_required(VERSION 3.5 FATAL_ERROR) | ||
|
||
project(qtsingleapplication | ||
LANGUAGES CXX | ||
) | ||
|
||
set(CMAKE_CXX_STANDARD 14) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
|
||
set(CMAKE_AUTOMOC ON) | ||
set(CMAKE_AUTOUIC ON) | ||
set(CMAKE_AUTORCC ON) | ||
|
||
find_package(Qt5 5.6 REQUIRED COMPONENTS Core Gui Widgets Network) | ||
|
||
add_definitions(-DUNICODE) | ||
add_library(qtsingleapplication STATIC | ||
qtsingleapplication/src/qtsingleapplication.cpp | ||
qtsingleapplication/src/qtsingleapplication.h | ||
qtsingleapplication/src/qtlocalpeer.cpp | ||
) | ||
|
||
target_link_libraries(qtsingleapplication | ||
Qt5::Core | ||
Qt5::Gui | ||
Qt5::Widgets | ||
Qt5::Network | ||
) | ||
|
||
install(TARGETS qtsingleapplication | ||
DESTINATION lib | ||
) | ||
install( | ||
FILES | ||
qtsingleapplication/src/qtlocalpeer.h | ||
qtsingleapplication/src/qtlockedfile.h | ||
qtsingleapplication/src/qtsingleapplication.h | ||
qtsingleapplication/src/qtsinglecoreapplication.h | ||
qtsingleapplication/src/QtLockedFile | ||
qtsingleapplication/src/QtSingleApplication | ||
DESTINATION include | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# common dependenceis | ||
set(CMAKE_AUTOMOC ON) | ||
set(CMAKE_AUTOUIC ON) | ||
set(CMAKE_AUTORCC ON) | ||
|
||
find_package(Qt5 5.6 REQUIRED COMPONENTS Core Gui Widgets Network) | ||
if(MINGW) | ||
get_target_property(_qwindows_dll Qt5::QWindowsIntegrationPlugin LOCATION) | ||
endif() | ||
if(APPLE) | ||
get_target_property(_qcocoa_dylib Qt5::QCocoaIntegrationPlugin LOCATION) | ||
endif() | ||
|
||
# macOS & GNU/Linux dependencies | ||
if(UNIX) | ||
find_package(GnuTLS REQUIRED) | ||
if(GNUTLS_FOUND) | ||
message(STATUS "Library 'GnuTLS' found at ${GNUTLS_LIBRARIES}") | ||
include_directories(SYSTEM ${GNUTLS_INCLUDE_DIR}) | ||
else() | ||
message(FATAL_ERROR "Library 'GnuTLS' not found! Install it vie e.g. 'brew install gnutls' or 'dnf install gnutls-devel'") | ||
endif() | ||
|
||
find_package(OpenConnect REQUIRED) | ||
if(OPENCONNECT_FOUND) | ||
message(STATUS "Library 'OpenConnect' found at ${OPENCONNECT_LIBRARIES}") | ||
link_directories(${OPENCONNECT_LIBRARY_DIRS}) | ||
include_directories(SYSTEM ${OPENCONNECT_INCLUDE_DIRS}) | ||
else() | ||
message(FATAL_ERROR "Libraru 'OpenConnect' not found! Install it vie e.g. 'brew install openconnect or 'dnf install openconnect'") | ||
endif() | ||
|
||
#find_package(spdlog CONFIG REQUIRED) | ||
|
||
set(CMAKE_THREAD_PREFER_PTHREAD ON) | ||
find_package(Threads REQUIRED) | ||
|
||
if(APPLE) | ||
find_library(SECURITY_LIBRARY Security REQUIRED) | ||
if(SECURITY_LIBRARY) | ||
message(STATUS "Framework 'Security' found at ${SECURITY_LIBRARY}") | ||
|
||
link_directories(${SECURITY_LIBRARY_DIRS}) | ||
include_directories(SYSTEM ${SECURITY_LIBRARY_INCLUDE_DIRS}) | ||
else() | ||
message(FATAL_ERROR "Framework 'Security' not found!") | ||
endif() | ||
mark_as_advanced(SECURITY_LIBRARY) | ||
endif() | ||
endif() | ||
|
||
# mingw32/mingw64 and other external dependencies | ||
include(ProjectExternals) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
set(openconnect-TAG v7.08) | ||
set(vpnc-scripts-TAG master) | ||
set(spdlog-TAG v0.13.0) | ||
set(qt-solutions-TAG master) | ||
set(tap-driver-TAG 9.21.2) | ||
|
||
if(CMAKE_CROSSCOMPILING AND MINGW) | ||
# Fedora mingw32/mingw64 | ||
if(CMAKE_SIZEOF_VOID_P EQUAL 8) | ||
set(CMAKE_CROSS_COMMAND mingw64-cmake) | ||
else() | ||
set(CMAKE_CROSS_COMMAND mingw32-cmake) | ||
endif() | ||
else() | ||
# Windows mingw32 & macOS & native GNU/Linux | ||
set(CMAKE_CROSS_COMMAND ${CMAKE_COMMAND}) | ||
endif() | ||
message(STATUS "Using '${CMAKE_CROSS_COMMAND}' as CMake...") | ||
|
||
|
||
include(ExternalProject) | ||
|
||
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/external/include) | ||
|
||
include(ProjectExternals_spdlog) | ||
include(ProjectExternals_qt-solutions) | ||
if(MINGW) | ||
include(ProjectExternals_openconnect) | ||
include(ProjectExternals_vpnc-scripts-win) | ||
include(ProjectExternals_tap-windows) | ||
endif() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
# -------------------------------------------------------------------------------------------------- | ||
# openconnect (libs, headers, etc.) | ||
# -------------------------------------------------------------------------------------------------- | ||
if(NOT EXISTS ${CMAKE_SOURCE_DIR}/external/openconnect-devel-${openconnect-TAG}_mingw32.zip) | ||
set(OPENCONNECT_DEV_URL https://github.com/horar/openconnect/releases/download/${openconnect-TAG}) | ||
else() | ||
message(STATUS "Using local openconnect-devel packages...") | ||
set(OPENCONNECT_DEV_URL ${CMAKE_SOURCE_DIR}/external) | ||
endif() | ||
|
||
ExternalProject_Add(openconnect-devel-${openconnect-TAG} | ||
PREFIX ${CMAKE_BINARY_DIR}/external | ||
INSTALL_DIR ${CMAKE_BINARY_DIR}/external | ||
|
||
DOWNLOAD_NO_PROGRESS 1 | ||
|
||
URL ${OPENCONNECT_DEV_URL}/openconnect-devel-${openconnect-TAG}_mingw32.zip | ||
|
||
CONFIGURE_COMMAND "" | ||
BUILD_COMMAND "" | ||
INSTALL_COMMAND "" | ||
) | ||
ExternalProject_Add_Step(openconnect-devel-${openconnect-TAG} deploy_headers | ||
COMMAND ${CMAKE_COMMAND} -E copy_directory include <INSTALL_DIR>/include | ||
COMMENT "...deploing openconnect-${openconnect-TAG} headers" | ||
WORKING_DIRECTORY <SOURCE_DIR> | ||
DEPENDEES install | ||
) | ||
ExternalProject_Add_Step(openconnect-devel-${openconnect-TAG} deploy_libraries | ||
COMMAND ${CMAKE_COMMAND} -E copy_directory lib <INSTALL_DIR>/lib | ||
COMMENT "...deploing openconnect-${openconnect-TAG} libraries" | ||
WORKING_DIRECTORY <SOURCE_DIR> | ||
DEPENDEES install | ||
ALWAYS 0 | ||
) | ||
|
||
# -------------------------------------------------------------------------------------------------- | ||
# openconnect (util & libs) | ||
# -------------------------------------------------------------------------------------------------- | ||
if(NOT EXISTS ${CMAKE_SOURCE_DIR}/external/openconnect-${openconnect-TAG}_mingw32.zip) | ||
set(OPENCONNECT_URL https://github.com/horar/openconnect/releases/download/${openconnect-TAG}) | ||
else() | ||
message(STATUS "Using local openconnect-devel packages...") | ||
set(OPENCONNECT_URL ${CMAKE_SOURCE_DIR}/external) | ||
endif() | ||
|
||
ExternalProject_Add(openconnect-${openconnect-TAG} | ||
PREFIX ${CMAKE_BINARY_DIR}/external | ||
INSTALL_DIR ${CMAKE_BINARY_DIR}/external | ||
|
||
DOWNLOAD_NO_PROGRESS 1 | ||
|
||
URL ${OPENCONNECT_URL}/openconnect-${openconnect-TAG}_mingw32.zip | ||
|
||
CONFIGURE_COMMAND "" | ||
BUILD_COMMAND "" | ||
INSTALL_COMMAND "" | ||
) | ||
ExternalProject_Add_Step(openconnect-${openconnect-TAG} deploy_libs | ||
COMMAND ${CMAKE_COMMAND} -E copy_directory . <INSTALL_DIR>/lib | ||
COMMENT "...deploing openconnect-${openconnect-TAG} libraries" | ||
WORKING_DIRECTORY <SOURCE_DIR> | ||
DEPENDEES install | ||
) | ||
|
||
add_executable(openconnect::app IMPORTED) | ||
set_property(TARGET openconnect::app PROPERTY IMPORTED_LOCATION ${CMAKE_BINARY_DIR}/external/lib/openconnect.exe) | ||
|
||
add_library(openconnect::gmp SHARED IMPORTED) | ||
set_property(TARGET openconnect::gmp PROPERTY IMPORTED_LOCATION ${CMAKE_BINARY_DIR}/external/lib/libgmp-10.dll) | ||
set_property(TARGET openconnect::gmp PROPERTY IMPORTED_IMPLIB ${CMAKE_BINARY_DIR}/external/lib/libgmp.dll.a) | ||
|
||
add_library(openconnect::gnutls SHARED IMPORTED) | ||
set_property(TARGET openconnect::gnutls PROPERTY IMPORTED_LOCATION ${CMAKE_BINARY_DIR}/external/lib/libgnutls-30.dll) | ||
set_property(TARGET openconnect::gnutls PROPERTY IMPORTED_IMPLIB ${CMAKE_BINARY_DIR}/external/lib/libgnutls.dll.a) | ||
|
||
add_library(openconnect::hogweed SHARED IMPORTED) | ||
set_property(TARGET openconnect::hogweed PROPERTY IMPORTED_LOCATION ${CMAKE_BINARY_DIR}/external/lib/libhogweed-4.dll) | ||
set_property(TARGET openconnect::hogweed PROPERTY IMPORTED_IMPLIB ${CMAKE_BINARY_DIR}/external/lib/libhogweed.dll.a) | ||
|
||
add_library(openconnect::nettle SHARED IMPORTED) | ||
set_property(TARGET openconnect::nettle PROPERTY IMPORTED_LOCATION ${CMAKE_BINARY_DIR}/external/lib/libnettle-6.dll) | ||
set_property(TARGET openconnect::nettle PROPERTY IMPORTED_IMPLIB ${CMAKE_BINARY_DIR}/external/lib/libnettle.dll.a) | ||
|
||
add_library(openconnect::openconnect SHARED IMPORTED) | ||
set_property(TARGET openconnect::openconnect PROPERTY IMPORTED_LOCATION ${CMAKE_BINARY_DIR}/external/lib/libopenconnect-5.dll) | ||
set_property(TARGET openconnect::openconnect PROPERTY IMPORTED_IMPLIB ${CMAKE_BINARY_DIR}/external/lib/libopenconnect.dll.a) | ||
|
||
add_library(openconnect::p11-kit SHARED IMPORTED) | ||
set_property(TARGET openconnect::p11-kit PROPERTY IMPORTED_LOCATION ${CMAKE_BINARY_DIR}/external/lib/libp11-kit-0.dll) | ||
set_property(TARGET openconnect::p11-kit PROPERTY IMPORTED_IMPLIB ${CMAKE_BINARY_DIR}/external/lib/libp11-kit.dll.a) | ||
|
||
add_library(openconnect::stoken SHARED IMPORTED) | ||
set_property(TARGET openconnect::stoken PROPERTY IMPORTED_LOCATION ${CMAKE_BINARY_DIR}/external/lib/libstoken-1.dll) | ||
set_property(TARGET openconnect::stoken PROPERTY IMPORTED_IMPLIB ${CMAKE_BINARY_DIR}/external/lib/libstoken.dll.a) | ||
|
||
add_library(openconnect::xml2 SHARED IMPORTED) | ||
set_property(TARGET openconnect::xml2 PROPERTY IMPORTED_LOCATION ${CMAKE_BINARY_DIR}/external/lib/libxml2-2.dll) | ||
set_property(TARGET openconnect::xml2 PROPERTY IMPORTED_IMPLIB ${CMAKE_BINARY_DIR}/external/lib/libxml2.dll.a) | ||
|
||
|
||
install(FILES ${CMAKE_BINARY_DIR}/external/lib/openconnect.exe | ||
DESTINATION . | ||
COMPONENT App_Console | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# -------------------------------------------------------------------------------------------------- | ||
# qt-solutions | ||
# -------------------------------------------------------------------------------------------------- | ||
ExternalProject_Add(qt-solutions-${qt-solutions-TAG} | ||
PREFIX ${CMAKE_BINARY_DIR}/external/ | ||
INSTALL_DIR ${CMAKE_BINARY_DIR}/external | ||
CMAKE_ARGS "${CMAKE_ARGS};-DQt5_DIR=${Qt5_DIR};-DCMAKE_BUILD_TYPE=Release;-DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>" | ||
|
||
UPDATE_DISCONNECTED 0 | ||
UPDATE_COMMAND "" | ||
|
||
GIT_REPOSITORY https://code.qt.io/qt-solutions/qt-solutions.git | ||
GIT_TAG ${qt-solutions-TAG} | ||
GIT_SHALLOW 1 | ||
|
||
BUILD_IN_SOURCE 1 | ||
|
||
PATCH_COMMAND ${CMAKE_COMMAND} -E copy_if_different | ||
${CMAKE_SOURCE_DIR}/CMake/Includes/CMakeLists_qt-solutions.cmake.in | ||
${CMAKE_BINARY_DIR}/external/src/qt-solutions-master/CMakeLists.txt | ||
CMAKE_COMMAND ${CMAKE_CROSS_COMMAND} -DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET} | ||
) | ||
|
||
add_library(qt-solutions::qtsingleapplication STATIC IMPORTED) | ||
set_target_properties(qt-solutions::qtsingleapplication PROPERTIES | ||
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_BINARY_DIR}/external/include" | ||
IMPORTED_LOCATION ${CMAKE_BINARY_DIR}/external/lib/libqtsingleapplication.a | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# -------------------------------------------------------------------------------------------------- | ||
# spdlog | ||
# -------------------------------------------------------------------------------------------------- | ||
ExternalProject_Add(spdlog-${spdlog-TAG} | ||
PREFIX ${CMAKE_BINARY_DIR}/external | ||
|
||
INSTALL_DIR ${CMAKE_BINARY_DIR}/external | ||
|
||
UPDATE_DISCONNECTED 0 | ||
UPDATE_COMMAND "" | ||
|
||
GIT_REPOSITORY https://github.com/gabime/spdlog | ||
GIT_TAG ${spdlog-TAG} | ||
GIT_SHALLOW 1 | ||
|
||
CMAKE_ARGS -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> -DBUILD_TESTING=off -DSPDLOG_BUILD_TESTING=off | ||
CMAKE_COMMAND ${CMAKE_CROSS_COMMAND} | ||
) | ||
|
||
add_library(spdlog::spdlog INTERFACE IMPORTED) | ||
set_target_properties(spdlog::spdlog PROPERTIES | ||
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_BINARY_DIR}/external/include" | ||
) |
Oops, something went wrong.