# utility function for formatting output: function(stringfill text length outvar) set(${outvar} "${text}") string(LENGTH "${${outvar}}" _len) while(_len LESS ${length}) set(${outvar} "${${outvar}} ") string(LENGTH "${${outvar}}" _len) endwhile() # push return value: set(${outvar} "${${outvar}}" PARENT_SCOPE) endfunction() function(printfeatures) if("${ARGV0}" STREQUAL "VERBOSE") set(PRINTFEATURES_VERBOSE true) endif() # get a list of features from the defined cache-variables: get_property(_CVARS DIRECTORY PROPERTY CACHE_VARIABLES) foreach(_VAR ${_CVARS}) if(_VAR MATCHES "^HAS_CXX11_(.*)") if(${_VAR}) # available c++11 feature set(CXX11_FEATURES "${CXX11_FEATURES} ${CMAKE_MATCH_1}") endif() endif() endforeach() # for now we only know one scenegraph: set(_SCENEGRAPH "OpenSG${OpenSG_MAJOR_VERSION}") # print a configuration summary. message(STATUS "inVRs Build Configuration:") message(STATUS "System: ${CMAKE_SYSTEM_NAME} ${CMAKE_SYSTEM_VERSION} ${CMAKE_SYSTEM_PROCESSOR}") message(STATUS "C++ Compiler: ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}") message(STATUS "C++11 Features:${CXX11_FEATURES}") message(STATUS "Scenegraph: ${_SCENEGRAPH}") message(STATUS "Testing: ${INVRS_ENABLE_TESTING}") message(STATUS "") message(STATUS "inVRs Features:") # determine length for pretty-printing: set(_MAXLEN 0) foreach(_feature ${AUTOFEATURE_FEATURES}) if(AUTOFEATURE_${_feature}_EXPERIMENTAL) set(_feature "${_feature}*") endif() # add one char to length: string(LENGTH "${_feature}#" _len) if(_len GREATER _MAXLEN) set(_MAXLEN ${_len}) endif() endforeach() foreach(_feature ${AUTOFEATURE_FEATURES}) if(AUTOFEATURE_${_feature}_EXPERIMENTAL) stringfill("${_feature}*" ${_MAXLEN} _f) else() stringfill("${_feature}" ${_MAXLEN} _f) endif() foreach(_pkgraw ${AUTOFEATURE_${_feature}_REQUIRED_PACKAGES}) string(REGEX MATCH "^[^:]+" _pkg "${_pkgraw}") list(FIND AUTOFEATURE_${_feature}_MISSING_PACKAGES "${_pkgraw}" _idx) if(NOT ("-1" STREQUAL "${_idx}")) set(_pkg "${_pkg}!") if(PRINTFEATURES_VERBOSE AND NOT "${_pkg}" STREQUAL "${_pkgraw}!") set(_pkg "${_pkg} [${_pkgraw}]") endif() endif() set(_req "${_req} ${_pkg}") endforeach() message(STATUS " ${_f}: ${${AUTOFEATURE_F2VAR_${_feature}}} (depends:${_req})") if(PRINTFEATURES_VERBOSE AND NOT "${AUTOFEATURE_${_feature}_MISSING_CONDITIONS}" STREQUAL "") stringfill("" ${_MAXLEN} _f) message(STATUS " ${_f} missing conditions: ${AUTOFEATURE_${_feature}_MISSING_CONDITIONS}") endif() unset(_req) endforeach() message(STATUS "") message(STATUS "Experimental features are marked with '*'. Experimental features are disabled by default.") message(STATUS "Missing dependencies are marked with '!'.") if(NOT PRINTFEATURES_VERBOSE) message(STATUS "Set PRINT_FEATURES to 'VERBOSE' to get more info about disabled features.") endif() message(STATUS "") endfunction(printfeatures) set(PRINT_FEATURES "ON" CACHE STRING "Print a summary of features after the configure step.") set_property(CACHE PRINT_FEATURES PROPERTY STRINGS ON OFF VERBOSE) if("${PRINT_FEATURES}" STREQUAL "VERBOSE") printfeatures(VERBOSE) elseif(NOT "${PRINT_FEATURES}" STREQUAL "OFF") printfeatures() endif()