mirror of
https://github.com/x-tools-author/x-tools.git
synced 2025-09-15 15:28:40 +08:00
14 lines
588 B
CMake
14 lines
588 B
CMake
find_package(Qt${QT_VERSION_MAJOR} QUIET COMPONENTS SerialPort)
|
|
set(X_ENABLE_SERIALPORT ${Qt${QT_VERSION_MAJOR}SerialPort_FOUND})
|
|
if(X_ENABLE_SERIALPORT)
|
|
add_compile_definitions(X_ENABLE_SERIALPORT)
|
|
list(APPEND X_LIBS Qt${QT_VERSION_MAJOR}::SerialPort)
|
|
else()
|
|
message(STATUS "SerialPort module is disable, SerialPort files will be removed.")
|
|
file(GLOB_RECURSE SERIAL_PORT_FILES "${CMAKE_CURRENT_SOURCE_DIR}/src/serialport*")
|
|
foreach(file ${SERIAL_PORT_FILES})
|
|
list(REMOVE_ITEM X_SOURCES ${file})
|
|
message(STATUS "[SerialPort]Remove file: ${file}")
|
|
endforeach()
|
|
endif()
|