2021-11-01 09:54:58 -04:00
|
|
|
cmake_minimum_required(VERSION 3.0)
|
|
|
|
project(xivlauncher)
|
|
|
|
|
|
|
|
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
|
|
|
set(CMAKE_AUTOMOC ON)
|
|
|
|
|
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
|
|
|
2021-11-18 07:30:38 -05:00
|
|
|
find_package(Qt5 COMPONENTS Core Widgets Network CONFIG REQUIRED)
|
2021-11-01 09:54:58 -04:00
|
|
|
|
|
|
|
add_subdirectory(external)
|
|
|
|
|
2021-12-06 21:15:31 -05:00
|
|
|
set(SRC
|
2021-11-01 09:54:58 -04:00
|
|
|
src/main.cpp
|
2021-11-23 15:34:23 -05:00
|
|
|
src/launchercore.cpp
|
2021-11-01 09:54:58 -04:00
|
|
|
src/sapphirelauncher.cpp
|
|
|
|
src/squareboot.cpp
|
2021-11-01 13:14:00 -04:00
|
|
|
src/squarelauncher.cpp
|
2021-11-09 14:12:41 -05:00
|
|
|
src/settingswindow.cpp
|
2021-11-23 15:34:23 -05:00
|
|
|
src/blowfish.cpp
|
|
|
|
src/assetupdater.cpp
|
|
|
|
src/assetupdater.h
|
|
|
|
src/launcherwindow.cpp
|
2021-12-06 21:15:31 -05:00
|
|
|
src/launcherwindow.h
|
|
|
|
src/watchdog.h
|
|
|
|
src/watchdog.cpp)
|
2021-11-01 09:54:58 -04:00
|
|
|
|
2021-12-06 21:15:31 -05:00
|
|
|
set(LIBRARIES
|
|
|
|
Qt5::Core Qt5::Widgets Qt5::Network qt5keychain QuaZip)
|
|
|
|
|
|
|
|
if(UNIX)
|
|
|
|
set(SRC ${SRC}
|
|
|
|
src/gameparser.h
|
|
|
|
src/gameparser.cpp)
|
|
|
|
|
|
|
|
set(LIBRARIES ${LIBRARIES}
|
|
|
|
tesseract
|
|
|
|
lept
|
|
|
|
X11
|
|
|
|
Xcomposite
|
|
|
|
Xrender)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
add_executable(xivlauncher ${SRC})
|
|
|
|
|
|
|
|
target_link_libraries(xivlauncher PUBLIC ${LIBRARIES})
|
2021-11-01 09:54:58 -04:00
|
|
|
|
2021-11-23 14:37:37 -05:00
|
|
|
# disgusting, thanks qtkeychain and quazip
|
2021-11-01 09:54:58 -04:00
|
|
|
target_include_directories(xivlauncher PRIVATE
|
|
|
|
${CMAKE_BINARY_DIR}/_deps/qtkeychain-src
|
2021-11-23 14:37:37 -05:00
|
|
|
${CMAKE_BINARY_DIR}/_deps/qtkeychain-build
|
|
|
|
${CMAKE_BINARY_DIR}/_deps/quazip-src)
|
2021-11-02 08:16:28 -04:00
|
|
|
|
|
|
|
install(TARGETS xivlauncher
|
|
|
|
DESTINATION "${INSTALL_BIN_PATH}"
|
|
|
|
)
|
|
|
|
|
|
|
|
if(WIN32)
|
|
|
|
get_target_property(QMAKE_EXE Qt6::qmake IMPORTED_LOCATION)
|
|
|
|
get_filename_component(QT_BIN_DIR "${QMAKE_EXE}" DIRECTORY)
|
|
|
|
|
|
|
|
find_program(WINDEPLOYQT_ENV_SETUP qtenv2.bat HINTS "${QT_BIN_DIR}")
|
|
|
|
find_program(WINDEPLOYQT_EXECUTABLE windeployqt HINTS "${QT_BIN_DIR}")
|
|
|
|
|
|
|
|
# Run windeployqt immediately after build
|
|
|
|
add_custom_command(TARGET xivlauncher
|
|
|
|
POST_BUILD
|
|
|
|
COMMAND "${WINDEPLOYQT_ENV_SETUP}" && "${WINDEPLOYQT_EXECUTABLE}" \"$<TARGET_FILE:xivlauncher>\"
|
|
|
|
)
|
|
|
|
endif()
|