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

Export include path using target_include_directories #82

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lemunozm
Copy link

@lemunozm lemunozm commented Apr 9, 2019

Hi!

I was using your project from an external CMake project, and I notice that the directories of the target are not exported to other projects that include yours as add_subdirectory and then use target_link_libraries.

For example, in a basic CMake example using your library:

project(curlpp-example)
cmake_minimum_required(VERSION 3.5)

add_subdirectory("thirdparty/curlpp")
set(CMAKE_CXX_STANDARD 11)
add_executable(${PROJECT_NAME} main.cpp)
target_link_libraries(${PROJECT_NAME} PUBLIC curlpp)

I'm not be able to use the curlpp includes. (More exaclty, the gcc does not compile with the -Ipath-to-curlpp)

Adding the target_include_directories in your CMake library allows to add the curlpp includes path to the compilation when you link against the library at target_link_libraries.

I let you know the change in case you want to incorporate it into your project.

Regards.

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 this pull request may close these issues.

1 participant