Use try_compile to look for the timing routine
[platform/upstream/lapack.git] / CMakeLists.txt
1 cmake_minimum_required(VERSION 2.6)
2 project(LAPACK Fortran)
3 if ( "${CMAKE_Fortran_COMPILER}" MATCHES "ifort" )
4   set( CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fltconsistency -fp_port" )
5 endif ()
6 enable_testing()
7 include(CTest)
8 enable_testing()
9 set(CMAKE_MODULE_PATH ${LAPACK_SOURCE_DIR} ${CMAKE_MODULE_PATH})
10 include(CheckTimeFunction)
11 set(TIME_FUNC NONE ${TIME_FUNC})
12 CHECK_TIME_FUNCTION(NONE TIME_FUNC)
13 CHECK_TIME_FUNCTION(INT_CPU_TIME TIME_FUNC)
14 CHECK_TIME_FUNCTION(EXT_ETIME TIME_FUNC)
15 CHECK_TIME_FUNCTION(EXT_ETIME_ TIME_FUNC)
16 CHECK_TIME_FUNCTION(INT_ETIME TIME_FUNC)
17 message(STATUS "--> Will use second_${TIME_FUNC}.f and dsecnd_${TIME_FUNC}.f as timing function.")
18
19 set(SECOND_SRC  ${LAPACK_SOURCE_DIR}/INSTALL/second_${TIME_FUNC}.f)
20 set(DSECOND_SRC  ${LAPACK_SOURCE_DIR}/INSTALL/dsecnd_${TIME_FUNC}.f)
21
22 add_subdirectory(BLAS)
23 add_subdirectory(SRC)
24 add_subdirectory(TESTING)
25
26 set(LAPACK_VERSION 3.2.1)
27 set(CPACK_PACKAGE_VERSION_MAJOR 3)
28 set(CPACK_PACKAGE_VERSION_MINOR 2)
29 set(CPACK_PACKAGE_VERSION_PATCH 1)
30 include(CPack)
31 export(TARGETS blas FILE lapack-targets.cmake)
32 configure_file(${LAPACK_SOURCE_DIR}/lapack-config-version.cmake.in
33   ${LAPACK_BINARY_DIR}/lapack-config-version.cmake @ONLY)
34 configure_file(${LAPACK_SOURCE_DIR}/lapack-config.cmake.in
35   ${LAPACK_BINARY_DIR}/lapack-config.cmake @ONLY)