Skip to content

Commit

Permalink
fix(build): compile cpp targets with cxx_std_11
Browse files Browse the repository at this point in the history
Signed-off-by: Benn Snyder <[email protected]>
  • Loading branch information
piedar committed Mar 21, 2020
1 parent fd3d159 commit aa36dce
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
6 changes: 3 additions & 3 deletions OpenNI2-FreenectDriver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# OpenNI2-FreenectDriver
######################################################################################

cmake_minimum_required(VERSION 3.1.0)
cmake_minimum_required(VERSION 3.8.2)

file(GLOB HEADERS src/*.hpp src/*.h)
file(GLOB SOURCES src/*.cpp)
Expand All @@ -15,14 +15,14 @@ set_target_properties(FreenectDriver PROPERTIES
VERSION ${PROJECT_VER}
SOVERSION ${PROJECT_APIVER}
OUTPUT_NAME FreenectDriver)

add_definitions(-DPROJECT_VER="${PROJECT_VER}")

include_directories(extern/OpenNI-Linux-x64-2.2.0.33/Include)
include_directories(${PROJECT_SOURCE_DIR}/src)
include_directories(${PROJECT_SOURCE_DIR}/wrappers/cpp)

target_compile_features(FreenectDriver PUBLIC cxx_constexpr)
target_compile_features(FreenectDriver PUBLIC cxx_std_11 cxx_constexpr)

target_link_libraries(FreenectDriver freenectstatic ${MATH_LIB})

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Notice: If you have the newer Kinect v2 (XBox One), use [OpenKinect/libfreenect2
To build libfreenect, you'll need

- [libusb](http://libusb.info) >= 1.0.18 (Windows needs >= 1.0.22)
- [CMake](http://cmake.org) >= 3.1.0
- [CMake](http://cmake.org) >= 3.8.2
- [python](http://python.org) >= 2.7 or >= 3.3 (only if BUILD_PYTHON=ON or BUILD_PYTHON2=ON or BUILD_PYTHON3=ON or BUILD_REDIST_PACKAGE=OFF)

For the examples, you'll need
Expand Down
6 changes: 4 additions & 2 deletions wrappers/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
cmake_minimum_required(VERSION 3.1.0)
set_property(DIRECTORY PROPERTY CXX_STANDARD 11)
cmake_minimum_required(VERSION 3.8.2)

install(FILES libfreenect.hpp
DESTINATION ${PROJECT_INCLUDE_INSTALL_DIR})
Expand All @@ -16,6 +15,9 @@ if (BUILD_EXAMPLES)
add_executable(freenect-cppview cppview.cpp)
add_executable(freenect-cpp_pcview cpp_pc_view.cpp)

target_compile_features(freenect-cppview PUBLIC cxx_std_11)
target_compile_features(freenect-cpp_pcview PUBLIC cxx_std_11)

target_link_libraries(freenect-cppview freenect ${OPENGL_LIBRARIES} ${GLUT_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} ${MATH_LIB})
target_link_libraries(freenect-cpp_pcview freenect ${OPENGL_LIBRARIES} ${GLUT_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} ${MATH_LIB})

Expand Down

0 comments on commit aa36dce

Please sign in to comment.