Teaspeak-Server/license/CMakeLists.txt
WolverinDEV 3869788b66 Updates
2020-01-24 17:09:34 +01:00

185 lines
5.3 KiB
CMake

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
shared/LicenseRequest.cpp
shared/LicenseRequestHandler.cpp
shared/License.cpp
../shared/src/log/LogUtils.cpp
)
#Protobuf
find_package(Protobuf REQUIRED)
include_directories(${Protobuf_INCLUDE_DIRS})
include_directories(${CMAKE_CURRENT_BINARY_DIR})
protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS packets/LicenseRequest.proto packets/LicenseManager.proto)
#The actual librarie
add_library(TeaLicenseHelper STATIC ${LICENCE_SOURCE_FILES} ${PROTO_SRCS} ${PROTO_HDRS})
target_link_libraries(TeaLicenseHelper PUBLIC TeaSpeak libevent::core libevent::pthreads)
#The license server
add_executable(TeaLicenseServer ${LICENCE_SOURCE_FILES} ${PROTO_SRCS} ${PROTO_HDRS}
server/KeyIdCache.cpp
server/LicenseServer.cpp
server/LicenseServerHandler.cpp
server/LicenseManager.cpp
LicenseServerMain.cpp
server/WebAPI.cpp
server/StatisticManager.cpp
server/UserManager.cpp
MySQLLibSSLFix.c
)
target_link_libraries(TeaLicenseServer
${LIBRARY_PATH_THREAD_POOL} #Static
TeaSpeak #Static
TeaLicenseHelper #Static
${LIBRARY_PATH_TERMINAL} #Static
${LIBRARY_PATH_VARIBALES}
${LIBRARY_PATH_YAML}
pthread
stdc++fs
libevent::core
libevent::pthreads
${LIBRARY_PATH_OPUS}
${LIBRARY_PATH_JSON}
${LIBRARY_PATH_PROTOBUF}
#We're forsed to use boringssl caused by the fact that boringssl is already within webrtc!
#Require a so
sqlite3
${LIBRARY_PATH_BREAKPAD}
${LIBRARY_PATH_PROTOBUF}
#${LIBWEBRTC_LIBRARIES} #ATTENTIAN! WebRTC does not work with crypto! (Already contains a crypto version)
${LIBRARY_TOM_CRYPT}
${LIBRARY_TOM_MATH}
mysqlclient.a
${LIBRARY_PATH_ED255}
${LIBRARY_PATH_DATA_PIPES}
${LIBRARY_PATH_NICE}
${LIBRARY_PATH_GLIBC}
${LIBRARY_PATH_BORINGSSL_SSL}
${LIBRARY_PATH_BORINGSSL_CRYPTO}
dl
z
)
include_directories(${LIBRARY_PATH}/boringssl/include/)
#The test license client
add_executable(TeaLicenseClient
LicenseClientMain.cpp
${LICENCE_SOURCE_FILES} ${PROTO_SRCS} ${PROTO_HDRS}
)
target_link_libraries(TeaLicenseClient
${LIBRARY_PATH_DATA_PIPES}
${LIBRARY_PATH_TERMINAL} #Static
${LIBRARY_PATH_THREAD_POOL} #Static
${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}
stdc++fs.a
${LIBRARY_PATH_TERMINAL}
${LIBRARY_PATH_BORINGSSL_SSL}
${LIBRARY_PATH_BORINGSSL_CRYPTO}
${LIBRARY_PATH_BREAKPAD}
${TOM_LIBRARIES}
${LIBRARY_PATH_JDBC}
${LIBRARY_PATH_ED255}
TeaSpeak #Static
jsoncpp.a
)
#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}
${LIBRARY_PATH_ED255}
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
shared/License.cpp
${PROTO_SRCS} ${PROTO_HDRS}
)
target_link_libraries(LicenseCLI
${LIBRARY_PATH_THREAD_POOL} #Static
${PROJECT_SOURCE_DIR}/../../libraries/event/build/lib/libevent.a
${PROJECT_SOURCE_DIR}/../../libraries/event/build/lib/libevent_pthreads.a
${LIBRARY_PATH_PROTOBUF}
${LIBRARY_TOM_MATH} #Static
${LIBRARY_TOM_CRYPT} #Static
pthread
)