0027514: Configuration, CMake - relative paths are not correctly handled for INSTALL_DIR
[occt.git] / samples / mfc / standard / 07_Triangulation / CMakeLists.txt
1 cmake_minimum_required (VERSION 2.6)
2
3 project (Triangulation)
4
5 add_definitions (-DWINVER=0x0501 -DUNICODE -D_UNICODE)
6 set (CMAKE_MFC_FLAG 2)
7
8 set (Triangulation_SRC_DIR      ${MFC_STANDARD_SAMPLES_DIR}/07_Triangulation/src)
9 set (Triangulation_HEADER_FILES ${Triangulation_SRC_DIR}/ISession_Curve.h
10                                 ${Triangulation_SRC_DIR}/OCCDemo_Presentation.h
11                                 ${Triangulation_SRC_DIR}/Tesselate_Presentation.h
12                                 ${Triangulation_SRC_DIR}/TriangulationApp.h
13                                 ${Triangulation_SRC_DIR}/TriangulationDoc.h
14                                 ${Triangulation_SRC_DIR}/StdAfx.h )
15 set (Triangulation_SOURCE_FILES ${Triangulation_SRC_DIR}/ISession_Curve.cpp
16                                 ${Triangulation_SRC_DIR}/OCCDemo_Presentation.cpp
17                                 ${Triangulation_SRC_DIR}/Tesselate_Presentation.cpp
18                                 ${Triangulation_SRC_DIR}/TriangulationApp.cpp
19                                 ${Triangulation_SRC_DIR}/TriangulationDoc.cpp
20                                 ${Triangulation_SRC_DIR}/StdAfx.cpp)
21
22 set (Triangulation_RESOURCE_DIR    ${MFC_STANDARD_SAMPLES_DIR}/07_Triangulation/res)
23 set (Triangulation_RESOURCE_HEADER ${Triangulation_RESOURCE_DIR}/resource.h)
24 set (Triangulation_RESOURCE_FILES  ${Triangulation_RESOURCE_DIR}/Toolbar.bmp
25                                    ${Triangulation_RESOURCE_DIR}/Triangulation.rc)
26
27 # groups in the VS solution
28 source_group ("Source Files" FILES ${Triangulation_SOURCE_FILES}
29                                    ${COMMON_WINMAIN_FILE})
30
31 source_group ("Header Files" FILES ${Triangulation_HEADER_FILES}
32                                    ${Triangulation_RESOURCE_HEADER})
33
34 source_group ("Resource Files" FILES ${Triangulation_RESOURCE_FILES})
35
36 add_executable (Triangulation WIN32 ${Triangulation_SOURCE_FILES}
37                                     ${Triangulation_HEADER_FILES}
38                                     ${COMMON_WINMAIN_FILE}
39                                     ${Triangulation_RESOURCE_HEADER}
40                                     ${Triangulation_RESOURCE_FILES})
41
42 set_property (TARGET Triangulation PROPERTY FOLDER Samples)
43
44 if (SINGLE_GENERATOR)
45   install (TARGETS Triangulation DESTINATION "${INSTALL_DIR_BIN}")
46 else()
47   install (TARGETS Triangulation
48            CONFIGURATIONS Release RelWithDebInfo
49            DESTINATION "${INSTALL_DIR_BIN}")
50   install (TARGETS Triangulation
51            CONFIGURATIONS Debug
52            DESTINATION "${INSTALL_DIR_BIN}d")
53 endif()
54
55 include_directories (${CMAKE_BINARY_DIR}/inc
56                      ${MFC_STANDARD_SAMPLES_DIR}/07_Triangulation
57                      ${Triangulation_SRC_DIR}
58                      ${MFC_STANDARD_SAMPLES_DIR}/Common)
59
60 target_link_libraries (Triangulation mfcsample TKSTEP209 TKSTEPAttr TKBO)