3 execute_process(COMMAND "cmd" " /C date /T" OUTPUT_VARIABLE ${RESULT})
4 string(REGEX REPLACE "[^0-9]*([0-9]+)[^0-9]([0-9]+)[^0-9]([0-9]+).*" "\\1-\\2-\\3" ${RESULT} ${${RESULT}})
6 execute_process(COMMAND "date" "+%Y-%m-%d" OUTPUT_VARIABLE ${RESULT})
7 string(REGEX REPLACE "(....)-(..)-(..).*" "\\1-\\2-\\3" ${RESULT} ${${RESULT}})
9 message(WARNING "date not implemented")
10 set(${RESULT} 00-00-0000)
16 execute_process(COMMAND "cmd" " /C time /T" OUTPUT_VARIABLE ${RESULT})
17 string(REGEX REPLACE "(..):(..).*" "\\1:\\2:00" ${RESULT} ${${RESULT}})
19 execute_process(COMMAND "date" "+%H:%M:%S" OUTPUT_VARIABLE ${RESULT})
20 string(REGEX REPLACE "(..):(..):(..).*" "\\1:\\2:\\3" ${RESULT} ${${RESULT}})
22 message(WARNING "time not implemented")
23 set(${RESULT} 00:00:00)
31 if (GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git")
32 execute_process(COMMAND "${GIT_EXECUTABLE}" "--git-dir=${PROJECT_SOURCE_DIR}/.git" "rev-parse" "--short=8" "HEAD" OUTPUT_VARIABLE proc_out ERROR_VARIABLE proc_err)
34 message(WARNING "Git failed with error: ${proc_err}")
36 string(REGEX REPLACE "(.*)\n" "\\1" ${RESULT} ${proc_out})
39 message(WARNING "Git executable not found, revision number not available.")
41 message(STATUS "Git repository not found, revision number not available.")
46 if (CMAKE_VERSION VERSION_LESS "3.1" AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
47 set (CMAKE_CXX_FLAGS "--std=gnu++11 ${CMAKE_CXX_FLAGS}")
51 macro(PrintTargetReport targetName)
52 if(CMAKE_CXX_COMPILER MATCHES "/(clang-)?cl\\.exe$")
53 set(cpp_version ${CMAKE_CXX_COMPILER_VERSION})
55 execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE cpp_version)
58 string(STRIP "v${cpp_version}" cpp_version)
60 set(cpp_version "WARNING: COMPILER NOT FOUND!")
62 message("TARGET ${targetName}: cpp compiler ${CMAKE_CXX_COMPILER} ${cpp_version}")
64 if(VERBOSE_CMAKELISTS)
65 get_directory_property(DirOpts COMPILE_OPTIONS)
66 get_directory_property(DirDefs COMPILE_DEFINITIONS)
67 string(REPLACE ";" " " DirOpts "${DirOpts}")
68 string(REPLACE ";" "; " DirDefs "${DirDefs}")
69 string(TOUPPER "${CMAKE_BUILD_TYPE}" build_type)
70 message("\twith cpp flags: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${build_type}} ${DirOpts}")
71 message("\twith link flags: ${CMAKE_EXE_LINKER_FLAGS}")
72 message("\twith defs: ${DirDefs}")
73 message("--------------")
75 endmacro(PrintTargetReport)