/alps/ipecamera

To get this branch, use:
bzr branch http://darksoft.org/webbzr/alps/ipecamera

« back to all changes in this revision

Viewing changes to CMakeLists.txt

  • Committer: Suren A. Chilingaryan
  • Date: 2015-04-27 00:28:57 UTC
  • Revision ID: csa@suren.me-20150427002857-82fk6r3e8rfgy4wr
First stand-alone ipecamera implementation

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
project(pcitool)
2
 
 
3
 
set(PCILIB_VERSION "0.1.0")
4
 
set(PCILIB_ABI_VERSION "1")
5
 
 
6
 
cmake_minimum_required(VERSION 2.6)
7
 
 
8
 
set(DISABLE_PCITOOL FALSE CACHE BOOL "Build only the library") 
9
 
 
10
 
 
11
 
find_package(PkgConfig REQUIRED)
12
 
find_package(Threads REQUIRED)
13
 
 
14
 
#Check in sibling directory
15
 
pkg_check_modules(UFODECODE ufodecode>=0.2 REQUIRED)
16
 
 
17
 
if (NOT DISABLE_PCITOOL)
18
 
    pkg_check_modules(FASTWRITER fastwriter REQUIRED)
19
 
endif (NOT DISABLE_PCITOOL)
20
 
 
21
 
set(HEADERS pcilib.h pci.h register.h kmem.h irq.h dma.h event.h default.h tools.h error.h)
22
 
add_definitions("-fPIC --std=c99 -Wall -O2")
23
 
#add_definitions("-fPIC --std=c99 -Wall -O2 -pthread")
24
 
 
25
 
add_subdirectory(dma)
26
 
add_subdirectory(ipecamera)
27
 
add_subdirectory(kapture)
28
 
add_subdirectory(pcitool)
29
 
add_subdirectory(apps)
30
 
 
31
 
include_directories(
32
 
    ${FASTWRITER_INCLUDE_DIRS}
33
 
)
34
 
 
35
 
link_directories(
36
 
    ${FASTWRITER_LIBRARY_DIRS}
37
 
    ${UFODECODE_LIBRARY_DIRS}
38
 
)
39
 
 
40
 
add_library(pcilib SHARED pci.c register.c kmem.c irq.c dma.c event.c default.c tools.c error.c) 
41
 
target_link_libraries(pcilib dma ipecamera kapture ${CMAKE_THREAD_LIBS_INIT} ${UFODECODE_LIBRARIES} )
42
 
add_dependencies(pcilib dma ipecamera)
43
 
 
44
 
set_target_properties(pcilib PROPERTIES
45
 
    VERSION ${PCILIB_VERSION}
46
 
    SOVERSION ${PCILIB_ABI_VERSION}
47
 
#    LINK_FLAGS "-pthread"
48
 
#    LINK_FLAGS "-pthread -Wl,--whole-archive,dma/libdma.a,ipecamera/libipecamera.a,--no-whole-archive"
49
 
)
50
 
 
51
 
if (NOT DISABLE_PCITOOL)
52
 
    add_executable(pci cli.c)
53
 
    add_dependencies(pci pcitool)
54
 
    target_link_libraries(pci pcilib pcitool ${FASTWRITER_LIBRARIES})
55
 
    set_target_properties(pci PROPERTIES
56
 
        LINK_FLAGS ${CMAKE_THREAD_LIBS_INIT}
57
 
    )
58
 
endif (NOT DISABLE_PCITOOL)
59
 
 
60
 
#set_target_properties(pci PROPERTIES
61
 
#    LINK_FLAGS "-Wl,pcitool/libpcitool.a"
62
 
#)
63
 
 
64
 
if(NOT DEFINED BIN_INSTALL_DIR)
65
 
    set(BIN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/bin")
66
 
endif(NOT DEFINED BIN_INSTALL_DIR)
67
 
 
68
 
 
69
 
install(TARGETS pcilib
70
 
    LIBRARY DESTINATION lib${LIB_SUFFIX}
71
 
)
72
 
 
73
 
if (NOT DISABLE_PCITOOL)
74
 
    install(TARGETS pci
75
 
        DESTINATION ${BIN_INSTALL_DIR}
76
 
    )
77
 
endif (NOT DISABLE_PCITOOL)
78
 
 
79
 
install(FILES pcilib.h
80
 
    DESTINATION include
81
 
)