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

openimageio: migrate to Conan v2 #18904

Closed
wants to merge 7 commits into from
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
76 changes: 63 additions & 13 deletions recipes/openimageio/all/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,69 @@
cmake_minimum_required(VERSION 3.1)
project(cmake_wrapper)
cmake_minimum_required(VERSION 3.15)
project(cmake_wrapper LANGUAGES CXX)

include("conanbuildinfo.cmake")
conan_basic_setup(KEEP_RPATHS)
set(libs
BZip2
Boost
DCMTK
FFmpeg
fmt
Freetype
GIF
HDF5
JPEG
Libheif
libjpeg-turbo
LibRaw
libsquish
Nuke
OpenCV
OpenColorIO
OpenEXR
OpenJPEG
OpenVDB
PNG
Ptex
pugixml
R3DSDK
Robinmap
TBB
TIFF
WebP
ZLIB
)
foreach(lib IN LISTS libs)
string(TOUPPER "${lib}" lib_upper)
if (DEFINED USE_${lib_upper} AND NOT USE_${lib_upper})
message("Skipping ${lib}")
continue()
endif()
find_package(${lib} REQUIRED CONFIG)
if(${lib}_FOUND)
set(${lib}_INCLUDE_DIR ${${lib}_INCLUDE_DIRS})
set(${lib_upper}_FOUND ${${lib}_FOUND})
set(${lib_upper}_INCLUDE_DIR ${${lib}_INCLUDE_DIRS})
set(${lib_upper}_INCLUDE_DIRS ${${lib}_INCLUDE_DIRS})
set(${lib_upper}_LIBRARIES ${${lib}_LIBRARIES})
set(${lib_upper}_LIBRARY_DIRS ${${lib}_LIBRARY_DIRS})
set(${lib_upper}_LIBS ${${lib}_LIBS})
set(${lib_upper}_DEFINITIONS ${${lib}_DEFINITIONS})
endif()
endforeach()

set(LibRaw_r_LIBRARIES ${LibRaw_LIBRARIES})
set(LibRaw_r_DEFINITIONS ${LibRaw_DEFINITIONS})
set(FFMPEG_LIBRARIES ffmpeg::ffmpeg)

include_directories(
BEFORE
# OIIO uses CMAKE_BINARY_DIR, we need to set include dirs
# in order to be able to use add_subdirectory
"${CMAKE_BINARY_DIR}/source_subfolder/src/include"
"${CMAKE_BINARY_DIR}/source_subfolder/include"
# Same as above but for CMAKE_SOURCE_DIR
"${CMAKE_SOURCE_DIR}/source_subfolder/src/include"
${fmt_INCLUDE_DIRS}
${OpenEXR_INCLUDE_DIRS}
${Robinmap_INCLUDE_DIRS}
)

set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP YES)
add_subdirectory(src)

add_subdirectory(source_subfolder)
target_link_libraries(OpenImageIO PRIVATE
fmt::fmt
tsl::robin_map
$<TARGET_NAME_IF_EXISTS:Freetype::Freetype>
)
37 changes: 6 additions & 31 deletions recipes/openimageio/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,7 @@
sources:
"2.2.7.0":
url: "https://github.com/OpenImageIO/oiio/archive/Release-2.2.7.0.tar.gz"
sha256: "857ac83798d6d2bda5d4d11a90618ff19486da2e5a4c4ff022c5976b5746fe8c"
"2.2.18.0":
url: "https://github.com/OpenImageIO/oiio/archive/refs/tags/v2.2.18.0.tar.gz"
sha256: "72597619f09b60cc2afc18f378b40fbec62701112957f43cff162dd9a52a26ce"
"2.3.7.2":
url: "https://github.com/OpenImageIO/oiio/archive/refs/tags/v2.3.7.2.tar.gz"
sha256: "829c05d17610f1156c2a777310f4709b81f3a302fd11e3999ea4a865a5b4a5d3"
"2.4.7.1":
url: "https://github.com/OpenImageIO/oiio/archive/refs/tags/v2.4.7.1.tar.gz"
sha256: "fd298f71e44c6776863db4b37c4a1388dba0d2eb37378afea95ab07a7cd6ecd4"
patches:
"2.2.7.0":
- patch_file: "patches/2.2.7.0-cmake-targets.patch"
base_path: "source_subfolder"
"2.2.18.0":
- patch_file: "patches/2.2.18.0-cmake-targets.patch"
base_path: "source_subfolder"
"2.3.7.2":
- patch_file: "patches/2.3.7.2-cmake-targets.patch"
base_path: "source_subfolder"
"2.4.7.1":
- patch_file: "patches/2.4.7.1-cmake-targets.patch"
base_path: "source_subfolder"
patch_description: "Ensure project builds correctly with Conan (don't pick up disabled dependencies from the system, fix different spelling of libraries)"
patch_type: "conan"
- patch_file: "patches/2.4.7.1-fix-msvc2017.patch"
base_path: "source_subfolder"
patch_description: "Fix compile error with MSVC 2017"
patch_type: "official"
"2.5.4.0":
url: "https://github.com/AcademySoftwareFoundation/OpenImageIO/archive/refs/tags/v2.5.4.0.tar.gz"
sha256: "2e262ae5e5281f839651cd706e417c83c58294a26527ec184b466a2ba6ca31dc"
"2.4.16.0":
url: "https://github.com/AcademySoftwareFoundation/OpenImageIO/archive/refs/tags/v2.4.16.0.tar.gz"
sha256: "a8cea8b6087610e5154fbbe028548ab4fc773eb36531eef44ffb42351bc0b0f0"
Loading