# A consumer of the *installed* package, not of the build tree. # # The test suite links the build tree, so it says nothing about whether an # installed libakstdlib is usable -- and the two have come apart before. This is # the smallest thing that exercises the paths only an install has: the version # file (find_package with a version request), akstdlibConfig.cmake's # find_dependency(akerror), and the exported akstdlib::akstdlib target. # # Configured standalone against CMAKE_PREFIX_PATH rather than being part of the # main build, because being part of the main build is exactly what would let it # pass without testing anything. cmake_minimum_required(VERSION 3.10) project(akstdlib_consumer LANGUAGES C) # A version request, so akstdlibConfigVersion.cmake has to be present and has to # agree. Deliberately MAJOR.MINOR rather than the full version: that is the # compatibility promise the soname makes, so it is the one worth asserting. find_package(akstdlib 0.2 REQUIRED) add_executable(consumer main.c) target_link_libraries(consumer PRIVATE akstdlib::akstdlib)