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