ENH: Improving the travis dashboard name
[platform/upstream/lapack.git] / CMAKE / CheckTimeFunction.cmake
1 # - Check if the Fortran function exists.
2 # CHECK_TIME_FUNCTION(FUNCTION VARIABLE TYPE)
3 # - macro which checks if the Fortran function exists
4 #  FUNCTION - the name of the Fortran function
5 #  VARIABLE - variable to store the result
6 #
7
8 macro(CHECK_TIME_FUNCTION FUNCTION VARIABLE)
9
10     try_compile(RES
11     ${PROJECT_BINARY_DIR}/INSTALL
12     ${PROJECT_SOURCE_DIR}/INSTALL
13     TIMING secondtst_${FUNCTION}
14     OUTPUT_VARIABLE OUTPUT)
15
16     if(RES)
17       set(${VARIABLE} ${FUNCTION} CACHE INTERNAL "Have Fortran function ${FUNCTION}")
18       message(STATUS "Looking for Fortran ${FUNCTION} - found")
19       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
20         "Fortran ${FUNCTION} exists. ${OUTPUT} \n\n")
21     else()
22       message(STATUS "Looking for Fortran ${FUNCTION} - not found")
23       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
24         "Fortran ${FUNCTION} does not exist. \n ${OUTPUT} \n")
25     endif()
26 endmacro()
27
28