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

Usage as git submodule with cmake #356

Closed
maxbachmann opened this issue Nov 7, 2021 · 2 comments
Closed

Usage as git submodule with cmake #356

maxbachmann opened this issue Nov 7, 2021 · 2 comments

Comments

@maxbachmann
Copy link
Contributor

Whats the correct way to use taskflow as git submodule. I tried to use it in the following way:

set(TF_BUILD_CUDA OFF CACHE BOOL "Enables build of CUDA code")
set(TF_BUILD_TESTS OFF CACHE BOOL "Enables build of tests")
set(TF_BUILD_EXAMPLES OFF CACHE BOOL "Enables build of examples")

add_subdirectory(extern/taskflow)
...
target_link_libraries(target tf::default_settings)

However this fails when compiling with the error:

fatal error: taskflow/taskflow.hpp: No such file or directory
      4 | #include <taskflow/taskflow.hpp>

I could not find any documentation on how to add taskflow as a submodule.

Since taskflow is header only I am currently working around this by using

set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
...
target_include_directories(target PRIVATE extern/taskflow/)
target_link_libraries(target Threads::Threads)
@burgholzer
Copy link
Contributor

You should be able to just link to the Taskflow CMake target after adding the subdirectory:

target_link_libraries(${PROJECT_NAME} PUBLIC Taskflow)

@maxbachmann
Copy link
Contributor Author

Thanks @burgholzer. This works as expected 👍

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

No branches or pull requests

3 participants