cmake: qnx adaptations

    https://github.com/warmcat/libwebsockets/issues/2034
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 77edb13..565f453 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -539,7 +539,7 @@
 	list(APPEND LIB_LIST_AT_END "${ZLIB_LIBRARIES}")
 endif()
 
-if (LWS_WITH_PLUGINS_API AND UNIX)
+if (LWS_WITH_PLUGINS_API AND UNIX AND NOT (${CMAKE_SYSTEM_NAME} MATCHES "QNX"))
 	list(APPEND LIB_LIST_AT_END "dl")
 endif()
 
@@ -612,7 +612,9 @@
 		if (COMPILER_IS_CLANG)
 			set(LWS_PTHR_FLAGS "-pthread")# -Wno-error=unused-command-line-argument")
 		else()
-			set(LWS_PTHR_FLAGS "-pthread")
+			if (NOT (${CMAKE_SYSTEM_NAME} MATCHES "QNX"))
+				set(LWS_PTHR_FLAGS "-pthread")
+			endif()
 		endif()
 	
 		#		set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${LWS_PTHR_FLAGS})
@@ -714,7 +716,7 @@
 endif ()
 
 if ((CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) AND NOT LWS_WITHOUT_TESTAPPS)
-	if (UNIX AND LWS_HAVE_PTHREAD_H)
+	if (UNIX AND LWS_HAVE_PTHREAD_H AND NOT (${CMAKE_SYSTEM_NAME} MATCHES "QNX"))
 	# jeez clang understands -pthread but dies if he sees it at link time!
 	# http://stackoverflow.com/questions/2391194/what-is-gs-pthread-equiv-in-clang
 	set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread" )
diff --git a/lib/tls/CMakeLists.txt b/lib/tls/CMakeLists.txt
index dffa70b..dc038ed 100644
--- a/lib/tls/CMakeLists.txt
+++ b/lib/tls/CMakeLists.txt
@@ -275,7 +275,7 @@
 if (DEFINED LIB_LIST)
 	set(CMAKE_REQUIRED_LIBRARIES ${LIB_LIST})
 endif()
-if (UNIX)
+if (UNIX AND NOT (${CMAKE_SYSTEM_NAME} MATCHES "QNX"))
 	set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} dl)
 endif()