Merge commit 'aa8ef89434c016a1a04178c497723995bc6574a5'

Conflicts:
	cmake/FindWiiUse.cmake
This commit is contained in:
Ryan Pavlik
2010-11-30 15:22:13 -06:00
5 changed files with 404 additions and 196 deletions

View File

@@ -59,7 +59,86 @@ if(PDFLATEX_COMPILER)
set(DOXYGEN_PDFLATEX "YES")
endif()
# An optional single-file install that supports cmake older than 2.8.0
# For internal use
function(_dt_install_file target filename dest rename)
if(CMAKE_VER VERSION_LESS 2.8.0)
set(INSTALL_CODE "
if(EXISTS \"${filename}\")
message(STATUS \"Found: ${filename}\")
file(INSTALL
DESTINATION \"\${CMAKE_INSTALL_PREFIX}/${dest}\"
TYPE FILE
RENAME \"${rename}\"
FILES \"${filename}\")
else()
message(STATUS \"Skipping (build '${target}' to create): ${filename}\")
endif()
")
if(NOT ARGN STREQUAL "")
set(INSTALL_COMPONENT "${ARGN}")
set(INSTALL_CODE "
if(NOT CMAKE_INSTALL_COMPONENT OR \"\${CMAKE_INSTALL_COMPONENT}\" STREQUAL \"${INSTALL_COMPONENT}\")
${INSTALL_CODE}
endif()
")
endif()
install(CODE "${INSTALL_CODE}")
else()
set(COMPONENT_ARGS)
if(NOT ARGN STREQUAL "")
set(COMPONENT_ARGS COMPONENT "${ARGN}")
endif()
install(FILES
"${filename}"
DESTINATION
"${dest}"
RENAME "${rename}"
${COMPONENT_ARGS}
OPTIONAL)
endif()
endfunction()
# An optional single-directory install that supports cmake older than 2.8.0
# For internal use
function(_dt_install_dir target dir dest)
if(CMAKE_VER VERSION_LESS 2.8.0)
set(INSTALL_CODE "
if(EXISTS \"${dir}\")
message(STATUS \"Found: ${dir}\")
file(INSTALL
DESTINATION \"\${CMAKE_INSTALL_PREFIX}/${dest}\"
TYPE DIRECTORY
FILES \"${dir}\")
else()
message(STATUS \"Skipping (build '${target}' to create): ${dir}\")
endif()
")
if(NOT ARGN STREQUAL "")
set(INSTALL_COMPONENT "${ARGN}")
set(INSTALL_CODE "
if(NOT CMAKE_INSTALL_COMPONENT OR \"\${CMAKE_INSTALL_COMPONENT}\" STREQUAL \"${INSTALL_COMPONENT}\")
${INSTALL_CODE}
endif()
")
endif()
install(CODE "${INSTALL_CODE}")
else()
set(COMPONENT_ARGS)
if(NOT ARGN STREQUAL "")
set(COMPONENT_ARGS COMPONENT "${ARGN}")
endif()
install(DIRECTORY
"${dir}"
DESTINATION
"${dest}"
${COMPONENT_ARGS}
OPTIONAL)
endif()
endfunction()
function(add_doxygen _doxyfile)
# parse arguments
@@ -215,30 +294,15 @@ function(add_doxygen _doxyfile)
if(INSTALL_DESTINATION)
if(INSTALL_COMPONENT)
install(DIRECTORY
"${OUTPUT_DIRECTORY}/html"
DESTINATION
"${INSTALL_DESTINATION}"
COMPONENT
"${INSTALL_COMPONENT}"
OPTIONAL)
_dt_install_dir("${DOC_TARGET}" "${OUTPUT_DIRECTORY}/html" "${INSTALL_DESTINATION}" "${INSTALL_COMPONENT}")
if(MAKE_PDF)
install(FILES "${OUTPUT_DIRECTORY}/latex/refman.pdf"
DESTINATION "${INSTALL_DESTINATION}"
COMPONENT "${INSTALL_COMPONENT}"
RENAME "${INSTALL_PDF_NAME}"
OPTIONAL)
_dt_install_file("${DOC_TARGET}" "${OUTPUT_DIRECTORY}/latex/refman.pdf" "${INSTALL_DESTINATION}" "${INSTALL_PDF_NAME}" "${INSTALL_COMPONENT}")
endif()
else()
install(DIRECTORY
"${OUTPUT_DIRECTORY}/html"
DESTINATION
"${INSTALL_DESTINATION}")
_dt_install_dir("${DOC_TARGET}" "${OUTPUT_DIRECTORY}/html" "${INSTALL_DESTINATION}")
if(MAKE_PDF)
install(FILES "${OUTPUT_DIRECTORY}/latex/refman.pdf"
DESTINATION "${INSTALL_DESTINATION}"
RENAME "${INSTALL_PDF_NAME}")
_dt_install_file("${DOC_TARGET}" "${OUTPUT_DIRECTORY}/latex/refman.pdf" "${INSTALL_DESTINATION}" "${INSTALL_PDF_NAME}")
endif()
endif()
endif()

View File

@@ -30,204 +30,212 @@ set(OPENCV_ROOT_DIR
PATH
"Path to search for OpenCV")
include(ProgramFilesGlob)
find_package(OpenCV QUIET NO_MODULE)
if(OpenCV_LIBS AND NOT OpenCV_LIBRARIES)
set(OPENCV_LIBRARIES ${OpenCV_LIBS})
set(OPENCV_FOUND true)
else()
include(ProgramFilesGlob)
# typical root dirs of installations, exactly one of them is used
program_files_glob(_dirs "/OpenCV*/")
# typical root dirs of installations, exactly one of them is used
program_files_glob(_dirs "/OpenCV*/")
#
# select exactly ONE OPENCV base directory/tree
# to avoid mixing different version headers and libs
#
find_path(OPENCV_BASE_DIR
NAMES
cv/include/cv.h
include/opencv/cv.h
include/cv/cv.h
include/cv.h
HINTS
"${OPENCV_ROOT_DIR}"
"$ENV{OPENCV_ROOT_DIR}"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Intel(R) Open Source Computer Vision Library_is1;Inno Setup: App Path]"
${_dirs})
# header include dir suffixes appended to OPENCV_BASE_DIR
set(OPENCV_INCDIR_SUFFIXES
include
include/cv
include/opencv
cv/include
cxcore/include
cvaux/include
otherlibs/cvcam/include
otherlibs/highgui
otherlibs/highgui/include
otherlibs/_graphics/include)
# library linkdir suffixes appended to OPENCV_BASE_DIR
set(OPENCV_LIBDIR_SUFFIXES lib lib64 OpenCV/lib otherlibs/_graphics/lib)
#
# find incdir for each lib
#
find_path(OPENCV_cv_INCLUDE_DIR
NAMES
cv.h
HINTS
"${OPENCV_BASE_DIR}"
"${OPENCV_ROOT_DIR}"
PATH_SUFFIXES
${OPENCV_INCDIR_SUFFIXES})
find_path(OPENCV_cxcore_INCLUDE_DIR
NAMES
cxcore.h
HINTS
"${OPENCV_BASE_DIR}"
"${OPENCV_ROOT_DIR}"
PATH_SUFFIXES
${OPENCV_INCDIR_SUFFIXES})
find_path(OPENCV_cxcore_INCLUDE_DIR
NAMES
cvaux.h
HINTS
"${OPENCV_BASE_DIR}"
"${OPENCV_ROOT_DIR}"
PATH_SUFFIXES
${OPENCV_INCDIR_SUFFIXES})
find_path(OPENCV_highgui_INCLUDE_DIR
NAMES
highgui.h
HINTS
"${OPENCV_BASE_DIR}"
"${OPENCV_ROOT_DIR}"
PATH_SUFFIXES
${OPENCV_INCDIR_SUFFIXES})
find_path(OPENCV_cvcam_INCLUDE_DIR
NAMES
cvcam.h
HINTS
"${OPENCV_BASE_DIR}"
"${OPENCV_ROOT_DIR}"
PATH_SUFFIXES
${OPENCV_INCDIR_SUFFIXES})
#
# find sbsolute path to all libraries
# some are optionally, some may not exist on Linux
#
find_library(OPENCV_legacy_LIBRARY
NAMES
opencv_legacy
HINTS
"${OPENCV_BASE_DIR}"
"${OPENCV_ROOT_DIR}"
PATH_SUFFIXES
${OPENCV_LIBDIR_SUFFIXES})
set(OPENCV_NEW_COMPONENTS calib3d contrib core features2d highgui imgproc legacy ml objdetect video)
set(OPENCV_OLD_COMPONENTS cv cvaux cvcam cvhaartraining cxcore cxts highgui ml trs)
set(opencv_components)
if(OPENCV_NEW_LIBRARY_NAMES OR OPENCV_legacy_LIBRARY)
# New-style library names
foreach(component ${OPENCV_NEW_COMPONENTS})
find_library(OPENCV_${component}_LIBRARY
#
# select exactly ONE OPENCV base directory/tree
# to avoid mixing different version headers and libs
#
find_path(OPENCV_BASE_DIR
NAMES
opencv_${component}
cv/include/cv.h
include/opencv/cv.h
include/cv/cv.h
include/cv.h
HINTS
${OPENCV_BASE_DIR}
"${OPENCV_ROOT_DIR}"
"$ENV{OPENCV_ROOT_DIR}"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Intel(R) Open Source Computer Vision Library_is1;Inno Setup: App Path]"
${_dirs})
# header include dir suffixes appended to OPENCV_BASE_DIR
set(OPENCV_INCDIR_SUFFIXES
include
include/cv
include/opencv
cv/include
cxcore/include
cvaux/include
otherlibs/cvcam/include
otherlibs/highgui
otherlibs/highgui/include
otherlibs/_graphics/include)
# library linkdir suffixes appended to OPENCV_BASE_DIR
set(OPENCV_LIBDIR_SUFFIXES lib lib64 OpenCV/lib otherlibs/_graphics/lib)
#
# find incdir for each lib
#
find_path(OPENCV_cv_INCLUDE_DIR
NAMES
cv.h
HINTS
"${OPENCV_BASE_DIR}"
"${OPENCV_ROOT_DIR}"
PATH_SUFFIXES
${OPENCV_INCDIR_SUFFIXES})
find_path(OPENCV_cxcore_INCLUDE_DIR
NAMES
cxcore.h
HINTS
"${OPENCV_BASE_DIR}"
"${OPENCV_ROOT_DIR}"
PATH_SUFFIXES
${OPENCV_INCDIR_SUFFIXES})
find_path(OPENCV_cxcore_INCLUDE_DIR
NAMES
cvaux.h
HINTS
"${OPENCV_BASE_DIR}"
"${OPENCV_ROOT_DIR}"
PATH_SUFFIXES
${OPENCV_INCDIR_SUFFIXES})
find_path(OPENCV_highgui_INCLUDE_DIR
NAMES
highgui.h
HINTS
"${OPENCV_BASE_DIR}"
"${OPENCV_ROOT_DIR}"
PATH_SUFFIXES
${OPENCV_INCDIR_SUFFIXES})
find_path(OPENCV_cvcam_INCLUDE_DIR
NAMES
cvcam.h
HINTS
"${OPENCV_BASE_DIR}"
"${OPENCV_ROOT_DIR}"
PATH_SUFFIXES
${OPENCV_INCDIR_SUFFIXES})
#
# find sbsolute path to all libraries
# some are optionally, some may not exist on Linux
#
find_library(OPENCV_legacy_LIBRARY
NAMES
opencv_legacy
HINTS
"${OPENCV_BASE_DIR}"
"${OPENCV_ROOT_DIR}"
PATH_SUFFIXES
${OPENCV_LIBDIR_SUFFIXES})
endforeach()
# cv components with header and library if COMPONENTS unspecified
if(NOT OpenCV_FIND_COMPONENTS)
# default
set(opencv_components core legacy imgproc highgui)
if(WIN32)
list(APPEND opencv_components video) # WIN32 only actually
endif()
else()
# TODO: clean up/convert to new components
string(TOLOWER "${OpenCV_FIND_COMPONENTS}" opencv_components)
endif()
set(OPENCV_NEW_COMPONENTS calib3d contrib core features2d highgui imgproc legacy ml objdetect video)
set(OPENCV_OLD_COMPONENTS cv cvaux cvcam cvhaartraining cxcore cxts highgui ml trs)
set(opencv_components)
if(OPENCV_NEW_LIBRARY_NAMES OR OPENCV_legacy_LIBRARY)
else()
# Old-style lib names
if(NOT OpenCV_FIND_COMPONENTS)
# default
set(opencv_components cv cxcore cvaux highgui)
if(WIN32)
list(APPEND opencv_components cvcam) # WIN32 only actually
endif()
else()
string(TOLOWER "${OpenCV_FIND_COMPONENTS}" opencv_components)
endif()
foreach(component ${OPENCV_OLD_COMPONENTS})
find_library(OPENCV_${component}_LIBRARY
# New-style library names
foreach(component ${OPENCV_NEW_COMPONENTS})
find_library(OPENCV_${component}_LIBRARY
NAMES
cvaux
opencv_${component}
HINTS
${OPENCV_BASE_DIR}
PATH_SUFFIXES
${OPENCV_LIBDIR_SUFFIXES})
endforeach()
endif()
endforeach()
#
# Logic selecting required libs and headers
#
# cv components with header and library if COMPONENTS unspecified
if(NOT OpenCV_FIND_COMPONENTS)
# default
set(opencv_components core legacy imgproc highgui)
if(WIN32)
list(APPEND opencv_components video) # WIN32 only actually
endif()
else()
# TODO: clean up/convert to new components
string(TOLOWER "${OpenCV_FIND_COMPONENTS}" opencv_components)
endif()
set(_req_check)
set(_req_libs)
set(_req_includes)
foreach(component ${opencv_components})
#message(STATUS "Component requested: ${component}")
else()
# Old-style lib names
if(NOT OpenCV_FIND_COMPONENTS)
# default
set(opencv_components cv cxcore cvaux highgui)
if(WIN32)
list(APPEND opencv_components cvcam) # WIN32 only actually
endif()
else()
string(TOLOWER "${OpenCV_FIND_COMPONENTS}" opencv_components)
endif()
# only good if header and library both found
list(APPEND
_req_check
OPENCV_${component}_LIBRARY)
list(APPEND _req_libs "${OPENCV_${component}_LIBRARY}")
if(DEFINED OPENCV_${component}_INCLUDE_DIR)
list(APPEND
_req_check
OPENCV_${component}_INCLUDE_DIR)
list(APPEND _req_includes "${OPENCV_${component}_INCLUDE_DIR}")
foreach(component ${OPENCV_OLD_COMPONENTS})
find_library(OPENCV_${component}_LIBRARY
NAMES
${component}
HINTS
${OPENCV_BASE_DIR}
PATH_SUFFIXES
${OPENCV_LIBDIR_SUFFIXES})
endforeach()
endif()
#
# Logic selecting required libs and headers
#
endforeach()
set(_req_check)
set(_req_libs)
set(_req_includes)
foreach(component ${opencv_components})
#message(STATUS "Component requested: ${component}")
# only good if header and library both found
list(APPEND
_req_check
OPENCV_${component}_LIBRARY)
list(APPEND _req_libs "${OPENCV_${component}_LIBRARY}")
if(DEFINED OPENCV_${component}_INCLUDE_DIR)
list(APPEND
_req_check
OPENCV_${component}_INCLUDE_DIR)
list(APPEND _req_includes "${OPENCV_${component}_INCLUDE_DIR}")
endif()
# handle the QUIETLY and REQUIRED arguments and set xxx_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(OpenCV
DEFAULT_MSG
OPENCV_cv_INCLUDE_DIR
${_req_check})
if(OPENCV_FOUND)
set(OPENCV_LIBRARY_DIRS)
foreach(lib ${_req_libs})
get_filename_component(dir "${lib}" PATH)
list(APPEND OPENCV_LIBRARY_DIRS "${dir}")
endforeach()
list(REVERSE OPENCV_LIBRARY_DIRS)
list(REMOVE_DUPLICATES OPENCV_LIBRARY_DIRS)
list(REVERSE OPENCV_LIBRARY_DIRS)
set(OPENCV_INCLUDE_DIRS ${_req_includes})
set(OPENCV_LIBRARIES ${_req_libs})
mark_as_advanced(OPENCV_ROOT_DIR)
# handle the QUIETLY and REQUIRED arguments and set xxx_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(OpenCV
DEFAULT_MSG
OPENCV_cv_INCLUDE_DIR
${_req_check})
if(OPENCV_FOUND)
set(OPENCV_LIBRARY_DIRS)
foreach(lib ${_req_libs})
get_filename_component(dir "${lib}" PATH)
list(APPEND OPENCV_LIBRARY_DIRS "${dir}")
endforeach()
list(REVERSE OPENCV_LIBRARY_DIRS)
list(REMOVE_DUPLICATES OPENCV_LIBRARY_DIRS)
list(REVERSE OPENCV_LIBRARY_DIRS)
set(OPENCV_INCLUDE_DIRS ${_req_includes})
set(OPENCV_LIBRARIES ${_req_libs})
mark_as_advanced(OPENCV_ROOT_DIR OpenCV_DIR)
endif()
mark_as_advanced(OPENCV_BASE_DIR)
foreach(component ${OPENCV_NEW_COMPONENTS} ${OPENCV_OLD_COMPONENTS})
mark_as_advanced(OPENCV_${component}_LIBRARY OPENCV_${component}_INCLUDE_DIR)
endforeach()
endif()
mark_as_advanced(OPENCV_BASE_DIR)
foreach(component ${OPENCV_NEW_COMPONENTS} ${OPENCV_OLD_COMPONENTS})
mark_as_advanced(OPENCV_${component}_LIBRARY OPENCV_${component}_INCLUDE_DIR)
endforeach()

View File

@@ -59,7 +59,15 @@ find_path(WIIUSE_INCLUDE_DIR
set(_deps_check)
if(WIN32)
find_file(WIIUSE_RUNTIME_LIBRARY NAMES wiiuse.dll HINTS "${_libdir}" "${_libdir}/../bin")
find_file(WIIUSE_RUNTIME_LIBRARY
NAMES
wiiuse.dll
HINTS
"${_libdir}"
"${_libdir}/.."
PATH_SUFFIXES
bin)
set(WIIUSE_RUNTIME_LIBRARIES "${WIIUSE_RUNTIME_LIBRARY}")
get_filename_component(WIIUSE_RUNTIME_LIBRARY_DIRS
"${WIIUSE_RUNTIME_LIBRARY}"

View File

@@ -0,0 +1,104 @@
# - Returns a version string from Git
#
# These functions force a re-configure on each git commit so that you can
# trust the values of the variables in your build system.
#
# get_git_head_revision(<refspecvar> <hashvar> [<additonal arguments to git describe> ...])
#
# Returns the refspec and sha hash of the current head revision
#
# git_describe(<var> [<additonal arguments to git describe> ...])
#
# Returns the results of git describe on the source tree, and adjusting
# the output so that it tests false if an error occurs.
#
# git_get_exact_tag(<var> [<additonal arguments to git describe> ...])
#
# Returns the results of git describe --exact-match on the source tree,
# and adjusting the output so that it tests false if there was no exact
# matching tag.
#
# Requires CMake 2.6 or newer (uses the 'function' command)
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
if(__get_git_revision_description)
return()
endif()
set(__get_git_revision_description YES)
# We must run the following at "include" time, not at function call time,
# to find the path to this module rather than the path to a calling list file
get_filename_component(_gitdescmoddir ${CMAKE_CURRENT_LIST_FILE} PATH)
function(get_git_head_revision _refspecvar _hashvar)
set(GIT_DIR "${CMAKE_SOURCE_DIR}/.git")
if(NOT EXISTS "${GIT_DIR}")
# not in git
set(${_refspecvar} "GITDIR-NOTFOUND" PARENT_SCOPE)
set(${_hashvar} "GITDIR-NOTFOUND" PARENT_SCOPE)
return()
endif()
set(GIT_DATA "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/git-data")
if(NOT EXISTS "${GIT_DATA}")
file(MAKE_DIRECTORY "${GIT_DATA}")
endif()
set(HEAD_FILE "${GIT_DATA}/HEAD")
configure_file("${GIT_DIR}/HEAD" "${HEAD_FILE}" COPYONLY)
configure_file("${_gitdescmoddir}/GetGitRevisionDescription.cmake.in" "${GIT_DATA}/grabRef.cmake" @ONLY)
include("${GIT_DATA}/grabRef.cmake")
set(${_refspecvar} "${HEAD_REF}" PARENT_SCOPE)
set(${_hashvar} "${HEAD_HASH}" PARENT_SCOPE)
endfunction()
function(git_describe _var)
if(NOT GIT_FOUND)
find_package(Git QUIET)
endif()
get_git_head_revision(refspec hash)
if(NOT GIT_FOUND)
set(${_var} "GIT-NOTFOUND" PARENT_SCOPE)
return()
endif()
if(NOT hash)
set(${_var} "HEAD-HASH-NOTFOUND" PARENT_SCOPE)
return()
endif()
# TODO sanitize
#if((${ARGN}" MATCHES "&&") OR
# (ARGN MATCHES "||") OR
# (ARGN MATCHES "\\;"))
# message("Please report the following error to the project!")
# message(FATAL_ERROR "Looks like someone's doing something nefarious with git_describe! Passed arguments ${ARGN}")
#endif()
#message(STATUS "Arguments to execute_process: ${ARGN}")
execute_process(COMMAND "${GIT_EXECUTABLE}" describe ${hash} ${ARGN}
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
RESULT_VARIABLE res
OUTPUT_VARIABLE out
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT res EQUAL 0)
set(out "${out}-${res}-NOTFOUND")
endif()
set(${_var} "${out}" PARENT_SCOPE)
endfunction()
function(git_get_exact_tag _var)
git_describe(out --exact-match ${ARGN})
set(${_var} "${out}" PARENT_SCOPE)
endfunction()

View File

@@ -0,0 +1,24 @@
#
# Internal file for GetGitRevisionDescription.cmake
#
# Requires CMake 2.6 or newer (uses the 'function' command)
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
file(READ "@HEAD_FILE@" HEAD_CONTENTS LIMIT 1024)
string(STRIP "${HEAD_CONTENTS}" HEAD_CONTENTS)
string(REPLACE "ref: " "" HEAD_REF "${HEAD_CONTENTS}")
configure_file("@GIT_DIR@/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY)
file(READ "@GIT_DATA@/head-ref" HEAD_HASH LIMIT 1024)
string(STRIP "${HEAD_HASH}" HEAD_HASH)