[12] | 1 | project(${<PROJECT_NAME>})
|
---|
| 2 |
|
---|
| 3 | ################################################################################
|
---|
| 4 | add_definitions( -D${<PROJECT_NAME_CAPS>}_EXPORTS )
|
---|
| 5 |
|
---|
| 6 | ################################################################################
|
---|
| 7 | # Qt
|
---|
| 8 | if(QT4_FOUND)
|
---|
| 9 | set(QT_USE_QTXML true)
|
---|
| 10 | set(QT_USE_QTNETWORK true)
|
---|
| 11 | include(${QT_USE_FILE})
|
---|
| 12 | else()
|
---|
| 13 | message(ERROR "Qt4 needed")
|
---|
| 14 | endif()
|
---|
| 15 |
|
---|
| 16 | add_definitions(
|
---|
| 17 | ${QT_DEFINITIONS}
|
---|
| 18 | )
|
---|
| 19 |
|
---|
| 20 | ################################################################################
|
---|
| 21 | # Include directories
|
---|
| 22 | include_directories(
|
---|
| 23 | ${PACPUSINCLUDE_DIRECTORY}
|
---|
| 24 | ${PROJECT_BINARY_DIR}
|
---|
| 25 | ${QT_INCLUDE_DIR}
|
---|
| 26 | )
|
---|
| 27 |
|
---|
| 28 | ################################################################################
|
---|
| 29 | # Link directories
|
---|
| 30 | link_directories(
|
---|
| 31 | ${PACPUS_LIB_DIR}
|
---|
| 32 | )
|
---|
| 33 | pacpus_plugin(PLUGIN_CPP PLUGIN_H ${PROJECT_NAME})
|
---|
| 34 |
|
---|
| 35 | ################################################################################
|
---|
| 36 | # FILES
|
---|
| 37 | set(HDRS
|
---|
| 38 | ${<PROJECT_NAME>}.h
|
---|
| 39 | ${<PROJECT_NAME>}Config.h
|
---|
| 40 | )
|
---|
| 41 |
|
---|
| 42 | set(SRCS
|
---|
| 43 | ${<PROJECT_NAME>}.cpp
|
---|
| 44 | ${PLUGIN_CPP}
|
---|
| 45 | )
|
---|
| 46 |
|
---|
| 47 | set(MOC_FILES
|
---|
| 48 | ${<PROJECT_NAME>}.h
|
---|
| 49 | ${PLUGIN_H}
|
---|
| 50 | )
|
---|
| 51 |
|
---|
| 52 | set(UI_FILES
|
---|
| 53 | )
|
---|
| 54 |
|
---|
| 55 | ################################################################################
|
---|
| 56 | # Call moc, uic
|
---|
| 57 | qt4_wrap_cpp(MOC_SRCS
|
---|
| 58 | ${MOC_FILES}
|
---|
| 59 | )
|
---|
| 60 | qt4_wrap_ui(UI_SRCS
|
---|
| 61 | ${UI_FILES}
|
---|
| 62 | )
|
---|
| 63 |
|
---|
| 64 | ################################################################################
|
---|
| 65 | # BUILD and LINK
|
---|
| 66 | pacpus_add_library(${PROJECT_NAME} SHARED
|
---|
| 67 | ${SRCS}
|
---|
| 68 | ${MOC_SRCS}
|
---|
| 69 | ${UI_SRCS}
|
---|
| 70 | )
|
---|
| 71 |
|
---|
| 72 | ################################################################################
|
---|
| 73 | # LIBS
|
---|
| 74 | message(STATUS ${PACPUS_DEPENDENCIES_LIB})
|
---|
| 75 |
|
---|
| 76 | set(LIBS
|
---|
| 77 | ${PACPUS_LIBRARIES}
|
---|
| 78 | ${QT_LIBRARIES}
|
---|
| 79 | ${PACPUS_DEPENDENCIES_LIB}
|
---|
| 80 | optimized FileLib debug FileLib_d
|
---|
| 81 | optimized PacpusLib debug PacpusLib_d
|
---|
| 82 | optimized PacpusTools debug PacpusTools_d
|
---|
| 83 | )
|
---|
| 84 | if (WIN32)
|
---|
| 85 | list(APPEND LIBS
|
---|
| 86 | optimized ROAD_TIME debug ROAD_TIME_d
|
---|
| 87 | )
|
---|
| 88 | endif()
|
---|
| 89 |
|
---|
| 90 | ################################################################################
|
---|
| 91 | # LINK
|
---|
| 92 | target_link_libraries(${PROJECT_NAME} ${LIBS})
|
---|
| 93 | # PROPERTIES
|
---|
| 94 | set_target_properties(${PROJECT_NAME} PROPERTIES DEBUG_POSTFIX "_d")
|
---|
| 95 | # FOLDERS
|
---|
| 96 | pacpus_folder(${PROJECT_NAME} "components")
|
---|
| 97 |
|
---|
| 98 | ################################################################################
|
---|
| 99 | # INSTALL
|
---|
| 100 | pacpus_install(${PROJECT_NAME})
|
---|
| 101 |
|
---|