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 | ${QT_DEFINITIONS}
|
---|
26 | )
|
---|
27 |
|
---|
28 | # ========================================
|
---|
29 | # Include directories
|
---|
30 | # ========================================
|
---|
31 | include_directories(
|
---|
32 | ${QT_INCLUDE_DIR}
|
---|
33 | )
|
---|
34 |
|
---|
35 | # ========================================
|
---|
36 | # List of sources
|
---|
37 | # ========================================
|
---|
38 | set(
|
---|
39 | PROJECT_SRCS
|
---|
40 | ${PACPUS_INCLUDE_DIR}/PacpusTools/matrice.h
|
---|
41 | ${PACPUS_INCLUDE_DIR}/PacpusTools/BinaryDecoder.h
|
---|
42 | ${PACPUS_INCLUDE_DIR}/PacpusTools/PosixShMem.h
|
---|
43 | ${PACPUS_INCLUDE_DIR}/PacpusTools/ShMem.h
|
---|
44 | ${PACPUS_INCLUDE_DIR}/PacpusTools/geodesie.h
|
---|
45 | ./src/matrice.cpp
|
---|
46 | ./src/geodesie.cpp
|
---|
47 | ./src/AsyncWorkerBase.cpp
|
---|
48 | ./src/PeriodicWorker.cpp
|
---|
49 | )
|
---|
50 |
|
---|
51 | # ========================================
|
---|
52 | # Files to MOC
|
---|
53 | # ========================================
|
---|
54 | set(
|
---|
55 | FILES_TO_MOC
|
---|
56 | ${PACPUS_INCLUDE_DIR}/PacpusTools/AsyncWorkerBase.h
|
---|
57 | ${PACPUS_INCLUDE_DIR}/PacpusTools/PeriodicWorker.h
|
---|
58 | )
|
---|
59 |
|
---|
60 | # ========================================
|
---|
61 | # Call MOC
|
---|
62 | # ========================================
|
---|
63 | qt4_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}/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}/PacpusTools/Win32ShMem.h
|
---|
84 | src/Win32ShMem.cpp
|
---|
85 | )
|
---|
86 | endif()
|
---|
87 |
|
---|
88 | # ========================================
|
---|
89 | # Build a library
|
---|
90 | # ========================================
|
---|
91 | add_library(
|
---|
92 | ${PROJECT_NAME}
|
---|
93 | ${PROJECT_SRCS}
|
---|
94 | ${PROJECT_MOC_SRCS}
|
---|
95 | )
|
---|
96 |
|
---|
97 | # ========================================
|
---|
98 | # Properties
|
---|
99 | # ========================================
|
---|
100 | set_target_properties(
|
---|
101 | ${PROJECT_NAME}
|
---|
102 | PROPERTIES DEBUG_POSTFIX "_d"
|
---|
103 | )
|
---|
104 |
|
---|
105 | # ========================================
|
---|
106 | # Install directories
|
---|
107 | # ========================================
|
---|
108 | install(
|
---|
109 | TARGETS ${PROJECT_NAME}
|
---|
110 | RUNTIME DESTINATION ${PACPUS_INSTALL_DIR}/bin
|
---|
111 | LIBRARY DESTINATION ${PACPUS_INSTALL_DIR}/lib
|
---|
112 | ARCHIVE DESTINATION ${PACPUS_INSTALL_DIR}/lib
|
---|
113 | )
|
---|