Skip to content

Commit

Permalink
Instructions how to import into CMake 3 project
Browse files Browse the repository at this point in the history
Signed-off-by: Mikko Johannes Koivunalho <mikko.koivunalho@iki.fi>
  • Loading branch information
mikkoi committed May 12, 2019
1 parent c22a491 commit 56c347d
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions doc/check.texi
Original file line number Diff line number Diff line change
Expand Up @@ -2241,6 +2241,30 @@ Officially CMake is supported only for Windows.
Documentation for using CMake is forthcoming. In the meantime, look
at the example CMake project in Check's @file{doc/examples} directory.

If you are using CMake version 3 or above, importing Check into your project
is easier than in earlier versions. If you have installed Check
as a CMake library, you should have the following files:

@verbatim
${INSTALL_PREFIX}/lib/cmake/check/check-config.cmake and
${INSTALL_PREFIX}/lib/cmake/check/check-config-version.cmake and
@end verbatim

If you haven't installed Check into a system directory, you have to tell
your CMake build how to find it:

@verbatim
cmake -Dcheck_ROOT=${INSTALL_PREFIX}
Then use Check in your @file{CMakeLists.txt} like this:
@verbatim
find_package(check <check_version if wanted> REQUIRED CONFIG)
add_executable(myproj.test myproj.test.c)
target_link_libraries(myproj.test Check::check)
add_test(NAME MyProj COMMAND myproj.test)
@end verbatim
@node Conclusion and References, Environment Variable Reference, Supported Build Systems, Top
Expand Down

0 comments on commit 56c347d

Please sign in to comment.