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