0029589: Configuration - allow MFC samples to be built when OCCT is linked statically
[occt.git] / samples / mfc / standard / 06_Ocaf / CMakeLists.txt
1 cmake_minimum_required (VERSION 2.6)
2
3 project (Ocaf)
4
5 add_definitions (-DWINVER=0x0501 -DUNICODE -D_UNICODE)
6 set (CMAKE_MFC_FLAG 2)
7
8 set (Ocaf_SRC_DIR      ${MFC_STANDARD_SAMPLES_DIR}/06_Ocaf/src)
9 set (Ocaf_HEADER_FILES ${Ocaf_SRC_DIR}/NewBoxDlg.h
10                        ${Ocaf_SRC_DIR}/NewCylDlg.h
11                        ${Ocaf_SRC_DIR}/OcafApp.h
12                        ${Ocaf_SRC_DIR}/OcafDoc.h
13                        ${Ocaf_SRC_DIR}/OcafMainFrm.h
14                        ${Ocaf_SRC_DIR}/TOcaf_Commands.hxx
15                        ${Ocaf_SRC_DIR}/StdAfx.h )
16 set (Ocaf_SOURCE_FILES ${Ocaf_SRC_DIR}/NewBoxDlg.cpp
17                        ${Ocaf_SRC_DIR}/NewCylDlg.cpp
18                        ${Ocaf_SRC_DIR}/OcafApp.cpp
19                        ${Ocaf_SRC_DIR}/OcafDoc.cpp
20                        ${Ocaf_SRC_DIR}/OcafMainFrm.cpp
21                        ${Ocaf_SRC_DIR}/TOcaf_Application.cxx
22                        ${Ocaf_SRC_DIR}/TOcaf_Commands.cxx
23                        ${Ocaf_SRC_DIR}/TOcafFunction_BoxDriver.cxx
24                        ${Ocaf_SRC_DIR}/TOcafFunction_CutDriver.cxx
25                        ${Ocaf_SRC_DIR}/TOcafFunction_CylDriver.cxx
26                        ${Ocaf_SRC_DIR}/StdAfx.cpp )
27
28 set (Ocaf_RESOURCE_DIR    ${MFC_STANDARD_SAMPLES_DIR}/06_Ocaf/res)
29 set (Ocaf_RESOURCE_HEADER ${Ocaf_RESOURCE_DIR}/resource.h)
30 set (Ocaf_RESOURCE_FILES  ${Ocaf_RESOURCE_DIR}/ActionsTB.bmp
31                           ${Ocaf_RESOURCE_DIR}/AIS_TB.bmp
32                           ${Ocaf_RESOURCE_DIR}/Toolbar.bmp
33                           ${Ocaf_RESOURCE_DIR}/UndoRedoTB.bmp
34                           ${Ocaf_RESOURCE_DIR}/Ocaf.rc)
35
36 # groups in the VS solution
37 source_group ("Source Files" FILES ${Ocaf_SOURCE_FILES}
38                                    ${COMMON_WINMAIN_FILE})
39
40 source_group ("Header Files" FILES ${Ocaf_HEADER_FILES}
41                                    ${Ocaf_RESOURCE_HEADER})
42
43 source_group ("Resource Files" FILES ${Ocaf_RESOURCE_FILES})
44
45 add_executable (Ocaf WIN32 ${Ocaf_SOURCE_FILES}
46                            ${Ocaf_HEADER_FILES}
47                            ${COMMON_WINMAIN_FILE}
48                            ${Ocaf_RESOURCE_HEADER}
49                            ${Ocaf_RESOURCE_FILES} )
50
51
52 set_property (TARGET Ocaf PROPERTY FOLDER Samples)
53
54 if (SINGLE_GENERATOR)
55   install (TARGETS Ocaf DESTINATION "${INSTALL_DIR_BIN}")
56 else()
57   install (TARGETS Ocaf
58            CONFIGURATIONS Release RelWithDebInfo
59            DESTINATION "${INSTALL_DIR_BIN}")
60   install (TARGETS Ocaf
61            CONFIGURATIONS Debug
62            DESTINATION "${INSTALL_DIR_BIN}d")
63 endif()
64
65 include_directories (${CMAKE_BINARY_DIR}/inc
66                      ${MFC_STANDARD_SAMPLES_DIR}/06_Ocaf
67                      ${Ocaf_SRC_DIR}
68                      ${MFC_STANDARD_SAMPLES_DIR}/Common)
69
70 target_link_libraries (Ocaf mfcsample TKLCAF TKVCAF TKBO TKBin TKXml TKBinL TKXmlL)