...CONFIG -= debug_and_release debug......OBJECTS_DIR = build/objMOC_DIR = build/moc...win32 { SOURCES += xyz.cpp}unix { SOURCES += zyx.cpp}
project( SerialDeviceWatcher )cmake_minimum_required( VERSION 2.6.0 )set(TARGET "qserialdevicewatcher" CACHE string "Name of the library")set( OPTIMIZATION_FLAGS "-O2" )set( SERIALDEVICEWATCHER_SRCS serialdevicewatcher.cpp serialdevicewatcher_p_win.cpp)set( SERIALDEVICEWATCHER_MOC_HDRS serialdevicewatcher.h serialdevicewatcher_p.h )find_package( Qt4 REQUIRED )include( ${QT_USE_FILE} )set( QT_DONT_USE_QTGUI ) #qt4_wrap_cpp( SERIALDEVICEWATCHER_MOC_SOURCES ${SERIALDEVICEWATCHER_SRCS} )qt4_automoc ( ${SERIALDEVICEWATCHER_SRCS} ${SERIALDEVICEWATCHER_MOC_HDRS} ) add_definitions( -Wall -DQT_NO_DEBUG ${OPTIMIZATION_FLAGS} ${QT_DEFINITIONS})#include_directories(# ${QT_INCLUDES}# ${QT_INCLUDE_DIR}# ${CMAKE_BINARY_DIR}# .#)add_library( ${TARGET} STATIC ${SERIALDEVICEWATCHER_SRCS} )TARGET_LINK_LIBRARIES( ${TARGET} ${QT_LIBRARIES})
project( SerialDeviceWatcher )cmake_minimum_required( VERSION 2.6.0 )set(TARGET "qserialdevicewatcher" CACHE string "Name of the library")set( OPTIMIZATION_FLAGS "-O2" )set( SERIALDEVICEWATCHER_SRCS serialdevicewatcher.cpp serialdevicewatcher_p_win.cpp)set( SERIALDEVICEWATCHER_MOC_HDRS serialdevicewatcher.h serialdevicewatcher_p.h )find_package( Qt4 REQUIRED )include( ${QT_USE_FILE} )set( QT_DONT_USE_QTGUI ) qt4_wrap_cpp( SERIALDEVICEWATCHER_MOC_SOURCES ${SERIALDEVICEWATCHER_MOC_HDRS} ) # <<<<<<#qt4_automoc ( ${SERIALDEVICEWATCHER_SRCS} ${SERIALDEVICEWATCHER_MOC_HDRS} ) add_definitions( -Wall -DQT_NO_DEBUG ${OPTIMIZATION_FLAGS} ${QT_DEFINITIONS})#include_directories(# ${QT_INCLUDES}# ${QT_INCLUDE_DIR}# ${CMAKE_BINARY_DIR}# .#)add_library( ${TARGET} STATIC ${SERIALDEVICEWATCHER_SRCS} ${SERIALDEVICEWATCHER_MOC_SOURCES} # <<<<<<<<<<)TARGET_LINK_LIBRARIES( ${TARGET} ${QT_LIBRARIES})
#project( SerialDeviceWatcher )cmake_minimum_required( VERSION 2.6.0 )set(TARGET "qserialdevicewatcher" CACHE string "Name of the library")set( OPTIMIZATION_FLAGS "-O2" )set( SERIALDEVICEWATCHER_SRCS serialdevicewatcher.cpp serialdevicewatcher_p_win.cpp)set( SERIALDEVICEWATCHER_HDRS serialdevicewatcher.h serialdevicewatcher_p.h )find_package( Qt4 REQUIRED )include( ${QT_USE_FILE} )set( QT_DONT_USE_QTGUI ) qt4_wrap_cpp( SERIALDEVICEWATCHER_MOC_SOURCES ${SERIALDEVICEWATCHER_HDRS})#qt4_automoc( ${SERIALDEVICEWATCHER_SRCS} ${SERIALDEVICEWATCHER_MOC_SOURCES} ) add_definitions( -Wall -DQT_NO_DEBUG ${OPTIMIZATION_FLAGS} ${QT_DEFINITIONS})#include_directories(# .#)add_library( ${TARGET} STATIC ${SERIALDEVICEWATCHER_SRCS} ${SERIALDEVICEWATCHER_MOC_SOURCES} )TARGET_LINK_LIBRARIES( ${TARGET} ${QT_LIBRARIES})
#include "serialdevicewatcher.moc"
//#include "moc_serialdevicewatcher.cpp"#include "serialdevicewatcher.moc"
#include "moc_serialdevicewatcher.cpp"//#include "serialdevicewatcher.moc"
#project( SerialDeviceWatcher )cmake_minimum_required( VERSION 2.6.0 )set(TARGET "qserialdevicewatcher" CACHE string "Name of the library")set( OPTIMIZATION_FLAGS "-O2" )set( SERIALDEVICEWATCHER_SRCS serialdevicewatcher.cpp serialdevicewatcher_p_win.cpp)set( SERIALDEVICEWATCHER_HDRS serialdevicewatcher.h serialdevicewatcher_p.h )find_package( Qt4 REQUIRED )include( ${QT_USE_FILE} )set( QT_DONT_USE_QTGUI ) qt4_automoc( ${SERIALDEVICEWATCHER_SRCS} ) add_definitions( -Wall -DQT_NO_DEBUG ${OPTIMIZATION_FLAGS} ${QT_DEFINITIONS})include_directories( ${CMAKE_CURRENT_BINARY_DIR} ${QT_INCLUDES} .)add_library( ${TARGET} STATIC ${SERIALDEVICEWATCHER_SRCS} )TARGET_LINK_LIBRARIES( ${TARGET} ${QT_LIBRARIES})
#project( SerialDeviceWatcher )cmake_minimum_required( VERSION 2.6.0 )set(TARGET "qserialdevicewatcher" CACHE string "Name of the library")set( OPTIMIZATION_FLAGS "-O2" )set( SERIALDEVICEWATCHER_SRCS serialdevicewatcher.cpp serialdevicewatcher_p_win.cpp)set( SERIALDEVICEWATCHER_HDRS serialdevicewatcher.h serialdevicewatcher_p.h )find_package( Qt4 REQUIRED )include( ${QT_USE_FILE} )set( QT_DONT_USE_QTGUI ) qt4_generate_moc(serialdevicewatcher.h ${CMAKE_CURRENT_BINARY_DIR}/moc_serialdevicewatcher.cpp1) add_definitions( -Wall -DQT_NO_DEBUG ${OPTIMIZATION_FLAGS} ${QT_DEFINITIONS})include_directories( ${CMAKE_CURRENT_BINARY_DIR} ${QT_INCLUDES} .)add_library( ${TARGET} STATIC ${SERIALDEVICEWATCHER_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/moc_serialdevicewatcher.cpp1)TARGET_LINK_LIBRARIES( ${TARGET} ${QT_LIBRARIES})
C++ (Qt)#ifdef -=CMAKE=-#include "file.moc"#else#include "moc_file.cpp"#endif
...set( OPTIMIZATION_FLAGS "-O2" )set( QT_DONT_USE_QTGUI ) add_definitions( -Wall -DQT_NO_DEBUG )...