Update to 2.0.0 tree from current Fremantle build
[opencv] / 3rdparty / lapack / CMakeLists.txt
1 # ----------------------------------------------------------------------------
2 #  CMake file for opencv_lapack. See root CMakeLists.txt
3 #
4 # ----------------------------------------------------------------------------
5 project(opencv_lapack)
6
7 # List of C++ files:
8
9 include_directories(
10         ${CMAKE_CURRENT_SOURCE_DIR}
11         "${CMAKE_CURRENT_SOURCE_DIR}/../include"
12     ${CMAKE_CURRENT_BINARY_DIR}
13         )
14
15 # The .cpp files:
16 file(GLOB lib_srcs *.c)
17 file(GLOB lib_hdrs *.h)
18 set(lib_ext_hdrs "../include/f2c.h" "../include/cblas.h" "../include/clapack.h")
19
20 # ----------------------------------------------------------------------------------
21 #                               Define the library target:
22 # ----------------------------------------------------------------------------------
23
24 set(the_target "opencv_lapack")
25
26 add_library(${the_target} STATIC ${lib_srcs} ${lib_hdrs} ${lib_ext_hdrs})
27
28 if(PCHSupport_FOUND)
29     set(pch_header ${CMAKE_CURRENT_SOURCE_DIR}/../include/clapack.h)
30     if(${CMAKE_GENERATOR} MATCHES "Visual*" OR ${CMAKE_GENERATOR} MATCHES "Xcode*")
31         if(${CMAKE_GENERATOR} MATCHES "Visual*")
32             set(${the_target}_pch "precomp.c")
33         endif()            
34         add_native_precompiled_header(${the_target} ${pch_header})
35     #elseif(CMAKE_COMPILER_IS_GNUCXX AND ${CMAKE_GENERATOR} MATCHES ".*Makefiles")
36     #    add_precompiled_header(${the_target} ${pch_header})
37     endif()
38 endif()
39
40 if(MSVC)
41     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W3")
42 endif()
43
44 if(CMAKE_COMPILER_IS_GNUCXX)
45     if(UNIX)
46         set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
47     endif()
48     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-parentheses")
49     set_source_files_properties(dlamch.c slamch.c PROPERTIES COMPILE_FLAGS "-ffloat-store -O0")
50 endif()
51
52 set_target_properties(${the_target}
53         PROPERTIES OUTPUT_NAME "${the_target}"
54         DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
55         ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/3rdparty/lib
56         )