1
0
mirror of https://github.com/wjwwood/serial.git synced 2026-01-22 03:34:53 +08:00

Merge pull request #1 from DaAwesomeP/DaAwesomeP-cmake-optional-example

Make example optional in CMake
This commit is contained in:
Cazadorro 2023-08-14 14:08:33 -05:00 committed by GitHub
commit c7281603cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -65,10 +65,12 @@ else()
target_link_libraries(${PROJECT_NAME} setupapi)
endif()
## Uncomment for example
add_executable(serial_example examples/serial_example.cc)
add_dependencies(serial_example ${PROJECT_NAME})
target_link_libraries(serial_example ${PROJECT_NAME})
option(SERIAL_ENABLE_EXAMPLE "Enable example" ON)
if(${SERIAL_ENABLE_EXAMPLE})
add_executable(serial_example examples/serial_example.cc)
add_dependencies(serial_example ${PROJECT_NAME})
target_link_libraries(serial_example ${PROJECT_NAME})
endif()