2014-10-27 20:05:40 -04:00
|
|
|
cmake_minimum_required (VERSION 2.8)
|
|
|
|
|
2014-11-21 00:49:41 -05:00
|
|
|
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
|
|
|
|
|
2014-12-07 21:06:05 -05:00
|
|
|
macro(configure_files srcDir destDir globStr)
|
|
|
|
message(STATUS "Copying ${srcDir}/${globStr} to directory ${destDir}")
|
2014-10-27 20:05:40 -04:00
|
|
|
make_directory(${destDir})
|
|
|
|
|
2014-12-07 21:06:05 -05:00
|
|
|
file(GLOB templateFiles RELATIVE ${srcDir} ${srcDir}/${globStr})
|
2014-10-27 20:05:40 -04:00
|
|
|
foreach(templateFile ${templateFiles})
|
|
|
|
set(srcTemplatePath ${srcDir}/${templateFile})
|
2014-12-07 21:06:05 -05:00
|
|
|
message(STATUS "Configuring file ${templateFile}")
|
2014-10-27 20:05:40 -04:00
|
|
|
if(NOT IS_DIRECTORY ${srcTemplatePath})
|
|
|
|
configure_file(
|
|
|
|
${srcTemplatePath}
|
|
|
|
${destDir}/${templateFile}
|
|
|
|
COPYONLY)
|
|
|
|
endif(NOT IS_DIRECTORY ${srcTemplatePath})
|
|
|
|
endforeach(templateFile)
|
|
|
|
endmacro(configure_files)
|
|
|
|
|
|
|
|
|
|
|
|
macro(configure_files_recurse srcDir destDir)
|
|
|
|
message(STATUS "Configuring directory ${destDir}")
|
|
|
|
make_directory(${destDir})
|
|
|
|
|
|
|
|
file(GLOB_RECURSE templateFiles RELATIVE ${srcDir} ${srcDir}/*)
|
|
|
|
foreach(templateFile ${templateFiles})
|
|
|
|
set(srcTemplatePath ${srcDir}/${templateFile})
|
2014-12-07 21:06:05 -05:00
|
|
|
message(STATUS "Configuring file ${templateFile}")
|
2014-10-27 20:05:40 -04:00
|
|
|
if(NOT IS_DIRECTORY ${srcTemplatePath})
|
|
|
|
configure_file(
|
|
|
|
${srcTemplatePath}
|
|
|
|
${destDir}/${templateFile}
|
|
|
|
COPYONLY)
|
|
|
|
endif(NOT IS_DIRECTORY ${srcTemplatePath})
|
|
|
|
endforeach(templateFile)
|
|
|
|
endmacro(configure_files_recurse)
|
|
|
|
|
|
|
|
project (CubicSDR)
|
|
|
|
|
|
|
|
SET( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
|
|
|
|
SET( CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${PROJECT_BINARY_DIR})
|
|
|
|
SET( CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${PROJECT_BINARY_DIR})
|
|
|
|
|
|
|
|
#add_subdirectory(${PROJECT_SOURCE_DIR}/glfw-3.0.3 ${PROJECT_BINARY_DIR}/glfw/)
|
|
|
|
#include_directories(${PROJECT_SOURCE_DIR}/glfw-3.0.3/include)
|
|
|
|
#include_directories ( ${PROJECT_SOURCE_DIR}/../CubicVR-2/build/include )
|
|
|
|
#link_directories ( ${PROJECT_SOURCE_DIR}/../CubicVR-2/build/lib )
|
|
|
|
|
|
|
|
find_package(OpenGL REQUIRED)
|
|
|
|
|
2014-11-21 00:49:41 -05:00
|
|
|
find_package(wxWidgets REQUIRED gl core base)
|
2014-10-27 20:05:40 -04:00
|
|
|
set(wxWidgets_CONFIGURATION mswu)
|
|
|
|
include(${wxWidgets_USE_FILE})
|
|
|
|
|
2014-10-27 21:22:29 -04:00
|
|
|
# include_directories ( ${PROJECT_SOURCE_DIR}/../CubicVR-2/build/include )
|
|
|
|
# link_directories ( ${PROJECT_SOURCE_DIR}/../CubicVR-2/build/lib ${OPENGL_INCLUDE_DIR})
|
2014-10-27 20:05:40 -04:00
|
|
|
|
2014-12-07 21:06:05 -05:00
|
|
|
IF (WIN32)
|
2014-11-21 00:49:41 -05:00
|
|
|
set(wxWidgets_USE_STATIC ON)
|
2014-11-20 20:10:28 -05:00
|
|
|
include_directories ( ${PROJECT_SOURCE_DIR}/external/fftw-3.3.4-dll64 ${PROJECT_SOURCE_DIR}/external/rtl-sdr-release )
|
|
|
|
link_directories ( ${PROJECT_SOURCE_DIR}/external/fftw-3.3.4-dll64 ${PROJECT_SOURCE_DIR}/external/rtl-sdr-release/x64 )
|
2014-10-31 02:31:43 -04:00
|
|
|
set(FFTW_LIB fftw3-3)
|
2014-11-06 21:30:47 -05:00
|
|
|
|
2014-11-20 20:10:28 -05:00
|
|
|
link_directories ( ${PROJECT_SOURCE_DIR}/external/liquid-dsp/lib/64 )
|
2014-11-06 21:30:47 -05:00
|
|
|
include_directories ( ${PROJECT_SOURCE_DIR}/external/liquid-dsp/include )
|
2014-12-04 19:03:02 -05:00
|
|
|
|
|
|
|
ADD_DEFINITIONS(
|
2014-12-04 22:25:18 -05:00
|
|
|
# To use wasapi
|
2014-12-04 19:44:49 -05:00
|
|
|
-D__WINDOWS_WASAPI__
|
2014-12-07 21:06:05 -05:00
|
|
|
|
2014-12-04 22:25:18 -05:00
|
|
|
# To use directsound
|
|
|
|
#-D__WINDOWS_DS__
|
2014-12-04 19:03:02 -05:00
|
|
|
)
|
2014-12-04 19:44:49 -05:00
|
|
|
|
2014-12-04 22:25:18 -05:00
|
|
|
# To use wasapi
|
|
|
|
SET(OTHER_LIBRARIES -luuid -lksuser )
|
2014-12-07 21:06:05 -05:00
|
|
|
|
2014-12-04 22:25:18 -05:00
|
|
|
# To use DirectSound (which uses WASAPI anyways?)
|
|
|
|
# SET(OTHER_LIBRARIES -ldsound)
|
2014-12-07 21:06:05 -05:00
|
|
|
|
|
|
|
# Copy DLL files to build dir
|
|
|
|
configure_files(${PROJECT_SOURCE_DIR}/external/liquid-dsp-lib/64 ${CMAKE_BINARY_DIR} "*.dll")
|
|
|
|
configure_files(${PROJECT_SOURCE_DIR}/external/rtl-sdr-release/x64 ${CMAKE_BINARY_DIR} "*.dll")
|
|
|
|
configure_files(${PROJECT_SOURCE_DIR}/external/fftw-3.3.4-dll64 ${CMAKE_BINARY_DIR} "*.dll")
|
|
|
|
|
|
|
|
ENDIF (WIN32)
|
2014-12-04 22:25:18 -05:00
|
|
|
|
|
|
|
IF (UNIX)
|
|
|
|
set(RTLSDR_INCLUDE "/opt/local/include" CACHE FILEPATH "RTL-SDR Include Path")
|
|
|
|
set(RTLSDR_LIB "/opt/local/lib" CACHE FILEPATH "RTL-SDR Lib Path")
|
|
|
|
include_directories(${RTLSDR_INCLUDE})
|
|
|
|
link_directories(${RTLSDR_LIB})
|
2014-12-04 19:03:02 -05:00
|
|
|
|
2014-12-04 22:25:18 -05:00
|
|
|
set(FFTW_LIB fftw3)
|
|
|
|
|
|
|
|
ADD_DEFINITIONS(
|
|
|
|
# -D__UNIX_JACK__
|
|
|
|
# -D__LINUX_ALSA__
|
|
|
|
# -D__LINUX_PULSE__
|
|
|
|
# -D__LINUX_OSS__
|
|
|
|
)
|
|
|
|
ENDIF(UNIX)
|
|
|
|
|
|
|
|
IF (APPLE)
|
|
|
|
set(RTLSDR_INCLUDE "/opt/local/include" CACHE FILEPATH "RTL-SDR Include Path")
|
|
|
|
set(RTLSDR_LIB "/opt/local/lib" CACHE FILEPATH "RTL-SDR Lib Path")
|
|
|
|
include_directories(${RTLSDR_INCLUDE})
|
|
|
|
link_directories(${RTLSDR_LIB})
|
2014-11-06 21:30:47 -05:00
|
|
|
|
2014-12-04 22:25:18 -05:00
|
|
|
set(FFTW_LIB fftw3)
|
|
|
|
|
|
|
|
ADD_DEFINITIONS(
|
|
|
|
-D__MACOSX_CORE__
|
|
|
|
)
|
2014-10-27 23:52:25 -04:00
|
|
|
|
2014-12-04 22:25:18 -05:00
|
|
|
FIND_LIBRARY(COREAUDIO_LIBRARY CoreAudio)
|
|
|
|
SET (OTHER_LIBRARIES ${COREAUDIO_LIBRARY})
|
|
|
|
ENDIF (APPLE)
|
2014-10-27 23:52:25 -04:00
|
|
|
|
2014-10-27 20:05:40 -04:00
|
|
|
|
|
|
|
SET (cubicsdr_sources
|
2014-11-15 23:41:41 -05:00
|
|
|
src/CubicSDR.cpp
|
2014-10-27 21:22:29 -04:00
|
|
|
src/AppFrame.cpp
|
2014-11-17 21:29:27 -05:00
|
|
|
src/sdr/SDRThread.cpp
|
2014-11-29 13:58:20 -05:00
|
|
|
src/sdr/SDRPostThread.cpp
|
2014-12-16 18:27:02 -05:00
|
|
|
src/demod/DemodulatorPreThread.cpp
|
2014-11-17 21:29:27 -05:00
|
|
|
src/demod/DemodulatorThread.cpp
|
2014-11-30 23:33:55 -05:00
|
|
|
src/demod/DemodulatorWorkerThread.cpp
|
2014-12-11 23:35:06 -05:00
|
|
|
src/demod/DemodulatorInstance.cpp
|
2014-11-17 22:58:56 -05:00
|
|
|
src/demod/DemodulatorMgr.cpp
|
2014-11-17 21:29:27 -05:00
|
|
|
src/audio/AudioThread.cpp
|
|
|
|
src/util/Gradient.cpp
|
|
|
|
src/util/Timer.cpp
|
2014-11-25 21:07:13 -05:00
|
|
|
src/util/MouseTracker.cpp
|
2014-12-07 21:06:05 -05:00
|
|
|
src/util/GLFont.cpp
|
2014-11-17 21:29:27 -05:00
|
|
|
src/visual/PrimaryGLContext.cpp
|
2014-11-12 21:55:11 -05:00
|
|
|
src/visual/ScopeCanvas.cpp
|
|
|
|
src/visual/ScopeContext.cpp
|
2014-11-15 23:41:41 -05:00
|
|
|
src/visual/SpectrumCanvas.cpp
|
|
|
|
src/visual/SpectrumContext.cpp
|
|
|
|
src/visual/WaterfallCanvas.cpp
|
|
|
|
src/visual/WaterfallContext.cpp
|
2014-12-04 19:03:02 -05:00
|
|
|
external/rtaudio/RtAudio.cpp
|
2014-12-07 21:06:05 -05:00
|
|
|
external/lodepng/lodepng.cpp
|
2014-10-27 20:05:40 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
SET (cubicsdr_headers
|
2014-11-17 21:29:27 -05:00
|
|
|
src/CubicSDRDefs.h
|
2014-11-15 23:41:41 -05:00
|
|
|
src/CubicSDR.h
|
2014-10-27 21:22:29 -04:00
|
|
|
src/AppFrame.h
|
2014-11-17 21:29:27 -05:00
|
|
|
src/sdr/SDRThread.h
|
2014-11-29 13:58:20 -05:00
|
|
|
src/sdr/SDRPostThread.h
|
2014-12-16 18:27:02 -05:00
|
|
|
src/demod/DemodulatorPreThread.h
|
2014-11-17 21:29:27 -05:00
|
|
|
src/demod/DemodulatorThread.h
|
2014-11-30 23:33:55 -05:00
|
|
|
src/demod/DemodulatorWorkerThread.h
|
2014-12-11 23:35:06 -05:00
|
|
|
src/demod/DemodulatorInstance.h
|
2014-11-17 22:58:56 -05:00
|
|
|
src/demod/DemodulatorMgr.h
|
2014-12-11 19:07:21 -05:00
|
|
|
src/demod/DemodDefs.h
|
2014-11-17 21:29:27 -05:00
|
|
|
src/audio/AudioThread.h
|
|
|
|
src/util/Gradient.h
|
|
|
|
src/util/Timer.h
|
2014-11-20 20:10:28 -05:00
|
|
|
src/util/ThreadQueue.h
|
2014-11-25 21:07:13 -05:00
|
|
|
src/util/MouseTracker.h
|
2014-12-07 21:06:05 -05:00
|
|
|
src/util/GLFont.h
|
2014-11-17 21:29:27 -05:00
|
|
|
src/visual/PrimaryGLContext.h
|
2014-11-12 21:55:11 -05:00
|
|
|
src/visual/ScopeCanvas.h
|
|
|
|
src/visual/ScopeContext.h
|
2014-11-15 23:41:41 -05:00
|
|
|
src/visual/SpectrumCanvas.h
|
|
|
|
src/visual/SpectrumContext.h
|
|
|
|
src/visual/WaterfallCanvas.h
|
|
|
|
src/visual/WaterfallContext.h
|
2014-12-04 19:03:02 -05:00
|
|
|
external/rtaudio/RtAudio.h
|
2014-12-07 21:06:05 -05:00
|
|
|
external/lodepng/lodepng.h
|
2014-10-27 20:05:40 -04:00
|
|
|
)
|
2014-11-12 21:55:11 -05:00
|
|
|
|
2014-12-07 21:06:05 -05:00
|
|
|
include_directories (
|
|
|
|
${PROJECT_SOURCE_DIR}/src/sdr
|
|
|
|
${PROJECT_SOURCE_DIR}/src/demod
|
|
|
|
${PROJECT_SOURCE_DIR}/src/audio
|
|
|
|
${PROJECT_SOURCE_DIR}/src/util
|
|
|
|
${PROJECT_SOURCE_DIR}/src/visual
|
|
|
|
${PROJECT_SOURCE_DIR}/src
|
|
|
|
${PROJECT_SOURCE_DIR}/external/rtaudio
|
|
|
|
${PROJECT_SOURCE_DIR}/external/lodepng
|
|
|
|
)
|
2014-11-12 21:55:11 -05:00
|
|
|
|
2014-11-19 00:34:41 -05:00
|
|
|
ADD_DEFINITIONS(
|
2014-11-20 20:10:28 -05:00
|
|
|
-std=c++0x # or -std=c++11
|
2014-11-21 21:50:14 -05:00
|
|
|
-pthread
|
2014-11-19 00:34:41 -05:00
|
|
|
)
|
2014-12-07 21:06:05 -05:00
|
|
|
|
|
|
|
configure_files(${PROJECT_SOURCE_DIR}/font ${CMAKE_BINARY_DIR} "*.fnt")
|
|
|
|
configure_files(${PROJECT_SOURCE_DIR}/font ${CMAKE_BINARY_DIR} "*.png")
|
2014-10-27 20:05:40 -04:00
|
|
|
|
|
|
|
add_executable(CubicSDR ${cubicsdr_sources} ${cubicsdr_headers})
|
|
|
|
|
2014-12-04 19:03:02 -05:00
|
|
|
target_link_libraries(CubicSDR rtlsdr liquid ${FFTW_LIB} ${wxWidgets_LIBRARIES} ${OPENGL_LIBRARIES} ${OTHER_LIBRARIES})
|
2014-12-07 21:06:05 -05:00
|
|
|
|
|
|
|
|