提交 338dc3ee 编写于 作者: L liaogang

Fix external denpendencies build order

上级 0b956711
...@@ -59,6 +59,8 @@ IF(NOT ${NUMPY_FOUND}) ...@@ -59,6 +59,8 @@ IF(NOT ${NUMPY_FOUND})
DEPENDS python setuptools cython DEPENDS python setuptools cython
) )
LIST(APPEND external_project_dependencies numpy)
# find numpy include directory # find numpy include directory
FILE(WRITE ${PROJECT_BINARY_DIR}/FindNumpyPath.py FILE(WRITE ${PROJECT_BINARY_DIR}/FindNumpyPath.py
"try: import numpy; print(numpy.get_include())\nexcept:pass\n") "try: import numpy; print(numpy.get_include())\nexcept:pass\n")
......
...@@ -42,10 +42,16 @@ IF(WIN32) ...@@ -42,10 +42,16 @@ IF(WIN32)
"${PROTOBUF_INSTALL_DIR}/lib/libprotoc.lib" CACHE FILEPATH "protobuf libraries." FORCE) "${PROTOBUF_INSTALL_DIR}/lib/libprotoc.lib" CACHE FILEPATH "protobuf libraries." FORCE)
SET(PROTOBUF_PROTOC_EXECUTABLE "${PROTOBUF_INSTALL_DIR}/bin/protoc.exe" CACHE FILEPATH "protobuf executable." FORCE) SET(PROTOBUF_PROTOC_EXECUTABLE "${PROTOBUF_INSTALL_DIR}/bin/protoc.exe" CACHE FILEPATH "protobuf executable." FORCE)
ELSE(WIN32) ELSE(WIN32)
FIND_PATH(PROTOBUF_LIBS_DIR libprotoc.a
PATHS
${PROTOBUF_INSTALL_DIR}/lib64
${PROTOBUF_INSTALL_DIR}/lib
NO_DEFAULT_PATH
)
SET(PROTOBUF_LIBRARIES SET(PROTOBUF_LIBRARIES
"${PROTOBUF_INSTALL_DIR}/lib/libprotobuf-lite.a" "${PROTOBUF_LIBS_DIR}/libprotobuf-lite.a"
"${PROTOBUF_INSTALL_DIR}/lib/libprotobuf.a" "${PROTOBUF_LIBS_DIR}/libprotobuf.a"
"${PROTOBUF_INSTALL_DIR}/lib/libprotoc.a" CACHE FILEPATH "protobuf libraries." FORCE) "${PROTOBUF_LIBS_DIR}/libprotoc.a" CACHE FILEPATH "protobuf libraries." FORCE)
SET(PROTOBUF_PROTOC_EXECUTABLE "${PROTOBUF_INSTALL_DIR}/bin/protoc" CACHE FILEPATH "protobuf executable." FORCE) SET(PROTOBUF_PROTOC_EXECUTABLE "${PROTOBUF_INSTALL_DIR}/bin/protoc" CACHE FILEPATH "protobuf executable." FORCE)
ENDIF(WIN32) ENDIF(WIN32)
......
...@@ -87,6 +87,9 @@ IF((NOT ${PYTHONINTERP_FOUND}) OR (NOT ${PYTHONLIBS_FOUND})) ...@@ -87,6 +87,9 @@ IF((NOT ${PYTHONINTERP_FOUND}) OR (NOT ${PYTHONLIBS_FOUND}))
MESSAGE(FATAL_ERROR "Unknown system !") MESSAGE(FATAL_ERROR "Unknown system !")
ENDIF() ENDIF()
LIST(APPEND external_project_dependencies python)
ENDIF() ENDIF()
INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_DIR}) INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_DIR})
...@@ -70,6 +70,9 @@ IF(NOT ${SWIG_FOUND}) ...@@ -70,6 +70,9 @@ IF(NOT ${SWIG_FOUND})
set(SWIG_DIR ${SWIG_INSTALL_DIR}/share/swig/${SWIG_TARGET_VERSION} CACHE FILEPATH "SWIG Directory" FORCE) set(SWIG_DIR ${SWIG_INSTALL_DIR}/share/swig/${SWIG_TARGET_VERSION} CACHE FILEPATH "SWIG Directory" FORCE)
set(SWIG_EXECUTABLE ${SWIG_INSTALL_DIR}/bin/swig CACHE FILEPATH "SWIG Executable" FORCE) set(SWIG_EXECUTABLE ${SWIG_INSTALL_DIR}/bin/swig CACHE FILEPATH "SWIG Executable" FORCE)
ENDIF(WIN32) ENDIF(WIN32)
LIST(APPEND external_project_dependencies swig)
ENDIF() ENDIF()
FUNCTION(generate_python_api target_name) FUNCTION(generate_python_api target_name)
...@@ -80,10 +83,12 @@ FUNCTION(generate_python_api target_name) ...@@ -80,10 +83,12 @@ FUNCTION(generate_python_api target_name)
&& mv ${PROJ_ROOT}/paddle/swig_paddle.py ${PROJ_ROOT}/paddle/py_paddle/swig_paddle.py && mv ${PROJ_ROOT}/paddle/swig_paddle.py ${PROJ_ROOT}/paddle/py_paddle/swig_paddle.py
DEPENDS ${PROJ_ROOT}/paddle/api/Paddle.swig DEPENDS ${PROJ_ROOT}/paddle/api/Paddle.swig
${PROJ_ROOT}/paddle/api/PaddleAPI.h ${PROJ_ROOT}/paddle/api/PaddleAPI.h
${external_project_dependencies}
WORKING_DIRECTORY ${PROJ_ROOT}/paddle WORKING_DIRECTORY ${PROJ_ROOT}/paddle
COMMENT "Generate Python API from swig") COMMENT "Generate Python API from swig")
ADD_CUSTOM_TARGET(${target_name} ALL DEPENDS ADD_CUSTOM_TARGET(${target_name} ALL DEPENDS
${PROJ_ROOT}/paddle/Paddle_wrap.cxx ${PROJ_ROOT}/paddle/Paddle_wrap.cxx
${PROJ_ROOT}/paddle/Paddle_wrap.h ${PROJ_ROOT}/paddle/Paddle_wrap.h
${PROJ_ROOT}/paddle/py_paddle/swig_paddle.py) ${PROJ_ROOT}/paddle/py_paddle/swig_paddle.py
${external_project_dependencies})
ENDFUNCTION(generate_python_api) ENDFUNCTION(generate_python_api)
...@@ -40,8 +40,14 @@ IF(WIN32) ...@@ -40,8 +40,14 @@ IF(WIN32)
SET(WARPCTC_LIBRARIES SET(WARPCTC_LIBRARIES
"${WARPCTC_INSTALL_DIR}/lib/warpctc.dll" CACHE FILEPATH "Warp-ctc Library" FORCE) "${WARPCTC_INSTALL_DIR}/lib/warpctc.dll" CACHE FILEPATH "Warp-ctc Library" FORCE)
ELSE(WIN32) ELSE(WIN32)
IF(APPLE)
SET(_warpctc_SHARED_SUFFIX dylib)
ELSE(APPLE)
SET(_warpctc_SHARED_SUFFIX so)
ENDIF(APPLE)
SET(WARPCTC_LIBRARIES SET(WARPCTC_LIBRARIES
"${WARPCTC_INSTALL_DIR}/lib/libwarpctc.dylib" CACHE FILEPATH "Warp-ctc Library" FORCE) "${WARPCTC_INSTALL_DIR}/lib/libwarpctc.${_warpctc_SHARED_SUFFIX}" CACHE FILEPATH "Warp-ctc Library" FORCE)
ENDIF(WIN32) ENDIF(WIN32)
LIST(APPEND external_project_dependencies warpctc) LIST(APPEND external_project_dependencies warpctc)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册