Skip to content

Commit 1d7cfb4

Browse files
author
mr.fantastic
committed
Make sure that OpenFX module have the imported target glib in CMakeLists.txt
1 parent 0a3a033 commit 1d7cfb4

2 files changed

Lines changed: 13 additions & 7 deletions

File tree

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,10 @@ if(MOD_JACKRACK)
260260
list(APPEND MLT_SUPPORTED_COMPONENTS jackrack)
261261
endif()
262262

263+
if(MOD_OPENFX)
264+
pkg_check_modules(glib IMPORTED_TARGET glib-2.0)
265+
endif()
266+
263267
if(USE_LV2)
264268
pkg_check_modules(lilv IMPORTED_TARGET lilv-0)
265269
if(NOT lilv_FOUND)

src/modules/openfx/CMakeLists.txt

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@ add_custom_target(Other_openfx_Files SOURCES
88
filter_openfx.yml
99
)
1010

11-
include(GenerateExportHeader)
12-
generate_export_header(mltopenfx)
13-
target_compile_options(mltopenfx PRIVATE ${MLT_COMPILE_OPTIONS})
14-
target_include_directories(mltopenfx PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
15-
target_link_libraries(mltopenfx PRIVATE mlt PkgConfig::glib ${CMAKE_DL_LIBS})
16-
if(NOT MSVC)
17-
target_link_libraries(mltopenfx PRIVATE m)
11+
if(GPL AND TARGET PkgConfig::glib)
12+
include(GenerateExportHeader)
13+
generate_export_header(mltopenfx)
14+
target_compile_options(mltopenfx PRIVATE ${MLT_COMPILE_OPTIONS})
15+
target_include_directories(mltopenfx PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
16+
target_link_libraries(mltopenfx PRIVATE mlt PkgConfig::glib ${CMAKE_DL_LIBS})
17+
if(NOT MSVC)
18+
target_link_libraries(mltopenfx PRIVATE m)
19+
endif()
1820
endif()
1921

2022
set_target_properties(mltopenfx PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${MLT_MODULE_OUTPUT_DIRECTORY}")

0 commit comments

Comments
 (0)