Final plutosdr macos fix

This commit is contained in:
AlexandreRouma 2021-11-18 09:38:56 +01:00
parent 3ca7dc87e7
commit 9c2cb26376
2 changed files with 20 additions and 10 deletions

View File

@ -96,10 +96,10 @@ jobs:
run: wget https://www.sdrplay.com/software/SDRplay_RSP_API-MacOSX-3.07.3.pkg && sudo installer -pkg SDRplay_RSP_API-MacOSX-3.07.3.pkg -target /
- name: Install libiio
run: git clone https://github.com/analogdevicesinc/libiio && cd libiio && mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release -DOSX_PACKAGE=OFF -DCMAKE_INSTALL_PREFIX=/usr/local .. && make -j3 && sudo make install && cd ../../
run: git clone https://github.com/analogdevicesinc/libiio && cd libiio && mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release .. && make -j3 && sudo make install && cd ../../
- name: Install libad9361
run: git clone https://github.com/analogdevicesinc/libad9361-iio && cd libad9361-iio && mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release -DOSX_PACKAGE=OFF -DCMAKE_INSTALL_PREFIX=/usr/local .. && make -j3 && sudo make install && cd ../../
run: git clone https://github.com/analogdevicesinc/libad9361-iio && cd libad9361-iio && mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release .. && make -j3 && sudo make install && cd ../../
- name: Prepare CMake
working-directory: ${{runner.workspace}}/build

View File

@ -25,18 +25,28 @@ if (MSVC)
target_link_libraries(plutosdr_source PRIVATE libiio)
target_link_libraries(plutosdr_source PRIVATE libad9361)
else (MSVC)
find_package(PkgConfig)
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
target_include_directories(plutosdr_source PRIVATE "/Library/Frameworks/iio.framework/Headers")
target_link_libraries(plutosdr_source PRIVATE "/Library/Frameworks/iio.framework/iio")
pkg_check_modules(LIBIIO REQUIRED libiio)
pkg_check_modules(LIBAD9361 REQUIRED libad9361)
target_include_directories(plutosdr_source PRIVATE "/Library/Frameworks/ad9361.framework/Headers")
target_link_libraries(plutosdr_source PRIVATE "/Library/Frameworks/ad9361.framework/ad9361")
else()
find_package(PkgConfig)
target_include_directories(plutosdr_source PRIVATE ${LIBIIO_INCLUDE_DIRS})
target_link_directories(plutosdr_source PRIVATE ${LIBIIO_LIBRARY_DIRS})
target_link_libraries(plutosdr_source PRIVATE ${LIBIIO_LIBRARIES})
pkg_check_modules(LIBIIO REQUIRED libiio)
pkg_check_modules(LIBAD9361 REQUIRED libad9361)
target_include_directories(plutosdr_source PRIVATE ${LIBIIO_INCLUDE_DIRS})
target_link_directories(plutosdr_source PRIVATE ${LIBIIO_LIBRARY_DIRS})
target_link_libraries(plutosdr_source PRIVATE ${LIBIIO_LIBRARIES})
target_include_directories(plutosdr_source PRIVATE ${LIBAD9361_INCLUDE_DIRS})
target_link_directories(plutosdr_source PRIVATE ${LIBAD9361_LIBRARY_DIRS})
target_link_libraries(plutosdr_source PRIVATE ${LIBAD9361_LIBRARIES})
endif()
target_include_directories(plutosdr_source PRIVATE ${LIBAD9361_INCLUDE_DIRS})
target_link_directories(plutosdr_source PRIVATE ${LIBAD9361_LIBRARY_DIRS})
target_link_libraries(plutosdr_source PRIVATE ${LIBAD9361_LIBRARIES})
endif ()
# Install directives