Skip to content
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

Windows Support #50

Merged
merged 43 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
246e335
Bug fixes (#51)
alatdneg Aug 7, 2023
14cd9cc
FindFFMPEG: Fix version parsing to check for `version_major.h`
nrusch Sep 21, 2023
b33162c
Correct syntax
adro79 Mar 29, 2023
2c4bcff
Add missing Imath dependency
markreidvfx Oct 13, 2023
57d796f
Added missing glew dependency
markreidvfx Oct 13, 2023
9e7012e
Allow setting CAF_ROOT_DIR
markreidvfx Nov 23, 2023
b188e51
FindFFMPEG: Support linking against static FFMPEG libraries on Linux
nrusch Sep 21, 2023
64d34b0
Update for 0.12
tedwaine Mar 28, 2024
93ec1ea
Adding missing license stub text
tedwaine Apr 2, 2024
4446955
Current Progress of Windows Port
mpkepic May 7, 2024
abf4087
Fix python install and portability.
mpkepic May 7, 2024
5771523
Remove portability debugging output.
mpkepic May 7, 2024
9dad874
Fix thumbnail cache pathing
mpkepic May 7, 2024
9c38750
Demote warnings into debug messages.
mpkepic May 7, 2024
b316e84
Post-merge intermediate work
mpkepic May 17, 2024
75c5cd0
Intermediate commit including the merge.
mpkepic May 21, 2024
9c6061e
Further updates to fix merge
mpkepic May 24, 2024
847f5bd
In-Progress Audio
mpkepic May 28, 2024
20dae30
Sound plays back without obvious problems
mpkepic May 29, 2024
0dd8a9c
Make audio device default to the "default" device.
mpkepic May 29, 2024
e0705f2
Update build instructions and minor cmake fixes.
mpkepic May 30, 2024
e9c203c
Add git install to build instructions.
mpkepic May 30, 2024
5709e7c
Update Readme
mpkepic May 30, 2024
dc61e38
Add build target swap to guide.
mpkepic May 30, 2024
5e69608
Add conditional to hide windows cmake presets from other platforms.
mpkepic May 30, 2024
2b474a6
Remove failing dataChanged modification.
mpkepic Jun 1, 2024
0ee4e0c
CoreAudio Stub and json debugging.
mpkepic Jun 3, 2024
bb06653
Community Feedback Fixes
mpkepic Jun 5, 2024
e902591
Clean unused comments
mpkepic Jun 5, 2024
4fa3afa
Remove spatial audio stub.
mpkepic Jun 5, 2024
0893def
Reorder build section
mpkepic Jun 6, 2024
7527421
Add boost fix for latest visual studio.
mpkepic Jun 6, 2024
42a9633
fix missing space in vcpkg override.
mpkepic Jun 7, 2024
ecb42d4
yet another formatting fix for overrides
mpkepic Jun 7, 2024
ad7c8bf
Support getting extensions from frame sequences. Resolves #106
mpkepic Jun 7, 2024
69e1856
Fix buffer deletion alignment; issue found by Ted
mpkepic Jun 12, 2024
a19a4c3
Various tweaks for Linux build compatibility.
tedwaine Jun 25, 2024
d5c5932
Adding duplicated extern headers
tedwaine Jun 25, 2024
9b3451b
Adding moew duplicated extern headers
tedwaine Jun 25, 2024
cfc31c1
Restore Win build compatibility
tedwaine Jul 5, 2024
8306569
Merge branch 'main' into windows
tedwaine Jul 22, 2024
931fe13
Ran clang-format on src and includes
mpkepic Jul 22, 2024
214b9e3
Removing extra numeral from cmake install prefix.
mpkepic Jul 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ python/src/xstudio.egg-info/
python/test/xstudio.log
docs/conf.py
python/src/xstudio/version.py
.vs/
148 changes: 135 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,20 +1,39 @@
cmake_minimum_required(VERSION 3.12 FATAL_ERROR)

option(USE_VCPKG "Use Vcpkg for package management" OFF)
if(WIN32)
set(USE_VCPKG ON)
endif()

if (USE_VCPKG)
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/vcpkg.cmake)
endif()

set(XSTUDIO_GLOBAL_VERSION "0.11.2" CACHE STRING "Version string")
set(XSTUDIO_GLOBAL_NAME xStudio)

project(${XSTUDIO_GLOBAL_NAME} VERSION ${XSTUDIO_GLOBAL_VERSION} LANGUAGES CXX)

cmake_policy(VERSION 3.26)

option(BUILD_TESTING "Build tests" OFF)
option(INSTALL_PYTHON_MODULE "Install python module" ON)
option(INSTALL_XSTUDIO "Install xstudio" ON)
option(BUILD_DOCS "Build xStudio documentation" ON)
option(BUILD_DOCS "Build xStudio documentation" OFF)
option(ENABLE_CLANG_TIDY "Enable clang-tidy, ninja clang-tidy." OFF)
option(ENABLE_CLANG_FORMAT "Enable clang format, ninja clangformat." OFF)
option(FORCE_COLORED_OUTPUT "Always produce ANSI-colored output (GNU/Clang only)." TRUE)
option(OPTIMIZE_FOR_NATIVE "Build with -march=native" OFF)
option(BUILD_RESKIN "Build xstudio reskin binary" ON)


if(WIN32)
set(CMAKE_CXX_FLAGS_DEBUG "/Zi /Ob0 /Od /Oy-")
add_compile_options($<$<CXX_COMPILER_ID:MSVC>:/MP>)
# enable UUID System Generator
add_definitions(-DUUID_SYSTEM_GENERATOR=ON)
endif()

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")

set(STUDIO_PLUGINS "" CACHE STRING "Enable compilation of SITE plugins")
Expand All @@ -30,7 +49,9 @@ if (("${CMAKE_GENERATOR}" MATCHES "Makefiles" OR ("${CMAKE_GENERATOR}" MATCHES "
endif()

set(CXXOPTS_BUILD_TESTS OFF CACHE BOOL "Enable or disable cxxopts' tests")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpic -fmax-errors=5 -fdiagnostics-color=always")
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpic -fmax-errors=5 -fdiagnostics-color=always")
endif()

if (${OPTIMIZE_FOR_NATIVE})
include(CheckCXXCompilerFlag)
Expand All @@ -50,18 +71,27 @@ if (NOT ${GCC_MARCH_OVERRIDE} STREQUAL "")
endif()
endif()


set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fpic")
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fpic")
endif()

set(TEST_RESOURCE "${CMAKE_CURRENT_SOURCE_DIR}/test_resource")
set(ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR})

set(CMAKE_CXX_STANDARD 17)
if(WIN32)
set(CMAKE_CXX_STANDARD 20)
add_compile_definitions($<$<CONFIG:Debug>:_ITERATOR_DEBUG_LEVEL=0>)
else()
set(CMAKE_CXX_STANDARD 17)
endif()

set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_LINK_DEPENDS_NO_SHARED true)

set(CMAKE_THREAD_LIBS_INIT "-lpthread")
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
set(CMAKE_THREAD_LIBS_INIT "-lpthread")
endif()
set(CMAKE_HAVE_THREADS_LIBRARY 1)
set(CMAKE_USE_WIN32_THREADS_INIT 0)
set(CMAKE_USE_PTHREADS_INIT 1)
Expand All @@ -73,10 +103,14 @@ set(REPROC++ ON)
set(OpenGL_GL_PREFERENCE GLVND)

if (USE_SANITIZER STREQUAL "Address")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -fsanitize=address")
if(MSVC)
target_compile_options(<target> PUBLIC /fsanitize=address)
else()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -fsanitize=address")
endif()
elseif (USE_SANITIZER STREQUAL "Thread")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=thread")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=thread")
Expand Down Expand Up @@ -123,7 +157,55 @@ if(ENABLE_CLANG_TIDY)

endif()

find_package(nlohmann_json REQUIRED)
if(WIN32)
ADD_DEFINITIONS(-DNOMINMAX)
set(CMAKE_CXX_STANDARD 20)
add_compile_options(/permissive-)

# Workaround for C++ 20+ comparisons in nlohmann json
# https://github.com/nlohmann/json/issues/3868#issuecomment-1563726354
add_definitions(-DJSON_HAS_THREE_WAY_COMPARISON=OFF)

set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)

# When moving to Qt6 or greater, we might be able to use qt_generate_deploy_app_script
#set(deploy_script "${Qt5_DIR}/../../../windeployqt.exe )
endif()

if(MSVC)
#Getenv complains, would be good to fix later but tired of seeing this for now.
add_definitions(-D_CRT_SECURE_NO_WARNINGS)

endif()

# Add the necessary libraries from Vcpkg if Vcpkg integration is enabled
if(USE_VCPKG)

set(VCPKG_INTEGRATION ON)
# Set Python in VCPKG
set(Python_EXECUTABLE "${VCPKG_DIRECTORY}/../vcpkg_installed/x64-windows/tools/python3/python.exe")
# Install pip and sphinx
execute_process(
COMMAND "${CMAKE_COMMAND}" -E env "PATH=${VCPKG_DIRECTORY}/../vcpkg_installed/x64-windows/tools/python3" python.exe -m ensurepip --upgrade
RESULT_VARIABLE ENSUREPIP_RESULT
)
if(ENSUREPIP_RESULT)
message(FATAL_ERROR "Failed to ensurepip.")
else()
execute_process(
COMMAND "${CMAKE_COMMAND}" -E env "PATH=${VCPKG_DIRECTORY}/../vcpkg_installed/x64-windows/tools/python3" python.exe -m pip install setuptools sphinx breathe sphinx-rtd-theme OpenTimelineIO importlib_metadata zipp
RESULT_VARIABLE PIP_RESULT
)
if(PIP_RESULT)
message(FATAL_ERROR "Failed to install Sphinx using pip.")
endif()
endif()
# append vcpkg packages
list(APPEND CMAKE_PREFIX_PATH "${VCPKG_DIRECTORY}/../vcpkg_installed/x64-windows")

endif()

find_package(nlohmann_json CONFIG REQUIRED)
include(CTest)

if(ENABLE_CLANG_FORMAT)
Expand All @@ -136,18 +218,31 @@ if(ENABLE_CLANG_FORMAT)
clangformat_setup(${FORMAT_ITEMS})
endif()


if(INSTALL_PYTHON_MODULE)
add_subdirectory(python)
endif()

add_subdirectory(src)

if(INSTALL_XSTUDIO)


# add extern libs that are build-time dependencies of xstudio
if (UNIX)
add_subdirectory("extern/reproc")
endif()
add_subdirectory("extern/quickfuture")
add_subdirectory("extern/quickpromise")

add_subdirectory(share/preference)
add_subdirectory(share/snippets)
add_subdirectory(share/fonts)

install(DIRECTORY include/xstudio
DESTINATION include)

INSTALL(DIRECTORY extern/ DESTINATION extern)

if(BUILD_DOCS)
if(NOT INSTALL_PYTHON_MODULE)
add_subdirectory(python)
Expand All @@ -157,6 +252,33 @@ if(INSTALL_XSTUDIO)
install(DIRECTORY share/docs/ DESTINATION share/xstudio/docs)
endif ()

include(CMakePackageConfigHelpers)

configure_package_config_file(xStudioConfig.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/xStudioConfig.cmake
INSTALL_DESTINATION lib/cmake/${PROJECT_NAME}
)
write_basic_package_version_file("xStudioConfigVersion.cmake"
VERSION ${PROJECT_VERSION}
COMPATIBILITY SameMajorVersion
)

install(FILES ${CMAKE_CURRENT_BINARY_DIR}/xStudioConfig.cmake
${CMAKE_CURRENT_BINARY_DIR}/xStudioConfigVersion.cmake
DESTINATION lib/cmake/${PROJECT_NAME}
)

install(EXPORT xstudio
DESTINATION lib/cmake/${PROJECT_NAME}
FILE ${PROJECT_NAME}Targets.cmake
NAMESPACE xstudio::
EXPORT_LINK_INTERFACE_LIBRARIES
)

endif ()

add_subdirectory("extern/reproc")
if(USE_VCPKG)
# To provide reliable ordering, we need to make this install script happen in a subdirectory.
# Otherwise, Qt deploy will happen before we have the rest of the application deployed.
add_subdirectory("scripts/qt_install")
endif()
47 changes: 47 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"version": 3,
"configurePresets": [
{
"name": "windows-base",
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Windows"
},
"hidden": true,
"generator": "Ninja",
"binaryDir": "${sourceDir}/build",
"cacheVariables": {
"CMAKE_TOOLCHAIN_FILE": "${sourceDir}/build/vcpkg/scripts/buildsystems/vcpkg.cmake",
"Qt5_DIR": "C:/Qt/5.15.2/msvc2019_64/lib/cmake/Qt5/",
"CMAKE_INSTALL_PREFIX": "C:/xstudio_install",
"X_VCPKG_APPLOCAL_DEPS_INSTALL": "ON",
"BUILD_DOCS": "OFF"
}
},
{
"name": "Release",
"inherits": ["windows-base"],
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release"
}
},
{
"name": "RelWithDebInfo",
"inherits": ["windows-base"],
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
"USE_SANITIZER": "address"
}
},
{
"name": "Debug",
"hidden": true,
"inherits": ["windows-base"],
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"USE_SANITIZER": "address"
}
}
]
}
29 changes: 28 additions & 1 deletion NOTICE.TXT
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,31 @@ Foundation, and Bitstream Inc., shall not be used in advertising or
otherwise to promote the sale, use or other dealings in this Font
Software without prior written authorization from the Gnome Foundation
or Bitstream Inc., respectively. For further information, contact:
fonts at gnome dot org.
fonts at gnome dot org.


zstr

Located in extern/include/

The MIT License (MIT)

Copyright (c) 2015 Matei David, Ontario Institute for Cancer Research

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
20 changes: 13 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,26 @@

xSTUDIO is a media playback and review application designed for professionals working in the film and TV post production industries, particularly the Visual Effects and Feature Animation sectors. xSTUDIO is focused on providing an intuitive, easy to use interface with a high performance playback engine at its core and C++ and Python APIs for pipeline integration and customisation for total flexibility.

## Building xSTUDIO for MS Windows
## Building xSTUDIO

You can now build and run xSTUDIO on MS Windows. However, work towards full Windows compatibility is still in its final phase and the updates are therefore not yet merged into the main branch here. To access the Windows compatible codebase please follow [this link](https://github.com/mpkepic/xstudio/tree/windows).
This release of xSTUDIO can be built on various Linux flavours and Windows 10 and 11. MacOS compatibility is not available yet but this work is on the roadmap for 2024.

## Building xSTUDIO for Linux
We provide comprehensive build steps for 4 of the most popular distributions.

We provide comprehensive build steps for 3 of the most popular Linux distributions:
### Building xSTUDIO for Linux

* [CentOS 7](docs/build_guides/centos_7.md)
* [Rocky Linux 9.1](docs/build_guides/rocky_linux_9_1.md)
* [Ubuntu 22.04](docs/build_guides/ubuntu_22_04.md)

Note that the xSTUDIO user guide is built with Sphinx using the Read-The-Docs theme. The package dependencies for building the docs are somewhat onerous to install and as such we have ommitted these steps from the instructions and instead recommend that you turn off the docs build. Instead, we include the fully built docs (as html pages) as part of this repo and building xSTUDIO will install these pages so that they can be loaded into your browser via the Help menu in the main UI.
### Building xSTUDIO for Windows

* [Windows](docs/build_guides/windows.md)
mpkepic marked this conversation as resolved.
Show resolved Hide resolved

### Building xSTUDIO for MacOS

## Building xSTUDIO for MacOS
MacOS compatibility is not yet available. Watch this space!

MacOS compatibility is not yet available but it is due in Q3 or Q4 2023. Watch this space!
### Documentation Note

Note that the xSTUDIO user guide is built with Sphinx using the Read-The-Docs theme. The package dependencies for building the docs are somewhat onerous to install and as such we have ommitted these steps from the instructions and instead recommend that you turn off the docs build. Instead, we include the fully built docs (as html pages) as part of this repo and building xSTUDIO will install these pages so that they can be loaded into your browser via the Help menu in the main UI.
Loading
Loading