Compare commits
No commits in common. "2fec4cc7f297b2b1a1d7467ff302bc2b598a30e1" and "692bb17d44e885ef5af81396302c5816206f2aa9" have entirely different histories.
2fec4cc7f2
...
692bb17d44
3 changed files with 5 additions and 81 deletions
|
@ -2,23 +2,4 @@ include(${CMAKE_CURRENT_SOURCE_DIR}/deps.cmake)
|
||||||
|
|
||||||
add_executable(client "src/main.cpp")
|
add_executable(client "src/main.cpp")
|
||||||
target_link_libraries(client PRIVATE openblocks glfw)
|
target_link_libraries(client PRIVATE openblocks glfw)
|
||||||
add_dependencies(client openblocks)
|
add_dependencies(client openblocks)
|
||||||
|
|
||||||
if(WIN32)
|
|
||||||
# Copy assets
|
|
||||||
add_custom_command(
|
|
||||||
TARGET client POST_BUILD
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
|
||||||
${CMAKE_SOURCE_DIR}/assets
|
|
||||||
$<TARGET_FILE_DIR:client>/assets)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set_target_properties(client PROPERTIES
|
|
||||||
WIN32_EXECUTABLE ON
|
|
||||||
)
|
|
||||||
|
|
||||||
# https://stackoverflow.com/a/73899349/16255372
|
|
||||||
if (WIN32)
|
|
||||||
# /ENTRY:mainCRTStartup keeps the same "main" function instead of requiring "WinMain"
|
|
||||||
target_link_options(client PRIVATE "/ENTRY:mainCRTStartup")
|
|
||||||
endif()
|
|
|
@ -4,7 +4,7 @@ To do this, first download the source archive from [`https://www.riverbankcomput
|
||||||
|
|
||||||
Next, launch the *x64 Native Tools Command Prompt for VS 2022*, and cd into the directory that you extracted the archive to
|
Next, launch the *x64 Native Tools Command Prompt for VS 2022*, and cd into the directory that you extracted the archive to
|
||||||
|
|
||||||
Now, run `qmake src` from your Qt's bin directory to configure it
|
Now, run `qmake` from your Qt's bin directory to configure it
|
||||||
|
|
||||||
Once that's done, build and install the project using `nmake install`
|
Once that's done, build and install the project using `nmake install`
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ set(CMAKE_AUTOUIC ON)
|
||||||
set(CMAKE_AUTOMOC ON)
|
set(CMAKE_AUTOMOC ON)
|
||||||
set(CMAKE_AUTORCC ON)
|
set(CMAKE_AUTORCC ON)
|
||||||
|
|
||||||
find_package(Qt6 REQUIRED COMPONENTS Widgets OpenGLWidgets REQUIRED)
|
find_package(Qt6 REQUIRED COMPONENTS Widgets Multimedia OpenGLWidgets REQUIRED)
|
||||||
find_package(QScintilla6 REQUIRED)
|
find_package(QScintilla6 REQUIRED)
|
||||||
|
|
||||||
set(PROJECT_SOURCES
|
set(PROJECT_SOURCES
|
||||||
|
@ -35,63 +35,6 @@ set(PROJECT_SOURCES
|
||||||
${TS_FILES}
|
${TS_FILES}
|
||||||
)
|
)
|
||||||
|
|
||||||
qt_add_executable(editor MANUAL_FINALIZATION ${PROJECT_SOURCES})
|
qt_add_executable(editor ${PROJECT_SOURCES})
|
||||||
target_include_directories(editor PRIVATE .)
|
target_include_directories(editor PRIVATE .)
|
||||||
target_link_libraries(editor PRIVATE openblocks Qt6::Widgets Qt6::OpenGLWidgets ${QSCINTILLA_LIBRARY})
|
target_link_libraries(editor PRIVATE openblocks Qt6::Widgets Qt6::Multimedia Qt6::OpenGLWidgets ${QSCINTILLA_LIBRARY})
|
||||||
|
|
||||||
set_target_properties(editor PROPERTIES
|
|
||||||
WIN32_EXECUTABLE ON
|
|
||||||
)
|
|
||||||
|
|
||||||
# Copy Qt files
|
|
||||||
if (WIN32)
|
|
||||||
#include("${QT_DEPLOY_SUPPORT}")
|
|
||||||
|
|
||||||
# Copy assets
|
|
||||||
add_custom_command(
|
|
||||||
TARGET editor POST_BUILD
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
|
||||||
${CMAKE_SOURCE_DIR}/assets
|
|
||||||
$<TARGET_FILE_DIR:editor>/assets)
|
|
||||||
|
|
||||||
# Copy over QScintilla DLLs
|
|
||||||
# TODO: Use a better approach?
|
|
||||||
add_custom_command(
|
|
||||||
TARGET editor POST_BUILD
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${QSCINTILLA_DLLS} $<TARGET_FILE_DIR:editor>
|
|
||||||
)
|
|
||||||
|
|
||||||
set(WINDEPLOYQT_OPTIONS
|
|
||||||
--dir $<TARGET_FILE_DIR:editor>
|
|
||||||
--translations en
|
|
||||||
--no-compiler-runtime
|
|
||||||
--no-opengl-sw # No sense adding opengl-sw given that hardware acceleration is necessary, anyway
|
|
||||||
--no-system-d3d-compiler
|
|
||||||
--plugindir $<TARGET_FILE_DIR:editor>/qtplugins
|
|
||||||
# Also don't want to clutter with plugins, add only needed ones
|
|
||||||
)
|
|
||||||
|
|
||||||
# We split these into two commands because
|
|
||||||
# we might build a debug binary against a release qscintilla library
|
|
||||||
# TODO: Add other translations
|
|
||||||
add_custom_command(
|
|
||||||
TARGET editor POST_BUILD
|
|
||||||
COMMAND ${WINDEPLOYQT_EXECUTABLE} $<TARGET_FILE:editor>
|
|
||||||
${WINDEPLOYQT_OPTIONS}
|
|
||||||
)
|
|
||||||
|
|
||||||
# Copy QScintilla dependencies too
|
|
||||||
add_custom_command(
|
|
||||||
TARGET editor POST_BUILD
|
|
||||||
COMMAND ${WINDEPLOYQT_EXECUTABLE} ${QSCINTILLA_DLLS}
|
|
||||||
${WINDEPLOYQT_OPTIONS}
|
|
||||||
)
|
|
||||||
|
|
||||||
# Copy qt.conf to override default plugins location
|
|
||||||
add_custom_command(
|
|
||||||
TARGET editor POST_BUILD
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/qt.conf $<TARGET_FILE_DIR:editor>/qt.conf
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
qt_finalize_executable(editor)
|
|
Loading…
Add table
Reference in a new issue