diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index 7114d9b762..5c84d048fc 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -250,6 +250,7 @@ function(add_python_module module) endif() set(targets) + set(component "Python") set(link_targets) set(import_flags) set(infiles_rel) @@ -259,7 +260,7 @@ function(add_python_module module) set(keyword) foreach(arg ${ARGN}) - if(arg STREQUAL "LINK" OR arg STREQUAL "IMPORT") + if(arg STREQUAL "LINK" OR arg STREQUAL "IMPORT" OR arg STREQUAL "COMPONENT") set(keyword "${arg}") elseif(keyword STREQUAL "LINK") list(APPEND link_targets "${arg}") @@ -267,6 +268,9 @@ function(add_python_module module) elseif(keyword STREQUAL "IMPORT") list(APPEND import_flags "-import" "${arg}") set(keyword) + elseif(keyword STREQUAL "COMPONENT") + set(component "${arg}") + set(keyword) else() list(APPEND targets "${arg}") endif() @@ -308,7 +312,8 @@ function(add_python_module module) COMMENT "Generating module ${module}" ) - add_python_target(panda3d.${module} "${module}_module.cxx" ${sources_abs} ${extensions}) + add_python_target(panda3d.${module} COMPONENT "${component}" EXPORT "${component}" + "${module}_module.cxx" ${sources_abs} ${extensions}) target_link_libraries(panda3d.${module} ${link_targets}) if(CMAKE_VERSION VERSION_LESS "3.11")