project(ipedma_test) cmake_minimum_required(VERSION 2.6) find_package(PkgConfig REQUIRED) pkg_check_modules(PCILIB pcitool>=0.2 REQUIRED) include_directories( ${PCILIB_INCLUDE_DIRS} ) link_directories( ${PCILIB_LIBRARY_DIRS} ) add_definitions("-fPIC --std=c99 -O2 -gdwarf-2 -g3") add_executable(ipedma_test ipedma_test.c) target_link_libraries(ipedma_test ${PCILIB_LIBRARIES}) set_target_properties(ipedma_test PROPERTIES COMPILE_FLAGS -Wno-array-bounds) add_executable(check_counter check_counter.c) if(NOT DEFINED BIN_INSTALL_DIR) set(BIN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/bin") endif(NOT DEFINED BIN_INSTALL_DIR) install(TARGETS ipedma_test check_counter DESTINATION ${BIN_INSTALL_DIR})