1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
|
Description: Add the missing libraries
Add missing library to link step of libfreecnect and libfakenect.
Centralize also the definition of MATH_LIB
Origin: vendor
Forwarded: no
Author: Nicolas Bourdaud <nicolas.bourdaud@gmail.com>
Last-Update: 2012-01-26
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -3,6 +3,7 @@
######################################################################################
include_directories (${CMAKE_CURRENT_SOURCE_DIR})
+find_package(Threads REQUIRED)
set(CMAKE_C_FLAGS "-Wall")
@@ -45,8 +46,8 @@
install (TARGETS freenectstatic
DESTINATION "${PROJECT_LIBRARY_INSTALL_DIR}")
-target_link_libraries (freenect ${LIBUSB_1_LIBRARIES})
-target_link_libraries (freenectstatic ${LIBUSB_1_LIBRARIES})
+target_link_libraries(freenect ${LIBUSB_1_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
+target_link_libraries(freenectstatic ${LIBUSB_1_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
# Install the header files
install (FILES "../include/libfreenect.h" "../include/libfreenect-registration.h"
--- a/fakenect/CMakeLists.txt
+++ b/fakenect/CMakeLists.txt
@@ -11,9 +11,10 @@
install (TARGETS fakenect
DESTINATION "${PROJECT_LIBRARY_INSTALL_DIR}/fakenect")
+target_link_libraries(fakenect ${MATH_LIB})
add_executable(fakenect-record record.c)
-target_link_libraries(fakenect-record freenect m)
+target_link_libraries(fakenect-record freenect)
install (TARGETS fakenect-record
DESTINATION bin)
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -104,6 +104,12 @@
add_definitions(-Wall)
+if (WIN32)
+ set(MATH_LIB "")
+else(WIN32)
+ set(MATH_LIB "m")
+endif()
+
# Pretty much everyone is going to need the main includes
include_directories (${CMAKE_CURRENT_SOURCE_DIR}/include)
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -58,11 +58,6 @@
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(glview freenect ${OPENGL_LIBRARIES} ${GLUT_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} ${MATH_LIB})
target_link_libraries(regview freenect ${OPENGL_LIBRARIES} ${GLUT_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} ${MATH_LIB})
|