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