source: pacpustutorials/template/plugin_template/plugin/CMakeLists.txt@ 1

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

add first tutorials exercises

File size: 3.7 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(PluginTemplate)
20################################################################################
21
22# The following definition is useful for Windows OS
23# It is used to declare dllimport and dllexport
24add_definitions( -DPLUGINTEMPLATE_EXPORTS )
25
26# ========================================
27# Configure qt4
28# ========================================
29if(QT4_FOUND)
30 set(QT_USE_QTXML true)
31 set(QT_USE_QTNETWORK true)
32 include(${QT_USE_FILE})
33else()
34 message(ERROR "Qt4 needed")
35endif()
36
37# ========================================
38# Compiler definitions
39# ========================================
40add_definitions(
41 ${QT_DEFINITIONS}
42)
43
44# ========================================
45# Include directories
46# ========================================
47include_directories(
48 ${PROJECT_BINARY_DIR}
49 ${QT_INCLUDE_DIR}
50)
51
52# ========================================
53# Link directories
54# ========================================
55link_directories(
56 ${PACPUS_LIB_DIR}
57)
58
59
60# Create the pacpus plugin
61pacpus_plugin(PLUGIN_CPP PLUGIN_H ${PROJECT_NAME} )
62
63# ========================================
64# List of sources
65# ========================================
66set(
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
75if(WIN32)
76 list(APPEND PROJECT_SRCS
77 # if needed add your specific source files for Windows OS
78 #SpecificWin32SourceFile.cpp
79 )
80endif(WIN32)
81if(UNIX)
82 list(APPEND PROJECT_SRCS
83 # if needed add your specific source files for Linux OS
84 #SpecificLinuxSourceFile.cpp
85 )
86endif(UNIX)
87
88# ========================================
89# Files to MOC
90# ========================================
91
92set(
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
102set(
103 UI_FILES
104)
105
106# ========================================
107# Call MOC
108# ========================================
109qt_wrap_cpp(
110 PROJECT_MOC_SRCS
111 ${FILES_TO_MOC}
112)
113
114qt_wrap_ui(
115 PROJECT_UI_SRCS
116 ${UI_FILES}
117)
118
119# ========================================
120# Build a library
121# ========================================
122pacpus_add_library(
123 ${PROJECT_NAME} SHARED
124 ${PROJECT_SRCS}
125 ${PROJECT_MOC_SRCS}
126 ${PROJECT_UI_SRCS}
127)
128
129# ========================================
130# Libraries
131# ========================================
132if(WIN32)
133 set(LIBS
134 # add your specific libraries to link here
135 # optimized yourlib.lib debug yourlib_debug.lib
136 )
137endif(WIN32)
138
139if(UNIX)
140 set(LIBS
141 # add your specific libraries to link here
142 # youlib
143 )
144endif(UNIX)
145
146# All the platform
147target_link_libraries(
148 ${PROJECT_NAME}
149 ${PACPUS_LIBRARIES}
150 ${QT_LIBRARIES}
151 ${PACPUS_DEPENDENCIES_LIB}
152 ${LIBS}
153)
154pacpus_folder(${PROJECT_NAME} "components")
155
156# ========================================
157# Install
158# ========================================
159# install plugin
160pacpus_install(${PROJECT_NAME}
Note: See TracBrowser for help on using the repository browser.