From e526d2479727b4ad3f2c22f6778e1cfb103c1f10 Mon Sep 17 00:00:00 2001 From: Olivier Stasse Date: Tue, 9 Jun 2020 05:28:17 +0200 Subject: [PATCH] Fix isssue #398 Do not call INSTALL(EXPORT ...) when having no targets but generates the Config.cmake file. --- package-config.cmake | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/package-config.cmake b/package-config.cmake index b89d7038a..60f513444 100644 --- a/package-config.cmake +++ b/package-config.cmake @@ -168,9 +168,12 @@ install( # Config # * /lib/cmake/Foo/FooTargets.cmake -install( +if(${TARGETS_EXPORT_NAME}) + install( EXPORT "${TARGETS_EXPORT_NAME}" NAMESPACE "${namespace}" DESTINATION "${CONFIG_INSTALL_DIR}" -) + ) +endif(${TARGETS_EXPORT_NAME}) + ENDMACRO(SETUP_PROJECT_PACKAGE_FINALIZE)