0027514: Configuration, CMake - relative paths are not correctly handled for INSTALL_DIR
[occt.git] / samples / mfc / standard / 01_Geometry / CMakeLists.txt
1 cmake_minimum_required (VERSION 2.6)
2
3 project (Geometry)
4
5 add_definitions(-DWINVER=0x0501 -DUNICODE -D_UNICODE)
6 set (CMAKE_MFC_FLAG 2)
7
8 set (Geometry_SRC_DIR      ${MFC_STANDARD_SAMPLES_DIR}/01_Geometry/src)
9 set (Geometry_HEADER_FILES ${Geometry_SRC_DIR}/ChildFrm.h
10                            ${Geometry_SRC_DIR}/ChildFrm2d.h
11                            ${Geometry_SRC_DIR}/GeoAlgo_Sol.hxx
12                            ${Geometry_SRC_DIR}/GeometryApp.h
13                            ${Geometry_SRC_DIR}/GeometryDoc.h
14                            ${Geometry_SRC_DIR}/GeometryView.h
15                            ${Geometry_SRC_DIR}/GeometryView2D.h
16                            ${Geometry_SRC_DIR}/GeomSources.h
17                            ${Geometry_SRC_DIR}/MainFrm.h
18                            ${Geometry_SRC_DIR}/StdAfx.h )
19 set (Geometry_SOURCE_FILES ${Geometry_SRC_DIR}/ChildFrm.cpp
20                            ${Geometry_SRC_DIR}/ChildFrm2d.cpp
21                            ${Geometry_SRC_DIR}/GeoAlgo_Sol.cxx
22                            ${Geometry_SRC_DIR}/GeometryApp.cpp
23                            ${Geometry_SRC_DIR}/GeometryDoc.cpp
24                            ${Geometry_SRC_DIR}/GeometryView.cpp
25                            ${Geometry_SRC_DIR}/GeometryView2D.cpp
26                            ${Geometry_SRC_DIR}/GeomSources.cpp
27                            ${Geometry_SRC_DIR}/MainFrm.cpp
28                            ${Geometry_SRC_DIR}/StdAfx.cpp )
29
30 set (Geometry_ISESSION2D_DIR          ${Geometry_SRC_DIR}/ISession2D)
31 set (Geometry_ISESSION2D_HEADER_FILES ${Geometry_ISESSION2D_DIR}/ISession_Curve.h
32                                       ${Geometry_ISESSION2D_DIR}/ISession_Direction.h
33                                       ${Geometry_ISESSION2D_DIR}/ISession_Point.h
34                                       ${Geometry_ISESSION2D_DIR}/ISession_Surface.h
35                                       ${Geometry_ISESSION2D_DIR}/ISession_Text.h
36                                       ${Geometry_ISESSION2D_DIR}/ISession2D_Curve.h)
37 set (Geometry_ISESSION2D_SOURCE_FILES ${Geometry_ISESSION2D_DIR}/ISession_Curve.cpp
38                                       ${Geometry_ISESSION2D_DIR}/ISession_Direction.cpp
39                                       ${Geometry_ISESSION2D_DIR}/ISession_Point.cpp
40                                       ${Geometry_ISESSION2D_DIR}/ISession_Surface.cpp
41                                       ${Geometry_ISESSION2D_DIR}/ISession_Text.cpp
42                                       ${Geometry_ISESSION2D_DIR}/ISession2D_Curve.cpp)
43
44 set (Geometry_RESOURCE_DIR            ${MFC_STANDARD_SAMPLES_DIR}/01_Geometry/res)
45 set (Geometry_RESOURCE_HEADER         ${Geometry_RESOURCE_DIR}/resource.h)
46 set (Geometry_RESOURCE_FILES          ${Geometry_RESOURCE_DIR}/Geometry.rc
47                                       ${Geometry_RESOURCE_DIR}/Toolbar1.bmp
48                                       ${Geometry_RESOURCE_DIR}/Toolbar2.bmp)
49
50 # groups in the VS solution
51 source_group ("Source Files" FILES ${Geometry_SOURCE_FILES}
52                                    ${COMMON_WINMAIN_FILE})
53
54 source_group ("Source Files\\ISession2d" FILES ${Geometry_ISESSION2D_SOURCE_FILES})
55
56 source_group ("Header Files" FILES ${Geometry_HEADER_FILES}
57                                    ${Geometry_ISESSION2D_HEADER_FILES}
58                                    ${Geometry_RESOURCE_HEADER})
59
60 source_group ("Resource Files" FILES ${Geometry_RESOURCE_FILES})
61
62 add_executable (Geometry WIN32 ${Geometry_SOURCE_FILES}
63                                ${Geometry_HEADER_FILES}
64                                ${COMMON_WINMAIN_FILE}
65                                ${Geometry_ISESSION2D_SOURCE_FILES}
66                                ${Geometry_ISESSION2D_HEADER_FILES}
67                                ${Geometry_RESOURCE_FILES}
68                                ${Geometry_RESOURCE_HEADER})
69
70 set_property(TARGET Geometry PROPERTY FOLDER Samples)
71
72 if (SINGLE_GENERATOR)
73   install (TARGETS Geometry DESTINATION "${INSTALL_DIR_BIN}")
74 else()
75   install (TARGETS Geometry
76            CONFIGURATIONS Release RelWithDebInfo
77            DESTINATION "${INSTALL_DIR_BIN}")
78   install (TARGETS Geometry
79            CONFIGURATIONS Debug
80            DESTINATION "${INSTALL_DIR_BIN}d")
81 endif()
82
83 include_directories (${CMAKE_BINARY_DIR}/inc
84                      ${Geometry_SRC_DIR}
85                      ${Geometry_ISESSION2D_DIR}
86                      ${Geometry_RESOURCE_DIR}
87                      ${MFC_STANDARD_SAMPLES_DIR}/Common)
88
89 target_link_libraries (Geometry mfcsample)