Skip to content
Closed

OIIO #143

Show file tree
Hide file tree
Changes from all commits
Commits
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
36 changes: 23 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ jobs:
CC: ${{matrix.cc_compiler}}
CMAKE_CXX_STANDARD: ${{matrix.cxx_std}}
OPENEXR_VERSION: ${{matrix.openexr_ver}}
CMAKE_CXX_FLAGS: "-lstdc++fs"
steps:
- uses: actions/checkout@v4

Expand All @@ -54,7 +55,7 @@ jobs:
shell: bash
run: |
build_scripts/install_aces_container.bash
sudo yum install --setopt=tsflags=nodocs -y eigen3-devel ceres-solver-devel LibRaw-devel
sudo yum install --setopt=tsflags=nodocs -y eigen3-devel ceres-solver-devel LibRaw-devel json-devel

- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
Expand Down Expand Up @@ -83,40 +84,49 @@ jobs:
fail-fast: false

matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
title: [ubuntu, windows, macos]
build_type: [Release]
c_compiler: [gcc, clang, cl]
include:
- os: windows-latest
- title: windows
os: windows-latest
c_compiler: cl
cpp_compiler: cl
install_deps: install_deps_windows
toolchain_file: "C:/vcpkg/scripts/buildsystems/vcpkg.cmake"
build_shared_libs: OFF
- os: ubuntu-latest
- title: ubuntu
os: ubuntu-24.04
c_compiler: gcc
cpp_compiler: g++
install_deps: install_deps_linux
- os: ubuntu-latest
c_compiler: clang
build_shared_libs: ON
- title: ubuntu
os: ubuntu-24.04
cpp_compiler: clang++
install_deps: install_deps_linux
- os: macos-latest
build_shared_libs: ON
- title: macos
os: macos-latest
c_compiler: clang
cpp_compiler: clang++
install_deps: install_deps_mac
build_shared_libs: ON
exclude:
- os: windows-latest
- title: windows
c_compiler: gcc
- os: windows-latest
- title: windows
c_compiler: clang
- os: ubuntu-latest
- title: ubuntu
c_compiler: cl
- os: macos-latest
- title: macos
c_compiler: cl
- os: macos-latest
- title: macos
c_compiler: gcc

env:
CMAKE_CXX_FLAGS: "-lstdc++fs"

steps:
- uses: actions/checkout@v4

Expand All @@ -140,7 +150,7 @@ jobs:
cmake
-B ${{ steps.strings.outputs.build-output-dir }}
-S ${{ github.workspace }}
-DCXX_STANDARD=C++14
-DCXX_STANDARD=C++17
-DCMAKE_TOOLCHAIN_FILE="${{ matrix.toolchain_file }}"
-DENABLE_SHARED="${{ matrix.build_shared_libs }}"

Expand Down
65 changes: 34 additions & 31 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.10)
project( RAWTOACES )

set( RAWTOACES_MAJOR_VERSION 1 )
Expand All @@ -12,9 +12,9 @@ set(RAWTOACESLIB "rawtoaces_util")
set( CMAKE_MACOSX_RPATH 1 )

if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
# set(warnings "/W4 /WX /EHsc")
add_compile_options ( /W0 )
add_compile_definitions( NOMINMAX )
add_compile_options ( $<$<COMPILE_LANGUAGE:CXX>:/utf-8> )
endif()

if (NOT CONFIGURED_ONCE)
Expand Down Expand Up @@ -74,8 +74,10 @@ include_directories( "${PROJECT_SOURCE_DIR}/include" )
add_definitions( -DPACKAGE="RAWTOACES" -DVERSION="${RAWTOACES_VERSION}" )
add_subdirectory("src/${RAWTOACESIDTLIB}")
add_subdirectory("src/${RAWTOACESLIB}")
add_subdirectory("src/rawtoaces")


add_subdirectory("src/rawtoaces_util2")
add_subdirectory("src/rawtoaces2")

# Create a RAWTOACESBuildTreeSettings.cmake file for the use from the build tree
file(RELATIVE_PATH CONF_REL_INCLUDE_DIR "${INSTALL_CMAKE_DIR}" "${INSTALL_INCLUDE_DIR}")
Expand All @@ -93,45 +95,46 @@ install( FILES
"${PROJECT_BINARY_DIR}/RAWTOACESConfigVersion.cmake"
DESTINATION "${INSTALL_CMAKE_DIR}" COMPONENT dev)







if ( WIN32 AND NOT CYGWIN )
install( FILES "${PROJECT_BINARY_DIR}/RAWTOACESLibraryDepends.cmake" DESTINATION
"${INSTALL_CMAKE_DIR}" COMPONENT dev )
endif( )

if ( APPLE OR UNIX )
install (DIRECTORY data DESTINATION include/rawtoaces)
include ( GNUInstallDirs )

install(
TARGETS rawtoaces_idt rawtoaces_util rawtoaces_util2 rawtoaces
EXPORT RawToAcesConfig
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)

export(
TARGETS rawtoaces_idt rawtoaces_util rawtoaces_util2 rawtoaces
NAMESPACE RawToAces::
FILE "${CMAKE_CURRENT_BINARY_DIR}/RawToAcesConfig.cmake"
)

install(
EXPORT RawToAcesConfig
DESTINATION "${CMAKE_INSTALL_LIBDIR}/CMake/RawToAces"
NAMESPACE RawToAces::
)

install (DIRECTORY data DESTINATION ${CMAKE_INSTALL_DATADIR}/rawtoaces)
endif()

### to build rawtoaces ###

add_executable( rawtoaces
main.cpp
)

target_include_directories( rawtoaces
PUBLIC
${AcesContainer_INCLUDE_DIRS}
)

target_link_libraries ( rawtoaces
PUBLIC
${RAWTOACESLIB}
INTERFACE
Boost::headers
)

if ( LIBRAW_CONFIG_FOUND )
target_link_libraries ( rawtoaces PUBLIC libraw::raw )
else ()
target_link_directories(rawtoaces PUBLIC ${libraw_LIBRARY_DIRS} )
target_link_libraries(rawtoaces PUBLIC ${libraw_LIBRARIES} ${libraw_LDFLAGS_OTHER} )
endif ()

enable_testing()
add_subdirectory(unittest)

install( TARGETS rawtoaces DESTINATION bin )

# uninstall target
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
Expand Down
20 changes: 10 additions & 10 deletions build_scripts/install_aces_container.bash
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@

set -ex

git clone https://github.com/ampas/aces_container.git aces_container
git clone https://github.com/ampas/aces_container.git ../aces_container

if [[ "$OSTYPE" == "linux-gnu"* ]] || [[ "$OSTYPE" == "darwin"* ]]; then
cmake \
-S aces_container \
-B aces_container/build \
-S ../aces_container \
-B ../aces_container/build \
-DCMAKE_CXX_FLAGS="-Wno-c++11-narrowing"
cmake --build aces_container/build
sudo cmake --install aces_container/build
cmake --build ../aces_container/build
sudo cmake --install ../aces_container/build
else
cmake \
-S aces_container \
-B aces_container/build \
-DCMAKE_INSTALL_PREFIX="." \
-S ../aces_container \
-B ../aces_container/build \
-DCMAKE_INSTALL_PREFIX="../AcesContainer" \
-DBUILD_SHARED_LIBS=OFF
cmake --build aces_container/build --config Release
cmake --install aces_container/build --config Release
cmake --build ../aces_container/build --config Release
cmake --install ../aces_container/build --config Release
fi

cd ../..
5 changes: 2 additions & 3 deletions build_scripts/install_deps.bash
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@ time sudo apt-get update

time sudo apt-get -q -f install -y \
libunwind-dev libilmbase-dev libopenexr-dev \
libboost-dev libboost-thread-dev libboost-filesystem-dev \
libboost-test-dev \
libraw-dev libceres-dev
libopenimageio-dev \
libraw-dev libceres-dev nlohmann-json-dev
11 changes: 7 additions & 4 deletions build_scripts/install_deps_linux.bash
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ set -ex
time sudo apt-get update

time sudo apt-get -q -f install -y \
libunwind-dev libimath-dev \
libboost-dev libboost-filesystem-dev \
libboost-test-dev \
libraw-dev libceres-dev
libunwind-dev \
libimath-dev libopenexr-dev \
libraw-dev libceres-dev \
libopencv-dev \
openimageio-tools \
libopenimageio-dev \
nlohmann-json3-dev
2 changes: 1 addition & 1 deletion build_scripts/install_deps_mac.bash
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

set -ex

brew install ceres-solver imath openexr libraw boost
brew install ceres-solver imath openexr libraw openimageio nlohmann-json
7 changes: 2 additions & 5 deletions build_scripts/install_deps_windows.bash
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,5 @@ vcpkg install \
libraw:x64-windows \
ceres:x64-windows \
imath:x64-windows \
boost-system:x64-windows \
boost-foreach:x64-windows \
boost-filesystem:x64-windows \
boost-test:x64-windows \
boost-property-tree:x64-windows
openimageio:x64-windows \
nlohmann-json:x64-windows
4 changes: 2 additions & 2 deletions config/RAWTOACESConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ if( EXISTS "${RAWTOACES_CMAKE_DIR}/CMakeCache.txt" )
include( "${RAWTOACES_CMAKE_DIR}/RAWTOACESBuildTreeSettings.cmake" )
else()
set( RAWTOACES_INCLUDE_DIRS "${RAWTOACES_CMAKE_DIR}/@CONF_REL_INCLUDE_DIR@" )
endif
endif()

# setup our library dependencies (i.e. ilmbase)
include( "${RAWTOACES_CMAKE_DIR}/RAWTOACESLibraryDepends.cmake" )
# include( "${RAWTOACES_CMAKE_DIR}/RAWTOACESLibraryDepends.cmake" )
Copy link
Contributor

@soswow soswow Feb 18, 2025

Choose a reason for hiding this comment

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

another commented out line not to forget about (unless, it's a special syntax in c++, which I don't know. sry if so)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is no such file in the repo, whoever wrote it has forgotten to push the file, I assume.


set( RAWTOACES_LIBRARIES RAWTOACES )
set( RAWTOACES_EXECUTABLE rawtoaces )
10 changes: 3 additions & 7 deletions configure.cmake
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
# Until we get some of these modules into the upstream packages, put them here
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules/")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_INSTALL_PREFIX}/share/CMake")
set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} "${CMAKE_SOURCE_DIR}/../")


find_package ( OpenImageIO CONFIG REQUIRED )
find_package ( AcesContainer CONFIG REQUIRED )
find_package ( Eigen3 CONFIG REQUIRED )
find_package ( Imath CONFIG REQUIRED )
find_package ( nlohmann_json CONFIG REQUIRED )
find_package ( Ceres REQUIRED )
find_package ( Boost REQUIRED
COMPONENTS
system
filesystem
unit_test_framework
)

find_package (libraw CONFIG QUIET )

Expand Down
3 changes: 2 additions & 1 deletion include/rawtoaces/acesrender.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@
#define _ACESRENDER_h__

#include <rawtoaces/rta.h>

#include <rawtoaces/define.h>
#include <libraw/libraw.h>
#include <unordered_map>

using namespace rta;
Expand Down
Loading