Skip to content

Commit

Permalink
build: ptex support for static library (#4072)
Browse files Browse the repository at this point in the history
In some environments, only one kind of the library could be available.
Choose proper fallback in such cases. Prefer static library, if
LINKSTATIC is ON and dynamic otherwise.

Signed-off-by: Dominik Wójt <domin144@o2.pl>
  • Loading branch information
domin144 authored Dec 9, 2023
1 parent d58e4aa commit 52f76f5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/ptex.imageio/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
# https://github.com/AcademySoftwareFoundation/OpenImageIO

if (Ptex_FOUND)
set(ptex_target Ptex::Ptex_dynamic)
if (TARGET Ptex::Ptex_static AND (NOT TARGET Ptex::Ptex_dynamic OR LINKSTATIC))
set(ptex_target Ptex::Ptex_static)
endif()
add_oiio_plugin (ptexinput.cpp
LINK_LIBRARIES Ptex::Ptex_dynamic ZLIB::ZLIB
LINK_LIBRARIES ${ptex_target} ZLIB::ZLIB
DEFINITIONS "-DUSE_PTEX")
endif ()

0 comments on commit 52f76f5

Please sign in to comment.