diff --git a/share/cmake/modules/Findminizip-ng.cmake b/share/cmake/modules/Findminizip-ng.cmake index 4d66093839..fb8764b7aa 100644 --- a/share/cmake/modules/Findminizip-ng.cmake +++ b/share/cmake/modules/Findminizip-ng.cmake @@ -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 @@ -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. @@ -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() \ No newline at end of file +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) diff --git a/share/cmake/modules/Findpystring.cmake b/share/cmake/modules/Findpystring.cmake index c466115476..50fc64635a 100644 --- a/share/cmake/modules/Findpystring.cmake +++ b/share/cmake/modules/Findpystring.cmake @@ -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 HINTS ${pystring_ROOT} PATH_SUFFIXES include + include/pystring pystring/include ) diff --git a/share/cmake/modules/Findyaml-cpp.cmake b/share/cmake/modules/Findyaml-cpp.cmake index 5a850f9601..3f35e74ab3 100644 --- a/share/cmake/modules/Findyaml-cpp.cmake +++ b/share/cmake/modules/Findyaml-cpp.cmake @@ -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 @@ -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 @@ -137,8 +143,8 @@ 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() @@ -146,7 +152,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} ) @@ -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) diff --git a/share/cmake/modules/install/Installpystring.cmake b/share/cmake/modules/install/Installpystring.cmake index 3045e4fbc4..48ca152290 100644 --- a/share/cmake/modules/install/Installpystring.cmake +++ b/share/cmake/modules/install/Installpystring.cmake @@ -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}") diff --git a/share/cmake/modules/install/Installyaml-cpp.cmake b/share/cmake/modules/install/Installyaml-cpp.cmake index a117fdcff0..8528d43f23 100644 --- a/share/cmake/modules/install/Installyaml-cpp.cmake +++ b/share/cmake/modules/install/Installyaml-cpp.cmake @@ -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() @@ -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() @@ -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} ) @@ -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) diff --git a/src/OpenColorIO/CMakeLists.txt b/src/OpenColorIO/CMakeLists.txt index 7ff40bfd7a..bbe80a7846 100755 --- a/src/OpenColorIO/CMakeLists.txt +++ b/src/OpenColorIO/CMakeLists.txt @@ -309,7 +309,7 @@ target_link_libraries(OpenColorIO "$" "$" "$" - ${YAML_CPP_LIBRARIES} + yaml-cpp::yaml-cpp MINIZIP::minizip-ng ) @@ -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) diff --git a/src/OpenColorIO/Config.cpp b/src/OpenColorIO/Config.cpp index a17d1dc288..08864ae647 100644 --- a/src/OpenColorIO/Config.cpp +++ b/src/OpenColorIO/Config.cpp @@ -12,6 +12,8 @@ #include #include +#include + #include #include "builtinconfigs/BuiltinConfigRegistry.h" @@ -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" diff --git a/src/OpenColorIO/Context.cpp b/src/OpenColorIO/Context.cpp index bb6fb07f31..3a1294be58 100644 --- a/src/OpenColorIO/Context.cpp +++ b/src/OpenColorIO/Context.cpp @@ -7,6 +7,8 @@ #include #include +#include + #include #include "ContextVariableUtils.h" @@ -15,7 +17,6 @@ #include "OCIOZArchive.h" #include "PathUtils.h" #include "PrivateTypes.h" -#include "pystring/pystring.h" #include "utils/StringUtils.h" namespace OCIO_NAMESPACE diff --git a/src/OpenColorIO/OCIOYaml.cpp b/src/OpenColorIO/OCIOYaml.cpp index 62cbb0d001..e62964349e 100644 --- a/src/OpenColorIO/OCIOYaml.cpp +++ b/src/OpenColorIO/OCIOYaml.cpp @@ -4,6 +4,8 @@ #include #include +#include + #include #include "Display.h" @@ -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" diff --git a/src/OpenColorIO/OCIOZArchive.cpp b/src/OpenColorIO/OCIOZArchive.cpp index 24d836e952..982fce6823 100644 --- a/src/OpenColorIO/OCIOZArchive.cpp +++ b/src/OpenColorIO/OCIOZArchive.cpp @@ -8,10 +8,12 @@ #include #include +#include + #include + #include "Mutex.h" #include "Platform.h" -#include "pystring/pystring.h" #include "utils/StringUtils.h" #include "transforms/FileTransform.h" @@ -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" diff --git a/src/OpenColorIO/Op.cpp b/src/OpenColorIO/Op.cpp index e1bd564ff9..81dfe9867e 100755 --- a/src/OpenColorIO/Op.cpp +++ b/src/OpenColorIO/Op.cpp @@ -4,6 +4,8 @@ #include #include +#include + #include #include "Logging.h" @@ -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 { diff --git a/src/OpenColorIO/PathUtils.cpp b/src/OpenColorIO/PathUtils.cpp index 9dc8c6b743..bd9fb11351 100644 --- a/src/OpenColorIO/PathUtils.cpp +++ b/src/OpenColorIO/PathUtils.cpp @@ -5,12 +5,13 @@ #include #include +#include + #include #include "Mutex.h" #include "PathUtils.h" #include "Platform.h" -#include "pystring/pystring.h" #include "utils/StringUtils.h" #include "OCIOZArchive.h" @@ -218,4 +219,3 @@ int ParseColorSpaceFromString(const Config & config, const char * str) } } // namespace OCIO_NAMESPACE - diff --git a/src/OpenColorIO/fileformats/FileFormatCTF.cpp b/src/OpenColorIO/fileformats/FileFormatCTF.cpp index ebed326c9f..c9ada57cda 100644 --- a/src/OpenColorIO/fileformats/FileFormatCTF.cpp +++ b/src/OpenColorIO/fileformats/FileFormatCTF.cpp @@ -6,6 +6,8 @@ #include #include +#include + #include #include "expat.h" @@ -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" diff --git a/src/OpenColorIO/fileformats/FileFormatDiscreet1DL.cpp b/src/OpenColorIO/fileformats/FileFormatDiscreet1DL.cpp index a52bc728f1..6a76d968d4 100755 --- a/src/OpenColorIO/fileformats/FileFormatDiscreet1DL.cpp +++ b/src/OpenColorIO/fileformats/FileFormatDiscreet1DL.cpp @@ -8,6 +8,8 @@ #include #include +#include + #include #include "BitDepthUtils.h" @@ -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" @@ -771,4 +772,3 @@ FileFormat * CreateFileFormatDiscreet1DL() } } // namespace OCIO_NAMESPACE - diff --git a/src/OpenColorIO/fileformats/FileFormatICC.cpp b/src/OpenColorIO/fileformats/FileFormatICC.cpp index 1fcfd9adcf..4768101129 100755 --- a/src/OpenColorIO/fileformats/FileFormatICC.cpp +++ b/src/OpenColorIO/fileformats/FileFormatICC.cpp @@ -5,6 +5,8 @@ #include #include +#include + #include #include "Logging.h" @@ -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" diff --git a/src/OpenColorIO/fileformats/FileFormatIridasLook.cpp b/src/OpenColorIO/fileformats/FileFormatIridasLook.cpp index 7402efd095..0ba209a905 100755 --- a/src/OpenColorIO/fileformats/FileFormatIridasLook.cpp +++ b/src/OpenColorIO/fileformats/FileFormatIridasLook.cpp @@ -5,6 +5,8 @@ #include #include +#include + #include #include "expat.h" @@ -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" @@ -579,4 +580,3 @@ FileFormat * CreateFileFormatIridasLook() } } // namespace OCIO_NAMESPACE - diff --git a/src/OpenColorIO/transforms/FileTransform.cpp b/src/OpenColorIO/transforms/FileTransform.cpp index 4fd4d5d475..9aeae8df43 100755 --- a/src/OpenColorIO/transforms/FileTransform.cpp +++ b/src/OpenColorIO/transforms/FileTransform.cpp @@ -9,6 +9,8 @@ #include #include +#include + #include #include "Caching.h" @@ -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 diff --git a/tests/cpu/CMakeLists.txt b/tests/cpu/CMakeLists.txt index 896bb3f92d..ba1498f4d1 100755 --- a/tests/cpu/CMakeLists.txt +++ b/tests/cpu/CMakeLists.txt @@ -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 diff --git a/tests/cpu/ColorSpace_tests.cpp b/tests/cpu/ColorSpace_tests.cpp index 8c37c37975..7d86b6a04f 100644 --- a/tests/cpu/ColorSpace_tests.cpp +++ b/tests/cpu/ColorSpace_tests.cpp @@ -4,9 +4,10 @@ #include +#include + #include "ColorSpace.cpp" -#include #include "testutils/UnitTest.h" #include "UnitTestUtils.h" diff --git a/tests/cpu/Config_tests.cpp b/tests/cpu/Config_tests.cpp index 5d30fda5fc..48747662cc 100644 --- a/tests/cpu/Config_tests.cpp +++ b/tests/cpu/Config_tests.cpp @@ -4,10 +4,10 @@ #include +#include + #include "Config.cpp" -#include "utils/StringUtils.h" -#include #include "testutils/UnitTest.h" #include "UnitTestLogUtils.h" #include "UnitTestUtils.h" diff --git a/tests/cpu/Context_tests.cpp b/tests/cpu/Context_tests.cpp index f78bad8d9e..c8d4052ffd 100644 --- a/tests/cpu/Context_tests.cpp +++ b/tests/cpu/Context_tests.cpp @@ -4,11 +4,12 @@ #include +#include + #include "Context.cpp" #include "PathUtils.h" #include "Platform.h" -#include "pystring/pystring.h" #include "testutils/UnitTest.h" namespace OCIO = OCIO_NAMESPACE; @@ -171,5 +172,3 @@ OCIO_ADD_TEST(Context, string_vars) OCIO_CHECK_EQUAL(std::string("var3"), ctx1->getStringVarNameByIndex(2)); OCIO_CHECK_EQUAL(std::string("val3"), ctx1->getStringVarByIndex(2)); } - - diff --git a/tests/cpu/UnitTestUtils.h b/tests/cpu/UnitTestUtils.h index 4c65b0f521..bbdac35549 100644 --- a/tests/cpu/UnitTestUtils.h +++ b/tests/cpu/UnitTestUtils.h @@ -13,12 +13,13 @@ # endif #endif +#include + #include #include "MathUtils.h" #include "Op.h" #include "Platform.h" -#include "pystring/pystring.h" #include "CPUInfoConfig.h" namespace OCIO_NAMESPACE diff --git a/vendor/openfx/OCIOUtils.cpp b/vendor/openfx/OCIOUtils.cpp index ca44905069..90f6e42527 100644 --- a/vendor/openfx/OCIOUtils.cpp +++ b/vendor/openfx/OCIOUtils.cpp @@ -8,8 +8,9 @@ namespace OCIO = OCIO_NAMESPACE; #include #include +#include + #include "ofxsLog.h" -#include "pystring/pystring.h" namespace {