@@ -9,28 +9,50 @@ set(CMAKE_CXX_STANDARD 20)
99set (CMAKE_CXX_STANDARD_REQUIRED ON )
1010set (CMAKE_CXX_EXTENSIONS OFF )
1111
12+ # Collocate all built executables (roqr-relayd, roqr-ingest, roqr-egress,
13+ # roqr-duplex, test binaries) in a single directory so tooling (e.g. the
14+ # ffmpeg e2e test) can find the gateway trio via one bin dir.
15+ set (CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR } /bin" )
16+
1217list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR } /cmake" )
1318
1419option (ROQR_BUILD_TESTS "Build unit tests" ON )
1520option (ROQR_BUILD_QUIC "Build the picoquic transport (needs picoquic)" OFF )
1621option (ROQR_BUILD_TOOLS "Build tools (roqr-relayd; needs ROQR_BUILD_QUIC)" OFF )
1722option (ROQR_BUILD_RTMP "Build the RTMP/AMF gateway module" ON )
23+ option (ROQR_BUILD_EXAMPLES "Build gateway library and example apps" ON )
1824
1925add_subdirectory (core )
2026
2127if (ROQR_BUILD_RTMP)
2228 add_subdirectory (rtmp )
2329endif ()
2430
31+ # The gateway library is needed by both the example binaries and the
32+ # relay's Media mode, so build it whenever its dependencies are present.
33+ if (ROQR_BUILD_QUIC AND ROQR_BUILD_RTMP)
34+ add_subdirectory (gateway )
35+ endif ()
36+
37+ if (ROQR_BUILD_EXAMPLES)
38+ if (NOT ROQR_BUILD_QUIC OR NOT ROQR_BUILD_RTMP)
39+ message (FATAL_ERROR "ROQR_BUILD_EXAMPLES requires ROQR_BUILD_QUIC and ROQR_BUILD_RTMP" )
40+ endif ()
41+ if (ROQR_BUILD_TESTS AND NOT ROQR_BUILD_TOOLS)
42+ message (FATAL_ERROR "ROQR_BUILD_EXAMPLES with ROQR_BUILD_TESTS requires ROQR_BUILD_TOOLS" )
43+ endif ()
44+ add_subdirectory (examples )
45+ endif ()
46+
2547if (ROQR_BUILD_QUIC)
2648 find_package (Picoquic REQUIRED )
2749 find_package (OpenSSL REQUIRED )
2850 add_subdirectory (quic )
2951endif ()
3052
3153if (ROQR_BUILD_TOOLS)
32- if (NOT ROQR_BUILD_QUIC)
33- message (FATAL_ERROR "ROQR_BUILD_TOOLS requires ROQR_BUILD_QUIC=ON " )
54+ if (NOT ROQR_BUILD_QUIC OR NOT ROQR_BUILD_RTMP )
55+ message (FATAL_ERROR "ROQR_BUILD_TOOLS requires ROQR_BUILD_QUIC and ROQR_BUILD_RTMP " )
3456 endif ()
3557 add_subdirectory (tools/relayd )
3658endif ()
0 commit comments