Skip to content

Commit

Permalink
fixes mavlink#9754
Browse files Browse the repository at this point in the history
- if gstreamer is not found but Microhard or Taisync is enabled
  issue an error message and cancel CMake generation
- exclude the target_link_libraries call if Microhard or Taisync
  is not enabled
- if Microhard or Taisync is enabled add compile definitions to
  enable #defines in the source code, else there are build errors
  • Loading branch information
kistlin authored and patrickelectric committed Jul 12, 2021
1 parent cb3bc26 commit 3da46a9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ if (GST_FOUND)

option(QGC_GST_MICROHARD_ENABLED "Enable microhard" OFF)
option(QGC_GST_TAISYNC_ENABLED "Enable taisyng" OFF)
else()
if (QGC_GST_MICROHARD_ENABLED OR QGC_GST_TAISYNC_ENABLED)
message(FATAL_ERROR "You tried to enable Microhard or Taisync but gstreamer is not found. Make sure to set PKG_CONFIG_EXECUTABLE and/or PKG_CONFIG_PATH properly.")
endif()
endif()

add_definitions(
Expand Down
10 changes: 8 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,14 @@ target_link_libraries(qgc
)

if(GST_FOUND)
target_link_libraries(qgc PUBLIC Microhard)
target_link_libraries(qgc PUBLIC Taisync)
if (${QGC_GST_MICROHARD_ENABLED})
target_compile_definitions(qgc PUBLIC QGC_GST_MICROHARD_ENABLED)
target_link_libraries(qgc PUBLIC Microhard)
endif()
if (${QGC_GST_TAISYNC_ENABLED})
target_compile_definitions(qgc PUBLIC QGC_GST_TAISYNC_ENABLED)
target_link_libraries(qgc PUBLIC Taisync)
endif()
endif()

if(BUILD_TESTING)
Expand Down

0 comments on commit 3da46a9

Please sign in to comment.