Use target definitions generated by cmake
Compare changes
Files
2+ 3
− 3
@@ -85,10 +85,10 @@ add_library(CrestApiLib SHARED ${SOURCES} ${HEADERS})
Instead of the manual definition of an imported target, just use the one that CMake has generated.
The namespace of the exported targets is set to CrestApiLib::
so the final target name is the same as before. Unlike the hand made version it has all the correct dependencies and other properties like include paths.
find_dependency() has to be called in the CrestApiLibConfig.cmake file before including the generated targets (the QUIET and REQUIRED options are automatically forwarded, so no need to specify them).