Changeset 99 in pacpussensors for trunk/Wifibot/CMakeLists.txt
- Timestamp:
- 10/15/15 14:47:01 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Wifibot/CMakeLists.txt
r21 r99 1 #########################quick start############################################ 2 #cmake ../ -G "CodeBlocks - Unix Makefiles" 3 #make 4 #make install 5 #make clean 6 ################################################################################ 1 7 project(Wifibot) 8 set(${PROJECT_NAME}_VERSION_MAJOR 0) 9 set(${PROJECT_NAME}_VERSION_MINOR 1) 10 add_definitions( -DWIFIBOTXT_EXPORTS ) 2 11 ################################################################################ 3 add_definitions( -DWIFIBOTXT_EXPORTS ) 12 create_export(EXPORT_HDR ${PROJECT_NAME}) 13 pacpus_plugin(PLUGIN_CPP PLUGIN_HDR ${PROJECT_NAME}) 14 add_definitions (${QT_DEFINITIONS}) 4 15 5 # ======================================== 6 # Configure qt4 7 # ======================================== 8 if(QT4_FOUND) 9 set(QT_USE_QTXML true) 10 set(QT_USE_QTNETWORK true) 11 include(${QT_USE_FILE}) 12 else() 13 message(ERROR "Qt4 needed") 14 endif() 15 16 # ======================================== 17 # Compiler definitions 18 # ======================================== 19 add_definitions( 20 ${QT_DEFINITIONS} 21 ) 22 23 # ======================================== 24 # Include directories 25 # ======================================== 26 include_directories( 27 ${PROJECT_BINARY_DIR} 28 ${QT_INCLUDE_DIR} 16 find_package(Qt5Network REQUIRED) 17 ################################################################################ 18 # DIRECTORIES 19 include_directories( 20 ${PROJECT_BINARY_DIR} 21 ${QT_INCLUDE_DIR} 22 ${PACPUS_INCLUDE_DIR} 23 ${PACPUS_INCLUDE_DIR}/Pacpus/ 29 24 ) 30 25 … … 32 27 # Link directories 33 28 # ======================================== 34 link_directories( ${PACPUS_LIB_DIR} 29 link_directories( 30 ${PACPUS_LIB_DIR} 35 31 ) 36 32 37 message (STATUS ${PACPUS_LIB_DIR})38 33 39 pacpus_plugin(PLUGIN_CPP PLUGIN_H ${PROJECT_NAME} ) 40 41 # ======================================== 42 # List of sources 43 # ======================================== 44 set( 45 PROJECT_SRCS 34 ################################################################################ 35 # FILES 36 set(PROJECT_HDRS 37 ${EXPORT_HDR} 38 wifibot.h 39 ps3remote.h 40 ) 41 set(PROJECT_SRCS 42 ${PLUGIN_CPP} 46 43 wifibot.cpp 47 44 ps3remote.cpp 48 ${PLUGIN_CPP}49 45 ) 50 46 51 # ======================================== 52 # Files to MOC 53 # ======================================== 54 set( 55 FILES_TO_MOC 47 set(FILES_TO_MOC 48 ${PLUGIN_HDR} 56 49 wifibot.h 57 50 ps3remote.h 58 ${PLUGIN_H}59 51 ) 60 52 61 set( 62 UI_FILES 63 53 set(UI_FILES 64 54 ) 65 55 66 # ======================================== 67 # Call MOC 68 # ======================================== 69 qt4_wrap_cpp( 70 PROJECT_MOC_SRCS 56 ################################################################################ 57 # Qt: call moc, uic 58 qt_wrap_cpp(PROJECT_MOC_SRCS 71 59 ${FILES_TO_MOC} 72 60 ) 73 61 74 qt4_wrap_ui( 75 PROJECT_UI_SRCS 62 qt_wrap_ui(PROJECT_UI_SRCS 76 63 ${UI_FILES} 77 64 ) 78 65 79 # ======================================== 80 # Build a library 81 # ======================================== 82 pacpus_add_library( 83 ${PROJECT_NAME} SHARED 66 ################################################################################ 67 # BUILD and LINK 68 pacpus_add_library(${PROJECT_NAME} SHARED 69 ${PROJECT_HDRS} 84 70 ${PROJECT_SRCS} 85 71 ${PROJECT_MOC_SRCS} … … 87 73 ) 88 74 89 message(STATUS ${PACPUS_DEPENDENCIES_LIB} )90 75 91 76 # ======================================== 92 77 # Libraries 93 78 # ======================================== 94 # All the platform 95 target_link_libraries( 96 ${PROJECT_NAME} 97 ${PACPUS_LIBRARIES} 98 ${QT_LIBRARIES} 99 ${PACPUS_DEPENDENCIES_LIB} 100 PacpusTools 101 PacpusSocket 79 set(LIBS 80 optimized FileLib debug FileLib_d 81 optimized PacpusLib debug PacpusLib_d 82 optimized PacpusTools debug PacpusTools_d 83 optimized PacpusSocket debug PacpusSocket_d 102 84 ) 103 104 # ======================================== 105 # Install 106 # ======================================== 107 pacpus_install(${PROJECT_NAME}) 108 85 if (WIN32) 86 list(APPEND LIBS 87 optimized ROAD_TIME debug ROAD_TIME_d 88 ) 89 endif() 90 # LINK 91 target_link_libraries(${PROJECT_NAME} 92 ${PACPUS_LIBRARIES} 93 ${PACPUS_DEPENDENCIES_LIB} 94 ${LIBS} 95 ${QT_LIBRARIES} 96 ) 97 qt5_use_modules(${PROJECT_NAME} Network) 98 ################################################################################ 99 # FOLDERS 100 pacpus_folder(${PROJECT_NAME} "components") 101 ################################################################################ 102 # INSTALL 103 pacpus_install(${PROJECT_NAME})
Note:
See TracChangeset
for help on using the changeset viewer.