source: pacpustutorials/solutions/project_exercises/plugin_exercise_2/CMakeLists.txt@ 14

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

update solutions of tutorials

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