2017-12-06 03:31:43 +00:00
|
|
|
cmake_minimum_required(VERSION 3.10)
|
|
|
|
|
|
|
|
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
|
|
|
set(CMAKE_AUTOMOC ON)
|
|
|
|
set(CMAKE_AUTOUIC ON)
|
|
|
|
|
2021-02-26 23:12:44 +00:00
|
|
|
if (APPLE AND CMAKE_SYSTEM_PROCESSOR STREQUAL x86_64)
|
|
|
|
set(QT_HOMEBREW_PATH /usr/local/opt/qt)
|
|
|
|
elseif (APPLE AND CMAKE_SYSTEM_PROCESSOR STREQUAL arm64)
|
|
|
|
set(QT_HOMEBREW_PATH /opt/homebrew/opt/qt)
|
|
|
|
else ()
|
|
|
|
set(QT_HOMEBREW_PATH "")
|
|
|
|
endif ()
|
2021-02-21 18:23:20 +00:00
|
|
|
|
|
|
|
find_package(Qt6Widgets QUIET PATHS ${QT_HOMEBREW_PATH})
|
2021-02-26 23:12:44 +00:00
|
|
|
if (Qt6Widgets_FOUND)
|
|
|
|
find_package(Qt6 COMPONENTS Core5Compat Network Widgets Xml Gui REQUIRED PATHS ${QT_HOMEBREW_PATH})
|
|
|
|
set(QUAZIP_QT_MAJOR_VERSION 6 CACHE STRING "")
|
|
|
|
else ()
|
|
|
|
find_package(Qt5Widgets REQUIRED PATHS ${QT_HOMEBREW_PATH})
|
|
|
|
find_package(Qt5 COMPONENTS Network Widgets Xml Gui REQUIRED PATHS ${QT_HOMEBREW_PATH})
|
|
|
|
set(QUAZIP_QT_MAJOR_VERSION 5 CACHE STRING "")
|
|
|
|
endif ()
|
2018-01-10 06:19:48 +00:00
|
|
|
|
2021-02-21 18:23:20 +00:00
|
|
|
set(BUILD_SHARED_LIBS OFF CACHE BOOL "")
|
|
|
|
set(QUAZIP_INSTALL OFF CACHE BOOL "")
|
|
|
|
add_subdirectory(quazip)
|
2021-02-20 23:02:36 +00:00
|
|
|
|
2021-02-22 02:56:21 +00:00
|
|
|
add_executable(hecl-gui WIN32 MACOSX_BUNDLE
|
2021-03-10 20:13:03 +00:00
|
|
|
#ArgumentEditor.cpp
|
|
|
|
#ArgumentEditor.hpp
|
|
|
|
#ArgumentEditor.ui
|
2021-02-26 23:12:44 +00:00
|
|
|
Common.cpp
|
|
|
|
Common.hpp
|
2021-03-10 20:13:03 +00:00
|
|
|
#CVarDialog.cpp
|
|
|
|
#CVarDialog.hpp
|
|
|
|
#CVarDialog.ui
|
2021-02-26 23:12:44 +00:00
|
|
|
DownloadManager.cpp
|
|
|
|
DownloadManager.hpp
|
|
|
|
ErrorLabel.hpp
|
|
|
|
EscapeSequenceParser.cpp
|
|
|
|
EscapeSequenceParser.hpp
|
|
|
|
ExtractZip.cpp
|
|
|
|
ExtractZip.hpp
|
|
|
|
FileDirDialog.hpp
|
|
|
|
FindBlender.cpp
|
|
|
|
FindBlender.hpp
|
|
|
|
MainWindow.cpp
|
|
|
|
MainWindow.hpp
|
|
|
|
MainWindow.ui
|
2021-02-28 02:35:15 +00:00
|
|
|
LayerDialog.cpp
|
|
|
|
LayerDialog.hpp
|
|
|
|
LayerDialog.ui
|
2021-02-26 23:12:44 +00:00
|
|
|
SysReqTableView.cpp
|
|
|
|
SysReqTableView.hpp
|
|
|
|
|
|
|
|
main.cpp
|
|
|
|
|
|
|
|
${QUAZIP_SRCS}
|
|
|
|
)
|
2019-08-25 23:56:11 +00:00
|
|
|
|
2019-08-28 01:35:51 +00:00
|
|
|
target_compile_definitions(hecl-gui PRIVATE
|
2021-02-26 23:12:44 +00:00
|
|
|
# Disable implicit conversions from ASCII to QString.
|
|
|
|
-DQT_NO_CAST_FROM_ASCII
|
|
|
|
-DQT_NO_CAST_TO_ASCII
|
|
|
|
|
|
|
|
# Disable implicit conversions of QByteArray to const char* or const void*
|
|
|
|
-DQT_NO_CAST_FROM_BYTEARRAY
|
|
|
|
|
|
|
|
# Disable narrowing conversions in signal/slot connect() calls.
|
|
|
|
-DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT
|
|
|
|
|
|
|
|
# Disable unsafe overloads of QProcess' start() function.
|
|
|
|
-DQT_NO_PROCESS_COMBINED_ARGUMENT_START
|
|
|
|
|
|
|
|
# Disable implicit QString->QUrl conversions to enforce use of proper resolving functions.
|
|
|
|
-DQT_NO_URL_CAST_FROM_STRING
|
|
|
|
|
|
|
|
# Allows for more efficient string concatenation, resulting in less temporaries.
|
|
|
|
-DQT_USE_QSTRINGBUILDER
|
|
|
|
)
|
|
|
|
|
|
|
|
if (Qt6Widgets_FOUND)
|
|
|
|
set(Qt_LIBS
|
|
|
|
Qt6::Core
|
|
|
|
Qt6::Core5Compat
|
|
|
|
Qt6::Gui
|
|
|
|
Qt6::Network
|
|
|
|
Qt6::Widgets
|
|
|
|
Qt6::Xml)
|
|
|
|
else ()
|
|
|
|
set(Qt_LIBS
|
|
|
|
Qt5::Core
|
|
|
|
Qt5::Gui
|
|
|
|
Qt5::Network
|
|
|
|
Qt5::Widgets
|
|
|
|
Qt5::Xml)
|
2021-03-13 16:57:15 +00:00
|
|
|
# Check for static linking
|
2021-04-02 16:51:28 +00:00
|
|
|
if (WIN32)
|
|
|
|
get_target_property(HECL_RUNTIME_LIBRARY hecl-gui MSVC_RUNTIME_LIBRARY)
|
|
|
|
if (NOT "${HECL_RUNTIME_LIBRARY}" MATCHES "DLL$")
|
|
|
|
list(APPEND Qt_LIBS Qt5::QWindowsIntegrationPlugin)
|
|
|
|
endif ()
|
2021-03-10 20:21:14 +00:00
|
|
|
endif ()
|
2021-02-26 23:12:44 +00:00
|
|
|
endif ()
|
2021-02-21 18:23:20 +00:00
|
|
|
target_link_libraries(hecl-gui PRIVATE
|
2021-02-26 23:12:44 +00:00
|
|
|
${Qt_LIBS}
|
|
|
|
hecl-light
|
|
|
|
zeus
|
2021-02-28 03:34:23 +00:00
|
|
|
QuaZip::QuaZip)
|
2019-08-26 00:06:56 +00:00
|
|
|
|
|
|
|
target_include_directories(hecl-gui PRIVATE quazip/quazip)
|
|
|
|
target_compile_definitions(hecl-gui PRIVATE QUAZIP_STATIC=1)
|
|
|
|
|
2021-02-26 23:12:44 +00:00
|
|
|
if (APPLE)
|
|
|
|
target_sources(hecl-gui PRIVATE
|
|
|
|
MacOSSystemVersion.hpp
|
|
|
|
MacOSSystemVersion.mm
|
|
|
|
)
|
|
|
|
set_source_files_properties(MacOSSystemVersion.mm
|
|
|
|
PROPERTIES COMPILE_FLAGS -fobjc-arc
|
|
|
|
)
|
|
|
|
find_library(FOUNDATION_LIBRARY Foundation)
|
|
|
|
target_link_libraries(hecl-gui PRIVATE ${FOUNDATION_LIBRARY})
|
|
|
|
elseif ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
|
|
|
|
target_link_libraries(hecl-gui PRIVATE
|
|
|
|
dl
|
|
|
|
pthread
|
|
|
|
)
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
if (WIN32)
|
|
|
|
target_sources(hecl-gui PRIVATE
|
|
|
|
platforms/win/hecl-gui.manifest
|
|
|
|
platforms/win/hecl-gui.rc
|
|
|
|
)
|
|
|
|
target_link_libraries(hecl-gui PRIVATE
|
|
|
|
Version)
|
|
|
|
elseif (APPLE)
|
2021-03-19 18:59:34 +00:00
|
|
|
set_target_properties(hecl-gui PROPERTIES
|
|
|
|
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/platforms/mac/Info.plist"
|
|
|
|
)
|
2021-02-26 23:12:44 +00:00
|
|
|
target_sources(hecl-gui PRIVATE platforms/mac/mainicon.icns)
|
|
|
|
set_source_files_properties(platforms/mac/mainicon.icns PROPERTIES
|
|
|
|
MACOSX_PACKAGE_LOCATION Resources
|
|
|
|
)
|
2021-03-19 18:59:34 +00:00
|
|
|
add_custom_command(
|
|
|
|
TARGET hecl-gui POST_BUILD
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:urde> $<TARGET_FILE_DIR:hecl-gui>
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:hecl> $<TARGET_FILE_DIR:hecl-gui>
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:visigen> $<TARGET_FILE_DIR:hecl-gui>
|
|
|
|
DEPENDS urde hecl visigen
|
|
|
|
)
|
2021-04-04 22:24:02 +00:00
|
|
|
if (NOT "${SENTRY_DSN}" STREQUAL "")
|
|
|
|
add_custom_command(
|
|
|
|
TARGET hecl-gui POST_BUILD
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:crashpad_handler> $<TARGET_FILE_DIR:hecl-gui>
|
|
|
|
DEPENDS crashpad_handler
|
|
|
|
)
|
|
|
|
endif()
|
2021-02-26 23:12:44 +00:00
|
|
|
endif ()
|
2019-08-26 00:06:56 +00:00
|
|
|
|
|
|
|
add_subdirectory(platforms/freedesktop)
|
|
|
|
declare_qticon_target()
|
|
|
|
target_sources(hecl-gui PRIVATE mainicon_qt.cpp)
|
|
|
|
|
2021-02-26 23:12:44 +00:00
|
|
|
if (COMMAND add_sanitizers)
|
|
|
|
add_sanitizers(hecl-gui)
|
|
|
|
endif ()
|
2019-08-26 00:06:56 +00:00
|
|
|
|
|
|
|
if (NOT MSVC)
|
2021-02-26 23:12:44 +00:00
|
|
|
target_compile_options(hecl-gui PRIVATE -Wno-misleading-indentation)
|
|
|
|
endif ()
|