Skip to content
Permalink
Browse files

Add nanogui as external project

  • Loading branch information...
jlblancoc committed May 11, 2019
1 parent b302320 commit f03ed21eb4a966cefa6555ceeeab65856d7279ee
Showing with 60 additions and 1 deletion.
  1. +1 −0 CMakeLists.txt
  2. +54 −0 cmakemodules/script_nanogui.cmake
  3. +2 −1 cmakemodules/script_show_final_summary.cmake
  4. +3 −0 parse-files/config.h.in
@@ -263,6 +263,7 @@ include(cmakemodules/script_clang_tidy.cmake REQUIRED) # Clang tidy
include(cmakemodules/script_iwyu.cmake REQUIRED) # Include-what-you-use
include(cmakemodules/script_cvd.cmake REQUIRED) # Check for VTK
include(cmakemodules/script_jsoncpp.cmake REQUIRED) # Check for jsoncpp
include(cmakemodules/script_nanogui.cmake REQUIRED) # Check for nanogui

# ---------------------------------------------------------------------------
# OPTIONS
@@ -0,0 +1,54 @@
# Declares external project: nanogui
# https://github.com/wjakob/nanogui
# ===================================================
set(CMAKE_MRPT_HAS_NANOGUI 0)
set(CMAKE_MRPT_HAS_NANOGUI_SYSTEM 0)

set(EMBEDDED_NANOGUI_DIR "${MRPT_BINARY_DIR}/otherlibs/nanogui")

set(BUILD_NANOGUI ON CACHE BOOL "Build an embedded version of nanogui (OpenGL GUIs)")
if (BUILD_NANOGUI)
include(ExternalProject)

set(nanogui_PREFIX "${MRPT_BINARY_DIR}/otherlibs/nanogui")
set(nanogui_INSTALL_DIR "${MRPT_BINARY_DIR}/otherlibs/nanogui/install")
set(nanogui_CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX=${nanogui_INSTALL_DIR}
-DNANOGUI_BUILD_PYTHON=OFF
-DNANOGUI_BUILD_EXAMPLE=OFF
-DCMAKE_LIBRARY_OUTPUT_PATH=${MRPT_BINARY_DIR}/lib
-DLIBRARY_OUTPUT_PATH=${MRPT_BINARY_DIR}/lib
-DCMAKE_RUNTIME_OUTPUT_DIRECTORY=${MRPT_BINARY_DIR}/bin
-DRUNTIME_OUTPUT_DIRECTORY=${MRPT_BINARY_DIR}/bin
-DCMAKE_DEBUG_POSTFIX=${CMAKE_DEBUG_POSTFIX}
)

# download from GH
ExternalProject_Add(EP_nanogui
PREFIX ${nanogui_PREFIX}
GIT_REPOSITORY https://github.com/wjakob/nanogui.git
GIT_SUBMODULES ext/eigen ext/glfw ext/nanovg # ext/pybind
INSTALL_DIR ${nanogui_INSTALL_DIR}
CMAKE_ARGS ${nanogui_CMAKE_ARGS}
)
set(CMAKE_MRPT_HAS_NANOGUI 1)
set(CMAKE_MRPT_HAS_NANOGUI_SYSTEM 0)
endif()

if (CMAKE_MRPT_HAS_ASSIMP)
if (NOT "${ASSIMP_LIBRARY_DIRS}" STREQUAL "")
link_directories("${ASSIMP_LIBRARY_DIRS}")
endif()

mark_as_advanced(ASSIMP_DIR)

if ($ENV{VERBOSE})
message(STATUS "Assimp:")
message(STATUS " ASSIMP_INCLUDE_DIRS: ${ASSIMP_INCLUDE_DIRS}")
message(STATUS " ASSIMP_CXX_FLAGS: ${ASSIMP_CXX_FLAGS}")
message(STATUS " ASSIMP_LINK_FLAGS: ${ASSIMP_LINK_FLAGS}")
message(STATUS " ASSIMP_LIBRARIES: ${ASSIMP_LIBRARIES}")
message(STATUS " ASSIMP_LIBRARY_DIRS: ${ASSIMP_LIBRARY_DIRS}")
message(STATUS " ASSIMP_VERSION: ${ASSIMP_VERSION}")
endif ($ENV{VERBOSE})
endif (CMAKE_MRPT_HAS_ASSIMP)
@@ -136,8 +136,9 @@ SHOW_CONFIG_LINE_SYSTEM("yamlcpp (YAML file format) " CMAKE_MRPT_HAS_YA
message(STATUS "")

message(STATUS " ______________________ GUI LIBRARIES ______________________")
SHOW_CONFIG_LINE ("wxWidgets " CMAKE_MRPT_HAS_WXWIDGETS)
SHOW_CONFIG_LINE ("nanogui (OpenGL GUI) " CMAKE_MRPT_HAS_NANOGUI)
SHOW_CONFIG_LINE ("Qt5 " CMAKE_MRPT_HAS_Qt5)
SHOW_CONFIG_LINE ("wxWidgets " CMAKE_MRPT_HAS_WXWIDGETS)
message(STATUS "")

message(STATUS " _______________________ WRAPPERS/BINDINGS ______________________")
@@ -89,6 +89,9 @@ ${CMAKE_MRPT_BUILD_SHARED_LIB}

#define MRPT_HAS_Qt5 ${CMAKE_MRPT_HAS_Qt5}

#define MRPT_HAS_NANOGUI ${CMAKE_MRPT_HAS_NANOGUI}
#define MRPT_HAS_NANOGUI_SYSTEM ${CMAKE_MRPT_HAS_NANOGUI_SYSTEM}

/** Has MRPT libjpeg? And whether it's in the system (Linux) or built-in (Windows, some rare cases in Linux). */
#define MRPT_HAS_JPEG ${CMAKE_MRPT_HAS_JPEG}
#define MRPT_HAS_JPEG_SYSTEM ${CMAKE_MRPT_HAS_JPEG_SYSTEM}

0 comments on commit f03ed21

Please sign in to comment.
You can’t perform that action at this time.