-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Remove vendored "FindGLEW.cmake" and adopt imported targets; rename "FindGTest.cmake" to prevent name clash #2679
Remove vendored "FindGLEW.cmake" and adopt imported targets; rename "FindGTest.cmake" to prevent name clash #2679
Conversation
If you get it running on windows I can step in on the OS X part and @taketwo probably on the linux one. |
Windows should work fine - I have tested it on my local machine before I had committed. |
We have a problem here. On Ubuntu GTest is distributed as a source-only package, it has no binaries. (This is the reason why we had to create our own However, to address the original issue #2677, we can simply exclud |
Couldn't we just call build script on Gtest? On our machines this needs just a few seconds. //EDIT: In Ubuntu 18.04 exists a package googletest-tools - but not on 16.04 :( |
Could you elaborate what you mean? |
Something like this (maybe local source instead of cloning)
|
At the moment compiling PCL with tests is as easy as making sure that gtest is installed through a package manager and then enabling corresponding CMake option. With your proposed change the users will need to perform additional manual installation steps. I think it's inconvenient, may break someones workflow, and will bring confusion. What do you think about my proposal to simply not install |
It solves it only in case you are building PCL in a separate build directory. So it will fix it on some machines, but not all. In general I prefer using shipped scripts, so we are getting any modernization by CMake developer for free (e.g. imported targets). |
Understandable. However, in this case the shipped script is (arguably) broken. It tries to find installed built binaries from GTest, which is against the recommendation of GTest developers. I believe we should continue following the recommended approach, even if this means we don't get modernization for free.
I'm not sure I understand your use-case. I thought we are talking about building/installing PCL, then consuming it in a downstream project via |
This FAQ is a bit outdated and I don't find it in official repo of GTest, but it is indeed a point. Current readme seems not to say we should not use a pre-built version, it just says usage of not pre-built source is more robust and flexible. Recommend way of this readme (git clone via cmake script) is btw imho really ugly even it is most robust ;-).
We have two use cases:
So currently I see following options for us:
@SergioRAgostinho What is your opinion about this topic? |
As you rightfully linked, these are the up-to-date recomendations which still endorses the same policy of building the lib as part of your project. We're following number one. Please correct me in case I misunderstood:
We should block installation of the GTest script. It's not used by the installation ever. I don't have a strong opinion about the second point. In my view, it is a "capital sin" in the cmake world to build in the source folder... Especially because you need to wipe the build folder every now and then.
As Sergey rightfully pointed out, the shipped GTest script is not following the recommend practices. Homebrew for mac also stopped distributing the library in their package manager exactly for this reason.
As much as I like to stop vendoring things, this case turned out to be an exception.
In terms of variants, I would follow the first one. CI issues are dealt with once and then things should work out fine. Regarding the name... I don't mind having a rename. We should just document properly the reason for us vendoring our own CMake find script and why the name change. Anyway, we should have a better read at |
…hipped with CMake.
fcc97f6
to
e3e79b2
Compare
macOS build is broken with the following error:
@SergioRAgostinho any idea? |
Not right now, but I can take care of it. |
Well, still no idea why it doesn't work, but I got some debug output, so we know now where the difference ist:
As you can see paths are a bit longer at imported target. But because I have no Mac I have no idea about content of this directories. |
@SunBlack don't worry about it. I'll test it on my machine and add the commit on top of your branch with whatever turns out to be the solution. It should be something simple 🤞 . |
The target pcl_simulation_io is complaining about the lack of glut symbols. Some other lib in the other platforms is probably exporting the linker flags, but not on OS X. diff --git a/simulation/tools/CMakeLists.txt b/simulation/tools/CMakeLists.txt
index 09c67499c..0f348ceb4 100644
--- a/simulation/tools/CMakeLists.txt
+++ b/simulation/tools/CMakeLists.txt
@@ -44,7 +44,7 @@ if(GLEW_FOUND)
${VTK_IO_TARGET_LINK_LIBRARIES}
${OPENNI_INCLUDES})
target_link_libraries(${LIB_NAME} pcl_simulation pcl_common pcl_io
- ${VTK_IO_TARGET_LINK_LIBRARIES} ${OPENGL_LIBRARIES})
+ ${VTK_IO_TARGET_LINK_LIBRARIES} ${OPENGL_LIBRARIES} GLUT::GLUT)
get_target_property(OUT ${LIB_NAME} LINK_LIBRARIES)
message(STATUS "${LIB_NAME}: ${OUT}") Edit: @SunBlack since the fix is so minor it's better you just add this yourself to the PR. |
de497e6
to
ef26232
Compare
Imported |
…ipt shipped with CMake on Windows. Furthermore removed it from install target.
fc6a99f
to
32d6cef
Compare
Ok, it was just a quick change to see what build server says without looking at minimum required CMake version ;). I added a small adjustment to Gtest, so this PR should fix #2677 completely. |
Maintainer Edit: The rename was to prevent a name clash with the standard FindGtest.cmake distributed by CMake.