tesseract-robotics / tesseract_ext

This contains external dependencies for Tesseract
1 stars 11 forks source link

Add SWIG and Travis CI #3

Closed Levi-Armstrong closed 4 years ago

Levi-Armstrong commented 4 years ago

This PR adds SWIG required for building tesseract_python. Also it fixes some of the packages depends so things build in the correct order.

Update: Also it adds Travis CI for linux and Windows. I excluded kinetic build because there is a bug in catkin that requires at least one catkin package. It will not build a workspace of all pure cmake packages even if they have package.xml files. This has been fixed in melodic.

Levi-Armstrong commented 4 years ago

@johnwason I am trying to get swig to build on windows but it uses automake and autotools and I am not sure how to install these tools on windows. Have install swig on windows?

johnwason commented 4 years ago

I have never been able to get SWIG to build on windows. I think it needs to be built with MinGW. My suggestion is to use the binaries available on the SWIG website.

http://www.swig.org/download.html

http://prdownloads.sourceforge.net/swig/swigwin-4.0.1.zip

See the Robot Raconteur travis.yml for an example:

https://github.com/robotraconteur/robotraconteur/blob/master/.travis.yml

Levi-Armstrong commented 4 years ago

@johnwason I almost have swig working in the windows ci. The only think I cannot figure out is how to move the swig.exe to the install bin director and rename it. Do you have any thoughts?

johnwason commented 4 years ago

I think you will have to put custom install directives in the CMakeLists.txt file. As long as the relative directory structure is unchanged it should be fine.

Levi-Armstrong commented 4 years ago

This is what I have so far but the it does not like my install command. I tested it on a windows machine in the command prompt which worked but not sure why it is not working here.

ExternalProject_Add(swig
      URL               https://sourceforge.net/projects/swig/files/swigwin/swigwin-4.0.1/swigwin-4.0.1.zip/download
      CONFIGURE_COMMAND ""
      BUILD_COMMAND     ""
      INSTALL_COMMAND   if not exist ${CMAKE_INSTALL_PREFIX}/bin mkdir ${CMAKE_INSTALL_PREFIX}/bin && mv ${CMAKE_BINARY_DIR}/swig-prefix/src/swig/swig.exe ${CMAKE_INSTALL_PREFIX}/bin/swig4.0.exe
    )
    )
johnwason commented 4 years ago

Oh, I forgot that I used chocolatey to install on Windows with the more recent versions. Add:

choco install swig

to the setup commands in travis.yml. I am not sure if rosdep has this configured for automatic install.

Disable the swig package in tesseract_ext for Windows and use choco instead.

Levi-Armstrong commented 4 years ago

Ah, Thank you.

Levi-Armstrong commented 4 years ago

@mpowelson Travis CI is now passing.