2019-07-17 13:37:18 -04:00
|
|
|
cmake_minimum_required(VERSION 3.6)
|
|
|
|
project(TeaSpeakLicence)
|
|
|
|
|
|
|
|
set(CMAKE_VERBOSE_MAKEFILE ON)
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fpermissive -Wall -Wno-sign-compare -Wno-reorder -static-libgcc -static-libstdc++")
|
|
|
|
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3")
|
|
|
|
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELEASE} -O3")
|
|
|
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/environment/)
|
|
|
|
|
|
|
|
#disable for debug
|
|
|
|
#add_definitions(-DRELEASE_MODE)
|
|
|
|
|
|
|
|
include_directories(../shared/src)
|
|
|
|
add_definitions(-DLTM_DESC)
|
|
|
|
|
|
|
|
set(LICENCE_SOURCE_FILES
|
2020-03-02 07:33:57 -05:00
|
|
|
shared/src/license.cpp
|
|
|
|
shared/src/client.cpp
|
2019-07-17 13:37:18 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
#Protobuf
|
|
|
|
find_package(Protobuf REQUIRED)
|
|
|
|
include_directories(${Protobuf_INCLUDE_DIRS})
|
2020-03-02 07:33:57 -05:00
|
|
|
protobuf_generate_cpp(PROTO_SRCS TeaLicenseHelper_PROTOCOL_HEADERS shared/packets/LicenseRequest.proto shared/packets/LicenseManager.proto)
|
2019-07-17 13:37:18 -04:00
|
|
|
|
2020-03-02 07:33:57 -05:00
|
|
|
#The actual shared library
|
|
|
|
add_library(TeaLicenseHelper STATIC ${LICENCE_SOURCE_FILES} ${PROTO_SRCS})
|
|
|
|
target_link_libraries(TeaLicenseHelper PUBLIC
|
|
|
|
TeaSpeak
|
|
|
|
protobuf::libprotobuf
|
|
|
|
libevent::core libevent::pthreads
|
2020-03-02 13:57:56 -05:00
|
|
|
# openssl::ssl::shared
|
|
|
|
# openssl::crypto::shared
|
2019-07-17 13:37:18 -04:00
|
|
|
|
2020-03-02 07:33:57 -05:00
|
|
|
${StringVariable_LIBRARIES_STATIC}
|
|
|
|
${ed25519_LIBRARIES_STATIC}
|
|
|
|
stdc++fs
|
2020-03-02 14:04:37 -05:00
|
|
|
rt
|
2020-03-02 07:33:57 -05:00
|
|
|
)
|
|
|
|
target_include_directories(TeaLicenseHelper PUBLIC shared/include/)
|
|
|
|
target_include_directories(TeaLicenseHelper PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
|
2019-07-17 13:37:18 -04:00
|
|
|
|
|
|
|
#The license server
|
2020-03-02 07:33:57 -05:00
|
|
|
add_executable(TeaLicenseServer ${LICENCE_SOURCE_FILES}
|
2019-07-17 13:37:18 -04:00
|
|
|
server/KeyIdCache.cpp
|
|
|
|
server/LicenseServer.cpp
|
|
|
|
server/LicenseServerHandler.cpp
|
2020-02-28 05:24:07 -05:00
|
|
|
server/DatabaseHandler.cpp
|
2019-07-17 13:37:18 -04:00
|
|
|
server/WebAPI.cpp
|
|
|
|
server/StatisticManager.cpp
|
|
|
|
server/UserManager.cpp
|
2020-03-02 07:33:57 -05:00
|
|
|
LicenseServerMain.cpp
|
2020-03-02 13:57:56 -05:00
|
|
|
# Only for boringssl: MySQLLibSSLFix.c
|
2019-07-17 13:37:18 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
target_link_libraries(TeaLicenseServer
|
2020-03-02 07:33:57 -05:00
|
|
|
TeaSpeak
|
|
|
|
TeaLicenseHelper #Static
|
2020-02-06 07:49:39 -05:00
|
|
|
threadpool::static #Static
|
|
|
|
CXXTerminal::static #Static
|
|
|
|
libevent::core libevent::pthreads
|
|
|
|
|
2020-03-02 07:33:57 -05:00
|
|
|
mysqlclient
|
2020-02-06 07:49:39 -05:00
|
|
|
jsoncpp_lib
|
2020-03-02 13:57:56 -05:00
|
|
|
DataPipes::core::static
|
|
|
|
openssl::ssl::static
|
|
|
|
openssl::crypto::static
|
2020-03-02 07:33:57 -05:00
|
|
|
|
2020-02-06 07:49:39 -05:00
|
|
|
pthread
|
|
|
|
dl
|
2020-03-02 14:04:37 -05:00
|
|
|
z
|
2020-03-02 13:30:50 -05:00
|
|
|
rt
|
2019-07-17 13:37:18 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
#The test license client
|
2020-03-02 07:33:57 -05:00
|
|
|
add_executable(TeaLicenseClient LicenseClientMain.cpp)
|
|
|
|
target_link_libraries(TeaLicenseClient TeaLicenseHelper)
|
2019-07-17 13:37:18 -04:00
|
|
|
|
|
|
|
#The license manager
|
|
|
|
if(NOT DISABLE_QT)
|
|
|
|
find_package(Qt5Widgets)
|
|
|
|
include_directories(${Qt5Widgets_INCLUDE_DIRS})
|
|
|
|
add_definitions(${Qt5Widgets_DEFINITIONS})
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
|
|
|
|
|
|
|
|
set(UI_FILES manager/ui/licensegenerator.ui manager/ui/loginwindow.ui manager/ui/owerview.ui manager/ui/licenseinfo.ui)
|
|
|
|
set(DESIGN_HEADER_FILES manager/ui/LicenseGenerator.h manager/ui/LoginWindow.h manager/ui/Overview.h manager/ui/UiLicenseInfo.h)
|
|
|
|
|
|
|
|
qt5_wrap_ui(UI_WARPED_FILES ${UI_FILES})
|
|
|
|
qt5_wrap_cpp(UI_HEADER_FILES ${DESIGN_HEADER_FILES})
|
|
|
|
|
|
|
|
add_executable(LicenseManager
|
|
|
|
${LICENCE_SOURCE_FILES}
|
|
|
|
LicenseManager.cpp
|
|
|
|
manager/ui/LicenseGenerator.cpp
|
|
|
|
manager/ui/LoginWindow.cpp
|
|
|
|
manager/ui/Overview.cpp
|
|
|
|
manager/ui/UiLicenseInfo.cpp
|
|
|
|
manager/ServerConnection.cpp
|
|
|
|
manager/ServerConnectionHandler.cpp
|
|
|
|
manager/ServerConnectionExecutor.cpp
|
|
|
|
${UI_WARPED_FILES} ${UI_HEADER_FILES} ${PROTO_SRCS} ${PROTO_HDRS})
|
|
|
|
target_link_libraries(LicenseManager Qt5::Widgets Qt5::Core Qt5::Gui)
|
|
|
|
target_link_libraries(LicenseManager
|
|
|
|
${LIBRARY_PATH_THREAD_POOL} #Static
|
|
|
|
TeaSpeak #Static
|
|
|
|
${LIBRARY_PATH_TERMINAL} #Static
|
|
|
|
${LIBRARY_PATH_BORINGSSL_CRYPTO}
|
|
|
|
${PROJECT_SOURCE_DIR}/../../libraries/event/build/lib/libevent.a
|
|
|
|
${PROJECT_SOURCE_DIR}/../../libraries/event/build/lib/libevent_pthreads.a
|
|
|
|
pthread
|
|
|
|
${LIBRARY_PATH_VARIBALES}
|
|
|
|
${LIBRARY_PATH_BREAKPAD}
|
|
|
|
${LIBRARY_PATH_PROTOBUF}
|
|
|
|
|
|
|
|
${LIBRARY_TOM_MATH}
|
|
|
|
${LIBRARY_TOM_CRYPT}
|
2019-11-08 14:08:22 -05:00
|
|
|
${LIBRARY_PATH_ED255}
|
2019-07-17 13:37:18 -04:00
|
|
|
stdc++fs
|
|
|
|
jsoncpp.a
|
|
|
|
${LIBRARY_PATH_DATA_PIPES}
|
|
|
|
${LIBRARY_PATH_BORINGSSL_SSL}
|
|
|
|
${LIBRARY_PATH_BORINGSSL_CRYPTO}
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
add_executable(LicenseCLI
|
|
|
|
LicenseCreatorCLI.cpp
|
|
|
|
manager/ServerConnection.cpp
|
|
|
|
manager/ServerConnectionExecutor.cpp
|
|
|
|
manager/ServerConnectionHandler.cpp
|
|
|
|
)
|
|
|
|
|
2020-03-02 07:33:57 -05:00
|
|
|
target_link_libraries(LicenseCLI TeaLicenseHelper)
|