Skip to content

Commit

Permalink
build(deps): Add libjpeg-turbo recipe (#4392)
Browse files Browse the repository at this point in the history
Build and link missing libjpeg-turbo shared + static libs

Signed-off-by: Zach Lewis <[email protected]>
  • Loading branch information
zachlewis committed Aug 26, 2024
1 parent 6b2d140 commit 1cbde79
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions src/cmake/build_libjpeg-turbo.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Copyright Contributors to the OpenImageIO project.
# SPDX-License-Identifier: Apache-2.0
# https://github.com/Academ SoftwareFoundation/OpenImageIO

set_cache (libjpeg-turbo_BUILD_VERSION 3.0.3 "libjpeg-turbo version for local builds")
set (libjpeg-turbo_GIT_REPOSITORY "https://github.com/libjpeg-turbo/libjpeg-turbo")
set (libjpeg-turbo_GIT_TAG "${libjpeg-turbo_BUILD_VERSION}")
set_cache (libjpeg-turbo_BUILD_SHARED_LIBS OFF #${LOCAL_BUILD_SHARED_LIBS_DEFAULT}
DOC "Should a local libjpeg-turbo build, if necessary, build shared libraries" ADVANCED)

string (MAKE_C_IDENTIFIER ${libjpeg-turbo_BUILD_VERSION} libjpeg-turbo_VERSION_IDENT)

build_dependency_with_cmake(libjpeg-turbo
VERSION ${libjpeg-turbo_BUILD_VERSION}
GIT_REPOSITORY ${libjpeg-turbo_GIT_REPOSITORY}
GIT_TAG ${libjpeg-turbo_GIT_TAG}
CMAKE_ARGS
-D ENABLE_SHARED=${libjpeg-turbo_BUILD_SHARED_LIBS}
-D WITH_JPEG8=1
-D CMAKE_INSTALL_LIBDIR=lib
-D CMAKE_POSITION_INDEPENDENT_CODE=1

)
# Set some things up that we'll need for a subsequent find_package to work
set (libjpeg-turbo_ROOT ${libjpeg-turbo_LOCAL_INSTALL_DIR})


# Signal to caller that we need to find again at the installed location
set (libjpeg-turbo_REFIND TRUE)
set (libjpeg-turbo_REFIND_ARGS CONFIG)

if (libjpeg-turbo_BUILD_SHARED_LIBS)
install_local_dependency_libs (libjpeg-turbo libjpeg-turbo)
endif ()

0 comments on commit 1cbde79

Please sign in to comment.