1 | #################################################
|
---|
2 | # ___________ ____ ______ __ __ _____ #
|
---|
3 | # \____ \__ \ _/ ___\\____ \| | \/ ___/ #
|
---|
4 | # | |_> > __ \\ \___| |_> > | /\___ \ #
|
---|
5 | # | __(____ /\___ > __/|____//____ > #
|
---|
6 | # |__| \/ \/|__| \/ #
|
---|
7 | # #
|
---|
8 | #################################################
|
---|
9 | project(PacpusTools)
|
---|
10 |
|
---|
11 | create_export(EXPORT_HDR ${PROJECT_NAME} "${PACPUS_INCLUDE_DIR}/Pacpus/PacpusTools")
|
---|
12 |
|
---|
13 | # ========================================
|
---|
14 | # Compiler definitions
|
---|
15 | # ========================================
|
---|
16 | add_definitions(${QT_DEFINITIONS})
|
---|
17 |
|
---|
18 | # ========================================
|
---|
19 | # Include directories
|
---|
20 | # ========================================
|
---|
21 | include_directories(${QT_INCLUDE_DIR})
|
---|
22 |
|
---|
23 | # ========================================
|
---|
24 | # Link directories
|
---|
25 | # ========================================
|
---|
26 | link_directories(
|
---|
27 | ${PROJECT_BINARY_DIR}/../PacpusLib
|
---|
28 | ${PROJECT_BINARY_DIR}/../RoadTime
|
---|
29 | )
|
---|
30 |
|
---|
31 | # ========================================
|
---|
32 | # List of sources
|
---|
33 | # ========================================
|
---|
34 | set(PROJECT_HDRS
|
---|
35 | ${EXPORT_HDR}
|
---|
36 | ${PACPUS_INCLUDE_DIR}/Pacpus/PacpusTools/AsyncWorkerBase.h
|
---|
37 | ${PACPUS_INCLUDE_DIR}/Pacpus/PacpusTools/BinaryDecoder.h
|
---|
38 | ${PACPUS_INCLUDE_DIR}/Pacpus/PacpusTools/geodesie.h
|
---|
39 | ${PACPUS_INCLUDE_DIR}/Pacpus/PacpusTools/matrice.h
|
---|
40 | ${PACPUS_INCLUDE_DIR}/Pacpus/PacpusTools/PeriodicWorker.h
|
---|
41 | ${PACPUS_INCLUDE_DIR}/Pacpus/PacpusTools/PosixShMem.h
|
---|
42 | ${PACPUS_INCLUDE_DIR}/Pacpus/PacpusTools/ShMem.h
|
---|
43 | #${PACPUS_INCLUDE_DIR}/Pacpus/PacpusTools/pacpusStruct.h
|
---|
44 | #${PACPUS_INCLUDE_DIR}/Pacpus/PacpusTools/PacpusSerialPort.h
|
---|
45 | )
|
---|
46 |
|
---|
47 | set(PROJECT_SRCS
|
---|
48 | ./src/matrice.cpp
|
---|
49 | ./src/geodesie.cpp
|
---|
50 | ./src/AsyncWorkerBase.cpp
|
---|
51 | ./src/PeriodicWorker.cpp
|
---|
52 | #./src/PacpusSerialPort.cpp
|
---|
53 | )
|
---|
54 |
|
---|
55 | # ========================================
|
---|
56 | # Files to MOC
|
---|
57 | # ========================================
|
---|
58 | set(FILES_TO_MOC
|
---|
59 | ${PACPUS_INCLUDE_DIR}/Pacpus/PacpusTools/AsyncWorkerBase.h
|
---|
60 | ${PACPUS_INCLUDE_DIR}/Pacpus/PacpusTools/PeriodicWorker.h
|
---|
61 | #${PACPUS_INCLUDE_DIR}/Pacpus/PacpusTools/PacpusSerialPort.h
|
---|
62 | )
|
---|
63 |
|
---|
64 | # ========================================
|
---|
65 | # Call MOC
|
---|
66 | # ========================================
|
---|
67 | qt_wrap_cpp(
|
---|
68 | PROJECT_MOC_SRCS
|
---|
69 | ${FILES_TO_MOC}
|
---|
70 | )
|
---|
71 |
|
---|
72 | # ========================================
|
---|
73 | # Platform specific sources
|
---|
74 | # ========================================
|
---|
75 | # Unix
|
---|
76 | if(UNIX)
|
---|
77 | list(APPEND PROJECT_SRCS
|
---|
78 | ${PACPUS_INCLUDE_DIR}/Pacpus/PacpusTools/PosixShMem.h
|
---|
79 | src/PosixShMem.cpp
|
---|
80 | )
|
---|
81 | endif()
|
---|
82 | # Windows
|
---|
83 | if(WIN32)
|
---|
84 | list(APPEND PROJECT_SRCS
|
---|
85 | ${PACPUS_INCLUDE_DIR}/Pacpus/PacpusTools/Win32ShMem.h
|
---|
86 | src/Win32ShMem.cpp
|
---|
87 | )
|
---|
88 | endif()
|
---|
89 |
|
---|
90 | # ========================================
|
---|
91 | # Build a library
|
---|
92 | # ========================================
|
---|
93 | pacpus_add_library(${PROJECT_NAME} SHARED
|
---|
94 | ${PROJECT_HDRS}
|
---|
95 | ${PROJECT_SRCS}
|
---|
96 | ${PROJECT_MOC_SRCS}
|
---|
97 | )
|
---|
98 |
|
---|
99 | # ========================================
|
---|
100 | # Libraries
|
---|
101 | # ========================================
|
---|
102 | set(OPT_LIBRARIES
|
---|
103 | optimized PacpusLib debug PacpusLib_d
|
---|
104 | )
|
---|
105 |
|
---|
106 | # Windows platform
|
---|
107 | if(WIN32)
|
---|
108 | LIST(APPEND OPT_LIBRARIES
|
---|
109 | optimized ROAD_TIME debug ROAD_TIME_d
|
---|
110 | )
|
---|
111 | endif()
|
---|
112 |
|
---|
113 | target_link_libraries(
|
---|
114 | ${PROJECT_NAME}
|
---|
115 | ${QT_LIBRARIES}
|
---|
116 | ${PACPUS_DEPENDENCIES_LIB}
|
---|
117 | ${OPT_LIBRARIES}
|
---|
118 | )
|
---|
119 |
|
---|
120 | # ========================================
|
---|
121 | # Install
|
---|
122 | # ========================================
|
---|
123 | pacpus_install(${PROJECT_NAME})
|
---|
124 |
|
---|
125 | # ========================================
|
---|
126 | # Folder
|
---|
127 | # ========================================
|
---|
128 | pacpus_folder(${PROJECT_NAME} "libraries")
|
---|