diff --git a/CMakeLists.txt b/CMakeLists.txt index 828e6f2e..c9045634 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,8 +22,14 @@ target_link_libraries(sdrpp PRIVATE sdrpp_core) # Copy dynamic libs over if (MSVC) add_custom_target(do_always ALL xcopy /s \"$\\*.dll\" \"$\" /Y) -else() - add_custom_target(do_always ALL cp \"$/sdrpp_core.so\" \"$\") endif (MSVC) +if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") + add_custom_target(do_always ALL cp \"$/sdrpp_core.so\" \"$\") +endif () + +if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + add_custom_target(do_always ALL cp \"$/sdrpp_core.dylib\" \"$\") +endif () + # cmake .. "-DCMAKE_TOOLCHAIN_FILE=C:/Users/Alex/vcpkg/scripts/buildsystems/vcpkg.cmake" -G "Visual Studio 15 2017 Win64" diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index da5423a1..0b1d0e1a 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -60,7 +60,9 @@ if (MSVC) find_package(portaudio CONFIG REQUIRED) target_link_libraries(sdrpp_core PUBLIC portaudio portaudio_static) -else() +endif (MSVC) + +if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") target_include_directories(sdrpp_core PUBLIC "/usr/include/volk") target_link_libraries(sdrpp_core PUBLIC pthread) @@ -73,7 +75,39 @@ else() target_link_libraries(sdrpp_core PUBLIC X11) target_link_libraries(sdrpp_core PUBLIC Xxf86vm) target_link_libraries(sdrpp_core PUBLIC dl) -endif (MSVC) +endif () + + +if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + find_package(OpenGL REQUIRED) + + # find_package(GLEW REQUIRED) + # find_package(fftw3 REQUIRED) + # find_package(glfw3 REQUIRED) + # find_package(volk REQUIRED) + + target_include_directories(sdrpp_core PUBLIC /usr/local/opt/glew/include) + target_include_directories(sdrpp_core PUBLIC /usr/local/opt/glfw/include) + target_include_directories(sdrpp_core PUBLIC /usr/local/opt/fftw/include) + target_include_directories(sdrpp_core PUBLIC /usr/local/opt/portaudio/include) + target_include_directories(sdrpp_core PUBLIC /usr/local/opt/volk/include) + target_include_directories(sdrpp_core PUBLIC /usr/local/opt/volk/include/volk) + + target_link_directories(sdrpp_core PUBLIC /usr/local/opt/glew/lib) + target_link_directories(sdrpp_core PUBLIC /usr/local/opt/volk/lib) + target_link_directories(sdrpp_core PUBLIC /usr/local/opt/glfw/lib) + target_link_directories(sdrpp_core PUBLIC /usr/local/opt/fftw/lib) + target_link_directories(sdrpp_core PUBLIC /usr/local/opt/portaudio/lib) + + target_link_libraries(sdrpp_core PUBLIC ${OPENGL_LIBRARIES}) + target_link_libraries(sdrpp_core PUBLIC volk) + target_link_libraries(sdrpp_core PUBLIC glew) + target_link_libraries(sdrpp_core PUBLIC glfw) + target_link_libraries(sdrpp_core PUBLIC fftw3) + target_link_libraries(sdrpp_core PUBLIC fftw3f) + target_link_libraries(sdrpp_core PUBLIC portaudio) + +endif () target_link_libraries(sdrpp_core PUBLIC volk) diff --git a/core/src/gui/waterfall.cpp b/core/src/gui/waterfall.cpp index 4b8258b8..3d60dabd 100644 --- a/core/src/gui/waterfall.cpp +++ b/core/src/gui/waterfall.cpp @@ -104,8 +104,6 @@ namespace ImGui { viewBandwidth = 1.0; wholeBandwidth = 1.0; - glGenTextures(1, &textureId); - updatePallette(COLOR_MAP, 13); } @@ -363,6 +361,7 @@ namespace ImGui { } void WaterFall::updateWaterfallTexture() { + glGenTextures(1, &textureId); glBindTexture(GL_TEXTURE_2D, textureId); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); diff --git a/readme.md b/readme.md index 1db83330..ce590be6 100644 --- a/readme.md +++ b/readme.md @@ -62,7 +62,21 @@ If you followed the steps above, it should be `build/Release`. comming soon :) # Building on OSX -comming soon as well :) +## Install requirements +``` +brew tap pothosware/homebrew-pothos +brew install volk glew glfw fftw portaudio +brew install soapysdr +``` +You can install additional soapy device support based on your hardware. + +## The build +``` +mkdir build +cd build +cmake .. +cmake --build . --config Release +``` # Contributing diff --git a/soapy/CMakeLists.txt b/soapy/CMakeLists.txt index a5c0e444..19c33483 100644 --- a/soapy/CMakeLists.txt +++ b/soapy/CMakeLists.txt @@ -19,4 +19,9 @@ add_library(soapy SHARED ${SRC}) target_link_libraries(soapy PRIVATE sdrpp_core) set_target_properties(soapy PROPERTIES PREFIX "") -target_link_libraries(soapy PUBLIC SoapySDR) \ No newline at end of file +target_link_libraries(soapy PUBLIC SoapySDR) + +if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + target_include_directories(soapy PUBLIC /usr/local/opt/soapysdr/include) + target_link_directories(soapy PUBLIC /usr/local/opt/soapysdr/lib) +endif ()