-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a CMake file for Designer. #6
base: main
Are you sure you want to change the base?
Conversation
I tried my best to not break the sln project, but you may need to change the include file path in `propertiesdialog.ui` to make it build. Read the BUILDING file for building it with CMake manually.
|
||
include(FetchContent) | ||
|
||
set(CMAKE_CXX_STANDARD 23) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the other project we are using c++20? Shouldn't that be enough?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right. I'll change it to 20.
# TODO: make qttools version as a variable | ||
FetchContent_Declare( | ||
QtTools | ||
URL https://download.qt.io/official_releases/qt/6.6/6.6.1/submodules/qttools-everywhere-src-6.6.1.tar.xz |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
set(CMAKE_CXX_STANDARD 23) | ||
|
||
find_package(Boost REQUIRED COMPONENTS filesystem) | ||
find_package(Qt6 REQUIRED COMPONENTS Core Widgets Gui Network UiTools) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better: find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Widgets Gui Network UiTools)
set(VCPKG_INSTALL_OPTIONS "--x-buildtrees-root=D:/v/") | ||
endif () | ||
|
||
project(VoukoderDesigner LANGUAGES CXX) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use "VoukoderProDesigner" rather than "VoukoderDesigner"
@@ -0,0 +1,136 @@ | |||
cmake_minimum_required(VERSION 3.28) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have difficulties to let Qt use a different CMake version higher than 3.27.7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may run into this problem because the QtCreator-bundled CMake is 3.27.7. CMake shipped with VS Buildtools is 3.28, you can use that.
I think you can just go to the 'CMake' tab, click 'add', and select the CMake from VS Buildtools. Then you can change the CMake in the 'Kit' tab.
Of course, you may run into some problems other than the CMake version, such as dependencies. I plan to write down the steps later so you can follow them.
#set(PatchNE2Cmake git apply ${CMAKE_CURRENT_SOURCE_DIR}/BuildNodeEditor2.patch) | ||
FetchContent_Declare( | ||
NodeEditor2 | ||
GIT_REPOSITORY https://github.com/RealXuChe/nodeeditor.git |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using the official repo would be better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please read paceholder/nodeeditor#409
The official repo has problems building as a static library. I made a temporary fix in my fork. I plan to test more and try to get my fix merged. After that, I'll change it back to the official repo.
I tested it, it builds on Windows in Qt Creator. If you want to build it using Qt Creator, you can't use the toolchain shipped with Qt Creator. You have to use the MinGW64 toolchain from msys to build it. I'll later write a guide for setting it up.
This PR breaks the existing sln project. To be exact, I changed the include file path in file
propertiesdialog.ui
, this will cause issues with the sln project.Also, I collected all
Q_DECLARE_METATYPE
into a single header, to avoid some symbol-redefine issue.