Skip to content
Closed
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
16 changes: 15 additions & 1 deletion share/cmake/modules/Findminizip-ng.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
# minizip-ng_LIBRARY - minizip-ng library to link to
# minizip-ng_INCLUDE_DIR - Where to find mz.h and other headers
# minizip-ng_VERSION - The version of the library
# minizip-ng_COMPAT - Whether minizip-ng MZ_COMPAT was used or not
#
# Global targets defined by this module:
# MINIZIP::minizip-ng - IMPORTED target, if found
Expand Down Expand Up @@ -115,6 +116,7 @@ if(NOT OCIO_INSTALL_EXT_PACKAGES STREQUAL ALL)
include
include/minizip-ng
minizip-ng/include
include/minizip
)

# Minizip-ng uses prefix "lib" on all platform by default.
Expand Down Expand Up @@ -202,4 +204,16 @@ if(_minizip-ng_TARGET_CREATE)
mark_as_advanced(minizip-ng_INCLUDE_DIR minizip-ng_LIBRARY minizip-ng_VERSION)

target_link_libraries(MINIZIP::minizip-ng INTERFACE ZLIB::ZLIB)
endif()
endif()

###############################################################################
### Detect compatibility mode ###

set(minizip-ng_COMPAT FALSE)
if(minizip-ng_INCLUDE_DIR)
list(GET minizip-ng_INCLUDE_DIR 0 _minizip-ng_INCLUDE_DIR)
if(EXISTS "${_minizip-ng_INCLUDE_DIR}/mz_compat.h")
set(minizip-ng_COMPAT TRUE)
endif()
endif()
mark_as_advanced(minizip-ng_COMPAT)
3 changes: 2 additions & 1 deletion share/cmake/modules/Findpystring.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@ if(NOT OCIO_INSTALL_EXT_PACKAGES STREQUAL ALL)
# Find include directory
find_path(pystring_INCLUDE_DIR
NAMES
pystring/pystring.h
pystring.h
Copy link

Choose a reason for hiding this comment

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

Running this in an Arch linux installation that has all the required libraries installed in system level results in the following include path: pystring_INCLUDE_DIR:PATH=/usr/include. However the correct path should be pystring_INCLUDE_DIR:PATH=/usr/include/pystring.

Only if I remove the pystring/pystring.h line from NAMES and add a line with include/pystring to PATH_SUFFIXES I get the correct path. Don't know how that might influence other combinations.

Copy link
Owner Author

Choose a reason for hiding this comment

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

That makes sense @irieger, I just implemented those changes and tested locally, if the CI pass I'll open a PR upstream.

HINTS
${pystring_ROOT}
PATH_SUFFIXES
include
include/pystring
pystring/include
)

Expand Down
27 changes: 13 additions & 14 deletions share/cmake/modules/Findyaml-cpp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# yaml-cpp_VERSION - Library's version
#
# Global targets defined by this module:
# yaml-cpp
# yaml-cpp::yaml-cpp
#
# For compatibility with the upstream CMake package, the following variables and targets are defined:
# yaml-cpp::yaml-cpp - Alias of the yaml-cpp target
Expand Down Expand Up @@ -50,7 +50,13 @@ if(NOT OCIO_INSTALL_EXT_PACKAGES STREQUAL ALL)
endif()

if(yaml-cpp_FOUND)
get_target_property(yaml-cpp_LIBRARY yaml-cpp LOCATION)
# yaml-cpp < 0.8 creates a yaml-cpp target
if(TARGET yaml-cpp)
message(STATUS "yaml-cpp ${yaml-cpp_VERSION} detected, aliasing targets.")
add_library(yaml-cpp::yaml-cpp ALIAS yaml-cpp)
endif()

get_target_property(yaml-cpp_LIBRARY yaml-cpp::yaml-cpp LOCATION)
else()

# As yaml-cpp-config.cmake search fails, search an installed library
Expand Down Expand Up @@ -137,16 +143,16 @@ endif()
###############################################################################
### Create target

if(yaml-cpp_FOUND AND NOT TARGET yaml-cpp)
add_library(yaml-cpp UNKNOWN IMPORTED GLOBAL)
if(yaml-cpp_FOUND AND NOT TARGET yaml-cpp::yaml-cpp)
add_library(yaml-cpp::yaml-cpp UNKNOWN IMPORTED GLOBAL)
set(_yaml-cpp_TARGET_CREATE TRUE)
endif()

###############################################################################
### Configure target ###

if(_yaml-cpp_TARGET_CREATE)
set_target_properties(yaml-cpp PROPERTIES
set_target_properties(yaml-cpp::yaml-cpp PROPERTIES
IMPORTED_LOCATION ${yaml-cpp_LIBRARY}
INTERFACE_INCLUDE_DIRECTORIES ${yaml-cpp_INCLUDE_DIR}
)
Expand All @@ -157,12 +163,5 @@ endif()
###############################################################################
### Set variables for compatibility ###

if(TARGET yaml-cpp AND NOT TARGET yaml-cpp::yaml-cpp)
add_library(yaml-cpp::yaml-cpp ALIAS yaml-cpp)
endif()

if(yaml-cpp_INCLUDE_DIR)
set(YAML_CPP_INCLUDE_DIR "${yaml-cpp_INCLUDE_DIR}")
endif()

set(YAML_CPP_LIBRARIES yaml-cpp::yaml-cpp)
get_target_property(YAML_CPP_INCLUDE_DIR yaml-cpp::yaml-cpp INCLUDE_DIRECTORIES)
get_target_property(YAML_CPP_LIBRARIES yaml-cpp::yaml-cpp LOCATION)
2 changes: 1 addition & 1 deletion share/cmake/modules/install/Installpystring.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ if(NOT pystring_FOUND AND OCIO_INSTALL_EXT_PACKAGES AND NOT OCIO_INSTALL_EXT_PAC
else()
set(pystring_VERSION ${pystring_FIND_VERSION})
endif()
set(pystring_INCLUDE_DIR "${_EXT_DIST_ROOT}/${CMAKE_INSTALL_INCLUDEDIR}")
set(pystring_INCLUDE_DIR "${_EXT_DIST_ROOT}/${CMAKE_INSTALL_INCLUDEDIR}/pystring")

set(pystring_LIBRARY
"${_EXT_DIST_ROOT}/${CMAKE_INSTALL_LIBDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}pystring${CMAKE_STATIC_LIBRARY_SUFFIX}")
Expand Down
19 changes: 6 additions & 13 deletions share/cmake/modules/install/Installyaml-cpp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
###############################################################################
### Create target (if previous 'find_package' call hasn't) ###

if(NOT TARGET yaml-cpp)
add_library(yaml-cpp UNKNOWN IMPORTED GLOBAL)
if(NOT TARGET yaml-cpp::yaml-cpp)
add_library(yaml-cpp::yaml-cpp UNKNOWN IMPORTED GLOBAL)
set(_yaml-cpp_TARGET_CREATE TRUE)
endif()

Expand Down Expand Up @@ -138,7 +138,7 @@ if(NOT yaml-cpp_FOUND AND OCIO_INSTALL_EXT_PACKAGES AND NOT OCIO_INSTALL_EXT_PAC
--parallel
)

add_dependencies(yaml-cpp yaml-cpp_install)
add_dependencies(yaml-cpp::yaml-cpp yaml-cpp_install)
if(OCIO_VERBOSE)
message(STATUS "Installing yaml-cpp: ${yaml-cpp_LIBRARY} (version \"${yaml-cpp_VERSION}\")")
endif()
Expand All @@ -149,7 +149,7 @@ endif()
### Configure target ###

if(_yaml-cpp_TARGET_CREATE)
set_target_properties(yaml-cpp PROPERTIES
set_target_properties(yaml-cpp::yaml-cpp PROPERTIES
IMPORTED_LOCATION ${yaml-cpp_LIBRARY}
INTERFACE_INCLUDE_DIRECTORIES ${yaml-cpp_INCLUDE_DIR}
)
Expand All @@ -160,12 +160,5 @@ endif()
###############################################################################
### Set variables for compatibility ###

if(TARGET yaml-cpp AND NOT TARGET yaml-cpp::yaml-cpp)
add_library(yaml-cpp::yaml-cpp ALIAS yaml-cpp)
endif()

if(yaml-cpp_INCLUDE_DIR)
set(YAML_CPP_INCLUDE_DIR "${yaml-cpp_INCLUDE_DIR}")
endif()

set(YAML_CPP_LIBRARIES yaml-cpp::yaml-cpp)
get_target_property(YAML_CPP_INCLUDE_DIR yaml-cpp::yaml-cpp INCLUDE_DIRECTORIES)
get_target_property(YAML_CPP_LIBRARIES yaml-cpp::yaml-cpp LOCATION)
4 changes: 2 additions & 2 deletions src/OpenColorIO/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ target_link_libraries(OpenColorIO
"$<BUILD_INTERFACE:utils::from_chars>"
"$<BUILD_INTERFACE:utils::strings>"
"$<BUILD_INTERFACE:xxHash>"
${YAML_CPP_LIBRARIES}
yaml-cpp::yaml-cpp
MINIZIP::minizip-ng
)

Expand Down Expand Up @@ -389,7 +389,7 @@ elseif(APPLE)


# Check for minizip first since our Findminizip module sets minizip-ng_LIBRARY.
if (minizip_LIBRARY)
if (minizip_LIBRARY OR minizip-ng_COMPAT)
get_filename_component(_minizip-ng_LIBDIR "${minizip_LIBRARY}" DIRECTORY)
set(_minizip-ng_NAME "minizip")
elseif(minizip-ng_LIBRARY)
Expand Down
3 changes: 2 additions & 1 deletion src/OpenColorIO/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
#include <regex>
#include <functional>

#include <pystring.h>

#include <OpenColorIO/OpenColorIO.h>

#include "builtinconfigs/BuiltinConfigRegistry.h"
Expand All @@ -34,7 +36,6 @@
#include "Platform.h"
#include "PrivateTypes.h"
#include "Processor.h"
#include "pystring/pystring.h"
#include "transforms/FileTransform.h"
#include "utils/StringUtils.h"
#include "ViewingRules.h"
Expand Down
3 changes: 2 additions & 1 deletion src/OpenColorIO/Context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#include <sstream>
#include <string>

#include <pystring.h>

#include <OpenColorIO/OpenColorIO.h>

#include "ContextVariableUtils.h"
Expand All @@ -15,7 +17,6 @@
#include "OCIOZArchive.h"
#include "PathUtils.h"
#include "PrivateTypes.h"
#include "pystring/pystring.h"
#include "utils/StringUtils.h"

namespace OCIO_NAMESPACE
Expand Down
3 changes: 2 additions & 1 deletion src/OpenColorIO/OCIOYaml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#include <cstring>
#include <unordered_set>

#include <pystring.h>

#include <OpenColorIO/OpenColorIO.h>

#include "Display.h"
Expand All @@ -19,7 +21,6 @@
#include "ParseUtils.h"
#include "PathUtils.h"
#include "Platform.h"
#include "pystring/pystring.h"
#include "utils/StringUtils.h"
#include "ViewingRules.h"
#include "yaml-cpp/yaml.h"
Expand Down
5 changes: 3 additions & 2 deletions src/OpenColorIO/OCIOZArchive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@
#include <set>
#include <limits>

#include <pystring.h>

#include <OpenColorIO/OpenColorIO.h>

#include "Mutex.h"
#include "Platform.h"
#include "pystring/pystring.h"
#include "utils/StringUtils.h"
#include "transforms/FileTransform.h"

Expand All @@ -24,7 +26,6 @@
#include "mz_strm_mem.h"
#include "mz_strm_os.h"
#include "mz_strm_split.h"
#include "mz_strm_zlib.h"
#include "mz_zip.h"
#include "mz_zip_rw.h"

Expand Down
3 changes: 2 additions & 1 deletion src/OpenColorIO/Op.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#include <cstring>
#include <sstream>

#include <pystring.h>

#include <OpenColorIO/OpenColorIO.h>

#include "Logging.h"
Expand All @@ -20,7 +22,6 @@
#include "ops/lut1d/Lut1DOp.h"
#include "ops/lut3d/Lut3DOp.h"
#include "ops/range/RangeOp.h"
#include "pystring/pystring.h"

namespace OCIO_NAMESPACE
{
Expand Down
4 changes: 2 additions & 2 deletions src/OpenColorIO/PathUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
#include <iostream>
#include <map>

#include <pystring.h>

#include <OpenColorIO/OpenColorIO.h>

#include "Mutex.h"
#include "PathUtils.h"
#include "Platform.h"
#include "pystring/pystring.h"
#include "utils/StringUtils.h"
#include "OCIOZArchive.h"

Expand Down Expand Up @@ -218,4 +219,3 @@ int ParseColorSpaceFromString(const Config & config, const char * str)
}

} // namespace OCIO_NAMESPACE

3 changes: 2 additions & 1 deletion src/OpenColorIO/fileformats/FileFormatCTF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#include <fstream>
#include <sstream>

#include <pystring.h>

#include <OpenColorIO/OpenColorIO.h>

#include "expat.h"
Expand All @@ -23,7 +25,6 @@
#include "OpBuilders.h"
#include "ops/noop/NoOps.h"
#include "Platform.h"
#include "pystring/pystring.h"
#include "TransformBuilder.h"
#include "transforms/FileTransform.h"
#include "utils/StringUtils.h"
Expand Down
4 changes: 2 additions & 2 deletions src/OpenColorIO/fileformats/FileFormatDiscreet1DL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
#include <sstream>
#include <iostream>

#include <pystring.h>

#include <OpenColorIO/OpenColorIO.h>

#include "BitDepthUtils.h"
Expand All @@ -16,7 +18,6 @@
#include "ops/lut1d/Lut1DOp.h"
#include "ops/lut3d/Lut3DOp.h"
#include "ParseUtils.h"
#include "pystring/pystring.h"
#include "Platform.h"
#include "transforms/FileTransform.h"
#include "utils/StringUtils.h"
Expand Down Expand Up @@ -771,4 +772,3 @@ FileFormat * CreateFileFormatDiscreet1DL()
}

} // namespace OCIO_NAMESPACE

3 changes: 2 additions & 1 deletion src/OpenColorIO/fileformats/FileFormatICC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#include <sstream>
#include <fstream>

#include <pystring.h>

#include <OpenColorIO/OpenColorIO.h>

#include "Logging.h"
Expand All @@ -15,7 +17,6 @@
#include "ops/matrix/MatrixOp.h"
#include "ops/range/RangeOp.h"
#include "Platform.h"
#include "pystring/pystring.h"
#include "transforms/FileTransform.h"


Expand Down
4 changes: 2 additions & 2 deletions src/OpenColorIO/fileformats/FileFormatIridasLook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#include <cstring>
#include <iterator>

#include <pystring.h>

#include <OpenColorIO/OpenColorIO.h>

#include "expat.h"
Expand All @@ -13,7 +15,6 @@
#include "ops/lut3d/Lut3DOp.h"
#include "ParseUtils.h"
#include "Platform.h"
#include "pystring/pystring.h"
#include "transforms/FileTransform.h"
#include "utils/StringUtils.h"
#include "utils/NumberUtils.h"
Expand Down Expand Up @@ -579,4 +580,3 @@ FileFormat * CreateFileFormatIridasLook()
}

} // namespace OCIO_NAMESPACE

3 changes: 2 additions & 1 deletion src/OpenColorIO/transforms/FileTransform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#include <iostream>
#include <iterator>

#include <pystring.h>

#include <OpenColorIO/OpenColorIO.h>

#include "Caching.h"
Expand All @@ -19,7 +21,6 @@
#include "ops/noop/NoOps.h"
#include "PathUtils.h"
#include "Platform.h"
#include "pystring/pystring.h"
#include "utils/StringUtils.h"

namespace OCIO_NAMESPACE
Expand Down
2 changes: 1 addition & 1 deletion tests/cpu/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function(add_ocio_test NAME SOURCES PRIVATE_INCLUDES)
sampleicc::sampleicc
unittest_data
utils::strings
${YAML_CPP_LIBRARIES}
yaml-cpp::yaml-cpp
testutils
MINIZIP::minizip-ng
xxHash
Expand Down
Loading