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

[OpenFX] New Port #37670

Merged
merged 12 commits into from
Apr 11, 2024
52 changes: 52 additions & 0 deletions ports/openfx/Openfx.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
cmake_minimum_required(VERSION 3.20)

project(openfx VERSION 1.4.0 LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

if(WIN32)
add_compile_definitions(WINDOWS)
add_compile_options(/DNOMINMAX)
add_definitions(-DWIN64)
set(OS_VAR "windows")
set(OFX_ARCH_NAME "Win64")
endif()

set(OFX_HEADERS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include CACHE INTERNAL "OFX_HEADERS_DIR")
include_directories(${OFX_HEADERS_DIR})

add_library(OpenFx INTERFACE)

add_subdirectory(Support)

install(
TARGETS OpenFx OfxSupport
EXPORT openfx-export
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
)

install(
EXPORT openfx-export
FILE unofficial-openfxConfig.cmake
NAMESPACE unofficial::OpenFx::
DESTINATION "share/unofficial-openfx"
)

file(GLOB OFX_HEADERS "${OFX_HEADERS_DIR}/*.h" "${OFX_SUPPORT_HEADERS_DIR}/*.h")
install(FILES ${OFX_HEADERS}
DESTINATION include/openfx
)

include(CMakePackageConfigHelpers)

write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/unofficial-openfxConfigVersion.cmake"
VERSION ${PROJECT_VERSION}
COMPATIBILITY AnyNewerVersion
)
install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/unofficial-openfxConfigVersion.cmake"
DESTINATION "share/unofficial-openfx"
)
21 changes: 21 additions & 0 deletions ports/openfx/Support.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
add_library(OfxSupport STATIC
Library/ofxsCore.cpp
Library/ofxsImageEffect.cpp
Library/ofxsInteract.cpp
Library/ofxsLog.cpp
Library/ofxsMultiThread.cpp
Library/ofxsParams.cpp
Library/ofxsProperty.cpp
Library/ofxsPropertyValidation.cpp
)

set(OFX_SUPPORT_HEADERS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include CACHE INTERNAL "OFX_SUPPORT_HEADERS_DIR")
target_include_directories(OfxSupport
PUBLIC
$<BUILD_INTERFACE:${OFX_SUPPORT_HEADERS_DIR}>
$<INSTALL_INTERFACE:include/openfx>
)

target_link_libraries(OfxSupport INTERFACE OpenFx)

target_compile_features(OfxSupport PUBLIC cxx_std_11)
21 changes: 21 additions & 0 deletions ports/openfx/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO AcademySoftwareFoundation/openfx
REF OFX_Release_1_4_TAG
SHA512 b20512ea38823167f191b72f1592548df85fbda6cefe47673972874c139641ee91277e78c1e0d57a457b9f864385e6fa0e4a7edcdbf0c7b2eda956c03a3e1e13
HEAD_REF main
)

file(COPY_FILE ${CMAKE_CURRENT_LIST_DIR}/Openfx.cmake ${SOURCE_PATH}/CMakeLists.txt)
file(COPY_FILE ${CMAKE_CURRENT_LIST_DIR}/Support.cmake ${SOURCE_PATH}/Support/CMakeLists.txt)

vcpkg_cmake_configure(SOURCE_PATH ${SOURCE_PATH})
vcpkg_cmake_install()
vcpkg_fixup_pkgconfig()
vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-openfx)

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include/DocSrc")

configure_file("${CMAKE_CURRENT_LIST_DIR}/usage" "${CURRENT_PACKAGES_DIR}/share/${PORT}/usage" COPYONLY)
file(INSTALL "${SOURCE_PATH}/Support/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/openfx" RENAME copyright)
4 changes: 4 additions & 0 deletions ports/openfx/usage
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
The package OpenFX provides CMake targets:

find_package(unofficial-openfx CONFIG REQUIRED)
target_link_libraries(main PRIVATE unofficial::OpenFx::OpenFx)
19 changes: 19 additions & 0 deletions ports/openfx/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json",
"name": "openfx",
"version": "1.4",
"maintainers": "Reza Alizadeh Majd <[email protected]>, Behnam Binesh <[email protected]>",
"summary": "OpenFX - An open-source plugin API for visual effects",
"homepage": "https://github.com/AcademySoftwareFoundation/openfx",
"license": "BSD-3-Clause",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}
4 changes: 4 additions & 0 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -6364,6 +6364,10 @@
"baseline": "2022-07-18",
"port-version": 0
},
"openfx": {
"baseline": "1.4",
"port-version": 0
},
"opengl": {
"baseline": "2022-12-04",
"port-version": 3
Expand Down
9 changes: 9 additions & 0 deletions versions/o-/openfx.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "3c893dd0d9c40b88eafed619ed0fc3d295cbaddd",
"version": "1.4",
"port-version": 0
}
]
}