diff options
author | Erik Kundiman <erik@megapahit.org> | 2023-07-11 19:29:32 +0800 |
---|---|---|
committer | Erik Kundiman <erik@megapahit.org> | 2023-07-19 10:48:27 +0800 |
commit | 593e7199e2dece84584882ed90b5dcc0ffb4d52b (patch) | |
tree | 5dfe05b969674d98e18aef2ddf2c075da7a911ac | |
parent | a763de1cfa21a184e0c941c5a3618125af366939 (diff) |
Obtain OpenJPEG flags when using system libs
The module name to check with pkgconf is different, hence the special
treatment.
-rw-r--r-- | indra/cmake/OpenJPEG.cmake | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/indra/cmake/OpenJPEG.cmake b/indra/cmake/OpenJPEG.cmake index c4aab2e9e5..3f86bfd025 100644 --- a/indra/cmake/OpenJPEG.cmake +++ b/indra/cmake/OpenJPEG.cmake @@ -4,6 +4,15 @@ include(Prebuilt) include_guard() add_library( ll::openjpeg INTERFACE IMPORTED ) +if (NOT (USE_AUTOBUILD_3P OR USE_CONAN)) + include(FindPkgConfig) + pkg_check_modules(Openjpeg REQUIRED libopenjp2) + target_include_directories(ll::openjpeg SYSTEM INTERFACE ${Openjpeg_INCLUDE_DIRS}) + target_link_directories(ll::openjpeg INTERFACE ${Openjpeg_LIBRARY_DIRS}) + target_link_libraries(ll::openjpeg INTERFACE ${Openjpeg_LIBRARIES}) + return () +endif () + use_system_binary(openjpeg) use_prebuilt_binary(openjpeg) |