Compare commits
3 commits
5fdc745259
...
96c82dbf22
Author | SHA1 | Date | |
---|---|---|---|
96c82dbf22 | |||
f4018e8883 | |||
fd370cb80b |
7 changed files with 57 additions and 6 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,20 @@ 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
|
||||||
|
)
|
||||||
|
|
||||||
|
get_filename_component(QSCINTILLA_LIB_DIR ${QSCINTILLA_LIBRARY} DIRECTORY)
|
||||||
|
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
|
||||||
|
${QSCINTILLA_LIB_DIR}
|
||||||
|
${VCPKG_INSTALLED_DIR}/x64-windows/lib
|
||||||
)
|
)
|
|
@ -14,6 +14,7 @@ include_directories(${Stb_INCLUDE_DIR})
|
||||||
# PkgConfig packages
|
# PkgConfig packages
|
||||||
find_package(PkgConfig REQUIRED)
|
find_package(PkgConfig REQUIRED)
|
||||||
pkg_check_modules(LUAJIT REQUIRED luajit)
|
pkg_check_modules(LUAJIT REQUIRED luajit)
|
||||||
|
link_directories(${LUAJIT_LIBRARY_DIRS})
|
||||||
|
|
||||||
# Run autogen
|
# Run autogen
|
||||||
file(GLOB_RECURSE AUTOGEN_SOURCES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/src" "src/objects/*.h" "src/datatypes/*.h")
|
file(GLOB_RECURSE AUTOGEN_SOURCES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/src" "src/objects/*.h" "src/datatypes/*.h")
|
||||||
|
@ -41,8 +42,9 @@ file(GLOB_RECURSE SOURCES "src/*.cpp" "src/*.h")
|
||||||
list(APPEND SOURCES ${AUTOGEN_OUTS})
|
list(APPEND SOURCES ${AUTOGEN_OUTS})
|
||||||
add_library(openblocks STATIC ${SOURCES})
|
add_library(openblocks STATIC ${SOURCES})
|
||||||
set_target_properties(openblocks PROPERTIES OUTPUT_NAME "openblocks")
|
set_target_properties(openblocks PROPERTIES OUTPUT_NAME "openblocks")
|
||||||
|
target_link_directories(openblocks PUBLIC ${LUAJIT_LIBRARY_DIRS})
|
||||||
target_link_libraries(openblocks ${GLEW_LIBRARIES} ${LUAJIT_LIBRARIES} OpenGL::GL ReactPhysics3D::ReactPhysics3D pugixml::pugixml)
|
target_link_libraries(openblocks ${GLEW_LIBRARIES} ${LUAJIT_LIBRARIES} OpenGL::GL ReactPhysics3D::ReactPhysics3D pugixml::pugixml)
|
||||||
target_include_directories(openblocks PUBLIC "src" "../include" ${LUAJIT_INCLUDE_DIR})
|
target_include_directories(openblocks PUBLIC "src" "../include" ${LUAJIT_INCLUDE_DIRS})
|
||||||
|
|
||||||
# Windows-specific dependencies
|
# Windows-specific dependencies
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include <luajit-2.1/luajit.h>
|
#include <luajit.h>
|
||||||
#include <luajit-2.1/lauxlib.h>
|
#include <lauxlib.h>
|
||||||
#include <luajit-2.1/lualib.h>
|
#include <lualib.h>
|
||||||
#include <luajit-2.1/lua.h>
|
#include <lua.h>
|
||||||
}
|
}
|
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`
|
|
@ -99,6 +99,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
|
||||||
|
|
|
@ -6,7 +6,9 @@
|
||||||
{ "name": "pugixml", "version>=": "1.15" },
|
{ "name": "pugixml", "version>=": "1.15" },
|
||||||
"sdl2",
|
"sdl2",
|
||||||
"stb",
|
"stb",
|
||||||
"reactphysics3d"
|
"reactphysics3d",
|
||||||
|
"pkgconf",
|
||||||
|
"luajit"
|
||||||
],
|
],
|
||||||
"overrides": [
|
"overrides": [
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue