From e630bc4be7de839113feaf082ed8efce14ed11f8 Mon Sep 17 00:00:00 2001
From: James Turner <zakalawe@mac.com>
Date: Mon, 18 Dec 2017 18:22:44 +0000
Subject: [PATCH] Make HID-Input test also conditional

Forgot to wrap this in the relevant CMake test, causing non-HID-input
builds to erroneously fail.
---
 src/Input/CMakeLists.txt | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/Input/CMakeLists.txt b/src/Input/CMakeLists.txt
index 0e0235391..9d8926e96 100644
--- a/src/Input/CMakeLists.txt
+++ b/src/Input/CMakeLists.txt
@@ -70,12 +70,14 @@ if(ENABLE_JS_DEMO)
     install(TARGETS js_demo RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
 endif()
 
-if (COMMAND flightgear_test)
-	set(HID_INPUT_TEST_SOURCES test_hidinput.cxx FGEventInput.cxx 
-		FGCommonInput.cxx FGDEviceConfigurationMap.cxx)
+if (ENABLE_HID_INPUT)
+	if (COMMAND flightgear_test)
+		set(HID_INPUT_TEST_SOURCES test_hidinput.cxx FGEventInput.cxx 
+			FGCommonInput.cxx FGDEviceConfigurationMap.cxx)
 
-	flightgear_test(hidinput "${HID_INPUT_TEST_SOURCES}")
-	target_link_libraries(hidinput ${EVENT_INPUT_LIBRARIES} hidapi)	
+		flightgear_test(hidinput "${HID_INPUT_TEST_SOURCES}")
+		target_link_libraries(hidinput ${EVENT_INPUT_LIBRARIES} hidapi)	
+	endif()
 endif()
 
 flightgear_component(Input "${SOURCES}" "${HEADERS}")