Explorar el Código

Optimize ctkMacroWrapPythonQt creating required source list in a single loop.

See #449
Jean-Christophe Fillion-Robin hace 11 años
padre
commit
06da22eaa6
Se han modificado 1 ficheros con 3 adiciones y 7 borrados
  1. 3 7
      CMake/ctkMacroWrapPythonQt.cmake

+ 3 - 7
CMake/ctkMacroWrapPythonQt.cmake

@@ -93,6 +93,8 @@ macro(ctkMacroWrapPythonQt WRAPPING_NAMESPACE TARGET SRCS_LIST_NAME SOURCES IS_W
   string(REPLACE "." "_" WRAPPING_NAMESPACE_UNDERSCORE ${WRAPPING_NAMESPACE})
 
   set(SOURCES_TO_WRAP)
+  set(SOURCES_TO_WRAP_ARG) # Custom_command argument
+
   # For each class
   foreach(FILE ${SOURCES})
 
@@ -137,16 +139,10 @@ macro(ctkMacroWrapPythonQt WRAPPING_NAMESPACE TARGET SRCS_LIST_NAME SOURCES IS_W
       endif()
 
       list(APPEND SOURCES_TO_WRAP ${TMP_INPUT})
-
+      set(SOURCES_TO_WRAP_ARG "${SOURCES_TO_WRAP_ARG}^^${TMP_INPUT}")
     endif()
   endforeach()
 
-  # Prepare custom_command argument
-  set(SOURCES_TO_WRAP_ARG)
-  foreach(source ${SOURCES_TO_WRAP})
-    set(SOURCES_TO_WRAP_ARG "${SOURCES_TO_WRAP_ARG}^^${source}")
-  endforeach()
-
   # Define wrap type and wrap intermediate directory
   set(wrap_int_dir generated_cpp/${WRAPPING_NAMESPACE_UNDERSCORE}_${TARGET}/)
   #message("wrap_int_dir:${wrap_int_dir}")