0028060: Samples - Objects in Geometry/Viewer2d have incorrect color
[occt.git] / samples / mfc / standard / mfcsample / CMakeLists.txt
1 cmake_minimum_required (VERSION 2.6)
2
3 project (mfcsample)
4
5 add_definitions(-DWINVER=0x0501 -D_AFXEXT -DUNICODE -D_UNICODE)
6 set (CMAKE_MFC_FLAG 2)
7
8 # mfcsample
9 set (mfcsample_SOURCE_FILES ${MFC_STANDARD_SAMPLES_DIR}/mfcsample/src/mfcsample.cpp
10                             ${MFC_STANDARD_SAMPLES_DIR}/mfcsample/src/StdAfx.cpp )
11
12 SET (MFC_STANDARD_COMMON_SAMPLES_DIR "${MFC_STANDARD_SAMPLES_DIR}/Common")
13 set (COMMON_SOURCE_FILES ${MFC_STANDARD_COMMON_SAMPLES_DIR}/AISDialogs.cpp
14                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/OCC_2dDoc.cpp
15                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/OCC_2dChildFrame.cpp
16                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/OCC_2dView.cpp
17                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/OCC_3dBaseDoc.cpp
18                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/OCC_App.cpp
19                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/OCC_3dDoc.cpp
20                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/OCC_3dChildFrame.cpp
21                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/OCC_3dView.cpp
22                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/OCC_BaseDoc.cpp
23                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/OCC_BaseChildFrame.cpp
24                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/OCC_BaseView.cpp
25                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/OCC_MainFrame.cpp
26                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/OCC_StereoConfigDlg.cpp
27                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/ParamsFacesPage.cpp
28                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/ResultDialog.cpp
29                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/User_Cylinder.cxx
30                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/ColoredMeshDlg.cpp
31                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/DimensionDlg.cpp
32                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/LengthParamsEdgePage.cpp
33                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/LengthParamsVerticesPage.cpp
34                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/RadiusParamsPage.cpp
35                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/LengthParamsEdgesPage.cpp
36                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/LengthParamsVerticesPage.cpp
37                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/AngleParamsVerticesPage.cpp)
38
39 # Common ImportExport
40 set (COMMON_IE_DIR          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/ImportExport)
41 set (COMMON_IE_HEADER_FILES ${COMMON_IE_DIR}/ImportExport.h
42                             ${COMMON_IE_DIR}/SaveSTEPDlg.h )
43 set (COMMON_IE_SOURCE_FILES ${COMMON_IE_DIR}/ImportExport.cpp
44                             ${COMMON_IE_DIR}/SaveSTEPDlg.cpp )
45
46 # Common ISession2D
47 set (COMMON_ISESSION2D_DIR          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/ISession2D)
48 set (COMMON_ISESSION2D_HEADER_FILES ${COMMON_ISESSION2D_DIR}/ISession2D_Shape.h )
49 set (COMMON_ISESSION2D_SOURCE_FILES ${COMMON_ISESSION2D_DIR}/ISession2D_Shape.cpp )
50
51 # Common Primitive
52 set (COMMON_PRIMITIVE_DIR          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/Primitive)
53 set (COMMON_PRIMITIVE_HEADER_FILES ${COMMON_PRIMITIVE_DIR}/Sample2D_Face.h
54                                    ${COMMON_PRIMITIVE_DIR}/Sample2D_Image.h
55                                    ${COMMON_PRIMITIVE_DIR}/Sample2D_Markers.h )
56 set (COMMON_PRIMITIVE_SOURCE_FILES ${COMMON_PRIMITIVE_DIR}/Sample2D_Face.cpp
57                                    ${COMMON_PRIMITIVE_DIR}/Sample2D_Image.cpp
58                                    ${COMMON_PRIMITIVE_DIR}/Sample2D_Markers.cpp )
59
60 # Common Resource2D
61 set (COMMON_RESOURCE2D_DIR          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/Resource2D)
62 set (COMMON_RESOURCE2D_HEADER_FILES ${COMMON_RESOURCE2D_DIR}/CircularGrid.h
63                                     ${COMMON_RESOURCE2D_DIR}/RectangularGrid.h )
64 set (COMMON_RESOURCE2D_SOURCE_FILES ${COMMON_RESOURCE2D_DIR}/CircularGrid.cpp
65                                     ${COMMON_RESOURCE2D_DIR}/RectangularGrid.cpp )
66
67 # Common headers
68 set (COMMON_HEADER_FILES ${MFC_STANDARD_COMMON_SAMPLES_DIR}/AISDialogs.h
69                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/OCC_2dDoc.h
70                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/OCC_2dChildFrame.h
71                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/OCC_2dView.h
72                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/OCC_3dBaseDoc.h
73                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/OCC_App.h
74                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/OCC_3dDoc.h
75                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/OCC_3dChildFrame.h
76                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/OCC_3dView.h
77                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/OCC_BaseDoc.h
78                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/OCC_BaseChildFrame.h
79                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/OCC_BaseView.h
80                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/OCC_MainFrame.h
81                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/OCC_StereoConfigDlg.h
82                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/ParamsFacesPage.h
83                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/ResultDialog.h
84                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/User_Cylinder.hxx
85                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/ColoredMeshDlg.h
86                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/DimensionDlg.h
87                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/LengthParamsEdgePage.h
88                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/LengthParamsVerticesPage.h
89                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/RadiusParamsPage.h
90                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/LengthParamsEdgesPage.h
91                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/LengthParamsVerticesPage.h
92                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/AngleParamsVerticesPage.h)
93
94
95 # Common resources
96 set (COMMON_RESOURCE_DIR   ${MFC_STANDARD_COMMON_SAMPLES_DIR}/res)
97 set (COMMON_RESOURCE_FILES ${COMMON_RESOURCE_DIR}/2dChildFrameTB.bmp
98                            ${COMMON_RESOURCE_DIR}/2dType.ico
99                            ${COMMON_RESOURCE_DIR}/3dChildFrameTB.bmp
100                            ${COMMON_RESOURCE_DIR}/3dType.ico
101                            ${COMMON_RESOURCE_DIR}/AIS_TB.bmp
102                            ${COMMON_RESOURCE_DIR}/coloredm.bmp
103                            ${COMMON_RESOURCE_DIR}/MainFrame.ico
104                            ${COMMON_RESOURCE_DIR}/occ_logo.bmp
105                            ${COMMON_RESOURCE_DIR}/OCC_Resource.rc)
106
107 # groups in the VS solution
108 source_group ( "Header Files" FILES   ${COMMON_HEADER_FILES}
109                                       ${COMMON_IE_HEADER_FILES}
110                                       ${COMMON_PRIMITIVE_HEADER_FILES}
111                                       ${COMMON_RESOURCE2D_HEADER_FILES}
112                                       ${COMMON_ISESSION2D_HEADER_FILES})
113
114 source_group ("Source Files" FILES    ${mfcsample_SOURCE_FILES}
115                                       ${COMMON_SOURCE_FILES}
116                                       ${COMMON_IE_SOURCE_FILES}
117                                       ${COMMON_PRIMITIVE_SOURCE_FILES}
118                                       ${COMMON_RESOURCE2D_SOURCE_FILES}
119                                       ${COMMON_ISESSION2D_SOURCE_FILES})
120
121 source_group ( "Resource Files" FILES ${COMMON_RESOURCE_FILES})
122
123 # mfcsample library
124 add_library ( mfcsample SHARED ${mfcsample_SOURCE_FILES}
125                                ${COMMON_HEADER_FILES}
126                                ${COMMON_SOURCE_FILES}
127                                ${COMMON_IE_HEADER_FILES}
128                                ${COMMON_IE_SOURCE_FILES}
129                                ${COMMON_PRIMITIVE_HEADER_FILES}
130                                ${COMMON_PRIMITIVE_SOURCE_FILES}
131                                ${COMMON_RESOURCE2D_HEADER_FILES}
132                                ${COMMON_RESOURCE2D_SOURCE_FILES}
133                                ${COMMON_ISESSION2D_HEADER_FILES}
134                                ${COMMON_ISESSION2D_SOURCE_FILES}
135                                ${COMMON_RESOURCE_FILES})
136
137 set_property (TARGET mfcsample PROPERTY FOLDER Samples)
138
139 if (SINGLE_GENERATOR)
140   install (TARGETS mfcsample
141            RUNTIME DESTINATION "${INSTALL_DIR_BIN}"
142            ARCHIVE DESTINATION "${INSTALL_DIR_LIB}"
143            LIBRARY DESTINATION "${INSTALL_DIR_LIB}")
144 else()
145   install (TARGETS mfcsample
146            CONFIGURATIONS Release RelWithDebInfo
147            RUNTIME DESTINATION "${INSTALL_DIR_BIN}"
148            ARCHIVE DESTINATION "${INSTALL_DIR_LIB}"
149            LIBRARY DESTINATION "${INSTALL_DIR_LIB}")
150   install (TARGETS mfcsample
151            CONFIGURATIONS Debug
152            RUNTIME DESTINATION "${INSTALL_DIR_BIN}d"
153            ARCHIVE DESTINATION "${INSTALL_DIR_LIB}d"
154            LIBRARY DESTINATION "${INSTALL_DIR_LIB}d")
155 endif()
156
157 include_directories( ${CMAKE_BINARY_DIR}/inc
158                      ${MFC_STANDARD_COMMON_SAMPLES_DIR}
159                      ${COMMON_IE_DIR}
160                      ${COMMON_ISESSION2D_DIR}
161                      ${COMMON_PRIMITIVE_DIR}
162                      ${COMMON_RESOURCE2D_DIR})
163
164 # OCCT libraries for using
165 set (mfcsample_USED_LIBS  TKVRML
166                           TKSTL
167                           TKBRep
168                           TKIGES
169                           TKShHealing
170                           TKSTEP
171                           TKXSBase
172                           TKBool
173                           TKCAF
174                           TKCDF
175                           TKernel
176                           TKFeat
177                           TKFillet
178                           TKG2d
179                           TKG3d
180                           TKGeomAlgo
181                           TKGeomBase
182                           TKHLR
183                           TKMath
184                           TKOffset
185                           TKOpenGl
186                           TKPrim
187                           TKService
188                           TKTopAlgo
189                           TKMesh
190                           TKV3d)
191
192 target_link_libraries (mfcsample ${mfcsample_USED_LIBS})