diff options
author | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2011-12-14 18:18:28 +0100 |
---|---|---|
committer | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2011-12-14 18:18:28 +0100 |
commit | 424dd760ee0a2e0734e89b70d834a29c4d9bbd7a (patch) | |
tree | 9d8d95a9bcaedd6cc7ea1f5a34806ce58fb921a7 /CMakeLists.txt | |
parent | 72fc5fa9be55ffab0e009085b05a3cad0b077826 (diff) | |
download | ipecamera-424dd760ee0a2e0734e89b70d834a29c4d9bbd7a.tar.gz ipecamera-424dd760ee0a2e0734e89b70d834a29c4d9bbd7a.tar.bz2 ipecamera-424dd760ee0a2e0734e89b70d834a29c4d9bbd7a.tar.xz ipecamera-424dd760ee0a2e0734e89b70d834a29c4d9bbd7a.zip |
build scripts: allow to build the library without pcitool
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 40d7396..2818ca6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,11 +5,17 @@ set(PCILIB_ABI_VERSION "0") cmake_minimum_required(VERSION 2.8) +set(DISABLE_PCITOOL FALSE CACHE BOOL "Build only the library") + + find_package(PkgConfig REQUIRED) #Check in sibling directory pkg_check_modules(UFODECODE ufodecode REQUIRED) -pkg_check_modules(FASTWRITER fastwriter REQUIRED) + +if (NOT DISABLE_PCITOOL) + pkg_check_modules(FASTWRITER fastwriter REQUIRED) +endif (NOT DISABLE_PCITOOL) set(HEADERS pcilib.h pci.h register.h kmem.h irq.h dma.h event.h default.h tools.h error.h) add_definitions("-fPIC --std=c99 -Wall -O2 -pthread") @@ -29,9 +35,11 @@ set_target_properties(pcilib PROPERTIES # LINK_FLAGS "-pthread -Wl,--whole-archive,dma/libdma.a,ipecamera/libipecamera.a,--no-whole-archive" ) -add_executable(pci cli.c) -add_dependencies(pci pcitool) -target_link_libraries(pci pcilib pcitool) +if (NOT DISABLE_PCITOOL) + add_executable(pci cli.c) + add_dependencies(pci pcitool) + target_link_libraries(pci pcilib pcitool) +endif (NOT DISABLE_PCITOOL) #set_target_properties(pci PROPERTIES # LINK_FLAGS "-Wl,pcitool/libpcitool.a" @@ -47,9 +55,11 @@ install(TARGETS pcilib LIBRARY DESTINATION lib${LIB_SUFFIX} ) -install(TARGETS pci - DESTINATION ${BIN_INSTALL_DIR} -) +if (NOT DISABLE_PCITOOL) + install(TARGETS pci + DESTINATION ${BIN_INSTALL_DIR} + ) +endif (NOT DISABLE_PCITOOL) install(FILES pcilib.h DESTINATION include |