/alps/ufodecode

To get this branch, use:
bzr branch http://suren.me/webbzr/alps/ufodecode

« back to all changes in this revision

Viewing changes to src/CMakeLists.txt

  • Committer: Matthias Vogelgesang
  • Date: 2011-12-02 10:28:12 UTC
  • Revision ID: matthias.vogelgesang@kit.edu-20111202102812-924ykic59d82dd31
Add missing CMakeLists

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# --- Look for SSE support --------------------------------------------------
 
2
include(CheckCXXSourceRuns)
 
3
set(SSE_FLAGS)
 
4
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
 
5
    set(CMAKE_REQUIRED_FLAGS "-msse")
 
6
    check_cxx_source_runs("
 
7
        #include <xmmintrin.h>
 
8
        int main()
 
9
        {
 
10
            __m128 a, b;
 
11
            float vals[4] = {0};
 
12
            a = _mm_loadu_ps(vals);
 
13
            b = a;
 
14
            b = _mm_add_ps(a,b);
 
15
            _mm_storeu_ps(vals,b);
 
16
            return 0;
 
17
        }"
 
18
    SSE_AVAILABLE)
 
19
 
 
20
    set(CMAKE_REQUIRED_FLAGS)
 
21
 
 
22
    if (SSE_AVAILABLE)
 
23
        option(HAVE_SSE "Use SSE extensions" ON)
 
24
        set(SSE_FLAGS "-msse")
 
25
    endif()
 
26
endif()
 
27
 
 
28
# --- Build library and install ---------------------------------------------
 
29
include_directories(
 
30
    ${CMAKE_SOURCE_DIR}/src 
 
31
    ${CMAKE_CURRENT_BINARY_DIR}
 
32
)
 
33
 
 
34
add_definitions("--std=c99 -Wall -O2 ${SSE_FLAGS}")
 
35
 
 
36
add_library(ufodecode SHARED ufodecode.c)
 
37
 
 
38
set_target_properties(ufodecode PROPERTIES
 
39
    VERSION ${LIBUFODECODE_ABI_VERSION}
 
40
    SOVERSION ${LIBUFODECODE_ABI_MAJOR_VERSION}
 
41
)
 
42
 
 
43
install(TARGETS ufodecode
 
44
    LIBRARY DESTINATION lib${LIB_SUFFIX}
 
45
)
 
46
 
 
47
install(FILES
 
48
    ufodecode.h
 
49
    DESTINATION include
 
50
)
 
51
 
 
52
if ("${CMAKE_BUILD_TYPE}" MATCHES "Debug")
 
53
    set(DEBUG "1")
 
54
endif()
 
55
configure_file(config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
 
56