| 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(PluginExercise1)
|
|---|
| 20 | ################################################################################
|
|---|
| 21 |
|
|---|
| 22 | # The following definition is useful for Windows OS
|
|---|
| 23 | # It is used to declare dllimport and dllexport
|
|---|
| 24 | add_definitions( -DPACPUSLIB_EXPORTS )
|
|---|
| 25 |
|
|---|
| 26 |
|
|---|
| 27 | # ========================================
|
|---|
| 28 | # Compiler definitions
|
|---|
| 29 | # ========================================
|
|---|
| 30 | add_definitions(
|
|---|
| 31 | ${QT_DEFINITIONS}
|
|---|
| 32 | )
|
|---|
| 33 |
|
|---|
| 34 | # ========================================
|
|---|
| 35 | # Include directories
|
|---|
| 36 | # ========================================
|
|---|
| 37 | include_directories(
|
|---|
| 38 | ${PROJECT_BINARY_DIR}
|
|---|
| 39 | ${QT_INCLUDE_DIR}
|
|---|
| 40 | )
|
|---|
| 41 |
|
|---|
| 42 | # ========================================
|
|---|
| 43 | # Link directories
|
|---|
| 44 | # ========================================
|
|---|
| 45 | link_directories(
|
|---|
| 46 | ${PACPUS_LIB_DIR}
|
|---|
| 47 | )
|
|---|
| 48 |
|
|---|
| 49 |
|
|---|
| 50 | # Create the pacpus plugin
|
|---|
| 51 | pacpus_plugin(PLUGIN_CPP PLUGIN_H ${PROJECT_NAME} )
|
|---|
| 52 |
|
|---|
| 53 | # ========================================
|
|---|
| 54 | # List of sources
|
|---|
| 55 | # ========================================
|
|---|
| 56 | set(
|
|---|
| 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 |
|
|---|
| 66 | if(WIN32)
|
|---|
| 67 | list(APPEND PROJECT_SRCS
|
|---|
| 68 | # if needed add your specific source files for Windows OS
|
|---|
| 69 | #SpecificWin32SourceFile.cpp
|
|---|
| 70 | )
|
|---|
| 71 | endif(WIN32)
|
|---|
| 72 | if(UNIX)
|
|---|
| 73 | list(APPEND PROJECT_SRCS
|
|---|
| 74 | # if needed add your specific source files for Linux OS
|
|---|
| 75 | #SpecificLinuxSourceFile.cpp
|
|---|
| 76 | )
|
|---|
| 77 | endif(UNIX)
|
|---|
| 78 |
|
|---|
| 79 | # ========================================
|
|---|
| 80 | # Files to MOC
|
|---|
| 81 | # ========================================
|
|---|
| 82 |
|
|---|
| 83 | set(
|
|---|
| 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 |
|
|---|
| 94 | set(
|
|---|
| 95 | UI_FILES
|
|---|
| 96 | )
|
|---|
| 97 |
|
|---|
| 98 | # ========================================
|
|---|
| 99 | # Call MOC
|
|---|
| 100 | # ========================================
|
|---|
| 101 | qt_wrap_cpp(
|
|---|
| 102 | PROJECT_MOC_SRCS
|
|---|
| 103 | ${FILES_TO_MOC}
|
|---|
| 104 | )
|
|---|
| 105 |
|
|---|
| 106 | qt_wrap_ui(
|
|---|
| 107 | PROJECT_UI_SRCS
|
|---|
| 108 | ${UI_FILES}
|
|---|
| 109 | )
|
|---|
| 110 |
|
|---|
| 111 | # ========================================
|
|---|
| 112 | # Build a library
|
|---|
| 113 | # ========================================
|
|---|
| 114 | pacpus_add_library(
|
|---|
| 115 | ${PROJECT_NAME} SHARED
|
|---|
| 116 | ${PROJECT_SRCS}
|
|---|
| 117 | ${PROJECT_MOC_SRCS}
|
|---|
| 118 | ${PROJECT_UI_SRCS}
|
|---|
| 119 | )
|
|---|
| 120 |
|
|---|
| 121 | # ========================================
|
|---|
| 122 | # Libraries
|
|---|
| 123 | # ========================================
|
|---|
| 124 | if(WIN32)
|
|---|
| 125 | set(LIBS
|
|---|
| 126 | # add your specific libraries to link here
|
|---|
| 127 | # optimized yourlib.lib debug yourlib_debug.lib
|
|---|
| 128 | )
|
|---|
| 129 | endif(WIN32)
|
|---|
| 130 |
|
|---|
| 131 | if(UNIX)
|
|---|
| 132 | set(LIBS
|
|---|
| 133 | # add your specific libraries to link here
|
|---|
| 134 | # youlib
|
|---|
| 135 | )
|
|---|
| 136 | endif(UNIX)
|
|---|
| 137 |
|
|---|
| 138 | # All the platform
|
|---|
| 139 | target_link_libraries(
|
|---|
| 140 | ${PROJECT_NAME}
|
|---|
| 141 | ${PACPUS_LIBRARIES}
|
|---|
| 142 | ${QT_LIBRARIES}
|
|---|
| 143 | ${PACPUS_DEPENDENCIES_LIB}
|
|---|
| 144 | ${LIBS}
|
|---|
| 145 | )
|
|---|
| 146 | pacpus_folder(${PROJECT_NAME} "components")
|
|---|
| 147 |
|
|---|
| 148 | # ========================================
|
|---|
| 149 | # Install
|
|---|
| 150 | # ========================================
|
|---|
| 151 | # install plugin
|
|---|
| 152 | pacpus_install(${PROJECT_NAME})
|
|---|