source: pacpusframework/branches/2.0-beta1/src/TestComponents/CPT/sensor/CMakeLists.txt@ 89

Last change on this file since 89 was 89, checked in by morasjul, 11 years ago

PACPUS 2.0 Beta deployed in new branch

Major changes:
-Add communication interface between components
-Add examples for communications interface (TestComponents)
-Move to Qt5 support

  • Property svn:executable set to *
File size: 2.6 KB
Line 
1project(CPTComponent)
2
3################################################################################
4add_definitions( -DCPTCOMPONENT_EXPORTS )
5add_definitions( -DPLUGINLIB_EXPORTS )
6
7################################################################################
8# FILES
9set(HDRS
10 CPTComponent.h
11 ${CMAKE_SOURCE_DIR}/driver/AbstractSerialPort.h
12)
13set(SRCS
14 CPTComponent.cpp
15 ${CMAKE_SOURCE_DIR}/driver/AbstractSerialPort.cpp
16)
17
18if(UNIX)
19 list(APPEND HDRS
20 ${CMAKE_SOURCE_DIR}/driver/PosixSerialPort.h
21 )
22 list(APPEND SRCS
23 ${CMAKE_SOURCE_DIR}/driver/PosixSerialPort.cpp
24 )
25endif(UNIX)
26if(WIN32)
27 list(APPEND HDRS
28 ${CMAKE_SOURCE_DIR}/driver/win32SerialPort.h
29 )
30 list(APPEND SRCS
31 ${CMAKE_SOURCE_DIR}/driver/win32SerialPort.cpp
32 )
33endif(WIN32)
34
35set(FILES_TO_MOC
36 # add here the header files that you want to MOC
37 ${CMAKE_SOURCE_DIR}/driver/PosixSerialPort.h
38 CPTComponent.h
39)
40
41if(UNIX)
42 list(APPEND FILES_TO_MOC
43 ${CMAKE_SOURCE_DIR}/driver/PosixSerialPort.h
44 )
45endif(UNIX)
46if(WIN32)
47 list(APPEND FILES_TO_MOC
48 ${CMAKE_SOURCE_DIR}/driver/win32SerialPort.h
49 )
50endif(WIN32)
51
52pacpus_plugin(PLUGIN_CPP PLUGIN_H ${PROJECT_NAME})
53
54################################################################################
55include_directories(${PACPUSINCLUDE_DIRECTORY})
56link_directories(${PACPUSLIB_DIRECTORY})
57link_directories(${PACPUSBIN_DIRECTORY})
58
59message("Creating source files for the plugin(s)")
60message(STATUS PLUGIN_H=${PLUGIN_H})
61message(STATUS PLUGIN_CPP=${PLUGIN_CPP})
62
63qt4_wrap_cpp(PLUGIN_MOC_SOURCES
64 ${PLUGIN_H}
65 ${FILES_TO_MOC}
66)
67
68################################################################################
69# BUILD AND LINK
70add_library(${PROJECT_NAME} SHARED
71 ${HDRS}
72 ${SRCS}
73 ${PLUGIN_CPP}
74 ${PLUGIN_MOC_SOURCES}
75)
76# LIBS
77list(APPEND LIBS
78 optimized FileLib debug FileLib_d
79 optimized PacpusLib debug PacpusLib_d
80 optimized PacpusTools debug PacpusTools_d
81 optimized NMEA0183LIB debug NMEA0183LIB_d
82 ${QT_LIBRARIES}
83 ${OpenCV_LIBS}
84)
85if(WIN32)
86 list(APPEND LIBS
87 optimized ROAD_TIME debug ROAD_TIME_d
88 )
89endif()
90# LINK
91target_link_libraries(${PROJECT_NAME} ${LIBS})
92# PROPERTIES
93set_target_properties(${PROJECT_NAME} PROPERTIES DEBUG_POSTFIX "_d")
94# FOLDERS
95if(PACPUS_FOLDERS)
96 set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER "components")
97endif()
98
99################################################################################
100# INSTALL
101install(TARGETS ${PROJECT_NAME}
102 RUNTIME DESTINATION ${PACPUSBIN_DIRECTORY}
103 LIBRARY DESTINATION ${PACPUSBIN_DIRECTORY}
104 ARCHIVE DESTINATION ${PACPUSLIB_DIRECTORY}
105)
Note: See TracBrowser for help on using the repository browser.