-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Let CMake find OpenGL/GLUT automatically
Signed-off-by: Benn Snyder <benn.snyder@gmail.com>
- Loading branch information
Showing
3 changed files
with
12 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,20 @@ | ||
INSTALL(FILES libfreenect.hpp | ||
DESTINATION ${PROJECT_INCLUDE_INSTALL_DIR}) | ||
install(FILES libfreenect.hpp | ||
DESTINATION ${PROJECT_INCLUDE_INSTALL_DIR}) | ||
|
||
IF(BUILD_EXAMPLES) | ||
|
||
if (WIN32) | ||
if (BUILD_EXAMPLES) | ||
set(THREADS_USE_PTHREADS_WIN32 true) | ||
find_package(Threads REQUIRED) | ||
|
||
include_directories(${THREADS_PTHREADS_INCLUDE_DIR}) | ||
endif() | ||
|
||
include_directories(.) | ||
|
||
add_executable(freenect-cppview cppview.cpp) | ||
add_executable(freenect-cpp_pcview cpp_pc_view.cpp) | ||
|
||
# Mac just has everything already | ||
if(APPLE) | ||
set(CMAKE_EXE_LINKER_FLAGS "-framework OpenGL -framework GLUT") | ||
target_link_libraries(freenect-cppview freenect) | ||
target_link_libraries(freenect-cpp_pcview freenect) | ||
else() | ||
find_package(Threads REQUIRED) | ||
find_package(OpenGL REQUIRED) | ||
find_package(GLUT REQUIRED) | ||
|
||
include_directories(${OPENGL_INCLUDE_DIR} ${GLUT_INCLUDE_DIR} ${USB_INCLUDE_DIRS}) | ||
|
||
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}) | ||
endif() | ||
include_directories(. ${THREADS_PTHREADS_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR} ${GLUT_INCLUDE_DIR}) | ||
|
||
install (TARGETS freenect-cppview | ||
DESTINATION bin) | ||
add_executable(freenect-cppview cppview.cpp) | ||
add_executable(freenect-cpp_pcview cpp_pc_view.cpp) | ||
|
||
install (TARGETS freenect-cpp_pcview | ||
DESTINATION bin) | ||
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) | ||
ENDIF() |
Empty file.