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

demo projects don't build #1582

Open
pptz opened this issue Apr 22, 2022 · 0 comments
Open

demo projects don't build #1582

pptz opened this issue Apr 22, 2022 · 0 comments

Comments

@pptz
Copy link

pptz commented Apr 22, 2022

Ubuntu 16. The problem during cmake stage is:

CMake Warning (dev) at CMakeLists.txt:18 (add_executable):
Policy CMP0028 is not set: Double colon in target name means ALIAS or
IMPORTED target. Run "cmake --help-policy CMP0028" for policy details.
Use the cmake_policy command to set the policy and suppress this warning.

Target "raw" links to target "Threads::Threads" but the target was not
found. Perhaps a find_package() call is missing for an IMPORTED target, or
an ALIAS target is missing?
This warning is for project developers. Use -Wno-dev to suppress it.

And building will fail.

The solution is to add to CMakeLists.txt:

set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)

For more: https://stackoverflow.com/questions/1620918/cmake-and-libpthread

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

1 participant