/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 CMakeLists.txt

  • Committer: Matthias Vogelgesang
  • Date: 2011-12-02 09:36:11 UTC
  • Revision ID: matthias.vogelgesang@kit.edu-20111202093611-f1lx9jlt947p391a
Add documentation and split CMakeLists

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
    set(LOCALE_INSTALL_DIR "${DATA_INSTALL_DIR}/locale/")
28
28
endif(NOT DEFINED LOCALE_INSTALL_DIR)
29
29
 
30
 
 
31
 
# --- Look for SSE support --------------------------------------------------
32
 
include(CheckCXXSourceRuns)
33
 
set(SSE_FLAGS)
34
 
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
35
 
    set(CMAKE_REQUIRED_FLAGS "-msse")
36
 
    check_cxx_source_runs("
37
 
        #include <xmmintrin.h>
38
 
        int main()
39
 
        {
40
 
            __m128 a, b;
41
 
            float vals[4] = {0};
42
 
            a = _mm_loadu_ps(vals);
43
 
            b = a;
44
 
            b = _mm_add_ps(a,b);
45
 
            _mm_storeu_ps(vals,b);
46
 
            return 0;
47
 
        }"
48
 
    SSE_AVAILABLE)
49
 
 
50
 
    set(CMAKE_REQUIRED_FLAGS)
51
 
 
52
 
    if (SSE_AVAILABLE)
53
 
        option(HAVE_SSE "Use SSE extensions" ON)
54
 
        set(SSE_FLAGS "-msse")
55
 
    endif()
56
 
endif()
57
 
 
58
 
# --- Build library and install ---------------------------------------------
59
 
include_directories(
60
 
    ${CMAKE_SOURCE_DIR}/src 
61
 
    ${CMAKE_CURRENT_BINARY_DIR}
62
 
)
63
 
 
64
 
add_definitions("--std=c99 -Wall -O2 ${SSE_FLAGS}")
65
 
 
66
 
add_library(ufodecode SHARED src/ufodecode.c)
67
 
 
68
 
set_target_properties(ufodecode PROPERTIES
69
 
    VERSION ${LIBUFODECODE_ABI_VERSION}
70
 
    SOVERSION ${LIBUFODECODE_ABI_MAJOR_VERSION}
71
 
)
72
 
 
73
 
install(TARGETS ufodecode
74
 
    LIBRARY DESTINATION lib${LIB_SUFFIX}
75
 
)
76
 
 
77
 
install(FILES
78
 
    src/ufodecode.h
79
 
    DESTINATION include
80
 
)
81
 
 
82
30
configure_file(ufodecode.pc.in ${CMAKE_CURRENT_BINARY_DIR}/ufodecode.pc)
83
 
 
84
 
if ("${CMAKE_BUILD_TYPE}" MATCHES "Debug")
85
 
    set(DEBUG "1")
86
 
endif()
87
 
configure_file(src/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
88
 
 
89
31
install(FILES 
90
32
    ${CMAKE_CURRENT_BINARY_DIR}/ufodecode.pc 
91
33
    DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
92
34
 
93
 
 
94
 
# --- Build test executable -------------------------------------------------
95
 
add_executable(ipedec test/ipedec.c)
96
 
target_link_libraries(ipedec ufodecode)
97
 
 
98
 
install(TARGETS ipedec DESTINATION ${BIN_INSTALL_DIR})
 
35
add_subdirectory(src)
 
36
add_subdirectory(doc)
 
37
add_subdirectory(test)
 
38