Skip to content

Commit

Permalink
Fix: Make qml module targets publicly visible
Browse files Browse the repository at this point in the history
As per the CMake documentation, by default IMPORTED targets are only
visible within the current directory.
This isn't useful behavior in our case, so make it globally accessible.

See also: https://cmake.org/cmake/help/latest/command/add_library.html#imported-libraries
  • Loading branch information
LeonMatthesKDAB committed Dec 6, 2024
1 parent 13e62c7 commit bbf5f0b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmake/CxxQt.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ function(cxx_qt_import_qml_module target)
DEPENDS ${QML_MODULE_SOURCE_CRATE}
BYPRODUCTS "${QML_MODULE_DIR}/plugin_init.o")

add_library(${target} OBJECT IMPORTED)
add_library(${target} OBJECT IMPORTED GLOBAL)
set_target_properties(${target}
PROPERTIES
IMPORTED_OBJECTS "${QML_MODULE_DIR}/plugin_init.o")
Expand Down

0 comments on commit bbf5f0b

Please sign in to comment.