no message
parent
d24267b620
commit
da25df7311
|
@ -1,31 +1,52 @@
|
||||||
cmake_minimum_required(VERSION 3.5)
|
cmake_minimum_required(VERSION 3.5)
|
||||||
|
|
||||||
message("configure qsswraper for " ${PROJECT_NAME})
|
set(PUBLIC_HEADERS ${CMAKE_CURRENT_LIST_DIR}/qextserialport.h
|
||||||
|
${CMAKE_CURRENT_LIST_DIR}/qextserialenumerator.h
|
||||||
message("system name is " ${CMAKE_SYSTEM_NAME})
|
${CMAKE_CURRENT_LIST_DIR}/qextserialport_global.h
|
||||||
|
|
||||||
set(PWD ${CMAKE_CURRENT_LIST_DIR})
|
|
||||||
|
|
||||||
set(PUBLIC_HEADERS ${PWD}/qextserialport.h
|
|
||||||
${PWD}/qextserialenumerator.h
|
|
||||||
${PWD}/qextserialport_global.h
|
|
||||||
)
|
)
|
||||||
|
list(APPEND EXTSERIAL_HEADERS
|
||||||
set(HEADERS $$PUBLIC_HEADERS
|
${PUBLIC_HEADERS}
|
||||||
$$PWD/qextserialport_p.h
|
${CMAKE_CURRENT_LIST_DIR}/qextserialport_p.h
|
||||||
$$PWD/qextserialenumerator_p.h
|
${CMAKE_CURRENT_LIST_DIR}/qextserialenumerator_p.h
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
set(SOURCES
|
list(APPEND EXTSERIAL_SOURCES
|
||||||
$$PWD/qextserialport.cpp
|
${CMAKE_CURRENT_LIST_DIR}/qextserialport.cpp
|
||||||
$$PWD/qextserialenumerator.cpp)
|
${CMAKE_CURRENT_LIST_DIR}/qextserialenumerator.cpp
|
||||||
|
)
|
||||||
|
|
||||||
IF (CMAKE_SYSTEM_NAME MATCHES "Linux")
|
IF (CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||||
|
list(APPEND EXTSERIAL_SOURCES ${CMAKE_CURRENT_LIST_DIR}/qextserialport_unix.cpp)
|
||||||
|
list(APPEND EXTSERIAL_SOURCES ${CMAKE_CURRENT_LIST_DIR}/qextserialenumerator_linux.cpp)
|
||||||
|
|
||||||
ELSEIF (CMAKE_SYSTEM_NAME MATCHES "Windows")
|
ELSEIF (CMAKE_SYSTEM_NAME MATCHES "Windows")
|
||||||
|
list(APPEND EXTSERIAL_SOURCES ${CMAKE_CURRENT_LIST_DIR}/qextserialport_win.cpp)
|
||||||
|
list(APPEND EXTSERIAL_SOURCES ${CMAKE_CURRENT_LIST_DIR}/qextserialenumerator_win.cpp)
|
||||||
|
|
||||||
|
link_libraries(setupapi advapi32 user32)
|
||||||
ELSEIF (CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
|
ELSEIF (CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
|
||||||
|
|
||||||
ELSE ()
|
ENDIF()
|
||||||
|
|
||||||
|
QT5_WRAP_CPP(EXTSERIAL_MOC_SOURCE ${EXTSERIAL_SOURCES} ) # moc预编译代码
|
||||||
|
QT5_WRAP_CPP(EXTSERIAL_MOC_HEADER ${EXTSERIAL_HEADERS} ) # moc预编译代码
|
||||||
|
|
||||||
|
|
||||||
|
list(APPEND MOC ${EXTSERIAL_MOC_SOURCE})
|
||||||
|
list(APPEND SOURCES ${EXTSERIAL_SOURCES})
|
||||||
|
|
||||||
|
|
||||||
|
FOREACH(list ${EXTSERIAL_MOC_SOURCE})
|
||||||
|
get_filename_component(BIN_PATH ${list} "DIRECTORY" )
|
||||||
|
message("EXTSERIAL_MOC_SOURCE file" ${list})
|
||||||
|
ENDFOREACH(list)
|
||||||
|
|
||||||
|
FOREACH(list ${EXTSERIAL_MOC_HEADER})
|
||||||
|
message("EXTSERIAL_MOC_HEADER file " ${list})
|
||||||
|
ENDFOREACH(list)
|
||||||
|
|
||||||
|
message("EXTSERIAL_MOC_SOURCE file " ${BIN_PATH})
|
||||||
|
include_directories(${BIN_PATH})
|
||||||
|
include_directories(${CMAKE_CURRENT_LIST_DIR})
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue