Skip to content

Commit

Permalink
Merge branch 'main' into napfft
Browse files Browse the repository at this point in the history
  • Loading branch information
lshoek committed Sep 23, 2024
2 parents 23702a5 + 1678613 commit b1deff0
Show file tree
Hide file tree
Showing 10,435 changed files with 313,237 additions and 1,401,076 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
22 changes: 15 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@ project(NAP)
set(NAP_ROOT ${CMAKE_CURRENT_LIST_DIR})
message(STATUS "Using NAP Root: ${CMAKE_CURRENT_LIST_DIR}")

# Inform system we're building from source
set(NAP_BUILD_CONTEXT "source")

# Thirdparty libraries reside in this location, keep an absolute path
set(THIRDPARTY_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty)
message(STATUS "Using thirdparty directory: ${THIRDPARTY_DIR}")

# Include utilities
include(cmake/macros_and_functions.cmake)
include(cmake/framework_release_packaging.cmake)
bootstrap_environment()

set_source_build_configuration()

include(cmake/qtconfig.cmake)

# Initialize environment
bootstrap_environment()
set_source_build_configuration()
set(MODULE_INTO_PARENT TRUE)

set(CMAKE_INSTALL_PREFIX ${CMAKE_SOURCE_DIR}/packaging_staging)

# store project directory
Expand Down Expand Up @@ -48,10 +48,18 @@ add_subdirectory(demos/helloworld)
add_subdirectory(demos/rotatingtexcube)
add_subdirectory(demos/vinyl)
add_subdirectory(demos/multiwindow)
add_subdirectory(demos/heightmap)
if(RPI_MODEL)
message(STATUS "Skipping target: heightmap, not supported on Raspberry Pi")
else()
add_subdirectory(demos/heightmap)
endif()
add_subdirectory(demos/dynamicgeo)
add_subdirectory(demos/computeparticles)
add_subdirectory(demos/computeflocking)
if(RPI_MODEL)
message(STATUS "Skipping target: computeflocking, not supported on Raspberry Pi")
else()
add_subdirectory(demos/computeflocking)
endif()
add_subdirectory(demos/videomodulation)
add_subdirectory(demos/blobtrace)
add_subdirectory(demos/audioanalysis)
Expand Down
4 changes: 2 additions & 2 deletions cmake/framework_release_packaging.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ macro(package_qt)
if(WIN32)
# Install frameworks
foreach(QT_INSTALL_FRAMEWORK ${QT_FRAMEWORKS})
set(QT_FRAMEWORK_SRC ${QT_DIR}/bin/Qt5${QT_INSTALL_FRAMEWORK})
set(QT_FRAMEWORK_SRC ${QT_DIR}/bin/Qt6${QT_INSTALL_FRAMEWORK})

install(FILES ${QT_FRAMEWORK_SRC}d.dll
DESTINATION thirdparty/Qt/bin/Debug
Expand Down Expand Up @@ -287,7 +287,7 @@ macro(package_qt)

# Install frameworks
foreach(QT_INSTALL_FRAMEWORK ${QT_FRAMEWORKS})
file(GLOB QT_FRAMEWORK_SRC ${QT_DIR}/lib/libQt5${QT_INSTALL_FRAMEWORK}.so*)
file(GLOB QT_FRAMEWORK_SRC ${QT_DIR}/lib/libQt6${QT_INSTALL_FRAMEWORK}.so*)

install(FILES ${QT_FRAMEWORK_SRC}
DESTINATION thirdparty/Qt/lib
Expand Down
2 changes: 1 addition & 1 deletion cmake/install_napkin_with_app.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ include(${CMAKE_CURRENT_LIST_DIR}/macros_and_functions.cmake)
set(NAPKIN_DEPENDENT_NAP_MODULES napscene napmath)

# Qt frameworks which Napkin uses
set(NAPKIN_QT_INSTALL_FRAMEWORKS QtCore QtGui QtWidgets QtPrintSupport QtOpenGL)
set(NAPKIN_QT_INSTALL_FRAMEWORKS QtCore QtGui QtWidgets QtOpenGL)
message(STATUS "Preparing Napkin deployment to output directory")

# Let find_python find our prepackaged Python in thirdparty,
Expand Down
35 changes: 21 additions & 14 deletions cmake/macros_and_functions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,12 @@ macro(bootstrap_environment)
# Ensure we have patchelf on Linux, preventing silent failures
ensure_patchelf_installed()

# Check if we're building on raspbian
check_raspbian_os(RASPBIAN)
# Check if we're building on a pi
get_rpi_model(RPI_MODEL)
if(RPI_MODEL)
message(STATUS "Detected Raspberry Pi model ${RPI_MODEL}")
endif()

endif()
endmacro()

Expand Down Expand Up @@ -156,18 +160,21 @@ macro(ensure_patchelf_installed)
endif()
endmacro()

# Check existence of bcm_host.h header file to see if we're building on Raspberry
macro(check_raspbian_os RASPBERRY)
if(${ARCH} MATCHES "armhf")
MESSAGE(VERBOSE "Looking for bcm_host.h")
INCLUDE(CheckIncludeFiles)

# Raspbian bullseye bcm_host.h location
CHECK_INCLUDE_FILES("/usr/include/bcm_host.h" RASPBERRY)

# otherwise, check previous location of bcm_host.h on older Raspbian OS's
if(NOT RASPBERRY)
CHECK_INCLUDE_FILES("/opt/vc/include/bcm_host.h" RASPBERRY)
# Check existence of '/proc/device-tree/model' file to see if we're building on Raspberry
macro(get_rpi_model RPI_MODEL)
if(${ARCH} MATCHES "armhf" OR ${ARCH} MATCHES "arm64")

# Read file that identifies model
set(MODEL_FILE "/proc/device-tree/model")
if(EXISTS ${MODEL_FILE})
file(READ ${MODEL_FILE} DEVICE_MODEL)

# Identify raspberry pi - we support 4 & 5
if(DEVICE_MODEL MATCHES "^Raspberry Pi 4")
set(RPI_MODEL 4)
elseif(DEVICE_MODEL MATCHES "^Raspberry Pi 5")
set(RPI_MODEL 5)
endif()
endif()
endif()
endmacro()
Expand Down
14 changes: 7 additions & 7 deletions cmake/qt_checker/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ cmake_minimum_required(VERSION 3.18.4)
project(qt_checker)

# Add possible Qt installation paths to the HINTS section
find_path(QT_DIR lib/cmake/Qt5/Qt5Config.cmake
find_path(QT_DIR lib/cmake/Qt6/Qt6Config.cmake
HINTS
$ENV{QT_DIR}
)
# Find_package for Qt5 will pick up the Qt installation from CMAKE_PREFIX_PATH
# Find_package for Qt6 will pick up the Qt installation from CMAKE_PREFIX_PATH
set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ${QT_DIR})

find_package(Qt5Core REQUIRED)
find_package(Qt5Widgets REQUIRED)
find_package(Qt5Gui REQUIRED)
find_package(Qt5OpenGL REQUIRED)
message(STATUS "Found Qt ${Qt5Core_VERSION}")
find_package(Qt6Core REQUIRED)
find_package(Qt6Widgets REQUIRED)
find_package(Qt6Gui REQUIRED)
find_package(Qt6OpenGL REQUIRED)
message(STATUS "Found Qt ${Qt6Core_VERSION}")
40 changes: 23 additions & 17 deletions cmake/qtconfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,20 @@ macro(nap_qt_pre)
elseif(DEFINED NAP_PACKAGED_BUILD)
# If we're doing a platform release let's enforce the an explicit Qt path so that we're
# certain what we're bundling with the release
message(FATAL_ERROR "Please set the QT_DIR environment variable to define the Qt5 version"
"to be installed with the platform release, eg. \"C:/dev/Qt/5.9.1/msvc2015_64\"")
message(FATAL_ERROR "Please set the QT_DIR environment variable to define the Qt6 version"
"to be installed with the platform release, eg. \"C:/dev/qt/6.7.2/msvc2019_64\"")
endif()
endif()

# Set vulkan SDK environment variable so QT to can find and use Vulkan
if(NOT DEFINED ENV{VULKAN_SDK})
set(ENV{VULKAN_SDK} "${NAP_ROOT}/system_modules/naprender/thirdparty/vulkansdk/${NAP_THIRDPARTY_PLATFORM_DIR}/${ARCH}")
message(STATUS "Using VULKAN_SDK environment variable: $ENV{VULKAN_SDK}")
endif()

# Add possible Qt installation paths to the HINTS section
# The version probably doesn't have to match exactly (5.8.? is probably fine)
find_path(QT_DIR lib/cmake/Qt5/Qt5Config.cmake
find_path(QT_DIR lib/cmake/Qt6/Qt6Config.cmake
HINTS
${QTDIR}
)
Expand All @@ -38,36 +44,36 @@ macro(nap_qt_pre)

# TODO Ensure we're not packaging system Qt on Linux, we only want to use a download from qt.io

# Find_package for Qt5 will pick up the Qt installation from CMAKE_PREFIX_PATH
# Find_package for Qt6 will pick up the Qt installation from CMAKE_PREFIX_PATH
set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ${QT_DIR})
else()
message(FATAL_ERROR
"Qt5 could not be found, please set the QT_DIR environment variable, eg.:"
"\n Win64 - \"C:/dev/Qt/5.11.3/msvc2015_64\""
"\n macOS - \"/Users/username/dev/Qt/Qt5.11.3/5.11.3/clang_64\""
"\n Linux - \"/home/username/dev/Qt/Qt5.11.3/5.11.3/gcc_64\"")
"Qt6 could not be found, please set the QT_DIR environment variable, eg.:"
"\n Win64 - \"C:/dev/Qt/6.7.2/msvc2019_64\""
"\n macOS - \"/Users/username/dev/Qt/6.7.2/clang_64\""
"\n Linux - \"/home/username/dev/Qt/6.7.2/gcc_64\"")
endif()

# TODO Update to CMake 3.24+ and use global scope here to avoid redefining
find_package(Qt5Core REQUIRED)
find_package(Qt5Widgets REQUIRED)
find_package(Qt5Gui REQUIRED)
find_package(Qt5OpenGL REQUIRED)
find_package(Qt6Core REQUIRED)
find_package(Qt6Widgets REQUIRED)
find_package(Qt6Gui REQUIRED)
find_package(Qt6OpenGL REQUIRED)

set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
add_definitions(-DQT_NO_KEYWORDS)

set(QT_LIBS Qt5::Widgets Qt5::Core Qt5::Gui Qt5::OpenGL)
set(QT_LIBS Qt6::Widgets Qt6::Core Qt6::Gui Qt6::OpenGL)
endmacro()

macro(nap_qt_post PROJECTNAME)
if(WIN32)
add_custom_command(TARGET ${PROJECTNAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different
$<TARGET_FILE:Qt5::Widgets>
$<TARGET_FILE:Qt5::Core>
$<TARGET_FILE:Qt5::Gui>
$<TARGET_FILE:Qt5::OpenGL>
$<TARGET_FILE:Qt6::Widgets>
$<TARGET_FILE:Qt6::Core>
$<TARGET_FILE:Qt6::Gui>
$<TARGET_FILE:Qt6::OpenGL>
$<TARGET_FILE_DIR:${PROJECTNAME}>
COMMENT "Copy Qt DLLs")
endif()
Expand Down
19 changes: 3 additions & 16 deletions demos/computeflocking/module/module_extra.cmake
Original file line number Diff line number Diff line change
@@ -1,17 +1,4 @@
# Check existence of bcm_host.h header file to see if we're building on Raspberry
if(${ARCH} MATCHES "armhf")
MESSAGE(VERBOSE "Looking for bcm_host.h")
INCLUDE(CheckIncludeFiles)

# Raspbian bullseye bcm_host.h location
CHECK_INCLUDE_FILES("/usr/include/bcm_host.h" COMPUTEFLOCKING_RASPBERRY)

# otherwise, check previous location of bcm_host.h on older Raspbian OS's
if(NOT COMPUTEFLOCKING_RASPBERRY)
CHECK_INCLUDE_FILES("/opt/vc/include/bcm_host.h" COMPUTEFLOCKING_RASPBERRY)
endif()
endif()

if(COMPUTEFLOCKING_RASPBERRY)
# Skip certain features when building against Raspberry Pi
if (RPI_MODEL)
target_compile_definitions(${PROJECT_NAME} PRIVATE COMPUTEFLOCKING_RPI)
endif()
endif()
Empty file modified demos/lightsandshadow/build.sh
100644 → 100755
Empty file.
32 changes: 16 additions & 16 deletions demos/lightsandshadow/data/lightsandshadow.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"y": 1.0,
"z": 0.0
},
"Speed": -0.20000000298023225,
"Speed": -0.20000000298023224,
"Offset": 1.0
}
},
Expand Down Expand Up @@ -194,16 +194,16 @@
{
"Type": "nap::OrbitController",
"mID": "OrbitController",
"MovementSpeed": 0.014999999664723874,
"MovementSpeed": 0.014999999664723873,
"RotateSpeed": 0.001500000013038516,
"PerspCameraComponent": "./PerspCamera",
"LimitZoomDistance": true,
"MinimumZoomDistance": 1.5,
"LookAtPosition": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"MinimumZoomDistance": 1.5,
"LimitZoomDistance": true
}
},
{
"Type": "nap::PointerInputComponent",
Expand Down Expand Up @@ -412,7 +412,7 @@
"Color": {
"Values": [
1.0,
0.20000000298023225,
0.20000000298023224,
0.4901960790157318
]
},
Expand Down Expand Up @@ -490,9 +490,9 @@
"mID": "UniformVec3_11cc25f4xx",
"Name": "specular",
"Value": {
"x": 0.20000000298023225,
"y": 0.20000000298023225,
"z": 0.20000000298023225
"x": 0.20000000298023224,
"y": 0.20000000298023224,
"z": 0.20000000298023224
}
},
{
Expand Down Expand Up @@ -701,8 +701,8 @@
"Name": "diffuse",
"Value": {
"x": 1.0,
"y": 0.20000000298023225,
"z": 0.49000000953674319
"y": 0.20000000298023224,
"z": 0.49000000953674316
}
}
]
Expand Down Expand Up @@ -958,7 +958,7 @@
"Value": {
"Values": [
1.0,
0.20392157137393952,
0.20392157137393951,
0.4901960790157318
]
}
Expand Down Expand Up @@ -1024,7 +1024,7 @@
"Title": "Light & Shadow Demo",
"Width": 1280,
"Height": 720,
"Mode": "Mailbox",
"Mode": "Immediate",
"ClearColor": {
"Values": [
0.0,
Expand Down Expand Up @@ -1413,9 +1413,9 @@
"mID": "UniformVec3_62017239",
"Name": "color",
"Value": {
"x": 0.20000000298023225,
"y": 0.20000000298023225,
"z": 0.20000000298023225
"x": 0.20000000298023224,
"y": 0.20000000298023224,
"z": 0.20000000298023224
}
},
{
Expand Down
Loading

6 comments on commit b1deff0

@cklosters
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TeamCity Public / Package NAP Win64 Build 272 is now running

@cklosters
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TeamCity Public / Package NAP Raspberry Pi Build 1747 is now running

@cklosters
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TeamCity Public / Package NAP Win64 Build 272 outcome was SUCCESS
Summary: Running Build time: 00:17:05

@cklosters
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TeamCity Public / Package NAP Linux Build 268 is now running

@cklosters
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TeamCity Public / Package NAP Raspberry Pi Build 1747 outcome was SUCCESS
Summary: Running Build time: 00:44:04

@cklosters
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TeamCity Public / Package NAP Linux Build 268 outcome was SUCCESS
Summary: Running Build time: 00:32:08

Please sign in to comment.