-
Notifications
You must be signed in to change notification settings - Fork 58
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
Please add cmake examples #204
Comments
Not precisely obvious, but it is created as a side product of vala. It should definitely be there after you build and install.
How about: find_package(PkgConfig REQUIRED)
pkg_check_modules(UMOCKDEV REQUIRED IMPORTED_TARGET GLOBAL umockdev-1.0)
add_executable(battery battery.c)
target_link_libraries(battery PkgConfig::UMOCKDEV) FetchContent won't work -- that is cmake-exclusive. You can use ExternalProject instead, and define custom build/install commands, before running pkg_check_modules. (The pkg-config search path will be automatically populated with cmake's prefix path.) |
Note that I don't know CMake, sorry. I am not going to create documentation for all the C build systems in the world, that would be redundant. If someone wants to use umockdev from a CMake project, they would already know how to use it. It's a standard shared library plus header file, there is nothing special about it. |
(No. Actually, cmake users most frequently do NOT know how to use standard mechanisms such as pkg-config, because cmake discourages you from using it and suggests instead that projects write their own Turing-complete script which heuristically walks the filesystem looking for your library and header by name, and include that script in their own project. That being said I'm not suggesting you be responsible to document it.) |
@eli-schwartz : Ugh, I'm sorry to hear. Well, I'm happy to review PRs against the README, but I'm afraid I can't give any advice myself. |
Retitling and added "help-wanted". I'm not going to do this myself. |
I'm trying to use umockdev for some regression tests, but I am having a difficult time. Where is
umockdev.h
? I tried manually building withmeson
, thinking that would generate the header, but that still did not produce the header (at least anywherefind . -name umockdev.h
would find it). Am I missing something obvious?Documentation on how to include umockdev using CMake would be ideal. Something like:
The text was updated successfully, but these errors were encountered: