source: pacpussensors/trunk/ExampleComponent/CMakeLists.txt@ 12

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

[script] NewComponent.bat.

File size: 2.4 KB
Line 
1project(${<PROJECT_NAME>})
2
3################################################################################
4add_definitions( -D${<PROJECT_NAME_CAPS>}_EXPORTS )
5
6################################################################################
7# Qt
8if(QT4_FOUND)
9 set(QT_USE_QTXML true)
10 set(QT_USE_QTNETWORK true)
11 include(${QT_USE_FILE})
12else()
13 message(ERROR "Qt4 needed")
14endif()
15
16add_definitions(
17 ${QT_DEFINITIONS}
18)
19
20################################################################################
21# Include directories
22include_directories(
23 ${PACPUSINCLUDE_DIRECTORY}
24 ${PROJECT_BINARY_DIR}
25 ${QT_INCLUDE_DIR}
26)
27
28################################################################################
29# Link directories
30link_directories(
31 ${PACPUS_LIB_DIR}
32)
33pacpus_plugin(PLUGIN_CPP PLUGIN_H ${PROJECT_NAME})
34
35################################################################################
36# FILES
37set(HDRS
38 ${<PROJECT_NAME>}.h
39 ${<PROJECT_NAME>}Config.h
40)
41
42set(SRCS
43 ${<PROJECT_NAME>}.cpp
44 ${PLUGIN_CPP}
45)
46
47set(MOC_FILES
48 ${<PROJECT_NAME>}.h
49 ${PLUGIN_H}
50)
51
52set(UI_FILES
53)
54
55################################################################################
56# Call moc, uic
57qt4_wrap_cpp(MOC_SRCS
58 ${MOC_FILES}
59)
60qt4_wrap_ui(UI_SRCS
61 ${UI_FILES}
62)
63
64################################################################################
65# BUILD and LINK
66pacpus_add_library(${PROJECT_NAME} SHARED
67 ${SRCS}
68 ${MOC_SRCS}
69 ${UI_SRCS}
70)
71
72################################################################################
73# LIBS
74message(STATUS ${PACPUS_DEPENDENCIES_LIB})
75
76set(LIBS
77 ${PACPUS_LIBRARIES}
78 ${QT_LIBRARIES}
79 ${PACPUS_DEPENDENCIES_LIB}
80 optimized FileLib debug FileLib_d
81 optimized PacpusLib debug PacpusLib_d
82 optimized PacpusTools debug PacpusTools_d
83)
84if (WIN32)
85 list(APPEND LIBS
86 optimized ROAD_TIME debug ROAD_TIME_d
87 )
88endif()
89
90################################################################################
91# LINK
92target_link_libraries(${PROJECT_NAME} ${LIBS})
93# PROPERTIES
94set_target_properties(${PROJECT_NAME} PROPERTIES DEBUG_POSTFIX "_d")
95# FOLDERS
96pacpus_folder(${PROJECT_NAME} "components")
97
98################################################################################
99# INSTALL
100pacpus_install(${PROJECT_NAME})
101
Note: See TracBrowser for help on using the repository browser.