1 | ######################################################################################################
|
---|
2 | #
|
---|
3 | # created: 2015/09/18
|
---|
4 | # filename: CMakeLists.txt
|
---|
5 | #
|
---|
6 | # author: Gerald Dherbomez
|
---|
7 | # Copyright Heudiasyc (c) UMR UTC/CNRS 7253
|
---|
8 | #
|
---|
9 | # license: CECILL-C
|
---|
10 | #
|
---|
11 | # version: $Id: $
|
---|
12 | #
|
---|
13 | # brief: Pacpus project template
|
---|
14 | #
|
---|
15 | ######################################################################################################
|
---|
16 |
|
---|
17 |
|
---|
18 | ################################################################################
|
---|
19 | project(PluginTemplate)
|
---|
20 | ################################################################################
|
---|
21 |
|
---|
22 | # The following definition is useful for Windows OS
|
---|
23 | # It is used to declare dllimport and dllexport
|
---|
24 | add_definitions( -DPLUGINTEMPLATE_EXPORTS )
|
---|
25 |
|
---|
26 | # ========================================
|
---|
27 | # Configure qt4
|
---|
28 | # ========================================
|
---|
29 | if(QT4_FOUND)
|
---|
30 | set(QT_USE_QTXML true)
|
---|
31 | set(QT_USE_QTNETWORK true)
|
---|
32 | include(${QT_USE_FILE})
|
---|
33 | else()
|
---|
34 | message(ERROR "Qt4 needed")
|
---|
35 | endif()
|
---|
36 |
|
---|
37 | # ========================================
|
---|
38 | # Compiler definitions
|
---|
39 | # ========================================
|
---|
40 | add_definitions(
|
---|
41 | ${QT_DEFINITIONS}
|
---|
42 | )
|
---|
43 |
|
---|
44 | # ========================================
|
---|
45 | # Include directories
|
---|
46 | # ========================================
|
---|
47 | include_directories(
|
---|
48 | ${PROJECT_BINARY_DIR}
|
---|
49 | ${QT_INCLUDE_DIR}
|
---|
50 | )
|
---|
51 |
|
---|
52 | # ========================================
|
---|
53 | # Link directories
|
---|
54 | # ========================================
|
---|
55 | link_directories(
|
---|
56 | ${PACPUS_LIB_DIR}
|
---|
57 | )
|
---|
58 |
|
---|
59 |
|
---|
60 | # Create the pacpus plugin
|
---|
61 | pacpus_plugin(PLUGIN_CPP PLUGIN_H ${PROJECT_NAME} )
|
---|
62 |
|
---|
63 | # ========================================
|
---|
64 | # List of sources
|
---|
65 | # ========================================
|
---|
66 | set(
|
---|
67 | PROJECT_SRCS
|
---|
68 | # Add your source files, at least one pacpus component cpp file
|
---|
69 | # See component_template
|
---|
70 | #
|
---|
71 | # YourComponent.cpp
|
---|
72 | ${PLUGIN_CPP}
|
---|
73 | )
|
---|
74 |
|
---|
75 | if(WIN32)
|
---|
76 | list(APPEND PROJECT_SRCS
|
---|
77 | # if needed add your specific source files for Windows OS
|
---|
78 | #SpecificWin32SourceFile.cpp
|
---|
79 | )
|
---|
80 | endif(WIN32)
|
---|
81 | if(UNIX)
|
---|
82 | list(APPEND PROJECT_SRCS
|
---|
83 | # if needed add your specific source files for Linux OS
|
---|
84 | #SpecificLinuxSourceFile.cpp
|
---|
85 | )
|
---|
86 | endif(UNIX)
|
---|
87 |
|
---|
88 | # ========================================
|
---|
89 | # Files to MOC
|
---|
90 | # ========================================
|
---|
91 |
|
---|
92 | set(
|
---|
93 | FILES_TO_MOC
|
---|
94 | # Add your header files that need to be MOCed (check Qt doc about MOCing)
|
---|
95 | # at least, put the pacpus component header file
|
---|
96 | # See component_template
|
---|
97 | #
|
---|
98 | # YourComponent.h
|
---|
99 | ${PLUGIN_H}
|
---|
100 | )
|
---|
101 |
|
---|
102 | set(
|
---|
103 | UI_FILES
|
---|
104 | )
|
---|
105 |
|
---|
106 | # ========================================
|
---|
107 | # Call MOC
|
---|
108 | # ========================================
|
---|
109 | qt_wrap_cpp(
|
---|
110 | PROJECT_MOC_SRCS
|
---|
111 | ${FILES_TO_MOC}
|
---|
112 | )
|
---|
113 |
|
---|
114 | qt_wrap_ui(
|
---|
115 | PROJECT_UI_SRCS
|
---|
116 | ${UI_FILES}
|
---|
117 | )
|
---|
118 |
|
---|
119 | # ========================================
|
---|
120 | # Build a library
|
---|
121 | # ========================================
|
---|
122 | pacpus_add_library(
|
---|
123 | ${PROJECT_NAME} SHARED
|
---|
124 | ${PROJECT_SRCS}
|
---|
125 | ${PROJECT_MOC_SRCS}
|
---|
126 | ${PROJECT_UI_SRCS}
|
---|
127 | )
|
---|
128 |
|
---|
129 | # ========================================
|
---|
130 | # Libraries
|
---|
131 | # ========================================
|
---|
132 | if(WIN32)
|
---|
133 | set(LIBS
|
---|
134 | # add your specific libraries to link here
|
---|
135 | # optimized yourlib.lib debug yourlib_debug.lib
|
---|
136 | )
|
---|
137 | endif(WIN32)
|
---|
138 |
|
---|
139 | if(UNIX)
|
---|
140 | set(LIBS
|
---|
141 | # add your specific libraries to link here
|
---|
142 | # youlib
|
---|
143 | )
|
---|
144 | endif(UNIX)
|
---|
145 |
|
---|
146 | # All the platform
|
---|
147 | target_link_libraries(
|
---|
148 | ${PROJECT_NAME}
|
---|
149 | ${PACPUS_LIBRARIES}
|
---|
150 | ${QT_LIBRARIES}
|
---|
151 | ${PACPUS_DEPENDENCIES_LIB}
|
---|
152 | ${LIBS}
|
---|
153 | )
|
---|
154 | pacpus_folder(${PROJECT_NAME} "components")
|
---|
155 |
|
---|
156 | # ========================================
|
---|
157 | # Install
|
---|
158 | # ========================================
|
---|
159 | # install plugin
|
---|
160 | pacpus_install(${PROJECT_NAME})
|
---|