1 | #################################################
|
---|
2 | # ___________ ____ ______ __ __ _____ #
|
---|
3 | # \____ \__ \ _/ ___\\____ \| | \/ ___/ #
|
---|
4 | # | |_> > __ \\ \___| |_> > | /\___ \ #
|
---|
5 | # | __(____ /\___ > __/|____//____ > #
|
---|
6 | # |__| \/ \/|__| \/ #
|
---|
7 | # #
|
---|
8 | #################################################
|
---|
9 | project(PacpusTools)
|
---|
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(QT4_FOUND)
|
---|
20 |
|
---|
21 | # ========================================
|
---|
22 | # Compiler definitions
|
---|
23 | # ========================================
|
---|
24 | add_definitions(
|
---|
25 | -DPACPUSTOOLS_EXPORTS
|
---|
26 | ${QT_DEFINITIONS}
|
---|
27 | )
|
---|
28 |
|
---|
29 | # ========================================
|
---|
30 | # Include directories
|
---|
31 | # ========================================
|
---|
32 | include_directories(
|
---|
33 | ${QT_INCLUDE_DIR}
|
---|
34 | )
|
---|
35 |
|
---|
36 | # ========================================
|
---|
37 | # List of sources
|
---|
38 | # ========================================
|
---|
39 | set(
|
---|
40 | PROJECT_SRCS
|
---|
41 | ${PACPUS_INCLUDE_DIR}/Pacpus/PacpusTools/matrice.h
|
---|
42 | ${PACPUS_INCLUDE_DIR}/Pacpus/PacpusTools/BinaryDecoder.h
|
---|
43 | ${PACPUS_INCLUDE_DIR}/Pacpus/PacpusTools/PosixShMem.h
|
---|
44 | ${PACPUS_INCLUDE_DIR}/Pacpus/PacpusTools/ShMem.h
|
---|
45 | ${PACPUS_INCLUDE_DIR}/Pacpus/PacpusTools/geodesie.h
|
---|
46 | ${PACPUS_INCLUDE_DIR}/Pacpus/PacpusTools/AsyncWorkerBase.h
|
---|
47 | ${PACPUS_INCLUDE_DIR}/Pacpus/PacpusTools/PeriodicWorker.h
|
---|
48 | ./src/matrice.cpp
|
---|
49 | ./src/geodesie.cpp
|
---|
50 | ./src/AsyncWorkerBase.cpp
|
---|
51 | ./src/PeriodicWorker.cpp
|
---|
52 | )
|
---|
53 |
|
---|
54 | # ========================================
|
---|
55 | # Files to MOC
|
---|
56 | # ========================================
|
---|
57 | set(
|
---|
58 | FILES_TO_MOC
|
---|
59 | ${PACPUS_INCLUDE_DIR}/Pacpus/PacpusTools/AsyncWorkerBase.h
|
---|
60 | ${PACPUS_INCLUDE_DIR}/Pacpus/PacpusTools/PeriodicWorker.h
|
---|
61 | )
|
---|
62 |
|
---|
63 | # ========================================
|
---|
64 | # Call MOC
|
---|
65 | # ========================================
|
---|
66 | qt4_wrap_cpp(
|
---|
67 | PROJECT_MOC_SRCS
|
---|
68 | ${FILES_TO_MOC}
|
---|
69 | )
|
---|
70 |
|
---|
71 | # ========================================
|
---|
72 | # Platform specific sources
|
---|
73 | # ========================================
|
---|
74 | # Unix
|
---|
75 | if(UNIX)
|
---|
76 | list(
|
---|
77 | 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(
|
---|
85 | APPEND PROJECT_SRCS
|
---|
86 | ${PACPUS_INCLUDE_DIR}/Pacpus/PacpusTools/Win32ShMem.h
|
---|
87 | src/Win32ShMem.cpp
|
---|
88 | )
|
---|
89 | endif()
|
---|
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 | # ========================================
|
---|
101 | # Libraries
|
---|
102 | # ========================================
|
---|
103 | target_link_libraries(
|
---|
104 | ${PROJECT_NAME}
|
---|
105 | ${QT_LIBRARIES}
|
---|
106 | ${PACPUS_DEPENDENCIES_LIB}
|
---|
107 | PacpusLib
|
---|
108 | )
|
---|
109 |
|
---|
110 |
|
---|
111 | # ========================================
|
---|
112 | # Install
|
---|
113 | # ========================================
|
---|
114 | pacpus_install(${PROJECT_NAME})
|
---|
115 |
|
---|
116 | # ========================================
|
---|
117 | # Folder
|
---|
118 | # ========================================
|
---|
119 | pacpus_folder(${PROJECT_NAME} "libraries")
|
---|