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

Wrong FFTS include path #230

Closed
smunaut opened this issue Aug 24, 2020 · 6 comments · Fixed by #231
Closed

Wrong FFTS include path #230

smunaut opened this issue Aug 24, 2020 · 6 comments · Fixed by #231

Comments

@smunaut
Copy link
Contributor

smunaut commented Aug 24, 2020

DeEmbedDecoder.h and FFTDecoder.h use #include <ffts/ffts.h> instead of #include <ffts.h>.

Some other places do it correctly and if you look at how FindFFTS.cmake works, LIBFFTS_INCLUDE_DIR will already include the ffts/ component.

But since glscopeclient includes something that includes those, you also need to simultaneously add LIBFFTS_INCLUDE_DIR to the include_directories of that application.

@azonenberg
Copy link
Collaborator

We've had issues where on Windows, the opposite is true: ffts.h fails to compile and ffts/ffts.h works.

Maybe FindFFTS.cmake needs porting work to find the library on Windows?

@azonenberg
Copy link
Collaborator

(paging @nshcat to look into this)

@smunaut
Copy link
Contributor Author

smunaut commented Aug 24, 2020

ATM some source file use #include <ffts.h>

scopeprotocols/CTLEDecoder.cpp:#include <ffts.h>
scopeprotocols/ChannelEmulationDecoder.cpp:#include <ffts.h>

So if those build the issue with windows should be elsewhere.

As mentionned I had to update the apps CMakelist.txt because the includes in headers will will leak there.

--- a/src/glscopeclient/CMakeLists.txt
+++ b/src/glscopeclient/CMakeLists.txt
@@ -11,7 +11,7 @@ if(WIN32)
 endif()
 
 #Set up include paths
-include_directories(${GTKMM_INCLUDE_DIRS} ${SIGCXX_INCLUDE_DIRS} ${GLEW_INCLUDE_DIRS})
+include_directories(${GTKMM_INCLUDE_DIRS} ${SIGCXX_INCLUDE_DIRS} ${GLEW_INCLUDE_DIRS} ${LIBFFTS_INCLUDE_DIR})
 link_directories(${GTKMM_LIBRARY_DIRS} ${SIGCXX_LIBRARY_DIRS})
 
 ###############################################################################

@smunaut
Copy link
Contributor Author

smunaut commented Aug 24, 2020

Actually a better solution is to set the FFTS include dir in the PUBLIC include of the scopeprotocols since it's required by anything using it.

diff --git a/scopeprotocols/CMakeLists.txt b/scopeprotocols/CMakeLists.txt
index e604b34..4c637f3 100644
--- a/scopeprotocols/CMakeLists.txt
+++ b/scopeprotocols/CMakeLists.txt
@@ -86,6 +86,6 @@ target_link_libraries(scopeprotocols
 
 target_include_directories(scopeprotocols
 PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
-PRIVATE ${LIBFFTS_INCLUDE_DIR})
+       ${LIBFFTS_INCLUDE_DIR})
 
 install(TARGETS scopeprotocols LIBRARY DESTINATION /usr/lib)

@azonenberg
Copy link
Collaborator

I'm in the middle of a major refactoring right now.

Send a PR in a day or so when I'm done? I don't want you to have to put too much effort into merging/rebasing.

@azonenberg
Copy link
Collaborator

Done with the refactoring if you want to look at this. Some of the FFTS includes may have got twiddled as part of this, so probably best to go check everywhere.

smunaut added a commit to smunaut/scopehal that referenced this issue Aug 30, 2020
From how FindFFTS.cmake works, LIBFFTS_INCLUDE_DIR will already
include the ffts/ component.

Fixes ngscopeclient#230

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
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

Successfully merging a pull request may close this issue.

2 participants