16
16
pkg_check_modules(FASTWRITER fastwriter REQUIRED)
17
17
endif (NOT DISABLE_PCITOOL)
19
set(HEADERS pcilib.h pci.h config.h model.h bank.h register.h kmem.h irq.h dma.h event.h tools.h error.h)
20
19
add_definitions("-fPIC --std=c99 -Wall -O2 -gdwarf-2 -g3")
21
20
#add_definitions("-fPIC --std=c99 -Wall -O2")
23
22
add_subdirectory(dma)
24
23
add_subdirectory(protocols)
24
add_subdirectory(pcilib)
25
25
add_subdirectory(pcitool)
26
26
add_subdirectory(apps)
30
${FASTWRITER_INCLUDE_DIRS}
34
${FASTWRITER_LIBRARY_DIRS}
35
${UFODECODE_LIBRARY_DIRS}
38
add_library(pcilib SHARED pci.c config.c model.c bank.c register.c kmem.c irq.c dma.c event.c tools.c error.c)
39
target_link_libraries(pcilib dma protocols ${CMAKE_THREAD_LIBS_INIT} ${UFODECODE_LIBRARIES} )
40
add_dependencies(pcilib dma protocols pcitool)
42
28
set_target_properties(pcilib PROPERTIES
43
29
VERSION ${PCILIB_VERSION}
44
30
SOVERSION ${PCILIB_ABI_VERSION}
47
if (NOT DISABLE_PCITOOL)
48
add_executable(pci cli.c)
49
add_dependencies(pci pcitool)
50
target_link_libraries(pci pcilib pcitool ${FASTWRITER_LIBRARIES})
51
set_target_properties(pci PROPERTIES
52
LINK_FLAGS ${CMAKE_THREAD_LIBS_INIT}
54
endif (NOT DISABLE_PCITOOL)
56
#set_target_properties(pci PROPERTIES
57
# LINK_FLAGS "-Wl,pcitool/libpcitool.a"
60
if(NOT DEFINED BIN_INSTALL_DIR)
61
set(BIN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/bin")
62
endif(NOT DEFINED BIN_INSTALL_DIR)
65
install(TARGETS pcilib
66
LIBRARY DESTINATION lib${LIB_SUFFIX}
69
if (NOT DISABLE_PCITOOL)
71
DESTINATION ${BIN_INSTALL_DIR}
73
endif (NOT DISABLE_PCITOOL)
75
install(FILES pcilib.h
79
install(FILES bank.h register.h dma.h event.h model.h error.h tools.h
80
DESTINATION include/pcilib