Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
########################################################################
# Project setup
########################################################################

cmake_minimum_required(VERSION 2.8)

# dabtools
add_subdirectory(src)

# wavefinder-driver
# add_subdirectory(wavefinder-driver)


########################################################################
# Create uninstall target
########################################################################

configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY)

add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)

21 changes: 21 additions & 0 deletions cmake/cmake_uninstall.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
message(FATAL_ERROR "Cannot find install manifest: @CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")

file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
string(REGEX REPLACE "\n" ";" files "${files}")
foreach(file ${files})
message(STATUS "Uninstalling $ENV{DESTDIR}${file}")
if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
exec_program(
"@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
OUTPUT_VARIABLE rm_out
RETURN_VALUE rm_retval
)
if(NOT "${rm_retval}" STREQUAL 0)
message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}")
endif(NOT "${rm_retval}" STREQUAL 0)
else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
message(STATUS "File $ENV{DESTDIR}${file} does not exist.")
endif(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
endforeach(file)
99 changes: 99 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
########################################################################
# Project setup
########################################################################

cmake_minimum_required(VERSION 2.8)
project(dabtools C)

# Select the release build type by default to get optimization flags
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release")
message(STATUS "Build type not specified: defaulting to release.")
endif(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "")

list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules)

# Set the version information here
set(VERSION_INFO_MAJOR_VERSION 0)
set(VERSION_INFO_API_COMPAT 0)
set(VERSION_INFO_MINOR_VERSION 0)
set(VERSION_INFO_MAINT_VERSION git)


########################################################################
# Compiler specific setup
########################################################################

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")

if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANGCC)
add_definitions(-Wall)
add_definitions(-Wno-unused)
endif()


########################################################################
# Find build dependencies
########################################################################

find_package(PkgConfig)
# pthreads
find_package(Threads REQUIRED)
# rtlsdr
pkg_check_modules(RTLSDR librtlsdr REQUIRED)
include_directories(${RTLSDR_INCLUDE_DIRS})
# fftw3
pkg_check_modules(FFTW3 fftw3 REQUIRED )
include_directories(${FFTW3_INCLUDE_DIRS})


########################################################################
# Setup apps
########################################################################

list(APPEND dabtools_sources
dab.c
dab_tables.c
depuncture.c
fic.c
input_sdr.c
input_wf.c
misc.c
sdr_fifo.c
# sdr_prstab.c
sdr_sync.c
wf_maths.c
wf_prstables.c
wf_sync.c
dab2eti.c
)

if(ENABLE_SPIRAL_VITERBI)
list(APPEND dabtools_sources
${dabtools_sources}
viterbi_spiral.c
viterbi_spiral_sse16.c
)
add_definitions(
-DENABLE_SPIRAL_VITERBI
-msse2
-msse3
-std=gnu99
)
else()
list(APPEND dabtools_sources
${dabtools_sources}
viterbi.c)
endif()

add_executable(dab2eti ${dabtools_sources})
add_executable(eti2mpa eti2mpa.c)
target_link_libraries(dab2eti m ${CMAKE_THREAD_LIBS_INIT} ${FFTW3_LIBRARIES} ${RTLSDR_LIBRARIES})

install(TARGETS
dab2eti
eti2mpa
DESTINATION bin
)