Skip to content

Commit aa36dce

Browse files
committed
fix(build): compile cpp targets with cxx_std_11
Signed-off-by: Benn Snyder <[email protected]>
1 parent fd3d159 commit aa36dce

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

OpenNI2-FreenectDriver/CMakeLists.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# OpenNI2-FreenectDriver
33
######################################################################################
44

5-
cmake_minimum_required(VERSION 3.1.0)
5+
cmake_minimum_required(VERSION 3.8.2)
66

77
file(GLOB HEADERS src/*.hpp src/*.h)
88
file(GLOB SOURCES src/*.cpp)
@@ -15,14 +15,14 @@ set_target_properties(FreenectDriver PROPERTIES
1515
VERSION ${PROJECT_VER}
1616
SOVERSION ${PROJECT_APIVER}
1717
OUTPUT_NAME FreenectDriver)
18-
18+
1919
add_definitions(-DPROJECT_VER="${PROJECT_VER}")
2020

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

25-
target_compile_features(FreenectDriver PUBLIC cxx_constexpr)
25+
target_compile_features(FreenectDriver PUBLIC cxx_std_11 cxx_constexpr)
2626

2727
target_link_libraries(FreenectDriver freenectstatic ${MATH_LIB})
2828

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Notice: If you have the newer Kinect v2 (XBox One), use [OpenKinect/libfreenect2
1818
To build libfreenect, you'll need
1919

2020
- [libusb](http://libusb.info) >= 1.0.18 (Windows needs >= 1.0.22)
21-
- [CMake](http://cmake.org) >= 3.1.0
21+
- [CMake](http://cmake.org) >= 3.8.2
2222
- [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)
2323

2424
For the examples, you'll need

wrappers/cpp/CMakeLists.txt

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
cmake_minimum_required(VERSION 3.1.0)
2-
set_property(DIRECTORY PROPERTY CXX_STANDARD 11)
1+
cmake_minimum_required(VERSION 3.8.2)
32

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

18+
target_compile_features(freenect-cppview PUBLIC cxx_std_11)
19+
target_compile_features(freenect-cpp_pcview PUBLIC cxx_std_11)
20+
1921
target_link_libraries(freenect-cppview freenect ${OPENGL_LIBRARIES} ${GLUT_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} ${MATH_LIB})
2022
target_link_libraries(freenect-cpp_pcview freenect ${OPENGL_LIBRARIES} ${GLUT_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} ${MATH_LIB})
2123

0 commit comments

Comments
 (0)