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