From ed77955635e80d2cf54a42ca619315945a7a1b2d Mon Sep 17 00:00:00 2001 From: Maria Dimashova Date: Thu, 3 Feb 2011 09:55:17 +0000 Subject: [PATCH] moved an include dirs setting to the root cmake file --- CMakeLists.txt | 27 +++++++++++++++++++-------- modules/highgui/CMakeLists.txt | 6 ------ 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index aebdcd296..0ab15fce6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -782,18 +782,29 @@ if(WITH_OPENNI) unset(OPENNI_LIBRARY CACHE) unset(PRIME_SENSOR_MODULES_FOR_OPENNI CACHE) find_library(OPENNI_LIBRARY "OpenNI" PATHS "/usr/lib" "c:/Program Files/OpenNI/Lib" DOC "OpenNI library") - if(OPENNI_LIBRARY) + + if(OPENNI_LIBRARY) set(HAVE_OPENNI TRUE) + + # set OpenNI include directory + if(WIN32) + set(OPENNI_INCLUDE_DIR "c:/Program Files/OpenNI/Include") + elseif(UNIX OR APPLE) + set(OPENNI_INCLUDE_DIR "/usr/include/ni") + endif() + # the check: are PrimeSensor Modules for OpenNI installed? - if(WIN32) - find_file(PRIME_SENSOR_MODULES_FOR_OPENNI "XnCore.dll" PATHS "c:/Program Files/Prime Sense/Sensor/Bin" DOC "Core library of PrimeSensor Modules for OpenNI") - elseif(UNIX OR APPLE) - find_library(PRIME_SENSOR_MODULES_FOR_OPENNI "XnCore" PATHS "/usr/lib" DOC "Core library of PrimeSensor Modules for OpenNI") - endif() - if(PRIME_SENSOR_MODULES_FOR_OPENNI) + if(WIN32) + find_file(PRIME_SENSOR_MODULES_FOR_OPENNI "XnCore.dll" PATHS "c:/Program Files/Prime Sense/Sensor/Bin" DOC "Core library of PrimeSensor Modules for OpenNI") + elseif(UNIX OR APPLE) + find_library(PRIME_SENSOR_MODULES_FOR_OPENNI "XnCore" PATHS "/usr/lib" DOC "Core library of PrimeSensor Modules for OpenNI") + endif() + if(PRIME_SENSOR_MODULES_FOR_OPENNI) set(HAVE_PRIME_SENSOR_FOR_OPENNI TRUE) endif() - endif() + + endif() #if(OPENNI_LIBRARY) + endif() #if(WITH_OPENNI) ############################## Eigen2 ############################## diff --git a/modules/highgui/CMakeLists.txt b/modules/highgui/CMakeLists.txt index d59215b74..e447d338f 100644 --- a/modules/highgui/CMakeLists.txt +++ b/modules/highgui/CMakeLists.txt @@ -177,12 +177,6 @@ endif() #OpenNI if(WITH_OPENNI AND HAVE_OPENNI) set(highgui_srcs ${highgui_srcs} src/cap_openni.cpp) - if(WIN32) - set(OPENNI_INCLUDE_DIR "c:/Program Files/OpenNI/Include") - elseif(UNIX OR APPLE) - set(OPENNI_INCLUDE_DIR "/usr/include/ni") - endif() - include_directories(${OPENNI_INCLUDE_DIR}) endif()