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