We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
a strange thing in
TARGET_INCLUDE_DIRECTORIES(hiredis PUBLIC $<INSTALL_INTERFACE:include> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
in INSTALL_INTERFACE, using #include <hiredis/hiredis.h> is ok
#include <hiredis/hiredis.h>
in BUILD_INTERFACE, I have to change it to #include <hiredis.h>
#include <hiredis.h>
keep them same maybe better
The text was updated successfully, but these errors were encountered:
Can you provide some more context? What's failing exactly?
Sorry, something went wrong.
firstly, fetch hiredis into my project and use it by target_link_libraries
find_package(hiredis 1.2.0 QUIET) if (NOT hiredis_FOUND) include(FetchContent) fetchcontent_declare(hiredis GIT_REPOSITORY https://github.com/redis/hiredis.git GIT_TAG v1.2.0 SOURCE_DIR ${CMAKE_BINARY_DIR}/_deps/hiredis ) fetchcontent_makeavailable(hiredis) if(NOT hiredis_POPULATED) message(FATAL_ERROR "fetch hiredis failed!") endif () endif () target_link_libraries(redis_pool PUBLIC hiredis::hiredis )
then include <hiredis/hireids.h> in my header file,but clion complains "hiredis/hiredis.h file not found",so print redis::redis's properties
include <hiredis/hireids.h>
include(CMakePrintHelpers) cmake_print_properties( TARGETS hiredis::hiredis PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ) # Properties for TARGET hiredis::hiredis: # hiredis::hiredis.INTERFACE_INCLUDE_DIRECTORIES = "$<INSTALL_INTERFACE:include>;$<BUILD_INTERFACE:/xx/Project/cmake-build-debug/_deps/hiredis>"
the reason why clion complains in BUILD_INTERFACE is obvious. it's why
include <hireids.h>
in most of others libraries, both of them are same and better for using.
No branches or pull requests
a strange thing in
in INSTALL_INTERFACE, using
#include <hiredis/hiredis.h>
is okin BUILD_INTERFACE, I have to change it to
#include <hiredis.h>
keep them same maybe better
The text was updated successfully, but these errors were encountered: