build: avoid error of Pleora isn't installed

Closes #16
This commit is contained in:
Joshua M. Doe 2020-04-14 11:24:14 -04:00
parent ef66205b40
commit 529d5788f9

View File

@ -40,6 +40,7 @@ find_library (Pleora_LIBRARY_DEVICE PvDevice${_LIB_SUFFIX} ${Pleora_LIBRARY_DIR}
set (Pleora_LIBRARIES ${Pleora_LIBRARY_BASE} ${Pleora_LIBRARY_DEVICE})
if (Pleora_INCLUDE_DIR)
file(STRINGS "${Pleora_INCLUDE_DIR}/PvVersion.h" _pleora_VERSION_CONTENTS REGEX "#define NVERSION_STRING")
if ("${_pleora_VERSION_CONTENTS}" MATCHES "#define NVERSION_STRING[ \t]+\"([0-9]+)\\.([0-9]+)\\.([0-9]+)\\.([0-9]+)+")
set(Pleora_VERSION_MAJOR "${CMAKE_MATCH_1}")
@ -51,6 +52,7 @@ if ("${_pleora_VERSION_CONTENTS}" MATCHES "#define NVERSION_STRING[ \t]+\"([0-9]
set(Pleora_VERSION ${Pleora_VERSION_STRING})
message(STATUS "Found Pleora version: ${Pleora_VERSION_STRING}")
endif ()
endif ()
include (FindPackageHandleStandardArgs)
find_package_handle_standard_args (Pleora