only use add_package when VERSION is present (#16)

This commit is contained in:
Lars Melchior
2019-04-15 14:22:43 +02:00
committed by GitHub
parent 3e65078ce7
commit f2ad294ef3

View File

@@ -63,7 +63,7 @@ function(CPMAddPackage)
endforeach()
endif()
if (NOT ${CPM_REMOTE_PACKAGES_ONLY})
if (CPM_ARGS_VERSION AND NOT ${CPM_REMOTE_PACKAGES_ONLY})
find_package(${CPM_ARGS_NAME} ${CPM_ARGS_VERSION} QUIET)
set(CPM_PACKAGE_FOUND ${CPM_ARGS_NAME}_FOUND)