Skip to content

Commit 14c47fa

Browse files
domin1441div0
authored andcommitted
build: ptex support for static library (AcademySoftwareFoundation#4072)
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 <[email protected]> Signed-off-by: Peter Kovář <[email protected]>
1 parent be4b97c commit 14c47fa

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/ptex.imageio/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33
# https://github.com/AcademySoftwareFoundation/OpenImageIO
44

55
if (Ptex_FOUND)
6+
set(ptex_target Ptex::Ptex_dynamic)
7+
if (TARGET Ptex::Ptex_static AND (NOT TARGET Ptex::Ptex_dynamic OR LINKSTATIC))
8+
set(ptex_target Ptex::Ptex_static)
9+
endif()
610
add_oiio_plugin (ptexinput.cpp
7-
LINK_LIBRARIES Ptex::Ptex_dynamic ZLIB::ZLIB
11+
LINK_LIBRARIES ${ptex_target} ZLIB::ZLIB
812
DEFINITIONS "-DUSE_PTEX")
913
endif ()

0 commit comments

Comments
 (0)