2014-10-27 20:05:40 -04:00
|
|
|
cmake_minimum_required (VERSION 2.8)
|
|
|
|
|
|
|
|
macro(configure_files srcDir destDir)
|
|
|
|
message(STATUS "Configuring directory ${destDir}")
|
|
|
|
make_directory(${destDir})
|
|
|
|
|
|
|
|
file(GLOB templateFiles RELATIVE ${srcDir} ${srcDir}/*)
|
|
|
|
foreach(templateFile ${templateFiles})
|
|
|
|
set(srcTemplatePath ${srcDir}/${templateFile})
|
|
|
|
if(NOT IS_DIRECTORY ${srcTemplatePath})
|
|
|
|
# message(STATUS "Configuring file ${templateFile}")
|
|
|
|
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})
|
|
|
|
if(NOT IS_DIRECTORY ${srcTemplatePath})
|
|
|
|
# message(STATUS "Configuring file ${templateFile}")
|
|
|
|
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 )
|
|
|
|
|
2014-10-27 23:52:25 -04:00
|
|
|
|
|
|
|
|
2014-10-27 20:05:40 -04:00
|
|
|
find_package(OpenGL REQUIRED)
|
|
|
|
|
|
|
|
set(wxWidgets_CONFIGURATION mswu)
|
|
|
|
find_package(wxWidgets COMPONENTS gl core base REQUIRED)
|
|
|
|
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-10-27 23:52:25 -04:00
|
|
|
|
|
|
|
if (DEFINED WIN32)
|
2014-10-30 22:51:33 -04:00
|
|
|
include_directories ( ${PROJECT_SOURCE_DIR}/external/fftw-3.3.4-dll32 ${PROJECT_SOURCE_DIR}/external/rtl-sdr-release )
|
|
|
|
link_directories ( ${PROJECT_SOURCE_DIR}/external/fftw-3.3.4-dll32 ${PROJECT_SOURCE_DIR}/external/rtl-sdr-release/x32 )
|
2014-10-31 02:31:43 -04:00
|
|
|
set(FFTW_LIB fftw3-3)
|
2014-11-06 21:30:47 -05:00
|
|
|
|
2014-11-09 04:38:33 -05:00
|
|
|
include_directories ( ${PROJECT_SOURCE_DIR}/external/portaudio/include )
|
|
|
|
link_directories ( ${PROJECT_SOURCE_DIR}/external/portaudio/libs )
|
|
|
|
SET (PORTAUDIO_LIBRARY portaudio.dll winmm)
|
2014-11-06 21:30:47 -05:00
|
|
|
|
|
|
|
link_directories ( ${PROJECT_SOURCE_DIR}/external/liquid-dsp/lib )
|
|
|
|
include_directories ( ${PROJECT_SOURCE_DIR}/external/liquid-dsp/include )
|
2014-10-27 23:52:25 -04:00
|
|
|
else (DEFINED WIN32)
|
|
|
|
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-10-31 02:31:43 -04:00
|
|
|
set(FFTW_LIB fftw3)
|
2014-11-09 05:18:33 -05:00
|
|
|
|
|
|
|
SET (PORTAUDIO_LIBRARY portaudio)
|
2014-10-27 23:52:25 -04:00
|
|
|
endif (DEFINED WIN32)
|
|
|
|
|
|
|
|
|
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
|
|
|
|
src/sdr/SDRThreadQueue.cpp
|
|
|
|
src/sdr/SDRThreadTask.cpp
|
|
|
|
src/demod/DemodulatorThread.cpp
|
|
|
|
src/demod/DemodulatorThreadQueue.cpp
|
|
|
|
src/demod/DemodulatorThreadTask.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/audio/AudioThreadQueue.cpp
|
|
|
|
src/audio/AudioThreadTask.cpp
|
|
|
|
src/util/Gradient.cpp
|
|
|
|
src/util/Timer.cpp
|
|
|
|
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-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
|
|
|
|
src/sdr/SDRThreadQueue.h
|
|
|
|
src/sdr/SDRThreadTask.h
|
|
|
|
src/demod/DemodulatorThread.h
|
|
|
|
src/demod/DemodulatorThreadQueue.h
|
|
|
|
src/demod/DemodulatorThreadTask.h
|
2014-11-17 22:58:56 -05:00
|
|
|
src/demod/DemodulatorMgr.h
|
2014-11-17 21:29:27 -05:00
|
|
|
src/audio/AudioThread.h
|
|
|
|
src/audio/AudioThreadQueue.h
|
|
|
|
src/audio/AudioThreadTask.h
|
|
|
|
src/util/Gradient.h
|
|
|
|
src/util/Timer.h
|
|
|
|
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-10-27 20:05:40 -04:00
|
|
|
)
|
2014-11-12 21:55:11 -05:00
|
|
|
|
2014-11-17 21:29:27 -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
|
2014-11-12 21:55:11 -05:00
|
|
|
${PROJECT_SOURCE_DIR}/src )
|
|
|
|
|
2014-10-27 20:05:40 -04:00
|
|
|
#configure_files(${PROJECT_SOURCE_DIR}/shaders ${PROJECT_BINARY_DIR}/shaders COPYONLY)
|
|
|
|
#configure_files(${PROJECT_SOURCE_DIR}/png ${PROJECT_BINARY_DIR}/png COPYONLY)
|
|
|
|
|
|
|
|
add_executable(CubicSDR ${cubicsdr_sources} ${cubicsdr_headers})
|
|
|
|
|
2014-11-09 04:38:33 -05:00
|
|
|
target_link_libraries(CubicSDR rtlsdr liquid ${FFTW_LIB} ${wxWidgets_LIBRARIES} ${OPENGL_LIBRARIES} ${PORTAUDIO_LIBRARY})
|
2014-11-05 19:10:18 -05:00
|
|
|
# cubicvr2 glfw ${GLFW_LIBRARIES}
|
2014-10-27 20:05:40 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|