Skip to content

Commit f17e2fa

Browse files
authored
Merge pull request #38 from nilsbore/windows
Start of Windows library. Wohoo!!
2 parents 6d0e64a + 723d656 commit f17e2fa

42 files changed

Lines changed: 423 additions & 246 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.appveyor.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
version: 1.0.{build}
2+
os: Visual Studio 2017
3+
platform: x64
4+
clone_folder: C:\projects\auvlib
5+
#shallow_clone: true
6+
branches:
7+
only:
8+
- master
9+
environment:
10+
matrix:
11+
- CONFIG: Release
12+
BOOST_ROOT: C:/Libraries/boost_1_65_1
13+
OpenCV_DIR: C:/tools/opencv/build/x64/vc14/lib
14+
PYTHON: 27
15+
install:
16+
- cd C:\projects\auvlib
17+
- git submodule update --init
18+
#- cinst python2 appveyor already has python
19+
- cinst OpenCV --version 3.4.7
20+
build:
21+
parallel: true
22+
build_script:
23+
# Tutorials and tests
24+
#- set PATH=C:\Python%PYTHON%-x64;C:\Python%PYTHON%-x64\Scripts;%PATH%
25+
- mkdir build
26+
- cd build
27+
- cmake -DCMAKE_BUILD_TYPE=%CONFIG%
28+
-G "Visual Studio 15 2017 Win64"
29+
-DAUVLIB_WITH_GSF=OFF
30+
-DAUVLIB_USE_LIBIGL_GLFW=ON
31+
-DAUVLIB_USE_LIBIGL_TINYXML=ON
32+
-DAUVLIB_EXPORT_BUILD=OFF
33+
-DCMAKE_SKIP_INSTALL_RULES=true
34+
../
35+
#-DCMAKE_INSTALL_PREFIX=../install
36+
- set MSBuildLogger="C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
37+
- set MSBuildOptions=/v:m /m /p:BuildInParallel=true /p:Configuration=%CONFIG% /logger:%MSBuildLogger%
38+
#- msbuild %MSBuildOptions% INSTALL.vcxproj
39+
- msbuild %MSBuildOptions% ALL_BUILD.vcxproj

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,6 @@
1111
[submodule "src/cxxopts"]
1212
path = src/cxxopts
1313
url = https://github.com/jarro2783/cxxopts.git
14+
[submodule "src/cereal"]
15+
path = src/cereal
16+
url = https://github.com/USCiLab/cereal.git

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
cmake_minimum_required(VERSION 2.8)
2+
project(auvlib)
23

34
add_subdirectory(src)

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# auvlib
22

33
[![Build Status](https://travis-ci.org/nilsbore/auvlib.svg?branch=master)](https://travis-ci.org/nilsbore/auvlib)
4+
[![Build status](https://ci.appveyor.com/api/projects/status/kcfxp0jlpwqxt2fs/branch/master?svg=true)](https://ci.appveyor.com/project/nilsbore/auvlib/branch/master)
45
[![license](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)
56

67
Tools for reading AUV deployment data files and for

src/CMakeLists.txt

Lines changed: 55 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
1111
# locations on all platforms.
1212
include(GNUInstallDirs)
1313

14-
find_package(Eigen3 REQUIRED)
15-
find_package(OpenCV REQUIRED)
16-
find_package(OpenGL REQUIRED)
17-
find_package(glfw3 REQUIRED)
18-
find_package(Ceres REQUIRED)
14+
option(AUVLIB_WITH_GSF "Enable reading and processing gsf data" ON)
15+
option(AUVLIB_USE_LIBIGL_EIGEN "Use libigl's version of Eigen" ON)
16+
option(AUVLIB_USE_LIBIGL_GLFW "Use libigl's version of glfw" OFF)
17+
option(AUVLIB_USE_LIBIGL_TINYXML "Use libigl's version of tinyxml" OFF)
18+
option(AUVLIB_USE_PYTHON3 "Use python3 instead of python2" OFF)
19+
option(AUVLIB_EXPORT_BUILD "Export build dir configs" ON)
1920

2021
# libigl
2122
option(LIBIGL_USE_STATIC_LIBRARY "Use libigl as static library" OFF)
@@ -35,13 +36,55 @@ option(LIBIGL_WITH_PYTHON "Use Python" OFF)
3536
option(LIBIGL_WITH_TETGEN "Use Tetgen" OFF)
3637
option(LIBIGL_WITH_TRIANGLE "Use Triangle" OFF)
3738
option(LIBIGL_WITH_VIEWER "Use OpenGL viewer" ON)
38-
option(LIBIGL_WITH_XML "Use XML" OFF)
39+
option(LIBIGL_WITH_XML "Use XML" ON)
3940
#option(LIBIGL_EXPORT_TARGETS "Export libigl CMake targets" ON)
4041

42+
find_package(OpenCV REQUIRED core highgui imgproc)
43+
find_package(OpenGL REQUIRED)
44+
if (AUVLIB_USE_LIBIGL_TINYXML)
45+
set(TinyXML2_LIBRARIES tinyxml2)
46+
else()
47+
#find_package(TinyXML2 REQUIRED)
48+
set(TinyXML2_LIBRARIES -ltinyxml2)
49+
endif()
50+
4151
set(ENV{LIBIGL_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/libigl)
4252
find_package(LIBIGL REQUIRED QUIET)
4353
include(${CMAKE_CURRENT_BINARY_DIR}/embree/embree-config.cmake)
4454

55+
if (AUVLIB_USE_LIBIGL_GLFW)
56+
#add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/libigl/external/glfw) # this might be needed on windows?
57+
set(GLFW3_LIBRARY glfw)
58+
else()
59+
find_package(glfw3 REQUIRED)
60+
endif()
61+
62+
if (AUVLIB_USE_LIBIGL_EIGEN)
63+
set(EIGEN3_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/libigl/external/eigen)
64+
else()
65+
find_package(Eigen3 REQUIRED)
66+
endif()
67+
68+
if(MSVC)
69+
if (AUVLIB_USE_PYTHON3)
70+
set(PYTHON_EXECUTABLE C:/Python35/python.exe)
71+
else()
72+
#set(PYTHON_EXECUTABLE C:/Python27/python.exe)
73+
set(PYTHON_EXECUTABLE C:/Python27-x64/python.exe)
74+
endif()
75+
else()
76+
if (AUVLIB_USE_PYTHON3)
77+
set(PYTHON_EXECUTABLE /usr/bin/python3.5)
78+
else()
79+
set(PYTHON_EXECUTABLE /usr/bin/python2.7)
80+
endif()
81+
endif()
82+
83+
if (MSVC)
84+
set(Boost_USE_STATIC_LIBS ON CACHE BOOL "use static libraries from Boost")
85+
set(Boost_USE_MULTITHREADED ON)
86+
set(Boost_USE_DEBUG_RUNTIME OFF)
87+
endif()
4588
# For some reason it seems like we need to do this after libigl
4689
find_package(Boost COMPONENTS system filesystem date_time REQUIRED)
4790

@@ -51,18 +94,21 @@ set(PYBIND11_CPP_STANDARD -std=c++11)
5194
#add_definitions(-DPYBIND11_PYTHON_VERSION=2.7)
5295
#set(PYBIND11_PYTHON_VERSION 2.7)
5396
#set(PYTHON_LIBRARIES /usr/lib/x86_64-linux-gnu/libpython2.7.so)
54-
set(PYTHON_EXECUTABLE /usr/bin/python2.7)
97+
5598
add_subdirectory(pybind11)
5699

57100
message("Pybind11: " ${PYBIND11_INCLUDE_DIR})
58101

59102
add_subdirectory(cxxopts)
60103

61-
include_directories(${PYBIND11_INCLUDE_DIR} ${CERES_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS})
104+
include_directories(${PYBIND11_INCLUDE_DIR} ${EIGEN3_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}/cereal/include ${TinyXML2_INCLUDE_DIRS})
105+
link_directories(${Boost_LIBRARY_DIRS})
62106
#include_directories(eigen_cereal/include)
63107

64108
include(cmake/glad.cmake)
65-
add_subdirectory(libgsf)
109+
if(AUVLIB_WITH_GSF)
110+
add_subdirectory(libgsf)
111+
endif()
66112
add_subdirectory(libxtf)
67113
add_subdirectory(eigen_cereal)
68114
add_subdirectory(data_tools)

src/bathy_maps/CMakeLists.txt

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ add_library(sss_meas_data src/sss_meas_data.cpp)
4444

4545
add_library(sss_gen_sim src/sss_gen_sim.cpp)
4646

47-
add_executable(test_mesh src/test_mesh.cpp)
47+
if(AUVLIB_WITH_GSF)
48+
add_executable(test_mesh src/test_mesh.cpp)
49+
endif()
4850

4951
# Define headers for this library. PUBLIC headers are used for
5052
# compiling the library, and will be added to consumers' build
@@ -110,14 +112,16 @@ target_include_directories(sss_gen_sim PUBLIC
110112
target_link_libraries(draw_map std_data ${OpenCV_LIBS})
111113

112114
#target_link_libraries(mesh_map std_data igl::embree ${OpenCV_LIBS} glad ${GLFW3_LIBRARY} ${OPENGL_LIBRARY} ${OPENGL_glu_LIBRARY} -lpthread)
113-
target_link_libraries(mesh_map PRIVATE std_data ${OpenCV_LIBS} ${GLFW3_LIBRARY} auvlib_glad -lpthread -ltinyxml2) # ${TinyXML2_LIBRARIES})
115+
target_link_libraries(mesh_map std_data ${OpenCV_LIBS} ${GLFW3_LIBRARY} auvlib_glad -lpthread ${TinyXML2_LIBRARIES})
114116

115117
target_link_libraries(align_map mesh_map std_data xyz_data ${GLFW3_LIBRARY} auvlib_glad -lpthread) # ${TinyXML2_LIBRARIES})
116118

117119

118120
target_link_libraries(drape_mesh snell_ray_tracing xtf_data ${GLFW3_LIBRARY} auvlib_glad)
119121

120-
target_link_libraries(test_mesh std_data gsf_data xtf_data csv_data navi_data mesh_map draw_map patch_draper igl::embree ${OpenCV_LIBS} cxxopts)
122+
if(AUVLIB_WITH_GSF)
123+
target_link_libraries(test_mesh std_data gsf_data xtf_data csv_data navi_data mesh_map draw_map patch_draper igl::embree ${OpenCV_LIBS} cxxopts)
124+
endif()
121125

122126
target_link_libraries(patch_views eigen_cereal ${OpenCV_LIBS})
123127

@@ -146,5 +150,7 @@ install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
146150
# just go into 'cmake'.
147151
install(EXPORT BathyMapsConfig DESTINATION share/BathyMaps/cmake)
148152

149-
# This makes the project importable from the build directory
150-
export(TARGETS draw_map mesh_map align_map drape_mesh patch_draper base_draper map_draper patch_views sss_map_image sss_meas_data sss_gen_sim FILE BathyMapsConfig.cmake)
153+
if (AUVLIB_EXPORT_BUILD)
154+
# This makes the project importable from the build directory
155+
export(TARGETS draw_map mesh_map align_map drape_mesh patch_draper base_draper map_draper patch_views sss_map_image sss_meas_data sss_gen_sim FILE BathyMapsConfig.cmake)
156+
endif()

src/bathy_maps/include/bathy_maps/align_map.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef ALIGN_MAP_H
22
#define ALIGN_MAP_H
33

4-
#include <eigen3/Eigen/Dense>
4+
#include <Eigen/Dense>
55
#include <igl/AABB.h>
66
#include <data_tools/xyz_data.h>
77

src/bathy_maps/include/bathy_maps/base_draper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include <igl/opengl/glfw/Viewer.h>
1616
#include <igl/opengl/gl.h>
1717

18-
#include <eigen3/Eigen/Dense>
18+
#include <Eigen/Dense>
1919
#include <random>
2020

2121
#include <data_tools/xtf_data.h>

src/bathy_maps/include/bathy_maps/drape_mesh.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#ifndef DRAPE_MESH_H
1313
#define DRAPE_MESH_H
1414

15-
#include <eigen3/Eigen/Dense>
15+
#include <Eigen/Dense>
1616
#include <data_tools/xtf_data.h>
1717
#include <data_tools/csv_data.h>
1818

src/bathy_maps/include/bathy_maps/mesh_map.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#ifndef MESH_MAP_H
1313
#define MESH_MAP_H
1414

15-
#include <eigen3/Eigen/Dense>
15+
#include <Eigen/Dense>
1616
#include <data_tools/std_data.h>
1717
#include <data_tools/xtf_data.h>
1818

0 commit comments

Comments
 (0)