]> git.mxchange.org Git - flightgear.git/blobdiff - CMakeModules/FindPLIB.cmake
Fix finding ATIS CommStation
[flightgear.git] / CMakeModules / FindPLIB.cmake
index c92f139b07118aeb47b3f362cd8271fea6e47dd1..da5463612aaf72eb7dec88449058e8195979a2fb 100644 (file)
@@ -125,7 +125,7 @@ if(${PLIB_LIBRARIES} STREQUAL "PLIB_LIBRARIES-NOTFOUND")
     set(PLIB_LIBRARIES "") # clear value
     
 # based on the contents of deps, add other required PLIB
-# static library dependencies. Eg PUI requires SSG and FNT
+# static library dependencies. Eg PUI requires FNT
     set(outDeps ${PLIB_FIND_COMPONENTS})
     
     foreach(c ${PLIB_FIND_COMPONENTS})
@@ -133,9 +133,9 @@ if(${PLIB_LIBRARIES} STREQUAL "PLIB_LIBRARIES-NOTFOUND")
             # handle MSVC confusion over pu/pui naming, by removing
             # 'pu' and then adding it back
             list(REMOVE_ITEM outDeps "pu")
-            list(APPEND outDeps ${PUNAME} "fnt" "ssg" "sg")
+            list(APPEND outDeps ${PUNAME} "fnt" "sg")
         elseif (${c} STREQUAL "puaux")
-            list(APPEND outDeps ${PUNAME} "fnt" "ssg" "sg")
+            list(APPEND outDeps ${PUNAME} "fnt" "sg")
         elseif (${c} STREQUAL "ssg")
             list(APPEND outDeps "sg")
         endif()
@@ -152,6 +152,30 @@ if(${PLIB_LIBRARIES} STREQUAL "PLIB_LIBRARIES-NOTFOUND")
     endforeach()
 endif()
 
+list(FIND outDeps "js" haveJs)
+if(${haveJs} GREATER -1)
+    message(STATUS "adding runtime JS dependencies")
+    if(APPLE)
+    # resolve frameworks to full paths
+        find_library(IOKIT_LIBRARY IOKit)
+        find_library(CF_LIBRARY CoreFoundation)
+        set(JS_LIBS ${IOKIT_LIBRARY} ${CF_LIBRARY})
+    elseif(WIN32)
+        set(WINMM_LIBRARY winmm)
+        set(JS_LIBS ${WINMM_LIBRARY})
+    elseif(CMAKE_SYSTEM_NAME MATCHES "Linux")
+        # anything needed here?
+    elseif(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
+        find_library(USBHID_LIBRARY usbhid)
+        # check_function_exists(hidinit)
+        set(JS_LIBS ${USBHID_LIBRARY})
+    else()
+        message(WARNING "Unsupported platform for PLIB JS libs")
+    endif()
+    
+    list(APPEND PLIB_LIBRARIES ${JS_LIBS})
+endif()
+
 include(FindPackageHandleStandardArgs)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(PLIB DEFAULT_MSG PLIB_LIBRARIES PLIB_INCLUDE_DIR)