From 07d7d813e1e3698c68d2661dfb6994fbad56a006 Mon Sep 17 00:00:00 2001 From: Andinet Enquobahrie <andinet.enqu@kitware.com> Date: Fri, 27 Jul 2018 12:04:12 -0400 Subject: [PATCH] PERF: when iMSTK used by external application, useful error message generated when necessary libraries are not found --- CMake/FindVRPN.cmake | 3 +++ CMake/Findg3log.cmake | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CMake/FindVRPN.cmake b/CMake/FindVRPN.cmake index 99f1d2cb2..68fd6f03b 100644 --- a/CMake/FindVRPN.cmake +++ b/CMake/FindVRPN.cmake @@ -134,6 +134,9 @@ if(WIN32) NAMES setupapi ) + if(NOT HIDAPI_LIBRARY) + message(FATAL_ERROR "hidapi library not found") + endif() elseif(APPLE) find_library(MACHID_CoreFoundation_LIBRARY CoreFoundation) find_library(MACHID_IOKit_LIBRARY IOKit) diff --git a/CMake/Findg3log.cmake b/CMake/Findg3log.cmake index da6f1fd79..e62d42bc2 100644 --- a/CMake/Findg3log.cmake +++ b/CMake/Findg3log.cmake @@ -5,6 +5,11 @@ if(WIN32) find_library(DbgHelp_LIBRARY NAMES DbgHelp) endif() +if(NOT DbgHelp_LIBRARY) + message(FATAL_ERROR "DbgHelp library not found") +endif() + + #----------------------------------------------------------------------------- # Find path #----------------------------------------------------------------------------- @@ -14,7 +19,6 @@ find_path(g3log_INCLUDE_DIR g3log/logworker.hpp ) mark_as_advanced(g3log_INCLUDE_DIR) -#message(STATUS "g3log_INCLUDE_DIR : ${g3log_INCLUDE_DIR}") #----------------------------------------------------------------------------- # Find library @@ -25,7 +29,6 @@ find_library(g3log_LIBRARY g3logger ) mark_as_advanced(g3log_LIBRARY) -#message(STATUS "g3log_LIBRARY : ${g3log_LIBRARY}") set(g3log_LIBRARIES ${g3log_LIBRARY} ${DbgHelp_LIBRARY}) -- GitLab