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

FindCheck.cmake is not consistent with check.pc #236

Closed
dernasherbrezon opened this issue Dec 20, 2019 · 3 comments
Closed

FindCheck.cmake is not consistent with check.pc #236

dernasherbrezon opened this issue Dec 20, 2019 · 3 comments

Comments

@dernasherbrezon
Copy link

dernasherbrezon commented Dec 20, 2019

FindCheck.cmake has only "check" library:

FIND_LIBRARY( CHECK_LIBRARIES NAMES check )

While check.pc can have "m", "rt", "pthread":

set(LIBS "${LIBS} -lm")

Actually seeing 2 issues here:

  1. Linking with the static libcheck is failing. See Building example throws undefined references #156 I guess "m" and "pthread" libraries are actually mandatory.
  2. Two places where lib dependencies defined for cmake. Is it possible to drop handcrafted search from FindCheck.cmake and rely only on pkg-config results? Or remove pkg-config from dependencies and rely purely on CMake's find_package?
@mikkoi
Copy link
Contributor

mikkoi commented Dec 20, 2019

Are you using the newest check version 0.13.0?
If so, you do not need FindCheck.cmake at all. Commit 56c347d contains instructions. They are missing from the example project at the moment.

In general, when working with CMake projects (using one from another) it is better to not use pkg-config. Pkg-config is mostly used when operating with GNU Autotools, or plain makefiles.

@dernasherbrezon
Copy link
Author

Got it.

I tried to re-build my project in Ubuntu 18.04. This is LTE Ubuntu and they have only check version 0.10.x

@mikkoi
Copy link
Contributor

mikkoi commented Dec 20, 2019

Can you download from repo and build yourself?
Just build in your homedir and do not install at all, i.e. just run cmake && make, not make install. CMake will then add the project to the user local package registry: ~/.cmake/packages/check. Then find_package() will find it even without it having been installed.
For the older Check versions, FindPackage is necessary. Sorry.

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

2 participants