/alps/pcitool

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

« back to all changes in this revision

Viewing changes to CMakeLists.txt

  • Committer: Suren A. Chilingaryan
  • Date: 2011-12-14 17:18:28 UTC
  • Revision ID: csa@dside.dyndns.org-20111214171828-qza370yg3cjk8w9s
build scripts: allow to build the library without pcitool

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 
6
6
cmake_minimum_required(VERSION 2.8)
7
7
 
 
8
set(DISABLE_PCITOOL FALSE CACHE BOOL "Build only the library") 
 
9
 
 
10
 
8
11
find_package(PkgConfig REQUIRED)
9
12
 
10
13
#Check in sibling directory
11
14
pkg_check_modules(UFODECODE ufodecode REQUIRED)
12
 
pkg_check_modules(FASTWRITER fastwriter REQUIRED)
 
15
 
 
16
if (NOT DISABLE_PCITOOL)
 
17
    pkg_check_modules(FASTWRITER fastwriter REQUIRED)
 
18
endif (NOT DISABLE_PCITOOL)
13
19
 
14
20
set(HEADERS pcilib.h pci.h register.h kmem.h irq.h dma.h event.h default.h tools.h error.h)
15
21
add_definitions("-fPIC --std=c99 -Wall -O2 -pthread")
29
35
#    LINK_FLAGS "-pthread -Wl,--whole-archive,dma/libdma.a,ipecamera/libipecamera.a,--no-whole-archive"
30
36
)
31
37
 
32
 
add_executable(pci cli.c)
33
 
add_dependencies(pci pcitool)
34
 
target_link_libraries(pci pcilib pcitool)
 
38
if (NOT DISABLE_PCITOOL)
 
39
    add_executable(pci cli.c)
 
40
    add_dependencies(pci pcitool)
 
41
    target_link_libraries(pci pcilib pcitool)
 
42
endif (NOT DISABLE_PCITOOL)
35
43
 
36
44
#set_target_properties(pci PROPERTIES
37
45
#    LINK_FLAGS "-Wl,pcitool/libpcitool.a"
47
55
    LIBRARY DESTINATION lib${LIB_SUFFIX}
48
56
)
49
57
 
50
 
install(TARGETS pci
51
 
    DESTINATION ${BIN_INSTALL_DIR}
52
 
)
 
58
if (NOT DISABLE_PCITOOL)
 
59
    install(TARGETS pci
 
60
        DESTINATION ${BIN_INSTALL_DIR}
 
61
    )
 
62
endif (NOT DISABLE_PCITOOL)
53
63
 
54
64
install(FILES pcilib.h
55
65
    DESTINATION include