From aa4a45ff3bdb6aa89caf29afeaf774dc801fda12 Mon Sep 17 00:00:00 2001 From: Andrey Kamaev Date: Mon, 9 Apr 2012 13:22:52 +0000 Subject: [PATCH] Added more version information to cmake status (Qt, CUDA, OpenEXR, gcc) --- CMakeLists.txt | 23 +++++++++++++++++------ cmake/OpenCVFindOpenEXR.cmake | 29 ++++++++++++++++++++++------- cmake/OpenCVUtils.cmake | 3 ++- 3 files changed, 41 insertions(+), 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c33c6b0434..bee1cfd2b3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -670,7 +670,7 @@ endif() status("") status(" C++:") status(" Built as dynamic libs?:" BUILD_SHARED_LIBS THEN YES ELSE NO) -status(" C++ Compiler:" ${CMAKE_CXX_COMPILER}) +status(" C++ Compiler:" CMAKE_COMPILER_IS_GNUCXX THEN "${CMAKE_CXX_COMPILER} (ver ${CMAKE_GCC_REGEX_VERSION})" ELSE "${CMAKE_CXX_COMPILER}" ) status(" C++ flags (Release):" ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE}) status(" C++ flags (Debug):" ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG}) status(" C Compiler:" ${CMAKE_C_COMPILER}) @@ -728,8 +728,8 @@ status("") status(" GUI: ") if (HAVE_QT) - status(" QT 4.x:" HAVE_QT THEN YES ELSE NO) - status(" QT OpenGL support:" HAVE_QT_OPENGL THEN YES ELSE NO) + status(" QT 4.x:" HAVE_QT THEN "YES (ver ${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}.${QT_VERSION_PATCH} ${QT_EDITION})" ELSE NO) + status(" QT OpenGL support:" HAVE_QT_OPENGL THEN "YES (${QT_QTOPENGL_LIBRARY})" ELSE NO) else() if(WIN32) status(" Win32 UI:" YES) @@ -748,7 +748,7 @@ else() endif() endif() -status(" OpenGL support:" HAVE_OPENGL THEN YES ELSE NO) +status(" OpenGL support:" HAVE_OPENGL THEN "YES (${OPENGL_LIBRARIES})" ELSE NO) # media status("") @@ -776,7 +776,7 @@ else() status(" JPEG 2000:" "NO") endif() -status(" OpenEXR:" WITH_OPENEXR AND OPENEXR_FOUND THEN ${OPENEXR_LIBRARIES} ELSE NO) +status(" OpenEXR:" WITH_OPENEXR AND OPENEXR_FOUND THEN "${OPENEXR_LIBRARIES} (ver ${OPENEXR_VERSION})" ELSE NO) status(" OpenNI:" HAVE_OPENNI THEN YES ELSE NO) status(" OpenNI PrimeSensor Modules:" HAVE_OPENNI_PRIME_SENSOR_MODULE THEN YES ELSE NO) @@ -835,9 +835,20 @@ else() endif() status(" Use TBB:" HAVE_TBB THEN "YES (ver ${TBB_VERSION_MAJOR}.${TBB_VERSION_MINOR} interface ${TBB_INTERFACE_VERSION})" ELSE NO) -status(" Use Cuda:" HAVE_CUDA THEN YES ELSE NO) +status(" Use Cuda:" HAVE_CUDA THEN "YES (ver ${CUDA_VERSION_STRING})" ELSE NO) status(" Use Eigen:" HAVE_EIGEN THEN YES ELSE NO) +if(HAVE_CUDA) + status("") + status(" NVIDIA CUDA:") + + status(" Use CUFFT:" HAVE_CUFFT THEN YES ELSE NO) + status(" Use CUBLAS:" HAVE_CUBLAS THEN YES ELSE NO) + status(" NVIDIA GPU arch:" OPENCV_CUDA_ARCH_BIN) + status(" NVIDIA PTX archs:" OPENCV_CUDA_ARCH_BIN) + status(" NVIDIA GPU features": OPENCV_CUDA_ARCH_FEATURES) +endif() + # interfaces to other languages status("") status(" Python:") diff --git a/cmake/OpenCVFindOpenEXR.cmake b/cmake/OpenCVFindOpenEXR.cmake index 9ce48725a3..32d3e713d9 100644 --- a/cmake/OpenCVFindOpenEXR.cmake +++ b/cmake/OpenCVFindOpenEXR.cmake @@ -74,13 +74,28 @@ IF (OPENEXR_INCLUDE_PATH AND OPENEXR_IMATH_LIBRARY AND OPENEXR_ILMIMF_LIBRARY AN ENDIF () IF(OPENEXR_FOUND) - IF(NOT OPENEXR_FIND_QUIETLY) - MESSAGE(STATUS "Found OpenEXR: ${OPENEXR_ILMIMF_LIBRARY}") - ENDIF() + IF(NOT OPENEXR_FIND_QUIETLY) + MESSAGE(STATUS "Found OpenEXR: ${OPENEXR_ILMIMF_LIBRARY}") + ENDIF() + if(PKG_CONFIG_FOUND AND NOT OPENEXR_VERSION) + get_filename_component(OPENEXR_LIB_PATH "${OPENEXR_ILMIMF_LIBRARY}" PATH) + if(EXISTS "${OPENEXR_LIB_PATH}/pkgconfig/OpenEXR.pc") + execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} --modversion "${OPENEXR_LIB_PATH}/pkgconfig/OpenEXR.pc" + RESULT_VARIABLE PKG_CONFIG_PROCESS + OUTPUT_VARIABLE OPENEXR_VERSION + OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET) + if(NOT PKG_CONFIG_PROCESS EQUAL 0) + SET(OPENEXR_VERSION "Unknown") + endif() + endif() + endif() + if(NOT OPENEXR_VERSION) + SET(OPENEXR_VERSION "Unknown") + endif() ELSE() - IF(OPENEXR_FIND_REQUIRED) - MESSAGE(FATAL_ERROR "Could not find OpenEXR library") - ENDIF() + IF(OPENEXR_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "Could not find OpenEXR library") + ENDIF() ENDIF() MARK_AS_ADVANCED( @@ -90,4 +105,4 @@ MARK_AS_ADVANCED( OPENEXR_IMATH_LIBRARY OPENEXR_IEX_LIBRARY OPENEXR_HALF_LIBRARY - OPENEXR_ILMTHREAD_LIBRARY) \ No newline at end of file + OPENEXR_ILMTHREAD_LIBRARY) diff --git a/cmake/OpenCVUtils.cmake b/cmake/OpenCVUtils.cmake index 0a45a013c9..b355e48438 100644 --- a/cmake/OpenCVUtils.cmake +++ b/cmake/OpenCVUtils.cmake @@ -277,7 +277,7 @@ macro(ocv_to_full_paths VAR) endmacro() -# read set of defines from the header file +# read set of version defines from the header file macro(ocv_parse_header FILENAME FILE_VAR) set(vars_regex "") set(__parnet_scope OFF) @@ -318,6 +318,7 @@ macro(ocv_parse_header FILENAME FILE_VAR) endforeach() endmacro() +# read single version define from the header file macro(ocv_parse_header2 LIBNAME HDR_PATH VARNAME SCOPE) set(${LIBNAME}_H "") if(EXISTS "${HDR_PATH}")