浏览代码

COMP: ctkMacroCompilePythonScript - Remove extra target - Added COMMENT argument to CUSTOM_COMMAND

Having this extra target was causing problem in parallel build.

Here is the explanation of Brad king:

"The copy rules end up in Copy${kit_name}PythonFiles as dependencies
of the byte compiling custom command.
Since the two targets do not depend on one another they
can build in parallel and try to copy the same file at the same time.
Removing the unnecessary target should solve the problem."
Jean-Christophe Fillion-Robin 15 年之前
父节点
当前提交
81f6f9a43c
共有 1 个文件被更改,包括 3 次插入7 次删除
  1. 3 7
      CMake/ctkMacroCompilePythonScript.cmake

+ 3 - 7
CMake/ctkMacroCompilePythonScript.cmake

@@ -19,13 +19,9 @@ MACRO(ctkMacroCompilePythonScript kit_name python_source_files dest_dir)
     ADD_CUSTOM_COMMAND(DEPENDS ${src}
                         COMMAND ${CMAKE_COMMAND} -E copy ${src} ${tgt}
                         OUTPUT ${tgt}
-                        COMMENT "source copy")
+                        COMMENT "Copying ${file_we}")
   ENDFOREACH()
   
-  ADD_CUSTOM_TARGET(Copy${kit_name}PythonFiles
-                  ALL
-                  DEPENDS ${copied_python_files})
-  
   # Byte compile the Python files.
   SET(compile_all_script "${CMAKE_CURRENT_BINARY_DIR}/compile_all_${kit_name}.py")
   
@@ -39,10 +35,10 @@ file.write('Done')
 ")
 
   ADD_CUSTOM_COMMAND(
-    COMMAND ${PYTHON_EXECUTABLE}
-    ARGS  "${compile_all_script}"
+    COMMAND ${PYTHON_EXECUTABLE} ${compile_all_script}
     DEPENDS ${copied_python_files}  ${compile_all_script}
     OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${kit_name}_python_compile_complete"
+    COMMENT "Compiling ${kit_name} python files"
     )
   
   ADD_CUSTOM_TARGET(${kit_name}_pyc ALL