source: pacpustutorials/solutions/project_exercises/plugin_exercise_1/CMakeLists.txt

Last change on this file was 11, checked in by DHERBOMEZ Gérald, 9 years ago

update solutions of tutorials

File size: 3.6 KB
Line 
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################################################################################
19project(PluginExercise1)
20################################################################################
21
22# The following definition is useful for Windows OS
23# It is used to declare dllimport and dllexport
24add_definitions( -DPACPUSLIB_EXPORTS )
25
26
27# ========================================
28# Compiler definitions
29# ========================================
30add_definitions(
31 ${QT_DEFINITIONS}
32)
33
34# ========================================
35# Include directories
36# ========================================
37include_directories(
38 ${PROJECT_BINARY_DIR}
39 ${QT_INCLUDE_DIR}
40)
41
42# ========================================
43# Link directories
44# ========================================
45link_directories(
46 ${PACPUS_LIB_DIR}
47)
48
49
50# Create the pacpus plugin
51pacpus_plugin(PLUGIN_CPP PLUGIN_H ${PROJECT_NAME} )
52
53# ========================================
54# List of sources
55# ========================================
56set(
57 PROJECT_SRCS
58 # Add your source files, at least one pacpus component cpp file
59 # See component_template
60 #
61 component_message/MessageComponent.cpp
62 component_fizzbuzz/FizzBuzz.cpp
63 ${PLUGIN_CPP}
64)
65
66if(WIN32)
67 list(APPEND PROJECT_SRCS
68 # if needed add your specific source files for Windows OS
69 #SpecificWin32SourceFile.cpp
70 )
71endif(WIN32)
72if(UNIX)
73 list(APPEND PROJECT_SRCS
74 # if needed add your specific source files for Linux OS
75 #SpecificLinuxSourceFile.cpp
76 )
77endif(UNIX)
78
79# ========================================
80# Files to MOC
81# ========================================
82
83set(
84 FILES_TO_MOC
85 # Add your header files that need to be MOCed (check Qt doc about MOCing)
86 # at least, put the pacpus component header file
87 # See component_template
88 #
89 component_message/MessageComponent.h
90 component_fizzbuzz/FizzBuzz.h
91 ${PLUGIN_H}
92)
93
94set(
95 UI_FILES
96)
97
98# ========================================
99# Call MOC
100# ========================================
101qt_wrap_cpp(
102 PROJECT_MOC_SRCS
103 ${FILES_TO_MOC}
104)
105
106qt_wrap_ui(
107 PROJECT_UI_SRCS
108 ${UI_FILES}
109)
110
111# ========================================
112# Build a library
113# ========================================
114pacpus_add_library(
115 ${PROJECT_NAME} SHARED
116 ${PROJECT_SRCS}
117 ${PROJECT_MOC_SRCS}
118 ${PROJECT_UI_SRCS}
119)
120
121# ========================================
122# Libraries
123# ========================================
124if(WIN32)
125 set(LIBS
126 # add your specific libraries to link here
127 # optimized yourlib.lib debug yourlib_debug.lib
128 )
129endif(WIN32)
130
131if(UNIX)
132 set(LIBS
133 # add your specific libraries to link here
134 # youlib
135 )
136endif(UNIX)
137
138# All the platform
139target_link_libraries(
140 ${PROJECT_NAME}
141 ${PACPUS_LIBRARIES}
142 ${QT_LIBRARIES}
143 ${PACPUS_DEPENDENCIES_LIB}
144 ${LIBS}
145)
146pacpus_folder(${PROJECT_NAME} "components")
147
148# ========================================
149# Install
150# ========================================
151# install plugin
152pacpus_install(${PROJECT_NAME})
Note: See TracBrowser for help on using the repository browser.