Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FindLibSDRplay.cmake registry path (win32) #3

Closed
guruofquality opened this issue Jan 16, 2021 · 3 comments
Closed

FindLibSDRplay.cmake registry path (win32) #3

guruofquality opened this issue Jan 16, 2021 · 3 comments

Comments

@guruofquality
Copy link

https://github.com/fventuri/gr-sdrplay3/blob/master/cmake/Modules/FindLibSDRplay.cmake also needs the path fixed

@guruofquality
Copy link
Author

Other typos and missing link stuff

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 260c1e3..dc224f2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -70,6 +70,25 @@ ELSE()
     message(WARNING "C standard could not be set because compiler is not GNU, Clang or MSVC.")
 ENDIF()

+IF(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
+    #fix min/max errors in gnuradio headers
+    add_definitions(-DNOMINMAX)
+ENDIF()
+
+########################################################################
+# Find boost
+########################################################################
+find_package(Boost "1.65" REQUIRED filesystem)
+
+if(NOT Boost_FOUND)
+    message(FATAL_ERROR "Boost not found")
+endif()
+
+if (MSVC)
+    add_definitions(-DBOOST_ALL_NO_LIB)
+    add_definitions(-DNOMINMAX)
+endif()
+
 ########################################################################
 # Install directories
 ########################################################################
diff --git a/cmake/Modules/FindLibSDRplay.cmake b/cmake/Modules/FindLibSDRplay.cmake
index 553c376..2739514 100644
--- a/cmake/Modules/FindLibSDRplay.cmake
+++ b/cmake/Modules/FindLibSDRplay.cmake
@@ -2,7 +2,7 @@ if(NOT LIBSDRPLAY_FOUND)
     # pkg_check_modules (LIBSDRPLAY_PKG libsdrplay)

     IF(WIN32)
-        GET_FILENAME_COMPONENT(SDRPLAY_API_DIR "[HKEY_LOCAL_MACHINE\\SOFTWARE\\SDRplaySDR\\API;Install_Dir]" ABSOLUTE)
+        GET_FILENAME_COMPONENT(SDRPLAY_API_DIR "[HKEY_LOCAL_MACHINE\\SOFTWARE\\SDRplay\\Service\\API;Install_Dir]" ABSOLUTE)

         if( CMAKE_SIZEOF_VOID_P EQUAL 8 )
             MESSAGE( "64 bit compiler detected" )
@@ -19,7 +19,7 @@ if(NOT LIBSDRPLAY_FOUND)
                 "${SDRPLAY_API_DIR}/inc"
                 )

-        find_library(LIBSDRPLAY_LIBRARIES NAMES sdrply_api.lib
+        find_library(LIBSDRPLAY_LIBRARIES NAMES sdrplay_api.lib
                 PATHS
                 "${SDRPLAY_API_DIR}/${EX_PLATFORM_NAME}"
                 )
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index ae66560..af43085 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -39,10 +39,13 @@ add_library(gnuradio-sdrplay3 SHARED ${sdrplay3_sources})
 target_link_libraries(gnuradio-sdrplay3
     gnuradio::gnuradio-runtime
     ${LIBSDRPLAY_LIBRARIES}
+    ${Boost_LIBRARIES}
   )
 target_include_directories(gnuradio-sdrplay3
     PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include>
     PUBLIC $<INSTALL_INTERFACE:include>
+    PRIVATE ${LIBSDRPLAY_INCLUDE_DIRS}
+    PRIVATE ${Boost_INCLUDE_DIRS}
   )
 set_target_properties(gnuradio-sdrplay3 PROPERTIES DEFINE_SYMBOL "gnuradio_sdrplay3_EXPORTS")

@fventuri
Copy link
Owner

@guruofquality - Thanks for the fixes, Josh!

I just pushed all of your changes to master; let me know if I missed anything.

Franco

@guruofquality
Copy link
Author

Builds now, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants