/alps/ufodecode

To get this branch, use:
bzr branch http://suren.me/webbzr/alps/ufodecode
11 by Matthias Vogelgesang
Add missing CMakeLists
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()
36 by Matthias Vogelgesang
Add INSTALL and README
55
11 by Matthias Vogelgesang
Add missing CMakeLists
56
configure_file(config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
57