I am using RtMidi as a git submodule inside a project, I've coded the build system with cmake, but I want to disable RtMidi Examples to build within my project, I've found the lines inside the rtmidi/CMakeLists.txt that enable building the examples.
option(RTMIDI_BUILD_TESTING "Build test programs" ON)
if (NOT DEFINED RTMIDI_BUILD_TESTING OR RTMIDI_BUILD_TESTING STREQUAL "")
set(RTMIDI_BUILD_TESTING ${BUILD_TESTING})
endif()
if (RTMIDI_BUILD_TESTING)
#Examples are built here
endif()
I think there is no way of building without the examples because the second line on the code above, any thoughts?
rtmidi sets the minimum CMake version to 3.10, but sane option()
behavior (honoring set()
) wasn't introduced until 3.13.
No problem, just define the option to OFF
before it gets the chance.
option(RTMIDI_BUILD_TESTING "Build test programs" OFF)
add_subdirectory(rtmidi)