From 748715a2e71a9849061430811bc57810790d0734 Mon Sep 17 00:00:00 2001 From: Oleg Vorobiov Date: Wed, 10 Aug 2022 00:16:53 +0300 Subject: [PATCH] driver: CMakeLists.txt: Moved to handling boost as a submodule Signed-off-by: Oleg Vorobiov --- driver/CMakeLists.txt | 28 ++++++++++++----------- driver/gaze_master_plugins/CMakeLists.txt | 4 ---- 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/driver/CMakeLists.txt b/driver/CMakeLists.txt index 93067d6..b4150a9 100644 --- a/driver/CMakeLists.txt +++ b/driver/CMakeLists.txt @@ -26,14 +26,6 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) endif() -if (MSVC) - # all warnings as errors - add_compile_options(/W4 /WX) -else() - # all warnings as errors - add_compile_options(-Wall -Wextra -pedantic -Werror -Wno-missing-braces) -endif() - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2") # options @@ -112,12 +104,16 @@ set(LAZY_SOCKETS_INCLUDE_DIR "lazy-sockets/src/") add_subdirectory("gaze_master_plugins") set(Boost_USE_STATIC_LIBS ON) -find_package(Boost REQUIRED) +add_subdirectory(boost) + +file(GLOB Boost_INCLUDE_DIRS + "./boost/libs/*/include" +) # actual build instructions include_directories( ${OPENVR_INCLUDE_DIR} - ${Boost_INCLUDE_DIR} + ${Boost_INCLUDE_DIRS} ${SHROOM_INCLUDE_DIR} ${LAZY_SOCKETS_INCLUDE_DIR} "src/plugins/" @@ -138,17 +134,23 @@ add_library(${TARGET_NAME} SHARED ${driver_hobovr_src} ) +if (MSVC) + # all warnings as errors + target_compile_options(${TARGET_NAME} PRIVATE /W4 /WX) +else() + # all warnings as errors + target_compile_options(${TARGET_NAME} PRIVATE -Wall -Wextra -pedantic -Werror -Wno-missing-braces) +endif() + target_link_libraries(${TARGET_NAME} "${OPENVR_LIBRARIES}" shoom lazy_sockets -lstdc++fs - ${Boost_DLL_LIBRARY} + boost_dll ${CMAKE_DL_LIBS} ) -message(NOTICE "boost_root: ${BOOST_ROOT}|") - install( TARGETS ${TARGET_NAME} diff --git a/driver/gaze_master_plugins/CMakeLists.txt b/driver/gaze_master_plugins/CMakeLists.txt index e8c9a63..47916d3 100644 --- a/driver/gaze_master_plugins/CMakeLists.txt +++ b/driver/gaze_master_plugins/CMakeLists.txt @@ -2,9 +2,6 @@ cmake_minimum_required(VERSION 3.16) project(gaze_master_example_plugin) -set(Boost_USE_STATIC_LIBS ON) -find_package(Boost REQUIRED) - add_library(gaze_logger SHARED "../src/plugins/gaze_master_plugin_interface.h" "src/plugin.cpp" @@ -17,7 +14,6 @@ target_include_directories(gaze_logger PRIVATE ) target_link_libraries(gaze_logger PRIVATE - ${Boost_DLL_LIBRARY} ${CMAKE_DL_LIBS} )