@@ -11,11 +11,12 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
1111# locations on all platforms.
1212include (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
2122option (LIBIGL_USE_STATIC_LIBRARY "Use libigl as static library" OFF )
@@ -35,13 +36,55 @@ option(LIBIGL_WITH_PYTHON "Use Python" OFF)
3536option (LIBIGL_WITH_TETGEN "Use Tetgen" OFF )
3637option (LIBIGL_WITH_TRIANGLE "Use Triangle" OFF )
3738option (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+
4151set (ENV{LIBIGL_DIR} ${CMAKE_CURRENT_SOURCE_DIR } /libigl)
4252find_package (LIBIGL REQUIRED QUIET )
4353include (${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
4689find_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+
5598add_subdirectory (pybind11 )
5699
57100message ("Pybind11: " ${PYBIND11_INCLUDE_DIR} )
58101
59102add_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
64108include (cmake/glad.cmake )
65- add_subdirectory (libgsf )
109+ if (AUVLIB_WITH_GSF)
110+ add_subdirectory (libgsf )
111+ endif ()
66112add_subdirectory (libxtf )
67113add_subdirectory (eigen_cereal )
68114add_subdirectory (data_tools )
0 commit comments