0025114: CMake-based build tools for OCCT 7.0
[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                                    ${COMMON_PRIMITIVE_DIR}/Sample2D_Text.h )
57 set (COMMON_PRIMITIVE_SOURCE_FILES ${COMMON_PRIMITIVE_DIR}/Sample2D_Face.cpp
58                                    ${COMMON_PRIMITIVE_DIR}/Sample2D_Image.cpp
59                                    ${COMMON_PRIMITIVE_DIR}/Sample2D_Markers.cpp
60                                    ${COMMON_PRIMITIVE_DIR}/Sample2D_Text.cpp )
61
62 # Common Resource2D
63 set (COMMON_RESOURCE2D_DIR          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/Resource2D)
64 set (COMMON_RESOURCE2D_HEADER_FILES ${COMMON_RESOURCE2D_DIR}/CircularGrid.h
65                                     ${COMMON_RESOURCE2D_DIR}/RectangularGrid.h )
66 set (COMMON_RESOURCE2D_SOURCE_FILES ${COMMON_RESOURCE2D_DIR}/CircularGrid.cpp
67                                     ${COMMON_RESOURCE2D_DIR}/RectangularGrid.cpp )
68
69 # Common headers
70 set (COMMON_HEADER_FILES ${MFC_STANDARD_COMMON_SAMPLES_DIR}/AISDialogs.h
71                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/OCC_2dDoc.h
72                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/OCC_2dChildFrame.h
73                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/OCC_2dView.h
74                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/OCC_3dBaseDoc.h
75                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/OCC_App.h
76                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/OCC_3dDoc.h
77                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/OCC_3dChildFrame.h
78                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/OCC_3dView.h
79                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/OCC_BaseDoc.h
80                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/OCC_BaseChildFrame.h
81                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/OCC_BaseView.h
82                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/OCC_MainFrame.h
83                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/OCC_StereoConfigDlg.h
84                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/ParamsFacesPage.h
85                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/ResultDialog.h
86                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/User_Cylinder.hxx
87                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/ColoredMeshDlg.h
88                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/DimensionDlg.h
89                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/LengthParamsEdgePage.h
90                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/LengthParamsVerticesPage.h
91                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/RadiusParamsPage.h
92                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/LengthParamsEdgesPage.h
93                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/LengthParamsVerticesPage.h
94                          ${MFC_STANDARD_COMMON_SAMPLES_DIR}/AngleParamsVerticesPage.h)
95
96
97 # Common resources
98 set (COMMON_RESOURCE_DIR   ${MFC_STANDARD_COMMON_SAMPLES_DIR}/res)
99 set (COMMON_RESOURCE_FILES ${COMMON_RESOURCE_DIR}/2dChildFrameTB.bmp
100                            ${COMMON_RESOURCE_DIR}/2dType.ico
101                            ${COMMON_RESOURCE_DIR}/3dChildFrameTB.bmp
102                            ${COMMON_RESOURCE_DIR}/3dType.ico
103                            ${COMMON_RESOURCE_DIR}/AIS_TB.bmp
104                            ${COMMON_RESOURCE_DIR}/coloredm.bmp
105                            ${COMMON_RESOURCE_DIR}/MainFrame.ico
106                            ${COMMON_RESOURCE_DIR}/occ_logo.bmp
107                            ${COMMON_RESOURCE_DIR}/OCC_Resource.rc)
108
109 # groups in the VS solution
110 source_group ( "Header Files" FILES   ${COMMON_HEADER_FILES}
111                                       ${COMMON_IE_HEADER_FILES}
112                                       ${COMMON_PRIMITIVE_HEADER_FILES}
113                                       ${COMMON_RESOURCE2D_HEADER_FILES}
114                                       ${COMMON_ISESSION2D_HEADER_FILES})
115
116 source_group ("Source Files" FILES    ${mfcsample_SOURCE_FILES}
117                                       ${COMMON_SOURCE_FILES}
118                                       ${COMMON_IE_SOURCE_FILES}
119                                       ${COMMON_PRIMITIVE_SOURCE_FILES}
120                                       ${COMMON_RESOURCE2D_SOURCE_FILES}
121                                       ${COMMON_ISESSION2D_SOURCE_FILES})
122
123 source_group ( "Resource Files" FILES ${COMMON_RESOURCE_FILES})
124
125 # mfcsample library
126 add_library ( mfcsample SHARED ${mfcsample_SOURCE_FILES}
127                                ${COMMON_HEADER_FILES}
128                                ${COMMON_SOURCE_FILES}
129                                ${COMMON_IE_HEADER_FILES}
130                                ${COMMON_IE_SOURCE_FILES}
131                                ${COMMON_PRIMITIVE_HEADER_FILES}
132                                ${COMMON_PRIMITIVE_SOURCE_FILES}
133                                ${COMMON_RESOURCE2D_HEADER_FILES}
134                                ${COMMON_RESOURCE2D_SOURCE_FILES}
135                                ${COMMON_ISESSION2D_HEADER_FILES}
136                                ${COMMON_ISESSION2D_SOURCE_FILES}
137                                ${COMMON_RESOURCE_FILES})
138
139 set_property (TARGET mfcsample PROPERTY FOLDER Samples)
140
141 install (TARGETS mfcsample RUNTIME DESTINATION "${INSTALL_DIR}/win${COMPILER_BITNESS}/${COMPILER}/bin${BUILD_POSTFIX}"
142                            ARCHIVE DESTINATION "${INSTALL_DIR}/win${COMPILER_BITNESS}/${COMPILER}/lib${BUILD_POSTFIX}"
143                            LIBRARY DESTINATION "${INSTALL_DIR}/win${COMPILER_BITNESS}/${COMPILER}/lib${BUILD_POSTFIX}")
144
145 include_directories( ${CMAKE_SOURCE_DIR}/src
146                      ${MFC_STANDARD_COMMON_SAMPLES_DIR}
147                      ${COMMON_IE_DIR}
148                      ${COMMON_ISESSION2D_DIR}
149                      ${COMMON_PRIMITIVE_DIR}
150                      ${COMMON_RESOURCE2D_DIR})
151
152 # OCCT libraries for using
153 set (mfcsample_USED_LIBS  TKVRML
154                           TKSTL
155                           TKBRep
156                           TKIGES
157                           TKShHealing
158                           TKSTEP
159                           TKXSBase
160                           FWOSPlugin
161                           TKBool
162                           TKCAF
163                           TKCDF
164                           TKernel
165                           TKFeat
166                           TKFillet
167                           TKG2d
168                           TKG3d
169                           TKGeomAlgo
170                           TKGeomBase
171                           TKHLR
172                           TKMath
173                           TKOffset
174                           TKOpenGl
175                           TKPrim
176                           TKService
177                           TKTopAlgo
178                           TKMesh
179                           TKV3d)
180
181 target_link_libraries (mfcsample ${mfcsample_USED_LIBS})