diff options
Diffstat (limited to 'host/cmake/Modules/UHDBuildInfo.cmake')
-rw-r--r-- | host/cmake/Modules/UHDBuildInfo.cmake | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/host/cmake/Modules/UHDBuildInfo.cmake b/host/cmake/Modules/UHDBuildInfo.cmake index 21b1e3c1d..468635b15 100644 --- a/host/cmake/Modules/UHDBuildInfo.cmake +++ b/host/cmake/Modules/UHDBuildInfo.cmake @@ -8,46 +8,46 @@ # We need this to be macro because GET_DIRECTORY_PROPERTY works with # the current directory. # -MACRO(UHD_LOAD_BUILD_INFO) - MESSAGE(STATUS "") - MESSAGE(STATUS "Loading build info.") +macro(UHD_LOAD_BUILD_INFO) + message(STATUS "") + message(STATUS "Loading build info.") # Build date - IF(IGNORE_BUILD_DATE) - SET(UHD_BUILD_DATE "") - ELSE() - EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c + if(IGNORE_BUILD_DATE) + set(UHD_BUILD_DATE "") + else() + execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import time; print(time.strftime('%a, %d %b %Y %H:%M:%S', time.gmtime()))" OUTPUT_VARIABLE UHD_BUILD_DATE OUTPUT_STRIP_TRAILING_WHITESPACE ) - ENDIF(IGNORE_BUILD_DATE) + endif(IGNORE_BUILD_DATE) # Compiler name - IF(MSVC) - IF(MSVC10) - SET(UHD_C_COMPILER "MSVC 2010") - SET(UHD_CXX_COMPILER "MSVC 2010") - ELSEIF(MSVC11) - SET(UHD_C_COMPILER "MSVC 2012") - SET(UHD_CXX_COMPILER "MSVC 2012") - ELSEIF(MSVC12) - SET(UHD_C_COMPILER "MSVC 2013") - SET(UHD_CXX_COMPILER "MSVC 2013") - ELSEIF(MSVC14) - SET(UHD_C_COMPILER "MSVC 2015") - SET(UHD_CXX_COMPILER "MSVC 2015") - ELSE() + if(MSVC) + if(MSVC10) + set(UHD_C_COMPILER "MSVC 2010") + set(UHD_CXX_COMPILER "MSVC 2010") + elseif(MSVC11) + set(UHD_C_COMPILER "MSVC 2012") + set(UHD_CXX_COMPILER "MSVC 2012") + elseif(MSVC12) + set(UHD_C_COMPILER "MSVC 2013") + set(UHD_CXX_COMPILER "MSVC 2013") + elseif(MSVC14) + set(UHD_C_COMPILER "MSVC 2015") + set(UHD_CXX_COMPILER "MSVC 2015") + else() # Go with the ugly string - SET(UHD_C_COMPILER "MSVC ${CMAKE_C_COMPILER_VERSION}") - SET(UHD_CXX_COMPILER "MSVC ${CMAKE_CXX_COMPILER_VERSION}") - ENDIF(MSVC10) - ELSE() - SET(UHD_C_COMPILER "${CMAKE_C_COMPILER_ID} ${CMAKE_C_COMPILER_VERSION}") - SET(UHD_CXX_COMPILER "${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}") - ENDIF(MSVC) + set(UHD_C_COMPILER "MSVC ${CMAKE_C_COMPILER_VERSION}") + set(UHD_CXX_COMPILER "MSVC ${CMAKE_CXX_COMPILER_VERSION}") + endif(MSVC10) + else() + set(UHD_C_COMPILER "${CMAKE_C_COMPILER_ID} ${CMAKE_C_COMPILER_VERSION}") + set(UHD_CXX_COMPILER "${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}") + endif(MSVC) # Compiler flags - GET_DIRECTORY_PROPERTY(uhd_flags COMPILE_DEFINITIONS) - SET(UHD_C_FLAGS "${uhd_flags}${CMAKE_C_FLAGS}") # CMAKE_C_FLAGS starts with a space - SET(UHD_CXX_FLAGS "${uhd_flags}${CMAKE_CXX_FLAGS}") # CMAKE_CXX_FLAGS starts with a space -ENDMACRO(UHD_LOAD_BUILD_INFO) + get_directory_property(uhd_flags COMPILE_DEFINITIONS) + set(UHD_C_FLAGS "${uhd_flags}${CMAKE_C_FLAGS}") # CMAKE_C_FLAGS starts with a space + set(UHD_CXX_FLAGS "${uhd_flags}${CMAKE_CXX_FLAGS}") # CMAKE_CXX_FLAGS starts with a space +endmacro(UHD_LOAD_BUILD_INFO) |