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