提交 b49745cd 编写于 作者: L liaogang

Add find system's swig

上级 d41ac090
...@@ -29,6 +29,7 @@ addons: ...@@ -29,6 +29,7 @@ addons:
- python-pip - python-pip
- python2.7-dev - python2.7-dev
- curl - curl
- swig
- graphviz - graphviz
- clang-format-3.8 - clang-format-3.8
- automake - automake
......
...@@ -12,16 +12,19 @@ ...@@ -12,16 +12,19 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
# build swig as an external project FIND_PACKAGE(SWIG)
INCLUDE(ExternalProject)
SET(SWIG_SOURCES_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/swig) IF(NOT SWIG_FOUND)
SET(SWIG_INSTALL_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/install/swig) # build swig as an external project
SET(SWIG_TARGET_VERSION "3.0.2") INCLUDE(ExternalProject)
SET(SWIG_DOWNLOAD_SRC_MD5 "62f9b0d010cef36a13a010dc530d0d41")
SET(SWIG_DOWNLOAD_WIN_MD5 "3f18de4fc09ab9abb0d3be37c11fbc8f")
IF(WIN32) SET(SWIG_SOURCES_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/swig)
SET(SWIG_INSTALL_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/install/swig)
SET(SWIG_TARGET_VERSION "3.0.2")
SET(SWIG_DOWNLOAD_SRC_MD5 "62f9b0d010cef36a13a010dc530d0d41")
SET(SWIG_DOWNLOAD_WIN_MD5 "3f18de4fc09ab9abb0d3be37c11fbc8f")
IF(WIN32)
# swig.exe available as pre-built binary on Windows: # swig.exe available as pre-built binary on Windows:
ExternalProject_Add(swig ExternalProject_Add(swig
URL http://prdownloads.sourceforge.net/swig/swigwin-${SWIG_TARGET_VERSION}.zip URL http://prdownloads.sourceforge.net/swig/swigwin-${SWIG_TARGET_VERSION}.zip
...@@ -34,7 +37,7 @@ IF(WIN32) ...@@ -34,7 +37,7 @@ IF(WIN32)
) )
SET(SWIG_DIR ${SWIG_SOURCES_DIR} CACHE FILEPATH "SWIG Directory" FORCE) SET(SWIG_DIR ${SWIG_SOURCES_DIR} CACHE FILEPATH "SWIG Directory" FORCE)
SET(SWIG_EXECUTABLE ${SWIG_SOURCES_DIR}/swig.exe CACHE FILEPATH "SWIG Executable" FORCE) SET(SWIG_EXECUTABLE ${SWIG_SOURCES_DIR}/swig.exe CACHE FILEPATH "SWIG Executable" FORCE)
ELSE(WIN32) ELSE(WIN32)
# From PCRE configure # From PCRE configure
ExternalProject_Add(pcre ExternalProject_Add(pcre
${EXTERNAL_PROJECT_LOG_ARGS} ${EXTERNAL_PROJECT_LOG_ARGS}
...@@ -65,6 +68,7 @@ ELSE(WIN32) ...@@ -65,6 +68,7 @@ ELSE(WIN32)
SET(SWIG_DIR ${SWIG_INSTALL_DIR}/share/swig/${SWIG_TARGET_VERSION}) SET(SWIG_DIR ${SWIG_INSTALL_DIR}/share/swig/${SWIG_TARGET_VERSION})
SET(SWIG_EXECUTABLE ${SWIG_INSTALL_DIR}/bin/swig) SET(SWIG_EXECUTABLE ${SWIG_INSTALL_DIR}/bin/swig)
ENDIF(WIN32) ENDIF(WIN32)
LIST(APPEND external_project_dependencies swig) LIST(APPEND external_project_dependencies swig)
ENDIF(NOT SWIG_FOUND)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册