SINGA-244 Separating swig interface and python binding files
Remove dependencies on copy_protobuf target.


Project: http://git-wip-us.apache.org/repos/asf/incubator-singa/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-singa/commit/5439e3a9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-singa/tree/5439e3a9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-singa/diff/5439e3a9

Branch: refs/heads/master
Commit: 5439e3a9524c5776123318a9dfb22661e8260484
Parents: 32ba40d
Author: xiezl <[email protected]>
Authored: Fri Sep 9 11:54:54 2016 +0800
Committer: xiezl <[email protected]>
Committed: Fri Sep 9 11:54:54 2016 +0800

----------------------------------------------------------------------
 src/CMakeLists.txt | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/5439e3a9/src/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 0752884..5f70204 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -62,20 +62,23 @@ AUX_SOURCE_DIRECTORY(io/network io_source)
 LIST(APPEND singa_sources ${io_source})
 
 ADD_CUSTOM_TARGET(
-  copy_protobuf
+  copy_protobuf ALL
   COMMAND ${CMAKE_COMMAND} -E make_directory 
"${CMAKE_BINARY_DIR}/include/singa/proto"
   DEPENDS ${proto_hdrs}
   COMMENT "Copying Protobuf headers"
   )
 FOREACH(fil ${proto_hdrs})
+  GET_FILENAME_COMPONENT(filename ${fil} NAME)
   ADD_CUSTOM_COMMAND(
-    TARGET copy_protobuf PRE_BUILD
-    COMMAND ${CMAKE_COMMAND} -E copy ${fil} 
"${CMAKE_BINARY_DIR}/include/singa/proto"
+    TARGET copy_protobuf POST_BUILD
+    COMMAND ${CMAKE_COMMAND} -E copy_if_different ${fil}
+    "${CMAKE_BINARY_DIR}/include/singa/proto/${filename}"
+    DEPENDS ${proto_files} 
  )
 ENDFOREACH()
 
 ADD_LIBRARY(singa_objects OBJECT ${singa_sources})
-ADD_DEPENDENCIES(singa_objects copy_protobuf)
+#ADD_DEPENDENCIES(singa_objects copy_protobuf)
 
 ADD_LIBRARY(singa SHARED $<TARGET_OBJECTS:singa_objects> ${cuda_objs})
 TARGET_LINK_LIBRARIES(singa ${SINGA_LINKER_LIBS})

Reply via email to