2017-01-11 14:04:53 +00:00
|
|
|
set(CMAKE_CXX_STANDARD 14)
|
|
|
|
|
|
|
|
set(NETLAUNCHER_UI
|
|
|
|
${CMAKE_SOURCE_DIR}/files/ui/Main.ui
|
|
|
|
${CMAKE_SOURCE_DIR}/files/ui/ServerInfo.ui
|
|
|
|
)
|
|
|
|
set(NETLAUNCHER
|
|
|
|
main.cpp
|
|
|
|
Main.cpp
|
|
|
|
ServerModel.cpp
|
|
|
|
NetController.cpp
|
|
|
|
ServerInfoDialog.cpp
|
|
|
|
netutils/HTTPNetwork.cpp
|
|
|
|
netutils/Utils.cpp
|
|
|
|
${CMAKE_SOURCE_DIR}/files/windows/launcher.rc
|
|
|
|
)
|
|
|
|
|
|
|
|
set(NETLAUNCHER_HEADER_MOC
|
|
|
|
Main.hpp
|
|
|
|
ServerModel.hpp
|
|
|
|
ServerInfoDialog.hpp
|
|
|
|
)
|
|
|
|
|
|
|
|
set(NETLAUNCHER_HEADER
|
|
|
|
${NETLAUNCHER_HEADER_MOC}
|
|
|
|
NetController.hpp
|
|
|
|
netutils/HTTPNetwork.hpp
|
|
|
|
netutils/Utils.hpp
|
|
|
|
)
|
|
|
|
|
|
|
|
source_group(netlauncher FILES ${NETLAUNCHER} ${NETLAUNCHER_HEADER})
|
|
|
|
|
|
|
|
set(QT_USE_QTGUI 1)
|
|
|
|
|
|
|
|
# Set some platform specific settings
|
|
|
|
if(WIN32)
|
|
|
|
set(GUI_TYPE WIN32)
|
|
|
|
set(QT_USE_QTMAIN TRUE)
|
|
|
|
endif(WIN32)
|
|
|
|
|
|
|
|
if (DESIRED_QT_VERSION MATCHES 4)
|
|
|
|
message(SEND_ERROR "QT4 is not supported.")
|
|
|
|
#include(${QT_USE_FILE})
|
|
|
|
#QT4_ADD_RESOURCES(RCC_SRCS ${CMAKE_SOURCE_DIR}/files/launcher/launcher.qrc)
|
|
|
|
#QT4_WRAP_CPP(MOC_SRCS ${NETLAUNCHER_HEADER_MOC})
|
|
|
|
#QT4_WRAP_UI(UI_HDRS ${NETLAUNCHER_UI})
|
|
|
|
else()
|
|
|
|
QT5_ADD_RESOURCES(RCC_SRCS ${CMAKE_SOURCE_DIR}/files/launcher/launcher.qrc)
|
|
|
|
QT5_WRAP_CPP(MOC_SRCS ${NETLAUNCHER_HEADER_MOC})
|
|
|
|
QT5_WRAP_UI(UI_HDRS ${NETLAUNCHER_UI})
|
|
|
|
endif()
|
|
|
|
|
|
|
|
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
if(NOT WIN32)
|
|
|
|
include_directories(${LIBUNSHIELD_INCLUDE_DIR})
|
|
|
|
endif(NOT WIN32)
|
|
|
|
|
|
|
|
# Main executable
|
2017-01-12 00:54:11 +00:00
|
|
|
add_executable(tes3mp-netlauncher
|
2017-01-11 14:04:53 +00:00
|
|
|
${GUI_TYPE}
|
|
|
|
${NETLAUNCHER}
|
|
|
|
${NETLAUNCHER_HEADER}
|
|
|
|
${RCC_SRCS}
|
|
|
|
${MOC_SRCS}
|
|
|
|
${UI_HDRS}
|
|
|
|
)
|
|
|
|
|
|
|
|
if (WIN32)
|
2017-01-12 00:54:11 +00:00
|
|
|
INSTALL(TARGETS tes3mp-netlauncher RUNTIME DESTINATION ".")
|
2017-01-11 14:04:53 +00:00
|
|
|
endif (WIN32)
|
|
|
|
|
2017-01-12 00:54:11 +00:00
|
|
|
target_link_libraries(tes3mp-netlauncher
|
2017-01-11 14:04:53 +00:00
|
|
|
${SDL2_LIBRARY_ONLY}
|
|
|
|
${RakNet_LIBRARY}
|
|
|
|
components
|
|
|
|
)
|
|
|
|
|
|
|
|
if (DESIRED_QT_VERSION MATCHES 4)
|
2017-01-12 00:54:11 +00:00
|
|
|
# target_link_libraries(tes3mp-netlauncher ${QT_QTGUI_LIBRARY} ${QT_QTCORE_LIBRARY})
|
2017-01-11 14:04:53 +00:00
|
|
|
# if(WIN32)
|
2017-01-12 00:54:11 +00:00
|
|
|
# target_link_libraries(tes3mp-netlauncher ${QT_QTMAIN_LIBRARY})
|
2017-01-11 14:04:53 +00:00
|
|
|
# endif(WIN32)
|
|
|
|
else()
|
2017-01-12 00:54:11 +00:00
|
|
|
qt5_use_modules(tes3mp-netlauncher Widgets Core)
|
2017-01-11 14:04:53 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if (BUILD_WITH_CODE_COVERAGE)
|
|
|
|
add_definitions (--coverage)
|
2017-01-12 00:54:11 +00:00
|
|
|
target_link_libraries(tes3mp-netlauncher gcov)
|
2017-01-11 14:04:53 +00:00
|
|
|
endif()
|