Skip to content

Commit

Permalink
Moved cppview example to cpp wrapper
Browse files Browse the repository at this point in the history
Moved compilation of cppview into cpp wrapper CMake

Signed-off-by: Kyle Machulis <[email protected]>
  • Loading branch information
qdot committed Dec 19, 2010
1 parent 3df43d9 commit 32a8093
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 7 deletions.
6 changes: 0 additions & 6 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ if (WIN32)
endif()

add_executable(glview glview.c)
add_executable(cppview cppview.cpp)

if (BUILD_C_SYNC)
add_executable(glpclview glpclview.c)
Expand All @@ -28,7 +27,6 @@ include_directories (../wrappers/c_sync/)
if(APPLE)
set(CMAKE_EXE_LINKER_FLAGS "-framework OpenGL -framework GLUT")
target_link_libraries(glview freenect)
target_link_libraries(cppview freenect)
if (BUILD_C_SYNC)
target_link_libraries(glpclview freenect_sync)
endif()
Expand All @@ -48,7 +46,6 @@ else()
endif()

target_link_libraries(glview freenect ${OPENGL_LIBRARIES} ${GLUT_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} ${MATH_LIB})
target_link_libraries(cppview freenect ${OPENGL_LIBRARIES} ${GLUT_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} ${MATH_LIB})
if (BUILD_C_SYNC)
target_link_libraries(glpclview freenect_sync ${OPENGL_LIBRARIES} ${GLUT_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} ${MATH_LIB})
endif()
Expand All @@ -58,9 +55,6 @@ endif()
install (TARGETS glview
DESTINATION bin)

install (TARGETS cppview
DESTINATION bin)

if (BUILD_C_SYNC)
install (TARGETS glpclview
DESTINATION bin)
Expand Down
38 changes: 37 additions & 1 deletion wrappers/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,38 @@
INSTALL(FILES libfreenect.hpp
DESTINATION include)
DESTINATION include)

set(CMAKE_C_FLAGS "-Wall")

if (WIN32)
set(THREADS_USE_PTHREADS_WIN32 true)
find_package(Threads REQUIRED)

include_directories(${THREADS_PTHREADS_INCLUDE_DIR})
endif()

include_directories(.)

add_executable(cppview cppview.cpp)

# Mac just has everything already
if(APPLE)
set(CMAKE_EXE_LINKER_FLAGS "-framework OpenGL -framework GLUT")
target_link_libraries(cppview freenect)
else()
find_package(Threads REQUIRED)
find_package(OpenGL REQUIRED)
find_package(GLUT REQUIRED)

include_directories(${OPENGL_INCLUDE_DIRS} ${GLUT_INCLUDE_DIRS} ${USB_INCLUDE_DIRS})

if (WIN32)
set(MATH_LIB "")
else(WIN32)
set(MATH_LIB "m")
endif()

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

install (TARGETS cppview
DESTINATION bin)
File renamed without changes.

0 comments on commit 32a8093

Please sign in to comment.