From ea2658e3994eee476a5bb0fa2f291c593341f250 Mon Sep 17 00:00:00 2001 From: Christian Frisson Date: Mon, 27 May 2013 00:19:52 +0200 Subject: [PATCH 1/2] CMake fixes to compile under OSX 10.6+ --- CMakeLists.txt | 3 +++ Findfreenect.cmake | 14 +++++++------- demo/CMakeLists.txt | 2 +- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8e2aa15..0f540c4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,9 +5,12 @@ set( VERSION 1.0.0 ) set( PACKAGE_NAME ${CMAKE_PROJECT_NAME} ) set( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR} ) +find_path(OpenCV_DIR NAMES opencv-config.cmake OpenCVConfig.cmake PATH_SUFFIXES lib/cmake lib) find_package( OpenCV REQUIRED COMPONENTS core imgproc highgui ) find_package( fftw REQUIRED ) find_package( freenect REQUIRED ) +MESSAGE("${FREENECT_INCLUDE_DIR}") +include_directories( ${FREENECT_INCLUDE_DIR} ) set( CMAKE_BUILD_TYPE Debug ) set( CMAKE_C_FLAGS_DEBUG "-g" ) diff --git a/Findfreenect.cmake b/Findfreenect.cmake index d3d9b7d..f68720c 100644 --- a/Findfreenect.cmake +++ b/Findfreenect.cmake @@ -4,26 +4,26 @@ # FREENECT_LIBRARIES # -set( LIBRARY_PATHS "/usr /usr/local /opt/local /sw" ) +#set( LIBRARY_PATHS "/usr /usr/local /opt/local /sw" ) find_path( FREENECT_INCLUDE_DIR NAMES libfreenect_sync.h - ${LIBRARY_PATHS} - PATH_SUFFIEXS include include/libfreenect +# ${LIBRARY_PATHS} + PATH_SUFFIXES include include/libfreenect DOC "The dicrectory where libfreenect_sync.h resides" ) find_library( FREENECT_SYNC_LIBRARIES NAMES freenect_sync - ${LIBRARY_PATHS} - PATH_SUFFIES lib lib64 +# ${LIBRARY_PATHS} + PATH_SUFFIXES lib lib64 DOC "The freenect_sync library" ) find_library( FREENECT_CV_LIBRARIES NAMES freenect_cv - ${LIBRARY_PATHS} - PATH_SUFFIEXS lib lib64 +# ${LIBRARY_PATHS} + PATH_SUFFIXES lib lib64 DOC "The freenect_cv library" ) diff --git a/demo/CMakeLists.txt b/demo/CMakeLists.txt index 1dd2700..6370e6d 100644 --- a/demo/CMakeLists.txt +++ b/demo/CMakeLists.txt @@ -4,7 +4,7 @@ include_directories( "${CMAKE_SOURCE_DIR}/include" ) add_executable( demoposture demoposture.c) target_link_libraries( demoposture body hand posture - ${OpenCV_LIBS} + ${OpenCV_LIBRARIES} ${FREENECT_LIBRARIES} ) From 73320d1d81d003383798243f6e781a3391b24776 Mon Sep 17 00:00:00 2001 From: Christian Frisson Date: Mon, 27 May 2013 00:20:28 +0200 Subject: [PATCH 2/2] Temporary solution when OpenCV isn't compiled against Qt --- tools/CMakeLists.txt | 2 +- tools/testposture.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 3d04e59..df63655 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -2,7 +2,7 @@ project( tools ) include_directories( "${CMAKE_SOURCE_DIR}/include" ) -set( POSTURE_TOOLS testposture trainposture ) +set( POSTURE_TOOLS testposture trainposture ) # testposture requires _cvFontQt _cvAddText foreach( PROG ${POSTURE_TOOLS} ) add_executable( ${PROG} "${PROG}.c" ) target_link_libraries( ${PROG} body hand posture diff --git a/tools/testposture.c b/tools/testposture.c index c2d74f5..c322790 100644 --- a/tools/testposture.c +++ b/tools/testposture.c @@ -65,7 +65,7 @@ int main (int argc, char *argv[]) int num, count=0; char *w1 = "rgb", *w2 = "number"; char buff[5]; - CvFont font[N]; + //CvFont font[N]; CvScalar color[N]; parse_args(argc,argv); @@ -79,9 +79,9 @@ int main (int argc, char *argv[]) color[4] = CV_RGB(0,255,255); int i; - for (i=0; i