mirror of
https://github.com/wjwwood/serial.git
synced 2026-01-22 19:54:57 +08:00
make example optional in CMake
This commit is contained in:
parent
a59a81fd82
commit
bda4ba7f1e
@ -65,10 +65,12 @@ else()
|
|||||||
target_link_libraries(${PROJECT_NAME} setupapi)
|
target_link_libraries(${PROJECT_NAME} setupapi)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
## Uncomment for example
|
option(SERIAL_ENABLE_EXAMPLE "Enable example" ON)
|
||||||
add_executable(serial_example examples/serial_example.cc)
|
if(${SERIAL_ENABLE_EXAMPLE})
|
||||||
add_dependencies(serial_example ${PROJECT_NAME})
|
add_executable(serial_example examples/serial_example.cc)
|
||||||
target_link_libraries(serial_example ${PROJECT_NAME})
|
add_dependencies(serial_example ${PROJECT_NAME})
|
||||||
|
target_link_libraries(serial_example ${PROJECT_NAME})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user