1 | #################################################
|
---|
2 | # ___________ ____ ______ __ __ _____ #
|
---|
3 | # \____ \__ \ _/ ___\\____ \| | \/ ___/ #
|
---|
4 | # | |_> > __ \\ \___| |_> > | /\___ \ #
|
---|
5 | # | __(____ /\___ > __/|____//____ > #
|
---|
6 | # |__| \/ \/|__| \/ #
|
---|
7 | # #
|
---|
8 | #################################################
|
---|
9 | project(PacpusLib)
|
---|
10 |
|
---|
11 | # ========================================
|
---|
12 | # Configure qt4
|
---|
13 | # ========================================
|
---|
14 | #if(QT4_FOUND)
|
---|
15 | # set(QT_USE_QTXML true)
|
---|
16 | # include(${QT_USE_FILE})
|
---|
17 | #else()
|
---|
18 | # message(ERROR "Qt4 needed")
|
---|
19 | #endif()
|
---|
20 |
|
---|
21 |
|
---|
22 | # ========================================
|
---|
23 | # Compiler definitions
|
---|
24 | # ========================================
|
---|
25 | add_definitions(
|
---|
26 | -DPACPUSLIB_EXPORTS
|
---|
27 | -DQT_NO_KEYWORDS
|
---|
28 | ${QT_DEFINITIONS}
|
---|
29 | )
|
---|
30 |
|
---|
31 | # ========================================
|
---|
32 | # Include directories
|
---|
33 | # ========================================
|
---|
34 | include_directories(
|
---|
35 | ${QT_INCLUDE_DIR}
|
---|
36 | )
|
---|
37 |
|
---|
38 | # ========================================
|
---|
39 | # Link directories
|
---|
40 | # ========================================
|
---|
41 | link_directories(
|
---|
42 | ${PROJECT_BINARY_DIR}/../RoadTime
|
---|
43 | ${PROJECT_BINARY_DIR}/../FileLib
|
---|
44 | )
|
---|
45 |
|
---|
46 | # ========================================
|
---|
47 | # List of sources
|
---|
48 | # ========================================
|
---|
49 | set(
|
---|
50 | PROJECT_SRCS
|
---|
51 | ${PACPUS_INCLUDE_DIR}/Pacpus/kernel/cstdint.h
|
---|
52 | ${PACPUS_INCLUDE_DIR}/Pacpus/kernel/ComponentBase.h
|
---|
53 | ${PACPUS_INCLUDE_DIR}/Pacpus/kernel/ComponentFactory.h
|
---|
54 | ${PACPUS_INCLUDE_DIR}/Pacpus/kernel/ComponentFactoryBase.h
|
---|
55 | ${PACPUS_INCLUDE_DIR}/Pacpus/kernel/ComponentManager.h
|
---|
56 | ${PACPUS_INCLUDE_DIR}/Pacpus/kernel/Log.h
|
---|
57 | ${PACPUS_INCLUDE_DIR}/Pacpus/kernel/pacpus.h
|
---|
58 | ${PACPUS_INCLUDE_DIR}/Pacpus/kernel/PacpusApplication.h
|
---|
59 | ${PACPUS_INCLUDE_DIR}/Pacpus/kernel/road_time.h
|
---|
60 | ${PACPUS_INCLUDE_DIR}/Pacpus/kernel/XmlComponentConfig.h
|
---|
61 | ${PACPUS_INCLUDE_DIR}/Pacpus/kernel/XmlConfigFile.h
|
---|
62 |
|
---|
63 | ${PACPUS_INCLUDE_DIR}/Pacpus/kernel/ConnectionBase.h
|
---|
64 | ${PACPUS_INCLUDE_DIR}/Pacpus/kernel/InputOutputBase.h
|
---|
65 | ${PACPUS_INCLUDE_DIR}/Pacpus/kernel/InputOutputInterface.h
|
---|
66 | ${PACPUS_INCLUDE_DIR}/Pacpus/kernel/PacpusEvent.h
|
---|
67 | # ${PACPUS_INCLUDE_DIR}/Pacpus/kernel/pacpusStruct.h
|
---|
68 |
|
---|
69 | ./ComponentBase.cpp
|
---|
70 | ./ComponentFactoryBase.cpp
|
---|
71 | ./ComponentManager.cpp
|
---|
72 | ./Log.cpp
|
---|
73 | ./PacpusApplication.cpp
|
---|
74 | ./XmlComponentConfig.cpp
|
---|
75 | ./XmlConfigFile.cpp
|
---|
76 | ./InputOutputBase.cpp
|
---|
77 | # ./PacpusStruct.cpp
|
---|
78 | )
|
---|
79 |
|
---|
80 | set(
|
---|
81 | FILES_TO_MOC
|
---|
82 | ${PACPUS_INCLUDE_DIR}/Pacpus/kernel/InputOutputBase.h
|
---|
83 | ${PACPUS_INCLUDE_DIR}/Pacpus/kernel/PacpusEvent.h
|
---|
84 | )
|
---|
85 |
|
---|
86 | qt5_wrap_cpp(
|
---|
87 | PROJECT_MOC_SRCS
|
---|
88 | ${FILES_TO_MOC}
|
---|
89 | )
|
---|
90 |
|
---|
91 | # ========================================
|
---|
92 | # Build a library
|
---|
93 | # ========================================
|
---|
94 | pacpus_add_library(
|
---|
95 | ${PROJECT_NAME} SHARED
|
---|
96 | ${PROJECT_SRCS}
|
---|
97 | ${PROJECT_MOC_SRCS}
|
---|
98 | )
|
---|
99 |
|
---|
100 | if(UNIX)
|
---|
101 | set(OPT_LIBRARIES optimized FileLib debug FileLib_d)
|
---|
102 | else()
|
---|
103 | set(OPT_LIBRARIES optimized ROAD_TIME debug ROAD_TIME_d)
|
---|
104 | endif()
|
---|
105 |
|
---|
106 | # ========================================
|
---|
107 | # Libraries
|
---|
108 | # ========================================
|
---|
109 | target_link_libraries(
|
---|
110 | ${PROJECT_NAME}
|
---|
111 | ${QT_LIBRARIES}
|
---|
112 | ${PACPUS_DEPENDENCIES_LIB}
|
---|
113 | ${OPT_LIBRARIES}
|
---|
114 | )
|
---|
115 |
|
---|
116 | # ========================================
|
---|
117 | # Install
|
---|
118 | # ========================================
|
---|
119 | pacpus_install(${PROJECT_NAME})
|
---|
120 |
|
---|
121 | # ========================================
|
---|
122 | # Folder
|
---|
123 | # ========================================
|
---|
124 | pacpus_folder(${PROJECT_NAME} "libraries")
|
---|