-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Including both glog and gflags as cmake subdirectories #560
Comments
Ok, if So is there any known workaround for getting glog and gflags to co-exist in-tree? edit: this bug in gflags is still waiting gflags/gflags#279 |
Unfortunately, I don't see any way to work around this gflags issue in glog. |
an other way is to hack locally (i.e. by applying a git patch) to your dependency (glog here) so before glog perform a find_package(gflag) you add a check if gflag is present: so you can modify Lines 62 to 69 in 0a2e593
into something like: if (WITH_GFLAGS)
if(NOT TARGET gflag::gflag)
find_package (gflags 2.2.0)
if (gflags_FOUND)
set (HAVE_LIB_GFLAGS 1)
determine_gflags_namespace (gflags_NAMESPACE)
endif (gflags_FOUND)
else()
set(gflags_NAMESPACE gflags)
endif()
endif (WITH_GFLAGS) note: not tested, and blind supposition of the purpose of note: In CMake having I would say CMake has always been targeted to unix system/distro way where you install your deps first then you 'find_package()' them so having super build/monolithic project is more or less outside of the kitware scope IMHO |
thanks! |
@growly Have you found a solution now? thank you! |
I gave up trying to include gflags and glog as subdirectories with my source, I now rely on a system-wide install and |
I think I have to change to your way, thank you! |
I haven't found a definitive answer so I'm asking here: does glog support being included as subdirectory in a subsuming cmake project, next to gflags? I'd like my
CMakeLists.txt
to be as simple as:but no dice (
find_package
fails). I've tried playing with theWITH_GFLAGS
,HAVE_LIB_GFLAGS
,gflags_FOUND
,gflags_NAMESPACE
,gflags_INSTALL
, etc, variables to trick glog into finding the right installation. @Mizux mentioned that this works when glog is an ExternalProject in #198 - is that the only known/blessed way?Thanks!
The text was updated successfully, but these errors were encountered: