Skip to content
Draft

V2 #1

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
276af0a
Take recent catch2 to fix build issue
Malcohol Nov 7, 2021
8b33a8b
Update README
paceholder Feb 12, 2022
b9c2032
Make deleteConnection take const. (#244)
Malcohol Feb 12, 2022
da8078e
Bump required CMake version to 3.8
paceholder Feb 12, 2022
55f68e6
Enforce C++14 for the whole library in CMake
paceholder Feb 12, 2022
7170998
Use C++11 random lib instead of qrand()
paceholder Feb 12, 2022
2580993
Support Qt 5.15 and Qt 6.xx
paceholder Feb 12, 2022
63a4c33
src/ConnectionPainter.cpp: Renamed a shadowed variable
emmenlau Jan 29, 2022
eb99ea9
CMakeLists.txt: Allow users to override c++ standard
emmenlau Jan 29, 2022
5118590
CMakeLists.txt: Added support for Clang-Cl on MSVC
emmenlau Jan 29, 2022
8b53dac
adding nodeclick signal (#255)
tatatupi Feb 12, 2022
d301d9c
Make Qt components not required for flexibility between Qt6 and Qt5
paceholder Feb 12, 2022
40aae14
Fix MSVC warnings
paceholder Feb 12, 2022
d3edfa6
Fix appveyor, remove MinGW because of Qt6
paceholder Feb 12, 2022
ed618c0
Reflect CI changes in README
paceholder Feb 19, 2022
411d407
Adjust the behavior of Connection's destructor (#308)
vhutter Mar 30, 2022
6ef6166
missing binary to install (#306)
SaulBerrenson Mar 30, 2022
3ec420f
Support for multiple connections for a single input port
vhutter Mar 6, 2022
bcc176e
Fix MSVC warnings for implicit cast
vhutter Mar 6, 2022
fed7ced
Try to fix graphics artefacts
paceholder Apr 10, 2022
21ede69
fix typo in README (#313)
cpi47 Apr 21, 2022
e5c7bc6
Bump Qt version to 6.3 for appveyor CI
paceholder Jul 12, 2022
6168de9
Support Qt5 build
Yadunund Jun 29, 2022
9b07d91
Don't std::move shared_ptr
paceholder Jul 12, 2022
5fb7d8a
Add comment regarding embedded widget leak
paceholder Jul 12, 2022
bb3bcc4
Rely on GraphicsScene selection model.
paceholder Jul 12, 2022
3b124f3
Remove wrong line (typo)
paceholder Jul 12, 2022
6aeec6c
Add code for dataInvalidated signal to the Node
paceholder Jul 12, 2022
95b5d8f
Add code for dataInvalidated signal to the Node
paceholder Jul 12, 2022
2deb044
Improved README.md and added showcase for CANdevStudio (#322)
githubuser0xFFFF Aug 31, 2022
99e1eb7
Add forward declaration in NodeDataModel.hpp (#323)
tatolevicz Sep 12, 2022
a6c4032
Fix redefined find_package macro for vcpkg (#328) (#329) (#324)
paceholder Nov 15, 2022
d09d173
Add cmake build action (#330)
zmoth Nov 17, 2022
8f9d655
Add header files to CMake targets (#331)
romch007 Nov 24, 2022
e0a1ab8
Fix compile definition in CMakeLists for static library
RealXuChe Mar 26, 2024
a67b8f2
Fix compile definition in CMakeLists for static library
RealXuChe Apr 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 11 additions & 16 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,25 @@ clone_depth: 5

environment:
matrix:
- GENERATOR : "Visual Studio 16 2019"
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
GENERATOR : "Visual Studio 16 2019"
ARCHITECTURE : "-A Win32"
QTDIR: C:\Qt\5.15\msvc2019
QT_MAJOR: 5
PLATFORM: Win32
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
GENERATOR : "Visual Studio 16 2019"
ARCHITECTURE : "-A x64"
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
QTDIR: C:\Qt\5.15.2\msvc2019_64
QTDIR: C:\Qt\6.3\msvc2019_64
QT_MAJOR: 6
PLATFORM: x64
- GENERATOR : "Visual Studio 15 2017"
ARCHITECTURE : ""
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
QTDIR: C:\Qt\5.13.2\msvc2017
PLATFORM: Win32
- GENERATOR : "MinGW Makefiles"
ARCHITECTURE : ""
QTDIR: C:\Qt\5.11.3\mingw53_32
PLATFORM: x86
CMAKE_CXX_FLAGS_INIT: -DCATCH_CONFIG_NO_CPP11_TO_STRING

configuration:
- Release

install:
- set PATH=%QTDIR%\bin;%PATH%
- set Qt5_DIR=%QTDIR%\lib\cmake\Qt5
- set PATH=C:\MinGW\bin;C:\MinGW\msys\1.0;%PATH%
- set PATH=C:\Qt\Tools\mingw530_32;%PATH%
- set Qt%QT_MAJOR%_DIR=%QTDIR%\lib\cmake\Qt%QT_MAJOR%
- set PATH=%PATH:C:\Program Files\Git\usr\bin=% # trick to remove sh.exe

before_build:
Expand Down
80 changes: 80 additions & 0 deletions .github/workflows/cmake_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: build nodeeditor

on:
push:
branches:
- master
- main
tags:
- "*"
pull_request:

jobs:
build-and-test:

name: ${{ matrix.toolchain }}
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
toolchain:
- linux-gcc
- macos-clang
- windows-msvc

configuration:
- Release

include:
- toolchain: linux-gcc
os: ubuntu-20.04
compiler: gcc
qt_version: "5.15.2"
modules: ""

- toolchain: macos-clang
os: macos-latest
compiler: clang
qt_version: "5.15.2"
modules: ""

- toolchain: windows-msvc
os: windows-latest
compiler: msvc
qt_version: "5.15.2"
modules: ""

- toolchain: windows-msvc
os: windows-latest
compiler: msvc
qt_version: "6.3.0"
modules: "qt5compat"

steps:
- name: Checkout Code
uses: actions/checkout@v2
with:
submodules: true

- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: ${{ matrix.qt_version }}
modules: ${{ matrix.modules }}

- name: Setup (Linux)
if: startsWith (matrix.os, 'ubuntu')
run: sudo apt-get install libxkbcommon-dev

- name: Setup VS tools (Windows)
if: startsWith (matrix.os, 'windows')
uses: egor-tensin/vs-shell@v2
with:
arch: x64

- name: Configure (${{ matrix.configuration }})
run: cmake -S . -Bbuild -DCMAKE_BUILD_TYPE=${{ matrix.configuration }}

- name: Build with ${{ matrix.compiler }}
run: cmake --build build --config ${{ matrix.configuration }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
*.py
*.pyc
CMakeLists.txt.user

build/
.vscode/
116 changes: 91 additions & 25 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
cmake_minimum_required(VERSION 3.2)
# version 3.4 is required as other do not work with C++14 and clang
cmake_minimum_required(VERSION 3.8)

project(NodeEditor CXX)

set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)
set(CMAKE_DISABLE_SOURCE_CHANGES ON)
set(OpenGL_GL_PREFERENCE LEGACY)

get_directory_property(_has_parent PARENT_DIRECTORY)
if(_has_parent)
Expand All @@ -24,9 +24,6 @@ option(NE_FORCE_TEST_COLOR "Force colorized unit test output" OFF)
enable_testing()

if(NE_DEVELOPER_DEFAULTS)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_EXTENSIONS OFF)

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib")
Expand All @@ -38,14 +35,37 @@ endif()

add_subdirectory(external)


# Find the QtWidgets library
find_package(Qt5 5.3 COMPONENTS
Core
Widgets
Gui
OpenGL)
find_package(Qt6 QUIET
COMPONENTS
Core
Widgets
Gui
OpenGL
)

if (NOT Qt6_FOUND)
find_package(Qt5 QUIET
COMPONENTS
Core
Widgets
Gui
OpenGL
)
endif()

qt5_add_resources(RESOURCES ./resources/resources.qrc)
if (NOT (Qt6_FOUND OR Qt5_FOUND))
message(FATAL_ERRROR "Qt libraries were not found.")
endif()

if (Qt6_FOUND)
qt_add_resources(RESOURCES ./resources/resources.qrc)
set(Qt Qt)
else()
qt5_add_resources(RESOURCES ./resources/resources.qrc)
set(Qt Qt5)
endif()

# Unfortunately, as we have a split include/src, AUTOMOC doesn't work.
# We'll have to manually specify some files
Expand Down Expand Up @@ -75,10 +95,42 @@ set(CPP_SOURCE_FILES
src/StyleCollection.cpp
)

set(HPP_HEADER_FILES
include/nodes/internal/Compiler.hpp
include/nodes/internal/Connection.hpp
include/nodes/internal/ConnectionGeometry.hpp
include/nodes/internal/ConnectionGraphicsObject.hpp
include/nodes/internal/ConnectionState.hpp
include/nodes/internal/ConnectionStyle.hpp
include/nodes/internal/DataModelRegistry.hpp
include/nodes/internal/Export.hpp
include/nodes/internal/FlowScene.hpp
include/nodes/internal/FlowView.hpp
include/nodes/internal/FlowViewStyle.hpp
include/nodes/internal/memory.hpp
include/nodes/internal/Node.hpp
include/nodes/internal/NodeData.hpp
include/nodes/internal/NodeDataModel.hpp
include/nodes/internal/NodeGeometry.hpp
include/nodes/internal/NodeGraphicsObject.hpp
include/nodes/internal/NodePainterDelegate.hpp
include/nodes/internal/NodeState.hpp
include/nodes/internal/NodeStyle.hpp
include/nodes/internal/OperatingSystem.hpp
include/nodes/internal/PortType.hpp
include/nodes/internal/QStringStdHash.hpp
include/nodes/internal/QUuidStdHash.hpp
include/nodes/internal/Serializable.hpp
include/nodes/internal/Style.hpp
include/nodes/internal/StyleCollection.hpp
include/nodes/internal/TypeConverter.hpp
)

# If we want to give the option to build a static library,
# set BUILD_SHARED_LIBS option to OFF
add_library(nodes
${CPP_SOURCE_FILES}
${HPP_HEADER_FILES}
${RESOURCES}
)
add_library(NodeEditor::nodes ALIAS nodes)
Expand All @@ -94,16 +146,15 @@ target_include_directories(nodes

target_link_libraries(nodes
PUBLIC
Qt5::Core
Qt5::Widgets
Qt5::Gui
Qt5::OpenGL
${Qt}::Core
${Qt}::Widgets
${Qt}::Gui
${Qt}::OpenGL
)

target_compile_definitions(nodes
PUBLIC
${Qt5Widgets_DEFINITIONS}
NODE_EDITOR_SHARED
$<IF:$<BOOL:${BUILD_SHARED_LIBS}>, NODE_EDITOR_SHARED, NODE_EDITOR_STATIC>
PRIVATE
NODE_EDITOR_EXPORTS
#NODE_DEBUG_DRAWING
Expand All @@ -114,13 +165,19 @@ target_compile_options(nodes
PRIVATE
$<$<CXX_COMPILER_ID:MSVC>:/W4 /wd4127 /EHsc>
$<$<CXX_COMPILER_ID:GNU>:-Wall -Wextra>
$<$<CXX_COMPILER_ID:Clang>:-Wall -Wextra>
)
if(NOT "${CMAKE_CXX_SIMULATE_ID}" STREQUAL "MSVC")
# Clang-Cl on MSVC identifies as "Clang" but behaves more like MSVC:
target_compile_options(nodes
PRIVATE
$<$<CXX_COMPILER_ID:Clang>:-Wall -Wextra>
)
endif()

target_compile_features(nodes
PUBLIC
cxx_generic_lambdas # Require C++14
)
if(NE_DEVELOPER_DEFAULTS)
target_compile_features(nodes PUBLIC cxx_std_14)
set_target_properties(nodes PROPERTIES CXX_EXTENSIONS OFF)
endif()

set_target_properties(nodes
PROPERTIES
Expand All @@ -135,11 +192,19 @@ set_target_properties(nodes

file(GLOB_RECURSE HEADERS_TO_MOC include/nodes/internal/*.hpp)

qt5_wrap_cpp(nodes_moc
${HEADERS_TO_MOC}
if (Qt6_FOUND)
qt_wrap_cpp(nodes_moc
${HEADERS_TO_MOC}
TARGET nodes
OPTIONS --no-notes # Don't display a note for the headers which don't produce a moc_*.cpp
)
else()
qt5_wrap_cpp(nodes_moc
${HEADERS_TO_MOC}
TARGET nodes
OPTIONS --no-notes # Don't display a note for the headers which don't produce a moc_*.cpp
)
)
endif()

target_sources(nodes PRIVATE ${nodes_moc})

Expand Down Expand Up @@ -171,6 +236,7 @@ install(TARGETS nodes
EXPORT NodeEditorTargets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)

install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
Expand Down
Loading