Skip to content
Snippets Groups Projects
Commit 638388cd authored by Nicolas Pope's avatar Nicolas Pope
Browse files

Merge branch 'feature/280/windowsgui' into 'master'

Resolve #280 windows gui compilation

Closes #280

See merge request nicolas.pope/ftl!218
parents 8ba77637 467453bd
No related branches found
No related tags found
1 merge request!218Resolve #280 windows gui compilation
Pipeline #18416 passed
......@@ -5,6 +5,7 @@
# Perhaps relevant in future https://gitlab.com/gitlab-org/gitlab-ce/issues/47063
variables:
GIT_SUBMODULE_STRATEGY: recursive
CMAKE_ARGS_WINDOWS: '-DCMAKE_GENERATOR_PLATFORM=x64 -DNVPIPE_DIR="D:/Build/NvPipe" -DEigen3_DIR="C:/Program Files (x86)/Eigen3/share/eigen3/cmake" -DOpenCV_DIR="D:/Build/opencv-4.1.1" -DCUDA_TOOLKIT_ROOT_DIR="C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.1"'
stages:
......@@ -50,8 +51,8 @@ webserver-deploy:
- 'call "C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Auxiliary/Build/vcvars64.bat"'
- mkdir build
- cd build
- echo cmake %CMAKE_ARGS% %CMAKE_ARGS_WINDOWS% ..
- cmake %CMAKE_ARGS% %CMAKE_ARGS_WINDOWS% ..
- echo cmake %CMAKE_ARGS% %CMAKE_ARGS_WINDOWS% -DNANOGUI_DIR="C:/Program Files (x86)/NanoGUI" ..
- cmake %CMAKE_ARGS% %CMAKE_ARGS_WINDOWS% -DNANOGUI_DIR="C:/Program Files (x86)/NanoGUI" ..
- devenv ftl.utu.fi.sln /build Release
- rmdir /q /s "%DEPLOY_DIR%/%CI_COMMIT_REF_SLUG%"
- mkdir "%DEPLOY_DIR%/%CI_COMMIT_REF_SLUG%"
......
[submodule "ext/nanogui"]
path = ext/nanogui
url = https://github.com/wjakob/nanogui.git
......@@ -17,6 +17,7 @@ option(WITH_FIXSTARS "Use Fixstars libSGM if available" ON)
option(BUILD_VISION "Enable the vision component" ON)
option(BUILD_RECONSTRUCT "Enable the reconstruction component" ON)
option(BUILD_RENDERER "Enable the renderer component" ON)
option(BUILD_GUI "Enable the GUI" ON)
option(BUILD_CALIBRATION "Enable the calibration component" OFF)
set(THREADS_PREFER_PTHREAD_FLAG ON)
......@@ -92,14 +93,39 @@ else()
set(REALSENSE_LIBRARY "")
endif()
if (BUILD_GUI)
#find_library( NANOGUI_LIBRARY NAMES nanogui libnanogui PATHS ${NANOGUI_DIR} PATH_SUFFIXES lib)
#if (NANOGUI_LIBRARY)
# set(HAVE_NANOGUI TRUE)
# add_library(nanogui UNKNOWN IMPORTED)
# #set_property(TARGET nanogui PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${NANOGUI_EXTRA_INCS})
# set_property(TARGET nanogui PROPERTY IMPORTED_LOCATION ${NANOGUI_LIBRARY})
# message(STATUS "Found NanoGUI: ${NANOGUI_LIBRARY}")
# if(WIN32)
# # Find include
# find_path(NANOGUI_INCLUDE_DIRS
# NAMES nanogui/nanogui.h
# PATHS "C:/Program Files/NanoGUI" "C:/Program Files (x86)/NanoGUI" ${NANOGUI_DIR}
# PATH_SUFFIXES include
# )
# set_property(TARGET nanogui PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${NANOGUI_INCLUDE_DIRS})
# endif()
#endif()
find_library( NANOGUI_LIBRARY NAMES nanogui libnanogui)
if (NANOGUI_LIBRARY)
set(HAVE_NANOGUI TRUE)
add_library(nanogui UNKNOWN IMPORTED)
#set_property(TARGET nanogui PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${NANOGUI_EXTRA_INCS})
set_property(TARGET nanogui PROPERTY IMPORTED_LOCATION ${NANOGUI_LIBRARY})
message(STATUS "Found NanoGUI: ${NANOGUI_LIBRARY}")
# Disable building extras we won't need (pure C++ project)
set(NANOGUI_BUILD_SHARED OFF CACHE BOOL " " FORCE)
set(NANOGUI_BUILD_EXAMPLE OFF CACHE BOOL " " FORCE)
set(NANOGUI_BUILD_PYTHON OFF CACHE BOOL " " FORCE)
set(NANOGUI_INSTALL OFF CACHE BOOL " " FORCE)
# Add the configurations from nanogui
add_subdirectory(ext/nanogui)
# For reliability of parallel build, make the NanoGUI targets dependencies
set_property(TARGET glfw glfw_objects nanogui PROPERTY FOLDER "dependencies")
endif()
find_library( NVPIPE_LIBRARY NAMES NvPipe libNvPipe PATHS ${NVPIPE_DIR} PATH_SUFFIXES lib)
......
......@@ -20,10 +20,17 @@ if (HAVE_OPENVR)
list(APPEND GUISRC "src/vr.cpp")
endif()
# Various preprocessor definitions have been generated by NanoGUI
add_definitions(${NANOGUI_EXTRA_DEFS})
# On top of adding the path to nanogui/include, you may need extras
include_directories(${NANOGUI_EXTRA_INCS})
add_executable(ftl-gui ${GUISRC})
target_include_directories(ftl-gui PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/ext/nanogui/include>
$<INSTALL_INTERFACE:include>
PRIVATE src)
......@@ -32,6 +39,6 @@ target_include_directories(ftl-gui PUBLIC
#endif()
#target_include_directories(cv-node PUBLIC ${PROJECT_SOURCE_DIR}/include)
target_link_libraries(ftl-gui ftlcommon ftlctrl ftlrgbd ftlstreams ftlrender Threads::Threads ${OpenCV_LIBS} ${OPENVR_LIBRARIES} glog::glog ftlnet nanogui GL)
target_link_libraries(ftl-gui ftlcommon ftlctrl ftlrgbd ftlstreams ftlrender Threads::Threads ${OpenCV_LIBS} ${OPENVR_LIBRARIES} glog::glog ftlnet nanogui ${NANOGUI_EXTRA_LIBS})
Subproject commit e9ec8a1a9861cf578d9c6e85a6420080aa715c03
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment