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 | )
|
---|
49 |
|
---|
50 | # ========================================
|
---|
51 | # Files to MOC
|
---|
52 | # ========================================
|
---|
53 | set(
|
---|
54 | FILES_TO_MOC
|
---|
55 | ${PACPUS_INCLUDE_DIR}/PacpusTools/AsyncWorkerBase.h
|
---|
56 | )
|
---|
57 |
|
---|
58 | # ========================================
|
---|
59 | # Call MOC
|
---|
60 | # ========================================
|
---|
61 | qt4_wrap_cpp(
|
---|
62 | PROJECT_MOC_SRCS
|
---|
63 | ${FILES_TO_MOC}
|
---|
64 | )
|
---|
65 |
|
---|
66 | # ========================================
|
---|
67 | # Platform specific sources
|
---|
68 | # ========================================
|
---|
69 | # Unix
|
---|
70 | if(UNIX)
|
---|
71 | list(
|
---|
72 | APPEND PROJECT_SRCS
|
---|
73 | ${PACPUS_INCLUDE_DIR}/PacpusTools/PosixShMem.h
|
---|
74 | src/PosixShMem.cpp
|
---|
75 | )
|
---|
76 | endif()
|
---|
77 | # Windows
|
---|
78 | if(WIN32)
|
---|
79 | list(
|
---|
80 | APPEND PROJECT_SRCS
|
---|
81 | ${PACPUS_INCLUDE_DIR}/PacpusTools/Win32ShMem.h
|
---|
82 | src/Win32ShMem.cpp
|
---|
83 | )
|
---|
84 | endif()
|
---|
85 |
|
---|
86 | # ========================================
|
---|
87 | # Build a library
|
---|
88 | # ========================================
|
---|
89 | add_library(
|
---|
90 | ${PROJECT_NAME}
|
---|
91 | ${PROJECT_SRCS}
|
---|
92 | ${PROJECT_MOC_SRCS}
|
---|
93 | )
|
---|
94 |
|
---|
95 | # ========================================
|
---|
96 | # Properties
|
---|
97 | # ========================================
|
---|
98 | set_target_properties(
|
---|
99 | ${PROJECT_NAME}
|
---|
100 | PROPERTIES DEBUG_POSTFIX "_d"
|
---|
101 | )
|
---|
102 |
|
---|
103 | # ========================================
|
---|
104 | # Install directories
|
---|
105 | # ========================================
|
---|
106 | install(
|
---|
107 | TARGETS ${PROJECT_NAME}
|
---|
108 | RUNTIME DESTINATION ${PACPUS_INSTALL_DIR}/bin
|
---|
109 | LIBRARY DESTINATION ${PACPUS_INSTALL_DIR}/lib
|
---|
110 | ARCHIVE DESTINATION ${PACPUS_INSTALL_DIR}/lib
|
---|
111 | )
|
---|