-
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
Use gflags ALIAS target instead of ${gflags_XXX} variables #198
Comments
Sorry for the necro posting but why the gflags ALIAS is not used in DetermineGflagsNamespace.cmake#L37 ? note: As a workaround when using glog and gflags as subprojects you can use: add_subdirectory(gflags EXCLUDE_FROM_ALL)
...
# Download and unpack glog at configure time using ExternalProject
...
# Bypass DetermineGflagsNamespace
set(gflags_NAMESPACE "gflags" CACHE INTERNAL "Namespace for gflags")
add_subdirectory(${CMAKE_BINARY_DIR}/glog-src ${CMAKE_BINARY_DIR}/glog-build
EXCLUDE_FROM_ALL) |
@Mizux Please create a new issue. Thanks! |
Well, according to the try_compile command doc
So in my case where I have gflags and glog as subproject of a meta CMake it didn't work either... |
@Mizux Maybe the |
@sergiud I doesn't help EDIT: since try_compile() is done at configure time, you can't rely on target which will be available at buildtime... |
The gflags project updated their CMake config last year with a `gflags` ALIAS target. This can be used instead of the legacy `${gflags_LIBRARIES}` and `${gflags_INCLUDE_DIRS}` variables. It also looks cleaner. Fixes google#198
The gflags project recently added an ALIAS library target for
gflags
which can be used instead of the legacy${gflags_INCLUDES}
and${gflags_LIBRARIES}
variables. This will also allow removal of thetarget_include_directories
line for gflags. Happy to submit a pull request if this sounds good.The text was updated successfully, but these errors were encountered: