mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2025-01-11 18:57:11 +01:00
Use pkg for every module, and link them static
This commit is contained in:
parent
6130428989
commit
e94888d533
3
.gitignore
vendored
3
.gitignore
vendored
@ -3,4 +3,5 @@ build/
|
||||
*.old
|
||||
*.dll
|
||||
*.exe
|
||||
*.zip
|
||||
*.zip
|
||||
.DS_Store
|
||||
|
@ -60,6 +60,8 @@ if (MSVC)
|
||||
find_package(portaudio CONFIG REQUIRED)
|
||||
target_link_libraries(sdrpp_core PUBLIC portaudio portaudio_static)
|
||||
|
||||
target_link_libraries(sdrpp_core PUBLIC volk)
|
||||
|
||||
endif (MSVC)
|
||||
|
||||
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
@ -76,42 +78,49 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
target_link_libraries(sdrpp_core PUBLIC Xxf86vm)
|
||||
target_link_libraries(sdrpp_core PUBLIC dl)
|
||||
target_link_libraries(sdrpp_core PUBLIC stdc++fs)
|
||||
target_link_libraries(sdrpp_core PUBLIC volk)
|
||||
endif ()
|
||||
|
||||
|
||||
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
find_package(PkgConfig)
|
||||
find_package(OpenGL REQUIRED)
|
||||
|
||||
# find_package(GLEW REQUIRED)
|
||||
# find_package(fftw3 REQUIRED)
|
||||
# find_package(glfw3 REQUIRED)
|
||||
# find_package(volk REQUIRED)
|
||||
pkg_check_modules(GLEW REQUIRED GLEW)
|
||||
pkg_check_modules(FFTW3 REQUIRED fftw3f)
|
||||
pkg_check_modules(VOLK REQUIRED volk)
|
||||
pkg_check_modules(GLFW3 REQUIRED glfw3)
|
||||
pkg_check_modules(PORTAUDIO REQUIRED portaudio-2.0)
|
||||
|
||||
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_include_directories(sdrpp_core PUBLIC
|
||||
${GLEW_INCLUDE_DIRS}
|
||||
${FFTW3_INCLUDE_DIRS}
|
||||
${GLFW3_INCLUDE_DIRS}
|
||||
${VOLK_INCLUDE_DIRS} ${VOLK_INCLUDE_DIRS}/volk
|
||||
${PORTAUDIO_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
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_directories(sdrpp_core PUBLIC
|
||||
${GLEW_LIBRARY_DIRS}
|
||||
${FFTW3_LIBRARY_DIRS}
|
||||
${GLFW3_LIBRARY_DIRS}
|
||||
${VOLK_LIBRARY_DIRS}
|
||||
${PORTAUDIO_LIBRARY_DIRS}
|
||||
)
|
||||
|
||||
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)
|
||||
target_link_libraries(sdrpp_core PUBLIC
|
||||
${OPENGL_LIBRARIES}
|
||||
${GLEW_STATIC_LIBRARIES}
|
||||
${FFTW3_STATIC_LIBRARIES}
|
||||
${GLFW3_STATIC_LIBRARIES}
|
||||
${VOLK_STATIC_LIBRARIES}
|
||||
${PORTAUDIO_STATIC_LIBRARIES}
|
||||
)
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -static-libstdc++")
|
||||
endif ()
|
||||
|
||||
target_link_libraries(sdrpp_core PUBLIC volk)
|
||||
|
||||
set(CORE_FILES ${RUNTIME_OUTPUT_DIRECTORY} PARENT_SCOPE)
|
||||
|
||||
# cmake .. "-DCMAKE_TOOLCHAIN_FILE=C:/Users/Alex/vcpkg/scripts/buildsystems/vcpkg.cmake" -G "Visual Studio 15 2017 Win64"
|
||||
|
@ -19,9 +19,15 @@ add_library(soapy SHARED ${SRC})
|
||||
target_link_libraries(soapy PRIVATE sdrpp_core)
|
||||
set_target_properties(soapy PROPERTIES PREFIX "")
|
||||
|
||||
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)
|
||||
find_package(PkgConfig)
|
||||
find_package(OpenGL REQUIRED)
|
||||
|
||||
pkg_check_modules(SOAPY REQUIRED soapysdr)
|
||||
|
||||
target_include_directories(soapy PUBLIC ${SOAPY_INCLUDE_DIRS})
|
||||
target_link_directories(soapy PUBLIC ${SOAPY_LIBRARY_DIRS})
|
||||
target_link_libraries(soapy PUBLIC ${SOAPY_LIBRARIES})
|
||||
else ()
|
||||
target_link_libraries(soapy PUBLIC SoapySDR)
|
||||
endif ()
|
||||
|
Loading…
Reference in New Issue
Block a user