chore: fixed qscintilla on windows
This commit is contained in:
parent
3cb5d34ced
commit
61b49bcc67
4 changed files with 45 additions and 0 deletions
1
BUILD.md
1
BUILD.md
|
@ -22,6 +22,7 @@ The project will be built using VCPKG and MSVC
|
||||||
* Qt 6.8.3 or higher, with MSVC toolchain
|
* Qt 6.8.3 or higher, with MSVC toolchain
|
||||||
* CMake
|
* CMake
|
||||||
* Git (for cloning the repo, optional)
|
* Git (for cloning the repo, optional)
|
||||||
|
* QScintilla already built (see [docs/qscintilla.md](./docs/qscintilla.md)) *\*likely temporary\**
|
||||||
|
|
||||||
To start, clone the repository:
|
To start, clone the repository:
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,12 @@
|
||||||
# Modified from QGIS' FindQScintilla.cmake by Thomas Moenicke, Larry Schaffer
|
# Modified from QGIS' FindQScintilla.cmake by Thomas Moenicke, Larry Schaffer
|
||||||
|
|
||||||
|
add_library(QScintilla::QScintilla UNKNOWN IMPORTED)
|
||||||
|
|
||||||
|
### NECESSARY TO PREVENT staticMetaObject ERROR!!! See qscintilla.prf AKA qmake config
|
||||||
|
if(WIN32)
|
||||||
|
add_compile_definitions(QSCINTILLA_DLL)
|
||||||
|
endif()
|
||||||
|
|
||||||
FIND_PATH(QSCINTILLA_INCLUDE_DIR
|
FIND_PATH(QSCINTILLA_INCLUDE_DIR
|
||||||
NAMES Qsci/qsciglobal.h
|
NAMES Qsci/qsciglobal.h
|
||||||
PATHS
|
PATHS
|
||||||
|
@ -7,6 +14,7 @@ FIND_PATH(QSCINTILLA_INCLUDE_DIR
|
||||||
$ENV{LIB_DIR}/include
|
$ENV{LIB_DIR}/include
|
||||||
/usr/local/include
|
/usr/local/include
|
||||||
/usr/include
|
/usr/include
|
||||||
|
${VCPKG_INSTALLED_DIR}/x64-windows/include
|
||||||
PATH_SUFFIXES ${QSCINTILLA_PATH_SUFFIXES}
|
PATH_SUFFIXES ${QSCINTILLA_PATH_SUFFIXES}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -29,4 +37,18 @@ PATHS
|
||||||
/usr/local/lib
|
/usr/local/lib
|
||||||
/usr/local/lib/qt${QT_VERSION_MAJOR}
|
/usr/local/lib/qt${QT_VERSION_MAJOR}
|
||||||
/usr/lib
|
/usr/lib
|
||||||
|
${VCPKG_INSTALLED_DIR}/x64-windows/lib
|
||||||
|
)
|
||||||
|
|
||||||
|
list(TRANSFORM QSCINTILLA_LIBRARY_NAMES APPEND ".dll" OUTPUT_VARIABLE QSCINTILLA_DLL_NAMES)
|
||||||
|
|
||||||
|
find_file(QSCINTILLA_DLLS
|
||||||
|
NAMES ${QSCINTILLA_DLL_NAMES}
|
||||||
|
PATHS
|
||||||
|
"${QT_LIBRARY_DIR}"
|
||||||
|
$ENV{LIB_DIR}/lib
|
||||||
|
/usr/local/lib
|
||||||
|
/usr/local/lib/qt${QT_VERSION_MAJOR}
|
||||||
|
/usr/lib
|
||||||
|
${VCPKG_INSTALLED_DIR}/x64-windows/lib
|
||||||
)
|
)
|
15
docs/qscintilla.md
Normal file
15
docs/qscintilla.md
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
In order to build openblocks on Windows, qscintilla will need to already be installed.
|
||||||
|
|
||||||
|
To do this, first download the source archive from [`https://www.riverbankcomputing.com/static/Downloads/QScintilla/2.14.1/QScintilla_src-2.14.1.tar.gz`](https://www.riverbankcomputing.com/static/Downloads/QScintilla/2.14.1/QScintilla_src-2.14.1.tar.gz)
|
||||||
|
|
||||||
|
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` from your Qt's bin directory to configure it
|
||||||
|
|
||||||
|
Once that's done, build and install the project using `nmake install`
|
||||||
|
|
||||||
|
The library should now automatically be installed into your Qt installed directory
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
To uninstall the library, run `nmake uninstall`
|
|
@ -100,6 +100,13 @@ if (WIN32)
|
||||||
# No sense adding opengl-sw given that hardware acceleration is necessary, anyway
|
# No sense adding opengl-sw given that hardware acceleration is necessary, anyway
|
||||||
# Also don't want to clutter with plugins, add only needed ones
|
# Also don't want to clutter with plugins, add only needed ones
|
||||||
|
|
||||||
|
# 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>
|
||||||
|
)
|
||||||
|
|
||||||
# Copy qt.conf to override default plugins location
|
# Copy qt.conf to override default plugins location
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
TARGET editor POST_BUILD
|
TARGET editor POST_BUILD
|
||||||
|
|
Loading…
Add table
Reference in a new issue