Skip to content

Commit

Permalink
examples: Trim dependencies
Browse files Browse the repository at this point in the history
Signed-off-by: Benn Snyder <[email protected]>
  • Loading branch information
piedar committed Jun 1, 2017
1 parent 1a381ad commit e59e4ef
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
11 changes: 5 additions & 6 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ target_link_libraries(freenect-wavrecord freenect)
install(TARGETS freenect-camtest freenect-wavrecord
DESTINATION bin)

# All viewers need pthreads and GLUT.
# Most viewers need pthreads and GLUT.
set(THREADS_USE_PTHREADS_WIN32 true)
find_package(Threads)
find_package(OpenGL)
Expand All @@ -37,22 +37,21 @@ endif ()

# A few examples use c_sync.
if (BUILD_C_SYNC)
find_package(Threads REQUIRED)
include_directories(../wrappers/c_sync/)
include_directories(${THREADS_PTHREADS_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR} ${GLUT_INCLUDE_DIR})

add_executable(freenect-regtest regtest.c)
add_executable(freenect-tiltdemo tiltdemo.c)

target_link_libraries(freenect-regtest freenect_sync ${CMAKE_THREAD_LIBS_INIT} ${MATH_LIB})
target_link_libraries(freenect-tiltdemo freenect_sync ${CMAKE_THREAD_LIBS_INIT} ${MATH_LIB})
target_link_libraries(freenect-regtest freenect_sync ${MATH_LIB})
target_link_libraries(freenect-tiltdemo freenect_sync ${MATH_LIB})

install(TARGETS freenect-regtest freenect-tiltdemo
DESTINATION bin)

if (OPENGL_FOUND AND GLUT_FOUND)
include_directories(${OPENGL_INCLUDE_DIR} ${GLUT_INCLUDE_DIR})
add_executable(freenect-glpclview glpclview.c)
target_link_libraries(freenect-glpclview freenect_sync ${OPENGL_LIBRARIES} ${GLUT_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} ${MATH_LIB})
target_link_libraries(freenect-glpclview freenect_sync ${OPENGL_LIBRARIES} ${GLUT_LIBRARY} ${MATH_LIB})
install(TARGETS freenect-glpclview
DESTINATION bin)
endif ()
Expand Down
22 changes: 12 additions & 10 deletions wrappers/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,20 @@ install(FILES libfreenect.hpp

if (BUILD_EXAMPLES)
set(THREADS_USE_PTHREADS_WIN32 true)
find_package(Threads REQUIRED)
find_package(OpenGL REQUIRED)
find_package(GLUT REQUIRED)
find_package(Threads)
find_package(OpenGL)
find_package(GLUT)

include_directories(. ${THREADS_PTHREADS_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR} ${GLUT_INCLUDE_DIR})
if (Threads_FOUND AND OPENGL_FOUND AND GLUT_FOUND)
include_directories(. ${THREADS_PTHREADS_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR} ${GLUT_INCLUDE_DIR})

add_executable(freenect-cppview cppview.cpp)
add_executable(freenect-cpp_pcview cpp_pc_view.cpp)
add_executable(freenect-cppview cppview.cpp)
add_executable(freenect-cpp_pcview cpp_pc_view.cpp)

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})
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})

install(TARGETS freenect-cppview freenect-cpp_pcview
DESTINATION bin)
install(TARGETS freenect-cppview freenect-cpp_pcview
DESTINATION bin)
endif()
ENDIF()

0 comments on commit e59e4ef

Please sign in to comment.