Skip to content

Commit 4d8364c

Browse files
committed
Some fixes for build on windows
1 parent f57c4f2 commit 4d8364c

4 files changed

Lines changed: 24 additions & 11 deletions

File tree

DEVELOPMENT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ $ sudo apt install qt5-default cmake gcc git-core
1919
Windows:
2020
- install cmake >= 3.20
2121
- install visual studio
22-
- install qt 5.12.x
22+
- install qt 5.12.x (And set system environment variable `QTDIR=C:\Qt\Qt5.12.3\5.12.3\`)
2323
- install python3 (for command scripts)
2424

2525
### step 1: create a empty project

UnigineEditorPlugin_Python3Scripting/CMakeLists.txt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ file (STRINGS "../version" PYTHON3SCRIPTING_VERSION)
1111
add_definitions(-DPYTHON3SCRIPTING_VERSION="${PYTHON3SCRIPTING_VERSION}")
1212
add_subdirectory(QCodeEditor)
1313

14-
15-
1614
include(${PROJECT_SOURCE_DIR}/cmake/Unigine.cmake)
1715

1816
if (EXISTS ${PROJECT_SOURCE_DIR}/${proj_name}.json.in)
@@ -34,7 +32,13 @@ set(CMAKE_AUTOMOC ON)
3432
# Create code from resource files
3533
set(CMAKE_AUTORCC ON)
3634

37-
find_package(Qt5 COMPONENTS Core Widgets Gui REQUIRED)
35+
IF (WIN32)
36+
# windows
37+
find_package(Qt5 HINTS "$ENV{QTDIR}" COMPONENTS Core Widgets Gui REQUIRED)
38+
ELSE()
39+
# linux
40+
find_package(Qt5 COMPONENTS Core Widgets Gui REQUIRED)
41+
ENDIF()
3842

3943
set(RESOURCES_FILE
4044
resources/UnigineEditorPlugin_Python3Scripting_resources.qrc

UnigineEditorPlugin_Python3Scripting/QCodeEditor/CMakeLists.txt

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,18 @@ set(CMAKE_AUTOMOC On)
7777
set(CMAKE_AUTORCC ON)
7878

7979
# Find includes in corresponding build directories
80-
find_package(Qt5Core CONFIG REQUIRED)
81-
find_package(Qt5Widgets CONFIG REQUIRED)
82-
find_package(Qt5Gui CONFIG REQUIRED)
80+
IF (WIN32)
81+
# windows
82+
find_package(Qt5Core HINTS "$ENV{QTDIR}" CONFIG REQUIRED)
83+
find_package(Qt5Widgets HINTS "$ENV{QTDIR}" CONFIG REQUIRED)
84+
find_package(Qt5Gui HINTS "$ENV{QTDIR}" CONFIG REQUIRED)
85+
ELSE()
86+
# linux
87+
find_package(Qt5Core CONFIG REQUIRED)
88+
find_package(Qt5Widgets CONFIG REQUIRED)
89+
find_package(Qt5Gui CONFIG REQUIRED)
90+
ENDIF()
91+
8392

8493
add_library(${proj_name} STATIC
8594
${RESOURCES_FILE}

build_plugin.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,23 @@
2323
build_commands = [
2424
{
2525
"name": "cmake configure release",
26-
"command": "cmake -H. -Bjunk/release -DCMAKE_BUILD_TYPE=Release \
26+
"command": "cmake -H. -Bjunk/release_" + _platform + " -DCMAKE_BUILD_TYPE=Release \
2727
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
2828
-DCMAKE_INSTALL_PREFIX=../bin",
2929
},
3030
{
3131
"name": "cmake build release",
32-
"command": "cmake --build junk/release --parallel 8 --config Release",
32+
"command": "cmake --build junk/release_" + _platform + " --parallel 8 --config Release",
3333
},
3434
{
3535
"name": "cmake configure debug",
36-
"command": "cmake -H. -Bjunk/debug -DCMAKE_BUILD_TYPE=Debug \
36+
"command": "cmake -H. -Bjunk/debug_" + _platform + " -DCMAKE_BUILD_TYPE=Debug \
3737
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
3838
-DCMAKE_INSTALL_PREFIX=../bin",
3939
},
4040
{
4141
"name": "cmake build debug",
42-
"command": "cmake --build junk/debug --parallel 8 --config Debug",
42+
"command": "cmake --build junk/debug_" + _platform + " --parallel 8 --config Debug",
4343
},
4444
]
4545

0 commit comments

Comments
 (0)