Add "optional static plugins" target to app description to make olsrd2 compile withou...
authorHenning Rogge <henning.rogge@fkie.fraunhofer.de>
Thu, 28 Jan 2016 08:20:19 +0000 (09:20 +0100)
committerHenning Rogge <henning.rogge@fkie.fraunhofer.de>
Thu, 28 Jan 2016 08:26:38 +0000 (09:26 +0100)
cmake/link_app.cmake
src-plugins/generic/nl80211_listener/CMakeLists.txt
src/dlep-radio/CMakeLists.txt
src/dlep-router/CMakeLists.txt
src/olsrd2/CMakeLists.txt
src/oonf/CMakeLists.txt

index 955d667..32196b4 100644 (file)
@@ -19,8 +19,10 @@ function (oonf_create_install_target name)
     ENDFOREACH(lib)     
 endfunction (oonf_create_install_target)
     
-function (oonf_create_app executable static_plugins)
-    message (STATUS "Static plugins for ${executable} app:")
+function (oonf_create_app executable static_plugins optional_static_plugins)
+    IF(VERBOSE)
+        message (STATUS "Static plugins for ${executable} app:")
+    ENDIF(VERBOSE)
 
     # standard static linked targets
     SET(OBJECT_TARGETS )
@@ -30,10 +32,20 @@ function (oonf_create_app executable static_plugins)
     # generate configuration file
     configure_file(${CMAKE_SOURCE_DIR}/src/app_data.c.in ${PROJECT_BINARY_DIR}/${executable}_app_data.c)
 
+    FOREACH(plugin ${optional_static_plugins})
+        IF(TARGET oonf_static_${plugin})
+            list (APPEND static_plugins ${plugin})
+        ELSE(TARGET oonf_static_${plugin})
+            message (STATUS "    Optional plugin ${plugin} is not available for executable ${executable}")
+        ENDIF(TARGET oonf_static_${plugin})
+    ENDFOREACH(plugin)
+
     # run through list of static plugins
     FOREACH(plugin ${static_plugins})
         IF(TARGET oonf_static_${plugin})
-            message (STATUS "    Found target: oonf_static_${plugin}")
+            IF(VERBOSE)
+                message (STATUS "    Found target: oonf_static_${plugin}")
+            ENDIF(VERBOSE)
 
             # Remember object targets for static plugin
             SET(OBJECT_TARGETS ${OBJECT_TARGETS} $<TARGET_OBJECTS:oonf_static_${plugin}>)
@@ -42,7 +54,9 @@ function (oonf_create_app executable static_plugins)
             get_property(value TARGET oonf_${plugin} PROPERTY LINK_LIBRARIES)
             FOREACH(lib ${value})
                 IF(NOT "${lib}" MATCHES "^oonf_")
-                    message (STATUS "        Library: ${lib}")
+                    IF(VERBOSE)
+                        message (STATUS "        Library: ${lib}")
+                    ENDIF(VERBOSE)
                     SET(EXTERNAL_LIBRARIES ${EXTERNAL_LIBRARIES} ${lib})
                 ENDIF()
             ENDFOREACH(lib)
index 5bdd802..cecd330 100644 (file)
@@ -4,7 +4,11 @@ INCLUDE(FindPkgConfig)
 
 pkg_check_modules(LIBNL3 libnl-tiny)
 if (NOT LIBNL3_FOUND)
-    pkg_check_modules(LIBNL3 libnl-genl-3.0)
+    pkg_check_modules(LIBNL3_GENL libnl-genl-3.0)
+    pkg_check_modules(LIBNL3 libnl-3.0)
+    if (NOT LIBNL3_GENL_FOUND)
+        set (LIBNL3_FOUND false)
+    endif (NOT LIBNL3_GENL_FOUND)
 endif(NOT LIBNL3_FOUND)
 
 if (LIBNL3_FOUND)
index decbccf..9e7b90d 100644 (file)
@@ -43,15 +43,18 @@ IF (NOT OONF_STATIC_PLUGINS)
                              os_system
                              cfg_compact
                              layer2info
-                             nl80211_listener
                              systeminfo
                              dlep_radio
                              )
 ENDIF (NOT OONF_STATIC_PLUGINS)
 
+IF (NOT OONF_OPTIONAL_STATIC_PLUGINS)
+    set (OONF_OPTIONAL_STATIC_PLUGINS nl80211_listener)
+ENDIF (NOT OONF_OPTIONAL_STATIC_PLUGINS)
+
 ##################################
 #### link framework libraries ####
 ##################################
 
 include(../../cmake/link_app.cmake)
-oonf_create_app("${OONF_EXE}" "${OONF_STATIC_PLUGINS}")
+oonf_create_app("${OONF_EXE}" "${OONF_STATIC_PLUGINS}" "${OONF_OPTIONAL_STATIC_PLUGINS}")
index 1e7faf6..002e101 100644 (file)
@@ -53,4 +53,4 @@ ENDIF (NOT OONF_STATIC_PLUGINS)
 ##################################
 
 include(../../cmake/link_app.cmake)
-oonf_create_app("${OONF_EXE}" "${OONF_STATIC_PLUGINS}")
+oonf_create_app("${OONF_EXE}" "${OONF_STATIC_PLUGINS}" "${OONF_OPTIONAL_STATIC_PLUGINS}")
index 4d1064c..8ef1a04 100644 (file)
@@ -46,7 +46,6 @@ IF (NOT OONF_STATIC_PLUGINS)
                              os_system
                              cfg_compact
                              layer2info
-                             nl80211_listener
                              systeminfo
                              nhdp
                              ff_dat_metric
@@ -61,9 +60,14 @@ IF (NOT OONF_STATIC_PLUGINS)
                              )
 ENDIF (NOT OONF_STATIC_PLUGINS)
 
+
+IF (NOT OONF_OPTIONAL_STATIC_PLUGINS)
+    set (OONF_OPTIONAL_STATIC_PLUGINS nl80211_listener)
+ENDIF (NOT OONF_OPTIONAL_STATIC_PLUGINS)
+
 ##################################
 #### link framework libraries ####
 ##################################
 
 include(../../cmake/link_app.cmake)
-oonf_create_app("${OONF_EXE}" "${OONF_STATIC_PLUGINS}")
+oonf_create_app("${OONF_EXE}" "${OONF_STATIC_PLUGINS}" "${OONF_OPTIONAL_STATIC_PLUGINS}")
index 394a634..57ea024 100644 (file)
@@ -30,9 +30,13 @@ IF (NOT OONF_STATIC_PLUGINS)
     set (OONF_STATIC_PLUGINS cfg_compact)
 ENDIF (NOT OONF_STATIC_PLUGINS)
 
+IF (NOT OONF_OPTIONAL_STATIC_PLUGINS)
+    set (OONF_OPTIONAL_STATIC_PLUGINS "")
+ENDIF (NOT OONF_OPTIONAL_STATIC_PLUGINS)
+
 ##################################
 #### link framework libraries ####
 ##################################
 
 include(../../cmake/link_app.cmake)
-oonf_create_app("${OONF_EXE}" "${OONF_STATIC_PLUGINS}")
+oonf_create_app("${OONF_EXE}" "${OONF_STATIC_PLUGINS}" "${OONF_OPTIONAL_STATIC_PLUGINS}")