Commit 08e041ce39967200a168072b115cdf6334e1db9d

Authored by pyb
1 parent 5d4fb3a808
Exists in master

libad9915: add gitignore & CMakelists

Showing 2 changed files with 54 additions and 0 deletions Side-by-side Diff

  1 +build/
  2 +*~
  1 +cmake_minimum_required(VERSION 2.8)
  2 +project(AD9915-library)
  3 +
  4 +option(AD9915_DEBUG "Activate debug build" ON)
  5 +
  6 +# CFLAGS
  7 +set(CMAKE_C_FLAGS "-O2")
  8 +set(CMAKE_C_FLAGS_DEBUG "-Wall -Wextra -g")
  9 +
  10 +# Depends (memo, currently nothing here)
  11 +#set(CMAKE_MODULE_PATH
  12 +# ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/modules")
  13 +#find_package(FFTW REQUIRED)
  14 +
  15 +# Include GNUInstallDirs
  16 +include(GNUInstallDirs)
  17 +
  18 +# Include header
  19 +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
  20 +
  21 +# Create library dynamic
  22 +add_library(ad9915 SHARED
  23 + src/ad9915.c
  24 + src/ddsFreq.c
  25 + src/spi.c
  26 +)
  27 +
  28 +if (AD9915_DEBUG)
  29 + message(STATUS "Debug enable")
  30 + set(CMAKE_BUILD_TYPE Debug)
  31 +endif()
  32 +
  33 +set_target_properties(ad9915
  34 + PROPERTIES SOVERSION 1.0
  35 +)
  36 +
  37 +# Rules for install
  38 +install(TARGETS ad9915
  39 + EXPORT ad9915Config
  40 + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
  41 +)
  42 +install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/
  43 + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ad9915
  44 + FILES_MATCHING
  45 + PATTERN "*.h"
  46 + PATTERN ".swp" EXCLUDE
  47 +)
  48 +install(
  49 + EXPORT ad9915Config
  50 + DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/ad9915"
  51 +)