0026529: CMake offers rebuilding of platform dependent code unclear for an user
authoribs <ibs@opencascade.com>
Thu, 20 Aug 2015 13:24:50 +0000 (16:24 +0300)
committerski <ski@opencascade.com>
Thu, 20 Aug 2015 13:26:23 +0000 (16:26 +0300)
Fix for building with GCC and CLang

CMake variable descriptions updated
"Building with CMake" article updated

BuildToolkit.cmake cleaned up and renamed
"TestCases" project and all relating variables removed; custom script added for building environment
DrawAppliInit is copied from occt root to CMake binary dir if the file exists

rebuild platform dependent code by cmake cleaned up
Flex & Bison compiler flags added

RelWithDebInfo OCCT libraries are moved to libi folder; the binary is moved to bini one

CMAKE_BUILD_TYPE is set as Release by-default for a single-configuration generator

env.bat in installation folder has default value of CASDEB that equals to the build type of the last installed OCCT libraries

"building with CMake" article updated

86 files changed:
CMakeLists.txt
adm/cmake/3rdparty_macro.cmake
adm/cmake/BuildToolkit.cmake [deleted file]
adm/cmake/bison.cmake [new file with mode: 0644]
adm/cmake/flex.cmake [new file with mode: 0644]
adm/cmake/freetype.cmake
adm/cmake/occt_macros.cmake
adm/cmake/occt_toolkit.cmake [new file with mode: 0644]
adm/cmake/tbb.cmake
adm/cmake/tcl.cmake
adm/cmake/vardescr.cmake [new file with mode: 0644]
adm/cmake/vtk.cmake
adm/templates/custom.bat.main
adm/templates/custom.build.bat.in [new file with mode: 0644]
adm/templates/custom.build.sh.in [new file with mode: 0644]
adm/templates/custom.install.bat.in [moved from adm/templates/custom.bat.in with 90% similarity]
adm/templates/custom.install.sh.in [moved from adm/templates/custom.sh.in with 89% similarity]
adm/templates/env.bat
adm/templates/env.build.bat.in
adm/templates/env.build.sh.in
adm/templates/env.install.bat.in [moved from adm/templates/env.bat.in with 95% similarity]
adm/templates/env.install.sh.in [moved from adm/templates/env.sh.in with 97% similarity]
adm/templates/env.sh
dox/dev_guides/building/building.md
dox/dev_guides/building/cmake/cmake.md
dox/dev_guides/building/cmake/images/cmake_image001.png
dox/dev_guides/building/cmake/images/cmake_image002.png
dox/dev_guides/building/cmake/images/cmake_image007.png
src/DRAWEXE/CMakeLists.txt
src/FWOSPlugin/CMakeLists.txt
src/TKBO/CMakeLists.txt
src/TKBRep/CMakeLists.txt
src/TKBin/CMakeLists.txt
src/TKBinL/CMakeLists.txt
src/TKBinTObj/CMakeLists.txt
src/TKBinXCAF/CMakeLists.txt
src/TKBool/CMakeLists.txt
src/TKCAF/CMakeLists.txt
src/TKCDF/CMakeLists.txt
src/TKDCAF/CMakeLists.txt
src/TKDraw/CMakeLists.txt
src/TKFeat/CMakeLists.txt
src/TKFillet/CMakeLists.txt
src/TKG2d/CMakeLists.txt
src/TKG3d/CMakeLists.txt
src/TKGeomAlgo/CMakeLists.txt
src/TKGeomBase/CMakeLists.txt
src/TKHLR/CMakeLists.txt
src/TKIGES/CMakeLists.txt
src/TKIVtk/CMakeLists.txt
src/TKIVtkDraw/CMakeLists.txt
src/TKLCAF/CMakeLists.txt
src/TKMath/CMakeLists.txt
src/TKMesh/CMakeLists.txt
src/TKMeshVS/CMakeLists.txt
src/TKOffset/CMakeLists.txt
src/TKOpenGl/CMakeLists.txt
src/TKPrim/CMakeLists.txt
src/TKQADraw/CMakeLists.txt
src/TKSTEP/CMakeLists.txt
src/TKSTEP209/CMakeLists.txt
src/TKSTEPAttr/CMakeLists.txt
src/TKSTEPBase/CMakeLists.txt
src/TKSTL/CMakeLists.txt
src/TKService/CMakeLists.txt
src/TKShHealing/CMakeLists.txt
src/TKTObj/CMakeLists.txt
src/TKTObjDRAW/CMakeLists.txt
src/TKTopAlgo/CMakeLists.txt
src/TKTopTest/CMakeLists.txt
src/TKV3d/CMakeLists.txt
src/TKVRML/CMakeLists.txt
src/TKViewerTest/CMakeLists.txt
src/TKVoxel/CMakeLists.txt
src/TKXCAF/CMakeLists.txt
src/TKXDEDRAW/CMakeLists.txt
src/TKXDEIGES/CMakeLists.txt
src/TKXDESTEP/CMakeLists.txt
src/TKXMesh/CMakeLists.txt
src/TKXSBase/CMakeLists.txt
src/TKXSDRAW/CMakeLists.txt
src/TKXml/CMakeLists.txt
src/TKXmlL/CMakeLists.txt
src/TKXmlTObj/CMakeLists.txt
src/TKXmlXCAF/CMakeLists.txt
src/TKernel/CMakeLists.txt

index bfd9c9e..11978c4 100644 (file)
@@ -4,9 +4,21 @@ set (CMAKE_SUPPRESS_REGENERATION TRUE)
 
 set (CMAKE_CONFIGURATION_TYPES Release Debug RelWithDebInfo CACHE INTERNAL "" FORCE)
 
+# macro: include patched file if it exists
+macro (OCCT_INCLUDE_CMAKE_FILE BEING_INCLUDED_FILE)
+  if (NOT "${APPLY_OCCT_PATCH_DIR}" STREQUAL "" AND EXISTS "${APPLY_OCCT_PATCH_DIR}/${BEING_INCLUDED_FILE}.cmake")
+    include (${APPLY_OCCT_PATCH_DIR}/${BEING_INCLUDED_FILE}.cmake)
+  else()
+    include (${BEING_INCLUDED_FILE}.cmake)
+  endif()
+endmacro()
+
+# include variable description
+OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/vardescr")
+
 # set type of OCCT libraries
 if (NOT BUILD_LIBRARY_TYPE)
-  set (BUILD_LIBRARY_TYPE "Shared" CACHE STRING "The type of OCCT libraries" FORCE)
+  set (BUILD_LIBRARY_TYPE "Shared" CACHE STRING "${BUILD_LIBRARY_TYPE_DESCR}" FORCE)
   SET_PROPERTY(CACHE BUILD_LIBRARY_TYPE PROPERTY STRINGS Shared Static)
 endif()
 
@@ -22,65 +34,48 @@ project (OCCT)
 # Solution folder property
 set_property (GLOBAL PROPERTY USE_FOLDERS ON)
 
-# Tests
-set (TESTS_RUN OFF CACHE BOOL "Run tests or not")
-set (TESTS_INSTALL OFF CACHE BOOL "Copy tests to folder install")
-set (TESTS_SHAPES_DIR "" CACHE PATH "Directory that will contain shapes for tests" )
-
-# Find Bison and Flex executables to rebuild *.yacc and *.lex files if it is necessary (BUILD_BISON_FLEX_FILES is ON)
-set (BUILD_BISON_FLEX_FILES OFF CACHE BOOL "Build *.yacc/*.lex files")
-if (${BUILD_BISON_FLEX_FILES})
-  foreach (aTool BISON FLEX)
-    list (APPEND CMAKE_PROGRAM_PATH ${BUILD_BISON_FLEX_DIR})
-    find_package (${aTool})
-    if (NOT ${${aTool}_FOUND})
-      message ("Warning : set BUILD_BISON_FLEX_DIR directory")
-      set (BUILD_BISON_FLEX_DIR "" CACHE PATH "Filepath to BISON and FLEX executables")
-      set (BUILD_BISON_FLEX_FILES OFF)
-    endif()
-  endforeach()
+set (INSTALL_OCCT_TEST_CASES OFF CACHE BOOL "${INSTALL_OCCT_TEST_CASES_DESCR}")
+# a single-configuration generator like the Makefile generator defines CMAKE_BUILD_TYPE variable
+# check this variable and set if it's required
+if (DEFINED CMAKE_BUILD_TYPE AND NOT CMAKE_BUILD_TYPE) # single-configuration generator.
+  set (CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel." FORCE)
 endif()
 
+
+# Rebuild *.yacc and *.lex files
+set (REBUILD_PLATFORM_DEPENDENT_CODE OFF CACHE BOOL "${REBUILD_PLATFORM_DEPENDENT_CODE_DESCR}")
+
 # copy samples to install directory
-set (INSTALL_SAMPLES OFF CACHE BOOL "Copy OCCT samples to install directory")
+set (INSTALL_OCCT_SAMPLES OFF CACHE BOOL "${INSTALL_OCCT_SAMPLES_DESCR}")
 
 # install dir of the built project
-set (INSTALL_DIR "" CACHE PATH "Directory that will contain install files of OCCT" )
+set (INSTALL_DIR "" CACHE PATH "${INSTALL_DIR_DESCR}" )
 set (CMAKE_INSTALL_PREFIX "${INSTALL_DIR}" CACHE INTERNAL "" FORCE )
 
-set (BUILD_PATCH_DIR "" CACHE PATH "directory with occt patch")
+set (APPLY_OCCT_PATCH_DIR "" CACHE PATH "${APPLY_OCCT_PATCH_DIR_DESCR}")
 
 # the list of being built toolkits
-set (BUILD_TOOLKITS "" CACHE STRING "Toolkits are also included in OCCT")
-separate_arguments (BUILD_TOOLKITS)
+set (BUILD_ADDITIONAL_TOOLKITS "" CACHE STRING "${BUILD_ADDITIONAL_TOOLKITS_DESCR}")
+separate_arguments (BUILD_ADDITIONAL_TOOLKITS)
 
 if (MSVC)
-  set (BUILD_MFC_SAMPLES OFF CACHE BOOL "OCCT samples building")
+  set (BUILD_MODULE_OcctMfcSamples OFF CACHE BOOL "${BUILD_MODULE_OcctMfcSamples_DESCR}")
 endif()
 
 # whether use optional 3rdparty or not
 if (APPLE)
-  set (USE_GLX OFF CACHE BOOL "Are X11 OpenGL used on OSX or not")
+  set (USE_GLX OFF CACHE BOOL "${USE_GLX_DESCR}")
 endif()
 
-set (USE_FREEIMAGE OFF CACHE BOOL "Is freeimage used or not")
-set (USE_VTK OFF CACHE BOOL "Is VTK used or not")
+set (USE_FREEIMAGE OFF CACHE BOOL "${USE_FREEIMAGE_DESCR}")
+set (USE_VTK OFF CACHE BOOL "${USE_VTK_DESCR}")
 
 if (NOT DEFINED ANDROID)
-  set (USE_GL2PS OFF CACHE BOOL "Is gl2ps used or not")
-  set (USE_TBB OFF CACHE BOOL "Is tbb used or not")
+  set (USE_GL2PS OFF CACHE BOOL "${USE_GL2PS_DESCR}")
+  set (USE_TBB OFF CACHE BOOL "${USE_TBB_DESCR}")
   #set (USE_OPENCL OFF CACHE BOOL "Is OpenCL used or not")
 endif()
 
-# macro: include patched file if it exists
-macro (OCCT_INCLUDE_CMAKE_FILE BEING_INCLUDED_FILE)
-  if (NOT "${BUILD_PATCH_DIR}" STREQUAL "" AND EXISTS "${BUILD_PATCH_DIR}/${BEING_INCLUDED_FILE}.cmake")
-    include (${BUILD_PATCH_DIR}/${BEING_INCLUDED_FILE}.cmake)
-  else()
-    include (${BEING_INCLUDED_FILE}.cmake)
-  endif()
-endmacro()
-
 # include occt macros
 OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros")
 
@@ -89,62 +84,61 @@ OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros")
 # list <OCCT_MODULES> will contain all modules
 OCCT_MODULES_AND_TOOLKITS (OCCT_MODULES)
 
-foreach (MODULE ${OCCT_MODULES})
-  set (BUILD_${MODULE} ON CACHE BOOL "include ${MODULE}")
+foreach (OCCT_MODULE ${OCCT_MODULES})
+  BUILD_MODULE (${OCCT_MODULE})
 endforeach()
 
 # Overview
-set (BUILD_OCCT_OVERVIEW OFF CACHE BOOL "Build OCCT overview in HTML format")
+set (BUILD_DOC_OcctOverview OFF CACHE BOOL "${BUILD_DOC_OcctOverview_DESCR}")
 
 if (NOT USE_VTK)
   list (REMOVE_ITEM Visualization_TOOLKITS TKIVtk)
   list (REMOVE_ITEM Draw_TOOLKITS TKIVtkDraw)
 endif()
 
-# accumulate used toolkits (first level) in USED_TOOLKITS variable
-list (APPEND USED_TOOLKITS ${BUILD_TOOLKITS})
+# accumulate used toolkits (first level) in BUILD_TOOLKITS variable
+list (APPEND BUILD_TOOLKITS ${BUILD_ADDITIONAL_TOOLKITS})
 
-foreach (MODULE ${OCCT_MODULES})
-  if (BUILD_${MODULE})
-    list (APPEND USED_TOOLKITS ${${MODULE}_TOOLKITS})
+foreach (OCCT_MODULE ${OCCT_MODULES})
+  if (BUILD_MODULE_${OCCT_MODULE})
+    list (APPEND BUILD_TOOLKITS ${${OCCT_MODULE}_TOOLKITS})
   endif()
 endforeach()
 
 # DRAWEXE excluded when library build is static
 if (NOT BUILD_SHARED_LIBS)
-  list (REMOVE_ITEM USED_TOOLKITS DRAWEXE)
+  list (REMOVE_ITEM BUILD_TOOLKITS DRAWEXE)
   message (STATUS "Info: DRAWEXE is not included due to ${BUILD_LIBRARY_TYPE} build library type")
 endif()
 
 # accumulate all used toolkits
-list (REMOVE_DUPLICATES USED_TOOLKITS)
-set (RAW_USED_TOOLKIT)
-foreach(USED_TOOLKIT ${USED_TOOLKITS})
-  OCCT_TOOLKIT_FULL_DEP (${USED_TOOLKIT} TOOLKIT_FULL_DEPS)
-  list (APPEND RAW_USED_TOOLKIT ${USED_TOOLKIT} ${TOOLKIT_FULL_DEPS})
+list (REMOVE_DUPLICATES BUILD_TOOLKITS)
+set (RAW_BUILD_TOOLKITS)
+foreach(BUILD_TOOLKIT ${BUILD_TOOLKITS})
+  OCCT_TOOLKIT_FULL_DEP (${BUILD_TOOLKIT} TOOLKIT_FULL_DEPS)
+  list (APPEND RAW_BUILD_TOOLKITS ${BUILD_TOOLKIT} ${TOOLKIT_FULL_DEPS})
 endforeach()
 
-list (REMOVE_DUPLICATES RAW_USED_TOOLKIT)
-set (USED_TOOLKITS ${RAW_USED_TOOLKIT})
+list (REMOVE_DUPLICATES RAW_BUILD_TOOLKITS)
+set (BUILD_TOOLKITS ${RAW_BUILD_TOOLKITS})
 
 # include the patched or original list of definitions and flags
 OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_defs_flags")
 
 OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/3rdparty_macro")
 
-set (3RDPARTY_DIR_LABEL "The directory containing required 3rdparty products")
 if (NOT DEFINED 3RDPARTY_DIR)
-  set (3RDPARTY_DIR "" CACHE PATH ${3RDPARTY_DIR_LABEL})
+  set (3RDPARTY_DIR "" CACHE PATH ${3RDPARTY_DIR_DESCR})
 endif()
 
 # search for 3rdparty dir
 if ("${3RDPARTY_DIR}" STREQUAL "")
   if (DEFINED ENV{3RDPARTY_DIR})
-    set (3RDPARTY_DIR "$ENV{3RDPARTY_DIR}" CACHE PATH ${3RDPARTY_DIR_LABEL} FORCE)
+    set (3RDPARTY_DIR "$ENV{3RDPARTY_DIR}" CACHE PATH ${3RDPARTY_DIR_DESCR} FORCE)
   elseif (EXISTS "${CMAKE_SOURCE_DIR}/../")
     # in version 6.7.0 and above, occt parent directory contains 3rdparties
     get_filename_component (3RDPARTY_DIR "${CMAKE_SOURCE_DIR}/../" ABSOLUTE)
-    set (3RDPARTY_DIR "${3RDPARTY_DIR}" CACHE PATH ${3RDPARTY_DIR_LABEL} FORCE)
+    set (3RDPARTY_DIR "${3RDPARTY_DIR}" CACHE PATH ${3RDPARTY_DIR_DESCR} FORCE)
   endif()
 endif()
 
@@ -226,24 +220,38 @@ else()
 endif()
 
 # Doxygen
-if (BUILD_OCCT_OVERVIEW)
-  if (NOT DEFINED INSTALL_OCCT_OVERVIEW)
-    set (INSTALL_OCCT_OVERVIEW OFF CACHE BOOL "Copy OCCT overview into install directory")
+if (BUILD_DOC_OcctOverview)
+  if (NOT DEFINED INSTALL_DOC_OcctOverview)
+    set (INSTALL_DOC_OcctOverview OFF CACHE BOOL "${INSTALL_DOC_OcctOverview_DESCR}")
   endif()
 
-  if (INSTALL_OCCT_OVERVIEW)
+  if (INSTALL_DOC_OcctOverview)
     install (DIRECTORY "${CMAKE_BINARY_DIR}/doc/overview" DESTINATION  "${INSTALL_DIR}/doc")
     install (FILES "${CMAKE_SOURCE_DIR}/dox/resources/overview.html" DESTINATION  "${INSTALL_DIR}")
   endif()
 
   OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/doxygen")
 else()
-  OCCT_CHECK_AND_UNSET ("INSTALL_OCCT_OVERVIEW")
+  OCCT_CHECK_AND_UNSET ("INSTALL_DOC_OcctOverview")
 
   OCCT_CHECK_AND_UNSET ("3RDPARTY_DOXYGEN_EXECUTABLE")
   OCCT_CHECK_AND_UNSET ("3RDPARTY_DOXYGEN_DOT_EXECUTABLE")
 endif()
 
+# bison 
+if (REBUILD_PLATFORM_DEPENDENT_CODE)
+  OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/bison")
+else()
+  OCCT_CHECK_AND_UNSET ("3RDPARTY_BISON_EXECUTABLE")
+endif()
+
+# flex 
+if (REBUILD_PLATFORM_DEPENDENT_CODE)
+  OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/flex")
+else()
+  OCCT_CHECK_AND_UNSET ("3RDPARTY_FLEX_EXECUTABLE")
+endif()
+
 string (REGEX REPLACE ";" " " 3RDPARTY_NOT_INCLUDED "${3RDPARTY_NOT_INCLUDED}")
 
 # check all 3rdparty paths
@@ -277,9 +285,9 @@ set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/
 set (CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bin")
 set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/lib")
 
-set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/lib")
-set (CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bin")
-set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/lib")
+set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/libi")
+set (CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bini")
+set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/libi")
 
 set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/libd")
 set (CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bind")
@@ -293,7 +301,7 @@ endif()
 if ("${INSTALL_DIR}" STREQUAL "")
   get_filename_component (CMAKE_BINARY_DIR_PARENT ${CMAKE_BINARY_DIR} DIRECTORY)
 
-  set (INSTALL_DIR "${CMAKE_BINARY_DIR_PARENT}/install" CACHE PATH "Directory that will contain install files of OCCT" FORCE)
+  set (INSTALL_DIR "${CMAKE_BINARY_DIR_PARENT}/install" CACHE PATH "${INSTALL_DIR_DESCR}" FORCE)
   set (CMAKE_INSTALL_PREFIX "${INSTALL_DIR}" CACHE INTERNAL "" FORCE )
 
   message (STATUS "Info: INSTALL_DIR has been set as ${INSTALL_DIR}")
@@ -303,20 +311,20 @@ message (STATUS "\nInfo: Collecting all OCCT header files into ${CMAKE_BINARY_DI
 
 # (!) patch is not taken into account COLLECT_AND_INSTALL_OCCT_HEADER_FILES
 # collect all the headers to <binary dir>/inc folder
-COLLECT_AND_INSTALL_OCCT_HEADER_FILES ("${CMAKE_SOURCE_DIR}" "${CMAKE_SOURCE_DIR}/adm/templates/header.in" "${CMAKE_BINARY_DIR}" "${USED_TOOLKITS}")
+COLLECT_AND_INSTALL_OCCT_HEADER_FILES ("${CMAKE_SOURCE_DIR}" "${CMAKE_SOURCE_DIR}/adm/templates/header.in" "${CMAKE_BINARY_DIR}" "${BUILD_TOOLKITS}")
 # apply patched header files
-#if (NOT "${BUILD_PATCH_DIR}" STREQUAL "")
-#  COLLECT_AND_INSTALL_OCCT_HEADER_FILES ("${BUILD_PATCH_DIR}" "${CMAKE_SOURCE_DIR}/adm/templates/header.in" "${CMAKE_BINARY_DIR}")
+#if (NOT "${APPLY_OCCT_PATCH_DIR}" STREQUAL "")
+#  COLLECT_AND_INSTALL_OCCT_HEADER_FILES ("${APPLY_OCCT_PATCH_DIR}" "${CMAKE_SOURCE_DIR}/adm/templates/header.in" "${CMAKE_BINARY_DIR}")
 #endif()
 
 OCCT_INSTALL_FILE_OR_DIR ("data" "${INSTALL_DIR}")
 OCCT_INSTALL_FILE_OR_DIR ("samples/tcl" "${INSTALL_DIR}/samples")
 
-if (INSTALL_SAMPLES)
+if (INSTALL_OCCT_SAMPLES)
   OCCT_INSTALL_FILE_OR_DIR ("samples" "${INSTALL_DIR}")
 endif()
 
-if (TESTS_INSTALL)
+if (INSTALL_OCCT_TEST_CASES)
   OCCT_INSTALL_FILE_OR_DIR ("tests" "${INSTALL_DIR}")
 endif()
 
@@ -326,17 +334,9 @@ else()
   set (SCRIPT_EXT sh)
 endif()
 
-# Creation of "START_TESTS" project
-if (TESTS_RUN AND TESTS_INSTALL)
-  #set(BUILD_TESTING ON)
-  #enable_testing ()
-  #add_test(NAME RUN_TESTS COMMAND ${INSTALL_DIR}/draw.${SCRIPT_EXT} -c testgrid -overwrite -outdir ${INSTALL_DIR}/TestResults)
-  add_custom_target(START_TESTS ${INSTALL_DIR}/draw.${SCRIPT_EXT} -c testgrid -overwrite -outdir ${INSTALL_DIR}/TestResults DEPENDS INSTALL)
-endif()
-
 # DRAW.BAT or DRAW.SH
-if (NOT "${BUILD_PATCH_DIR}" STREQUAL "" AND EXISTS "${BUILD_PATCH_DIR}/adm/templates/draw.${SCRIPT_EXT}")
-  install (FILES "${BUILD_PATCH_DIR}/adm/templates/draw.${SCRIPT_EXT}" DESTINATION  "${INSTALL_DIR}" PERMISSIONS
+if (NOT "${APPLY_OCCT_PATCH_DIR}" STREQUAL "" AND EXISTS "${APPLY_OCCT_PATCH_DIR}/adm/templates/draw.${SCRIPT_EXT}")
+  install (FILES "${APPLY_OCCT_PATCH_DIR}/adm/templates/draw.${SCRIPT_EXT}" DESTINATION  "${INSTALL_DIR}" PERMISSIONS
           OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_WRITE WORLD_EXECUTE)
 else()
   install (FILES "${CMAKE_SOURCE_DIR}/adm/templates/draw.${SCRIPT_EXT}" DESTINATION  "${INSTALL_DIR}" PERMISSIONS
@@ -344,12 +344,12 @@ else()
 endif()
 OCCT_COPY_FILE_OR_DIR ("adm/templates/draw.${SCRIPT_EXT}" "${CMAKE_BINARY_DIR}")
 
-set (SUB_CUSTOM "custom_${COMPILER}_${COMPILER_BITNESS}.${SCRIPT_EXT}")
+set (SUB_CUSTOM_NAME "custom_${COMPILER}_${COMPILER_BITNESS}.${SCRIPT_EXT}")
 
 if (WIN32)
-  set (ADDITIONAL_CUSTOM_CONTENT "\nif exist \"%~dp0${SUB_CUSTOM}\" (\n  call \"%~dp0${SUB_CUSTOM}\" %VCVER% %ARCH% %CASDEB% \n)")
+  set (ADDITIONAL_CUSTOM_CONTENT "\nif exist \"%~dp0${SUB_CUSTOM_NAME}\" (\n  call \"%~dp0${SUB_CUSTOM_NAME}\" %VCVER% %ARCH% %CASDEB% \n)")
 else()
-  set (ADDITIONAL_CUSTOM_CONTENT "\nif [ -e \"\${aScriptPath}/${SUB_CUSTOM}\" ]; then\n  source \"\${aScriptPath}/${SUB_CUSTOM}\" \"\${COMPILER}\" \"\${WOKSTATION}\${ARCH}\" \"\${CASDEB}\" \nfi")
+  set (ADDITIONAL_CUSTOM_CONTENT "\nif [ -e \"\${aScriptPath}/${SUB_CUSTOM_NAME}\" ]; then\n  source \"\${aScriptPath}/${SUB_CUSTOM_NAME}\" \"\${COMPILER}\" \"\${WOKSTATION}\${ARCH}\" \"\${CASDEB}\" \nfi")
 endif()
 
  # change custom.bat/sh
@@ -360,20 +360,53 @@ if (EXISTS "${INSTALL_DIR}/custom.${SCRIPT_EXT}")
 
   file (WRITE "${INSTALL_DIR}/custom.${SCRIPT_EXT}" "${CUSTOM_CONTENT}")
 else()
-  OCCT_CONFIGURE_AND_INSTALL ("adm/templates/custom.${SCRIPT_EXT}.main" "custom.${SCRIPT_EXT}" "${INSTALL_DIR}")
+  OCCT_CONFIGURE_AND_INSTALL ("adm/templates/custom.${SCRIPT_EXT}.main" "custom.${SCRIPT_EXT}" "custom.${SCRIPT_EXT}" "${INSTALL_DIR}")
 endif()
 
-# write current custom.bat/sh
-OCCT_CONFIGURE_AND_INSTALL ("adm/templates/custom.${SCRIPT_EXT}.in" "${SUB_CUSTOM}" "${INSTALL_DIR}")
+# write current custom.bat/sh (for install directory)
+set (SUB_CUSTOM_BUILD_NAME "custom_${COMPILER}_${COMPILER_BITNESS}.install.${SCRIPT_EXT}")
+OCCT_CONFIGURE_AND_INSTALL ("adm/templates/custom.install.${SCRIPT_EXT}.in" "${SUB_CUSTOM_BUILD_NAME}" "${SUB_CUSTOM_NAME}" "${INSTALL_DIR}")
 
-if (BUILD_MFC_SAMPLES)
+# write current custom.bat/sh (for build directory)
+OCCT_CONFIGURE ("adm/templates/custom.build.${SCRIPT_EXT}.in" "${SUB_CUSTOM_NAME}")
+
+if (BUILD_MODULE_OcctMfcSamples)
   OCCT_INSTALL_FILE_OR_DIR ("adm/templates/sample.bat" "${INSTALL_DIR}")
   OCCT_COPY_FILE_OR_DIR ("adm/templates/sample.bat" "${CMAKE_BINARY_DIR}")
 endif()
 
+# env script for draw in building environment
 OCCT_CONFIGURE ("adm/templates/env.build.${SCRIPT_EXT}.in" "env.${SCRIPT_EXT}")
-OCCT_CONFIGURE ("adm/templates/env.${SCRIPT_EXT}.in" "env.install.${SCRIPT_EXT}")
-install (FILES "${CMAKE_BINARY_DIR}/env.install.${SCRIPT_EXT}" DESTINATION  "${INSTALL_DIR}" RENAME "env.${SCRIPT_EXT}")
+
+# end script for draw in standalone environment
+# release version
+set (BUILD_LETTER "")
+OCCT_CONFIGURE ("adm/templates/env.install.${SCRIPT_EXT}.in" "env.install.release.${SCRIPT_EXT}")
+install (FILES "${CMAKE_BINARY_DIR}/env.install.release.${SCRIPT_EXT}" 
+         CONFIGURATIONS Release
+         DESTINATION  "${INSTALL_DIR}"
+         RENAME "env.${SCRIPT_EXT}")
+
+# debug version
+set (BUILD_LETTER "d")
+OCCT_CONFIGURE ("adm/templates/env.install.${SCRIPT_EXT}.in" "env.install.debug.${SCRIPT_EXT}")
+install (FILES "${CMAKE_BINARY_DIR}/env.install.debug.${SCRIPT_EXT}" 
+         CONFIGURATIONS Debug
+         DESTINATION  "${INSTALL_DIR}"
+         RENAME "env.${SCRIPT_EXT}")
+
+# release with debug info version
+set (BUILD_LETTER "i")
+OCCT_CONFIGURE ("adm/templates/env.install.${SCRIPT_EXT}.in" "env.install.relwithdebinfo.${SCRIPT_EXT}")
+install (FILES "${CMAKE_BINARY_DIR}/env.install.relwithdebinfo.${SCRIPT_EXT}" 
+         CONFIGURATIONS RelWithDebInfo
+         DESTINATION  "${INSTALL_DIR}"
+         RENAME "env.${SCRIPT_EXT}")
+
+# copy DrawAppliInit from OCCT source to build directory
+if (EXISTS "${CMAKE_SOURCE_DIR}/DrawAppliInit" AND NOT EXISTS "${CMAKE_BINARY_DIR}/DrawAppliInit")
+  file (COPY "${CMAKE_SOURCE_DIR}/DrawAppliInit" DESTINATION "${CMAKE_BINARY_DIR}")
+endif()
 
 # RESOURCES
 FILE_TO_LIST ("adm/RESOURCES" RESOURCES)
@@ -388,23 +421,23 @@ foreach(RESOURCE ${RESOURCES})
 endforeach()
 
 # include patched toolkit projects or original ones
-foreach (USED_TOOLKIT ${USED_TOOLKITS})
-  if (NOT "${BUILD_PATCH_DIR}" STREQUAL "" AND EXISTS "${BUILD_PATCH_DIR}/src/${USED_TOOLKIT}")
-    add_subdirectory(${BUILD_PATCH_DIR}/src/${USED_TOOLKIT})
-  elseif (EXISTS "${CMAKE_SOURCE_DIR}/src/${USED_TOOLKIT}")
-    add_subdirectory (${CMAKE_SOURCE_DIR}/src/${USED_TOOLKIT})
+foreach (BUILD_TOOLKIT ${BUILD_TOOLKITS})
+  if (NOT "${APPLY_OCCT_PATCH_DIR}" STREQUAL "" AND EXISTS "${APPLY_OCCT_PATCH_DIR}/src/${BUILD_TOOLKIT}")
+    add_subdirectory(${APPLY_OCCT_PATCH_DIR}/src/${BUILD_TOOLKIT})
+  elseif (EXISTS "${CMAKE_SOURCE_DIR}/src/${BUILD_TOOLKIT}")
+    add_subdirectory (${CMAKE_SOURCE_DIR}/src/${BUILD_TOOLKIT})
   else()
-    message (STATUS "${USED_TOOLKIT} is not included")
+    message (STATUS "${BUILD_TOOLKIT} is not included")
   endif()
 endforeach()
 
-if (BUILD_OCCT_OVERVIEW)
+if (BUILD_DOC_OcctOverview)
   add_subdirectory (dox)
 endif()
 
 # patch DRAWEXE
 if (MSVC AND 3RDPARTY_DLL_DIRS)
-  list (FIND USED_TOOLKITS DRAWEXE DRAWEXE_INDEX)
+  list (FIND BUILD_TOOLKITS DRAWEXE DRAWEXE_INDEX)
   if (${DRAWEXE_INDEX} GREATER -1)
     list (REMOVE_DUPLICATES 3RDPARTY_DLL_DIRS)
     set (3RDPARTY_DLL_DIRS_FOR_PATH "")
@@ -424,7 +457,7 @@ if (MSVC AND 3RDPARTY_DLL_DIRS)
 endif()
 
 # samples do not support patch usage
-if (BUILD_MFC_SAMPLES)
+if (BUILD_MODULE_OcctMfcSamples)
   set (OCCT_ROOT ${CMAKE_SOURCE_DIR})
 
   set (MFC_STANDARD_SAMPLES_DIR ${OCCT_ROOT}/samples/mfc/standard)
index 051d703..6705f5b 100644 (file)
@@ -20,7 +20,12 @@ macro (THIRDPARTY_PRODUCT PRODUCT_NAME HEADER_NAME LIBRARY_NAME LIBRARY_NAME_DEB
   endif()
 
   if (NOT DEFINED INSTALL_${PRODUCT_NAME})
-    set (INSTALL_${PRODUCT_NAME} OFF CACHE BOOL "Is ${PRODUCT_NAME} required to be copied into install directory")
+    message (STATUS "${INSTALL_${PRODUCT_NAME}_DESCR}")
+    if (NOT "${INSTALL_${PRODUCT_NAME}_DESCR}" STREQUAL "")
+      set (INSTALL_${PRODUCT_NAME} OFF CACHE BOOL "${INSTALL_${PRODUCT_NAME}_DESCR}")
+    else()
+      set (INSTALL_${PRODUCT_NAME} OFF CACHE BOOL "Is ${PRODUCT_NAME} required to be copied into install directory")
+    endif()
   endif()
 
   # search for include directory
@@ -138,7 +143,7 @@ macro (THIRDPARTY_PRODUCT PRODUCT_NAME HEADER_NAME LIBRARY_NAME LIBRARY_NAME_DEB
                DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bin")
       install (FILES "${3RDPARTY_${PRODUCT_NAME}_DLL}" 
                CONFIGURATIONS RelWithDebInfo
-               DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bin")
+               DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bini")
       install (FILES "${3RDPARTY_${PRODUCT_NAME}_DLL}" 
                CONFIGURATIONS Debug
                DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bind")
@@ -153,7 +158,7 @@ macro (THIRDPARTY_PRODUCT PRODUCT_NAME HEADER_NAME LIBRARY_NAME LIBRARY_NAME_DEB
                  RENAME ${FREEIMLIB}.3)
                  install (FILES "${ABS_PATH}"
                  CONFIGURATIONS RelWithDebInfo
-                 DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib"
+                 DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libi"
                  RENAME ${FREEIMLIB}.3)
         install (FILES "${ABS_PATH}"
                  CONFIGURATIONS Debug
@@ -168,7 +173,7 @@ macro (THIRDPARTY_PRODUCT PRODUCT_NAME HEADER_NAME LIBRARY_NAME LIBRARY_NAME_DEB
                  RENAME ${GL2PSLIB}.1)
         install (FILES "${ABS_PATH}"
                  CONFIGURATIONS RelWithDebInfo
-                 DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib"
+                 DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libi"
                  RENAME ${GL2PSLIB}.1)
         install (FILES "${ABS_PATH}"
                  CONFIGURATIONS Debug
diff --git a/adm/cmake/BuildToolkit.cmake b/adm/cmake/BuildToolkit.cmake
deleted file mode 100644 (file)
index 4e920a6..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-# Get all used packages from toolkit
-foreach (MODULE ${TOOLKIT_MODULES})
-  if (WIN32)
-    list (APPEND PRECOMPILED_DEFS "-D__${MODULE}_DLL")
-  endif()
-  list (APPEND COMPILER_DIRECTORIES "${OCCT_SOURCE_DIR}/src/${MODULE}")
-endforeach()
-string (REGEX REPLACE ";" " " PRECOMPILED_DEFS "${PRECOMPILED_DEFS}")
-
-# Get from toolkits EXTERNLIB all used libs
-OCCT_TOOLKIT_DEP (${PROJECT_NAME} ${PROJECT_NAME}_DEPS)
-foreach (DEP ${${PROJECT_NAME}_DEPS})
-  IS_OCCT_TOOLKIT (${DEP} OCCT_MODULES FOUND_TOOLKIT)
-  if ("${FOUND_TOOLKIT}" STREQUAL "ON")
-    list ( APPEND USED_LIBS "${DEP}" )
-  endif()
-endforeach()
-
-# Get all source files from used packages
-foreach (CDIR ${COMPILER_DIRECTORIES})
-  get_filename_component (CDirName ${CDIR} NAME)
-  set (CDIR_files)
-  set (HDIR_files)
-  file(STRINGS "${CDIR}/FILES" FLEX_Files REGEX ".+[.]lex")
-  file(STRINGS "${CDIR}/FILES" BISON_Files REGEX ".+[.]yacc")
-  file(STRINGS "${CDIR}/FILES" CFiles REGEX ".+[.]c")
-  file(STRINGS "${CDIR}/FILES" MFiles REGEX ".+[.]mm")
-  file(STRINGS "${CDIR}/FILES" HFiles REGEX ".+[.]h")
-  file(STRINGS "${CDIR}/FILES" LXXFiles REGEX ".+[.]lxx")
-  file(STRINGS "${CDIR}/FILES" GXXFiles REGEX ".+[.]gxx")
-
-  # Generate Flex and Bison files
-  if (${BUILD_BISON_FLEX_FILES})
-    list (LENGTH FLEX_Files FLength)
-    list (LENGTH BISON_Files BLength)
-    list (SORT FLEX_Files)
-    list (SORT BISON_Files)
-    if (${FLength} EQUAL ${BLength} AND NOT ${FLength} EQUAL 0)
-      math (EXPR FLength "${FLength} - 1")
-      foreach (FileIndex RANGE ${FLength})
-        list (GET FLEX_Files ${FileIndex} FLEX_File)
-        list (GET BISON_Files ${FileIndex} BISON_File)
-        get_filename_component (FLEX_Name ${FLEX_File} NAME_WE)
-        get_filename_component (BISON_Name ${BISON_File} NAME_WE)
-        string (COMPARE EQUAL ${FLEX_Name} ${BISON_Name} isEQUAL)
-        if (EXISTS "${FLEX_File}" AND EXISTS "${BISON_File}" AND ${isEQUAL})
-          BISON_TARGET (Parser_${BISON_Name} ${BISON_File} ${CDIR}/${BISON_Name}.tab.c)
-          FLEX_TARGET (Scanner_${FLEX_Name} ${FLEX_File} ${CDIR}/lex.${FLEX_Name}.c)
-          ADD_FLEX_BISON_DEPENDENCY (Scanner_${FLEX_Name} Parser_${BISON_Name})
-          list (APPEND CDIR_files ${BISON_Parser_${BISON_Name}_OUTPUTS} ${FLEX_Scanner_${FLEX_Name}_OUTPUTS})
-        endif()
-      endforeach()
-    endif()
-  endif()
-
-  list(APPEND HDIR_files ${HFiles} ${LXXFiles} ${GXXFiles})
-  list( APPEND CDIR_files ${CFiles})
-  if(APPLE)
-    list( APPEND CDIR_files ${MFiles})
-  endif()
-
-  foreach(HFile ${HDIR_files})
-    list( APPEND USED_INCFILES ${CDIR}/${HFile} )
-    SOURCE_GROUP ("Header Files\\${CDirName}" FILES ${CDIR}/${HFile})
-  endforeach(HFile)
-
-  foreach(CFile ${CDIR_files})
-    list( APPEND USED_SRCFILES ${CDIR}/${CFile} )
-    SOURCE_GROUP ("Source Files\\${CDirName}" FILES ${CDIR}/${CFile})
-  endforeach(CFile)
-endforeach(CDIR)
-
-list( FIND USED_TOOLKITS ${PROJECT_NAME} isFOUND)
-
-# Create project for toolkit
-if ("${USED_TOOLKITS}" STREQUAL "" OR NOT ${isFOUND} EQUAL -1)
-  foreach (MODULE ${OCCT_MODULES})
-    list (FIND ${MODULE}_TOOLKITS ${PROJECT_NAME} isFOUND)
-    if (NOT ${isFOUND} EQUAL -1)
-      set (CURRENT_MODULE ${MODULE})
-    endif()
-  endforeach()
-  if (isEXE)
-    add_executable (${PROJECT_NAME} ${USED_SRCFILES} ${USED_INCFILES})
-    install (TARGETS ${PROJECT_NAME}
-             CONFIGURATIONS Release
-             DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bin")
-    install (TARGETS ${PROJECT_NAME}
-             CONFIGURATIONS RelWithDebInfo
-             DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bin")
-    install (TARGETS ${PROJECT_NAME}
-             CONFIGURATIONS Debug
-             DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bind")
-  else()
-    add_library (${PROJECT_NAME} ${USED_SRCFILES} ${USED_INCFILES})
-    install (TARGETS ${PROJECT_NAME}
-             CONFIGURATIONS Release
-             RUNTIME DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bin"
-             ARCHIVE DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib"
-             LIBRARY DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib")
-    install (TARGETS ${PROJECT_NAME}
-             CONFIGURATIONS RelWithDebInfo
-             RUNTIME DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bin"
-             ARCHIVE DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib"
-             LIBRARY DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib")
-    install (TARGETS ${PROJECT_NAME}
-             CONFIGURATIONS Debug
-             RUNTIME DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bind"
-             ARCHIVE DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libd"
-             LIBRARY DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libd")
-    if (MSVC)
-      install (FILES  ${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bind/${PROJECT_NAME}.pdb
-               CONFIGURATIONS Debug
-               DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bind")
-    endif()
-  endif()
-
-  set_property (TARGET ${PROJECT_NAME} PROPERTY FOLDER "Modules/${CURRENT_MODULE}")
-  set_target_properties (${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "${PRECOMPILED_DEFS}")
-  target_link_libraries (${PROJECT_NAME} ${USED_LIBS})
-endif()
\ No newline at end of file
diff --git a/adm/cmake/bison.cmake b/adm/cmake/bison.cmake
new file mode 100644 (file)
index 0000000..1932a84
--- /dev/null
@@ -0,0 +1,20 @@
+# bison
+
+# execute FindBISON script by "find_package (Bison)" is required to define BISON_TARGET macro
+
+if (NOT DEFINED 3RDPARTY_BISON_EXECUTABLE)
+  set (3RDPARTY_BISON_EXECUTABLE "" CACHE FILEPATH "The path to the bison command")
+endif()
+
+# BISON_EXECUTABLE is required by BISON_TARGET macro and should be defined
+set (BISON_EXECUTABLE "${3RDPARTY_BISON_EXECUTABLE}" CACHE FILEPATH "path to the bison executable" FORCE)
+
+find_package (Bison)
+
+if (BISON_FOUND)
+  set (3RDPARTY_BISON_EXECUTABLE "${BISON_EXECUTABLE}" CACHE FILEPATH "The Path to the bison command" FORCE)
+endif()
+
+if (NOT 3RDPARTY_BISON_EXECUTABLE OR NOT EXISTS "${3RDPARTY_BISON_EXECUTABLE}")
+  list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_BISON_EXECUTABLE)
+endif()
\ No newline at end of file
diff --git a/adm/cmake/flex.cmake b/adm/cmake/flex.cmake
new file mode 100644 (file)
index 0000000..71249d8
--- /dev/null
@@ -0,0 +1,20 @@
+# flex
+
+# execute FindFLEX script by "find_package (Flex)" is required to define FLEX_TARGET macro
+
+if (NOT DEFINED 3RDPARTY_FLEX_EXECUTABLE)
+  set (3RDPARTY_FLEX_EXECUTABLE "" CACHE FILEPATH "The Path to the flex command")
+endif()
+
+# FLEX_EXECUTABLE is required by FLEX_TARGET macro and should be defined
+set (FLEX_EXECUTABLE "${3RDPARTY_FLEX_EXECUTABLE}" CACHE FILEPATH "path to the flex executable" FORCE)
+
+find_package (FLEX)
+
+if (FLEX_FOUND)
+  set (3RDPARTY_FLEX_EXECUTABLE "${FLEX_EXECUTABLE}" CACHE FILEPATH "The Path to the flex command" FORCE)
+endif()
+
+if (NOT 3RDPARTY_FLEX_EXECUTABLE OR NOT EXISTS "${3RDPARTY_FLEX_EXECUTABLE}")
+  list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_FLEX_EXECUTABLE)
+endif()
\ No newline at end of file
index e016868..0d73251 100644 (file)
@@ -1,7 +1,7 @@
 # freetype
 
 if (NOT DEFINED INSTALL_FREETYPE)
-  set (INSTALL_FREETYPE OFF CACHE BOOL "Is freetype required to be copied into install directory")
+  set (INSTALL_FREETYPE OFF CACHE BOOL "${INSTALL_FREETYPE_DESCR}")
 endif()
 
 if (NOT DEFINED 3RDPARTY_FREETYPE_DIR)
@@ -215,7 +215,7 @@ if (INSTALL_FREETYPE)
              DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bin")
     install (FILES "${3RDPARTY_FREETYPE_DLL}"
              CONFIGURATIONS RelWithDebInfo
-             DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bin")
+             DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bini")
     install (FILES "${3RDPARTY_FREETYPE_DLL}"
              CONFIGURATIONS Debug
              DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bind")
@@ -229,7 +229,7 @@ if (INSTALL_FREETYPE)
              RENAME ${FREETYPELIB}.6)
     install (FILES "${ABS_PATH}"
              CONFIGURATIONS RelWithDebInfo
-             DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib"
+             DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libi"
              RENAME ${FREETYPELIB}.6)
     install (FILES "${ABS_PATH}"
              CONFIGURATIONS Debug
index 2e8b41b..38d5cdd 100644 (file)
@@ -118,15 +118,15 @@ function (FIND_PRODUCT_DIR ROOT_DIR PRODUCT_NAME RESULT)
 endfunction()
 
 macro (OCCT_INSTALL_FILE_OR_DIR BEING_INSTALLED_OBJECT DESTINATION_PATH)
-  if (BUILD_PATCH_DIR AND EXISTS "${BUILD_PATCH_DIR}/${BEING_INSTALLED_OBJECT}")
-    if (IS_DIRECTORY "${BUILD_PATCH_DIR}/${BEING_INSTALLED_OBJECT}")
+  if (APPLY_OCCT_PATCH_DIR AND EXISTS "${APPLY_OCCT_PATCH_DIR}/${BEING_INSTALLED_OBJECT}")
+    if (IS_DIRECTORY "${APPLY_OCCT_PATCH_DIR}/${BEING_INSTALLED_OBJECT}")
       # first of all, install original files
       install (DIRECTORY "${CMAKE_SOURCE_DIR}/${BEING_INSTALLED_OBJECT}" DESTINATION  "${DESTINATION_PATH}")
 
       # secondly, rewrite original files with patched ones
-      install (DIRECTORY "${BUILD_PATCH_DIR}/${BEING_INSTALLED_OBJECT}" DESTINATION  "${DESTINATION_PATH}")
+      install (DIRECTORY "${APPLY_OCCT_PATCH_DIR}/${BEING_INSTALLED_OBJECT}" DESTINATION  "${DESTINATION_PATH}")
     else()
-      install (FILES     "${BUILD_PATCH_DIR}/${BEING_INSTALLED_OBJECT}" DESTINATION  "${DESTINATION_PATH}")
+      install (FILES     "${APPLY_OCCT_PATCH_DIR}/${BEING_INSTALLED_OBJECT}" DESTINATION  "${DESTINATION_PATH}")
     endif()
   else()
     if (IS_DIRECTORY "${CMAKE_SOURCE_DIR}/${BEING_INSTALLED_OBJECT}")
@@ -137,20 +137,20 @@ macro (OCCT_INSTALL_FILE_OR_DIR BEING_INSTALLED_OBJECT DESTINATION_PATH)
   endif()
 endmacro()
 
-macro (OCCT_CONFIGURE_AND_INSTALL BEING_CONGIRUGED_FILE FINAL_NAME DESTINATION_PATH)
-  if (BUILD_PATCH_DIR AND EXISTS "${BUILD_PATCH_DIR}/${BEING_CONGIRUGED_FILE}")
-    configure_file("${BUILD_PATCH_DIR}/${BEING_CONGIRUGED_FILE}" "${FINAL_NAME}" @ONLY)
+macro (OCCT_CONFIGURE_AND_INSTALL BEING_CONGIRUGED_FILE BUILD_NAME INSTALL_NAME DESTINATION_PATH)
+  if (APPLY_OCCT_PATCH_DIR AND EXISTS "${APPLY_OCCT_PATCH_DIR}/${BEING_CONGIRUGED_FILE}")
+    configure_file("${APPLY_OCCT_PATCH_DIR}/${BEING_CONGIRUGED_FILE}" "${BUILD_NAME}" @ONLY)
   else()
-    configure_file("${CMAKE_SOURCE_DIR}/${BEING_CONGIRUGED_FILE}" "${FINAL_NAME}" @ONLY)
+    configure_file("${CMAKE_SOURCE_DIR}/${BEING_CONGIRUGED_FILE}" "${BUILD_NAME}" @ONLY)
   endif()
 
-  install(FILES "${OCCT_BINARY_DIR}/${FINAL_NAME}" DESTINATION  "${DESTINATION_PATH}")
+  install(FILES "${OCCT_BINARY_DIR}/${BUILD_NAME}" DESTINATION  "${DESTINATION_PATH}" RENAME ${INSTALL_NAME})
 endmacro()
 
-macro (COLLECT_AND_INSTALL_OCCT_HEADER_FILES ROOT_OCCT_DIR TEMPLATE_HEADER_PATH ROOT_TARGET_OCCT_DIR OCCT_USED_TOOLKITS)
+macro (COLLECT_AND_INSTALL_OCCT_HEADER_FILES ROOT_OCCT_DIR TEMPLATE_HEADER_PATH ROOT_TARGET_OCCT_DIR OCCT_BUILD_TOOLKITS)
   set (OCCT_SOURCE_DIRS)
 
-  foreach (OCCT_USED_TOOLKIT ${OCCT_USED_TOOLKITS})
+  foreach (OCCT_USED_TOOLKIT ${OCCT_BUILD_TOOLKITS})
     # append parent folder
     list (APPEND OCCT_SOURCE_DIRS ${OCCT_USED_TOOLKIT})
 
@@ -183,15 +183,15 @@ macro (OCCT_COPY_FILE_OR_DIR BEING_COPIED_OBJECT DESTINATION_PATH)
   # first of all, copy original files
   file (COPY "${CMAKE_SOURCE_DIR}/${BEING_COPIED_OBJECT}" DESTINATION  "${DESTINATION_PATH}")
 
-  if (BUILD_PATCH_DIR AND EXISTS "${BUILD_PATCH_DIR}/${BEING_COPIED_OBJECT}")
+  if (APPLY_OCCT_PATCH_DIR AND EXISTS "${APPLY_OCCT_PATCH_DIR}/${BEING_COPIED_OBJECT}")
     # secondly, rewrite original files with patched ones
-    file (COPY "${BUILD_PATCH_DIR}/${BEING_COPIED_OBJECT}" DESTINATION  "${DESTINATION_PATH}")
+    file (COPY "${APPLY_OCCT_PATCH_DIR}/${BEING_COPIED_OBJECT}" DESTINATION  "${DESTINATION_PATH}")
   endif()
 endmacro()
 
 macro (OCCT_CONFIGURE BEING_CONGIRUGED_FILE FINAL_NAME)
-  if (BUILD_PATCH_DIR AND EXISTS "${BUILD_PATCH_DIR}/${BEING_CONGIRUGED_FILE}")
-    configure_file("${BUILD_PATCH_DIR}/${BEING_CONGIRUGED_FILE}" "${FINAL_NAME}" @ONLY)
+  if (APPLY_OCCT_PATCH_DIR AND EXISTS "${APPLY_OCCT_PATCH_DIR}/${BEING_CONGIRUGED_FILE}")
+    configure_file("${APPLY_OCCT_PATCH_DIR}/${BEING_CONGIRUGED_FILE}" "${FINAL_NAME}" @ONLY)
   else()
     configure_file("${CMAKE_SOURCE_DIR}/${BEING_CONGIRUGED_FILE}" "${FINAL_NAME}" @ONLY)
   endif()
@@ -200,12 +200,12 @@ endmacro()
 function (OCCT_IS_PRODUCT_REQUIRED CSF_VAR_NAME USE_PRODUCT)
   set (${USE_PRODUCT} OFF PARENT_SCOPE)
 
-  if (NOT USED_TOOLKITS)
+  if (NOT BUILD_TOOLKITS)
     message(STATUS "Warning: the list of being used toolkits is empty")
   else()
-    foreach (USED_TOOLKIT ${USED_TOOLKITS})
-      if (BUILD_PATCH_DIR AND EXISTS "${BUILD_PATCH_DIR}/src/${USED_TOOLKIT}/EXTERNLIB")
-        file (READ "${BUILD_PATCH_DIR}/src/${USED_TOOLKIT}/EXTERNLIB" FILE_CONTENT)
+    foreach (USED_TOOLKIT ${BUILD_TOOLKITS})
+      if (APPLY_OCCT_PATCH_DIR AND EXISTS "${APPLY_OCCT_PATCH_DIR}/src/${USED_TOOLKIT}/EXTERNLIB")
+        file (READ "${APPLY_OCCT_PATCH_DIR}/src/${USED_TOOLKIT}/EXTERNLIB" FILE_CONTENT)
       elseif (EXISTS "${CMAKE_SOURCE_DIR}/src/${USED_TOOLKIT}/EXTERNLIB")
         file (READ "${CMAKE_SOURCE_DIR}/src/${USED_TOOLKIT}/EXTERNLIB" FILE_CONTENT)
       endif()
@@ -222,8 +222,8 @@ endfunction()
 
 function (FILE_TO_LIST FILE_NAME FILE_CONTENT)
   set (LOCAL_FILE_CONTENT)
-  if (BUILD_PATCH_DIR AND EXISTS "${BUILD_PATCH_DIR}/${FILE_NAME}")
-    file (STRINGS "${BUILD_PATCH_DIR}/${FILE_NAME}" LOCAL_FILE_CONTENT)
+  if (APPLY_OCCT_PATCH_DIR AND EXISTS "${APPLY_OCCT_PATCH_DIR}/${FILE_NAME}")
+    file (STRINGS "${APPLY_OCCT_PATCH_DIR}/${FILE_NAME}" LOCAL_FILE_CONTENT)
   elseif (EXISTS "${CMAKE_SOURCE_DIR}/${FILE_NAME}")
     file (STRINGS "${CMAKE_SOURCE_DIR}/${FILE_NAME}" LOCAL_FILE_CONTENT)
   endif()
diff --git a/adm/cmake/occt_toolkit.cmake b/adm/cmake/occt_toolkit.cmake
new file mode 100644 (file)
index 0000000..2be865c
--- /dev/null
@@ -0,0 +1,144 @@
+# script for each OCCT toolkit
+
+# Get all used packages from toolkit
+foreach (TOOLKIT_MODULE ${TOOLKIT_MODULES})
+  if (WIN32)
+    list (APPEND PRECOMPILED_DEFS "-D__${TOOLKIT_MODULE}_DLL")
+  endif()
+  list (APPEND COMPILER_DIRECTORIES "${OCCT_SOURCE_DIR}/src/${TOOLKIT_MODULE}")
+endforeach()
+string (REGEX REPLACE ";" " " PRECOMPILED_DEFS "${PRECOMPILED_DEFS}")
+
+# Get from toolkits EXTERNLIB all used libs
+OCCT_TOOLKIT_DEP (${PROJECT_NAME} ${PROJECT_NAME}_DEPS)
+foreach (PROJECT_DEP ${${PROJECT_NAME}_DEPS})
+  IS_OCCT_TOOLKIT (${PROJECT_DEP} OCCT_MODULES FOUND_TOOLKIT)
+  if ("${FOUND_TOOLKIT}" STREQUAL "ON")
+    list (APPEND USED_LIBS "${PROJECT_DEP}")
+  endif()
+endforeach()
+
+# Get all source files from used packages
+foreach (CMP_DIR ${COMPILER_DIRECTORIES})
+  get_filename_component (CMP_DIR_NAME ${CMP_DIR} NAME)
+
+  set (SOURCE_FILES)
+  set (HEADER_FILES)
+
+  # Generate Flex and Bison files
+  if (${REBUILD_PLATFORM_DEPENDENT_CODE})
+
+    # flex files
+    file (GLOB SOURCE_FILES_FLEX "${CMP_DIR}/*[.]lex") 
+    list (LENGTH SOURCE_FILES_FLEX SOURCE_FILES_FLEX_LEN)
+    list (SORT SOURCE_FILES_FLEX)
+
+    # bison files
+    file (GLOB SOURCE_FILES_BISON "${CMP_DIR}/*[.]yacc") 
+    list (LENGTH SOURCE_FILES_BISON SOURCE_FILES_BISON_LEN)
+    list (SORT SOURCE_FILES_BISON)
+
+    if (${SOURCE_FILES_FLEX_LEN} EQUAL ${SOURCE_FILES_BISON_LEN} AND NOT ${SOURCE_FILES_FLEX_LEN} EQUAL 0)
+
+      math (EXPR SOURCE_FILES_FLEX_LEN "${SOURCE_FILES_FLEX_LEN} - 1")
+      foreach (FLEX_FILE_INDEX RANGE ${SOURCE_FILES_FLEX_LEN})
+
+        list (GET SOURCE_FILES_FLEX ${FLEX_FILE_INDEX} CURRENT_FLEX_FILE)
+        get_filename_component (CURRENT_FLEX_FILE_NAME ${CURRENT_FLEX_FILE} NAME_WE)
+
+        list (GET SOURCE_FILES_BISON ${FLEX_FILE_INDEX} CURRENT_BISON_FILE)
+        get_filename_component (CURRENT_BISON_FILE_NAME ${CURRENT_BISON_FILE} NAME_WE)
+        
+        string (COMPARE EQUAL ${CURRENT_FLEX_FILE_NAME} ${CURRENT_BISON_FILE_NAME} ARE_FILES_EQUAL)
+
+        if (EXISTS "${CURRENT_FLEX_FILE}" AND EXISTS "${CURRENT_BISON_FILE}" AND ${ARE_FILES_EQUAL})
+          set (BISON_OUTPUT_FILE ${CURRENT_BISON_FILE_NAME}.tab.c)
+          set (FLEX_OUTPUT_FILE lex.${CURRENT_FLEX_FILE_NAME}.c)
+          BISON_TARGET (Parser_${CURRENT_BISON_FILE_NAME} ${CURRENT_BISON_FILE} ${CMP_DIR}/${BISON_OUTPUT_FILE} COMPILE_FLAGS "-p ${CURRENT_BISON_FILE_NAME}")
+          FLEX_TARGET  (Scanner_${CURRENT_FLEX_FILE_NAME} ${CURRENT_FLEX_FILE} ${CMP_DIR}/${FLEX_OUTPUT_FILE} COMPILE_FLAGS "-P${CURRENT_FLEX_FILE_NAME}")
+          ADD_FLEX_BISON_DEPENDENCY (Scanner_${CURRENT_FLEX_FILE_NAME} Parser_${CURRENT_BISON_FILE_NAME})
+
+          list (APPEND SOURCE_FILES ${BISON_OUTPUT_FILE} ${FLEX_OUTPUT_FILE})
+        endif()
+      endforeach()
+    endif()
+  endif()
+
+  # header files 
+  file (STRINGS "${CMP_DIR}/FILES" HEADER_FILES_M   REGEX ".+[.]h")
+  file (STRINGS "${CMP_DIR}/FILES" HEADER_FILES_LXX REGEX ".+[.]lxx")
+  file (STRINGS "${CMP_DIR}/FILES" HEADER_FILES_GXX REGEX ".+[.]gxx")
+  list (APPEND HEADER_FILES ${HEADER_FILES_M} ${HEADER_FILES_LXX} ${SOURCE_FILES_GXX})
+
+  foreach(HEADER_FILE ${HEADER_FILES})
+    list (APPEND USED_INCFILES ${CMP_DIR}/${HEADER_FILE})
+    SOURCE_GROUP ("Header Files\\${CMP_DIR_NAME}" FILES ${CMP_DIR}/${HEADER_FILE})
+  endforeach()
+
+  # source files
+  file (STRINGS "${CMP_DIR}/FILES" SOURCE_FILES_C REGEX ".+[.]c")
+  list (APPEND SOURCE_FILES ${SOURCE_FILES_C})
+
+  if(APPLE)
+    file (STRINGS "${CMP_DIR}/FILES" SOURCE_FILES_M REGEX ".+[.]mm")
+    list (APPEND SOURCE_FILES ${SOURCE_FILES_M})
+  endif()
+
+  foreach(SOURCE_FILE ${SOURCE_FILES})
+    list (APPEND USED_SRCFILES ${CMP_DIR}/${SOURCE_FILE})
+    SOURCE_GROUP ("Source Files\\${CMP_DIR_NAME}" FILES ${CMP_DIR}/${SOURCE_FILE})
+  endforeach()
+endforeach()
+
+# Create project for toolkit
+list (FIND BUILD_TOOLKITS ${PROJECT_NAME} CURRENT_PROJECT_IS_BUILT)
+if ("${BUILD_TOOLKITS}" STREQUAL "" OR NOT ${CURRENT_PROJECT_IS_BUILT} EQUAL -1)
+
+  foreach (OCCT_MODULE ${OCCT_MODULES})
+    list (FIND ${OCCT_MODULE}_TOOLKITS ${PROJECT_NAME} CURRENT_PROJECT_IS_BUILT)
+    if (NOT ${CURRENT_PROJECT_IS_BUILT} EQUAL -1)
+      set (CURRENT_MODULE ${OCCT_MODULE})
+    endif()
+  endforeach()
+  
+  if ("${PROJECT_NAME}" STREQUAL "DRAWEXE")
+    add_executable (${PROJECT_NAME} ${USED_SRCFILES} ${USED_INCFILES})
+
+    install (TARGETS ${PROJECT_NAME}
+             CONFIGURATIONS Release
+             DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bin")
+    install (TARGETS ${PROJECT_NAME}
+             CONFIGURATIONS RelWithDebInfo
+             DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bini")
+    install (TARGETS ${PROJECT_NAME}
+             CONFIGURATIONS Debug
+             DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bind")
+  else()
+    add_library (${PROJECT_NAME} ${USED_SRCFILES} ${USED_INCFILES})
+
+    install (TARGETS ${PROJECT_NAME}
+             CONFIGURATIONS Release
+             RUNTIME DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bin"
+             ARCHIVE DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib"
+             LIBRARY DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib")
+    install (TARGETS ${PROJECT_NAME}
+             CONFIGURATIONS RelWithDebInfo
+             RUNTIME DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bini"
+             ARCHIVE DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libi"
+             LIBRARY DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libi")
+    install (TARGETS ${PROJECT_NAME}
+             CONFIGURATIONS Debug
+             RUNTIME DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bind"
+             ARCHIVE DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libd"
+             LIBRARY DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libd")
+    if (MSVC)
+      install (FILES  ${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bind/${PROJECT_NAME}.pdb
+               CONFIGURATIONS Debug
+               DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bind")
+    endif()
+  endif()
+
+  set_property (TARGET ${PROJECT_NAME} PROPERTY FOLDER "Modules/${CURRENT_MODULE}")
+  set_target_properties (${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "${PRECOMPILED_DEFS}")
+  target_link_libraries (${PROJECT_NAME} ${USED_LIBS})
+endif()
\ No newline at end of file
index 64d80b2..df059e3 100644 (file)
@@ -1,7 +1,7 @@
 # tbb
 
 if (NOT DEFINED INSTALL_TBB)
-  set (INSTALL_TBB OFF CACHE BOOL "Is tbb required to be copied into install directory")
+  set (INSTALL_TBB OFF CACHE BOOL "${INSTALL_TBB_DESCR}")
 endif()
 
 # tbb directory
@@ -204,7 +204,7 @@ if (INSTALL_TBB)
              DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bin")
     install (FILES ${3RDPARTY_TBB_DLL} ${3RDPARTY_TBBMALLOC_DLL}
              CONFIGURATIONS RelWithDebInfo
-             DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bin")
+             DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bini")
     install (FILES ${3RDPARTY_TBB_DLL} ${3RDPARTY_TBBMALLOC_DLL}
              CONFIGURATIONS Debug
              DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bind")
@@ -218,7 +218,7 @@ if (INSTALL_TBB)
              RENAME ${TBBLIB}.2)
     install (FILES ${3RDPARTY_TBB_LIBRARY}.2
              CONFIGURATIONS RelWithDebInfo
-             DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib"
+             DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libi"
              RENAME ${TBBLIB}.2)
     install (FILES ${3RDPARTY_TBB_LIBRARY}.2
              CONFIGURATIONS Debug
@@ -231,7 +231,7 @@ if (INSTALL_TBB)
              RENAME ${TBBMALLOCLIB}.2)
     install (FILES ${3RDPARTY_TBBMALLOC_LIBRARY}.2
              CONFIGURATIONS RelWithDebInfo
-             DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib"
+             DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libi"
              RENAME ${TBBMALLOCLIB}.2)
     install (FILES ${3RDPARTY_TBBMALLOC_LIBRARY}.2
              CONFIGURATIONS Debug
index b3df891..99aa0c5 100644 (file)
@@ -1,7 +1,7 @@
 # tcl
 
 if (NOT DEFINED INSTALL_TCL)
-  set (INSTALL_TCL OFF CACHE BOOL "Is tcl lib required to be copied into install directory")
+  set (INSTALL_TCL OFF CACHE BOOL "${INSTALL_TCL_DESCR}")
 endif()
 
 # tcl directory
@@ -314,7 +314,7 @@ if (INSTALL_TCL)
              DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bin")
     install (FILES ${TCL_DLLS} ${TK_DLLS}
              CONFIGURATIONS RelWithDebInfo
-             DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bin")
+             DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bini")
     install (FILES ${TCL_DLLS} ${TK_DLLS}
              CONFIGURATIONS Debug
              DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bind")
@@ -325,7 +325,7 @@ if (INSTALL_TCL)
              DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib")
     install (FILES ${3RDPARTY_TCL_LIBRARY_REALPATH}
              CONFIGURATIONS RelWithDebInfo
-             DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib")
+             DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libi")
     install (FILES ${3RDPARTY_TCL_LIBRARY_REALPATH}
              CONFIGURATIONS Debug
              DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libd")
@@ -336,7 +336,7 @@ if (INSTALL_TCL)
              DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib")
     install (FILES ${3RDPARTY_TK_LIBRARY_REALPATH}
              CONFIGURATIONS RelWithDebInfo
-             DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib")
+             DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libi")
     install (FILES ${3RDPARTY_TK_LIBRARY_REALPATH}
              CONFIGURATIONS Debug
              DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libd")
diff --git a/adm/cmake/vardescr.cmake b/adm/cmake/vardescr.cmake
new file mode 100644 (file)
index 0000000..ad3f9ac
--- /dev/null
@@ -0,0 +1,48 @@
+# variable description
+
+# 
+set (APPLY_OCCT_PATCH_DIR_DESCR "The directory contaning patched OCCT sources that should be used")
+set (BUILD_LIBRARY_TYPE_DESCR "The type of further OCCT libraries: shared or static")
+
+set (REBUILD_PLATFORM_DEPENDENT_CODE_DESCR "OCCT has already compiled platform-depending code and it can be rebult once again (*.yacc/*.lex)")
+
+# install variables
+set (INSTALL_DIR_DESCR "The place where built OCCT libraries, headers, test cases (INSTALL_OCCT_TEST_CASES variable), \n samples (INSTALL_OCCT_SAMPLES_DESCR variable) and certain 3rdparties (INSTALL_GL2PS, INSTALL_TBB and other similar variables) \n will be placed during the installation process (building INSTALL project)")
+
+set (INSTALL_OCCT_SAMPLES_DESCR "The installation process (building INSTALL project) also places OCCT samples into installation directory (INSTALL_DIR variable)")
+set (INSTALL_OCCT_TEST_CASES_DESCR "The installation process (building INSTALL project) also places OCCT test cases into installation directory (INSTALL_DIR variable)")
+set (INSTALL_DOC_OcctOverview_DESCR "The installation process (building INSTALL project) also places OCCT overview documentation (HTML format) \n into installation directory (INSTALL_DIR variable)") 
+
+set (INSTALL_FREEIMAGE_DESCR "The installation process (building INSTALL project) also places FreeImage library \n into installation directory (INSTALL_DIR variable). After that OCCT can use this library in portable mode")
+set (INSTALL_FREEIMAGEPLUS_DESCR "The installation process (building INSTALL project) also places FreeImagePlus library into \n installation directory (INSTALL_DIR variable). After that OCCT can use this library in portable mode")
+set (INSTALL_FREETYPE_DESCR "The installation process (building INSTALL project) also places FreeType library into \n installation directory (INSTALL_DIR variable). After that OCCT can use this library in portable mode")
+set (INSTALL_GL2PS_DESCR "The installation process (building INSTALL project) also places GL2PS library into \n installation directory (INSTALL_DIR variable). After that OCCT can use this library in portable mode")
+set (INSTALL_TBB_DESCR "The installation process (building INSTALL project) also places tbb and tbbmalloc libraries into \n installation directory (INSTALL_DIR variable). After that OCCT can use these libraries in portable mode")
+set (INSTALL_TCL_DESCR "The installation process (building INSTALL project) also places Tcl (library and its nessecary sources) into \n installation directory (INSTALL_DIR variable). After that OCCT can use Tcl in portable mode")
+set (INSTALL_VTK_DESCR "The installation process (building INSTALL project) also places Vtk libraries into \n installation directory (INSTALL_DIR variable). After that OCCT can use these libraries in portable mode")
+
+# build variables
+set (BUILD_MODULE_ApplicationFramework_DESCR "Build all toolkits of ApplicationFramework module in the solution")
+set (BUILD_MODULE_DataExchange_DESCR "Build all toolkits of DataExchange module in the solution")
+set (BUILD_MODULE_Draw_DESCR "Build all toolkits of Draw module in the solution")
+set (BUILD_MODULE_FoundationClasses_DESCR "Build all toolkits of FoundationClasses module in the solution")
+set (BUILD_MODULE_ModelingAlgorithms_DESCR "Build all toolkits of ModelingAlgorithms module in the solution")
+set (BUILD_MODULE_ModelingData_DESCR "Build all toolkits of ModelingData module in the solution")
+set (BUILD_MODULE_Visualization_DESCR "Build all toolkits of Visualization module in the solution")
+
+set (BUILD_ADDITIONAL_TOOLKITS_DESCR "Build additional OCCT toolkits (including dependent ones) in the solution")
+
+set (BUILD_MODULE_OcctMfcSamples_DESCR "Build several OCCT MFC sample projects in the solution. \n These samples show some possibilities of using OCCT and they can \n be executed with script samples.bat from the installation directory (INSTALL_DIR)")
+set (BUILD_DOC_OcctOverview_DESCR "Build a project containing OCCT overview documentation (Markdown format) \n in the solution. The building of the project executes doxygen command that generates \n the documentation in HTML format. The documentation will be available in the installation \n directory (overview.bat script) if INSTALL_DOC_OcctOverview variable is checked")
+
+set (3RDPARTY_DIR_DESCR "The directory that contain several or all used 3rdparties. \n If the 3rdpartyies have been found - corresponding CMake variables \n will be specified (VTK: 3RDPARTY_VTK_DIR, 3RDPARTY_VTK_INCLUDE_DIR, 3RDPARTY_VTK_LIBRARY_DIR)")
+
+set (USE_FREEIMAGE_DESCR "The solution can use FreeImage")
+set (USE_GL2PS_DESCR "The solution can use GL2PS")
+set (USE_TBB_DESCR "The solution can use tbb")
+set (USE_VTK_DESCR "The solution can use VTK")
+set (USE_GLX_DESCR "The solution can use X11 OpenGl on OSX")
+
+macro (BUILD_MODULE MODULE_NAME)
+  set (BUILD_MODULE_${MODULE_NAME} ON CACHE BOOL "${BUILD_MODULE_${MODULE_NAME}_DESCR}")
+endmacro()
index 8705807..7ccb28d 100644 (file)
@@ -1,7 +1,7 @@
 # vtk
 
 if (NOT DEFINED INSTALL_VTK)
-  set (INSTALL_VTK OFF CACHE BOOL "Is vtk required to be copied into install directory")
+  set (INSTALL_VTK OFF CACHE BOOL "${INSTALL_VTK_DESCR}")
 endif()
 
 # vtk directory
@@ -144,7 +144,7 @@ if (INSTALL_VTK)
                    DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bin")
           install (FILES ${3RDPARTY_VTK_DLL}
                    CONFIGURATIONS RelWithDebInfo
-                   DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bin")
+                   DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bini")
           install (FILES ${3RDPARTY_VTK_DLL}
                    CONFIGURATIONS Debug
                    DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bind")
@@ -161,7 +161,7 @@ if (INSTALL_VTK)
               RENAME "lib${VTK_DLL_NAME}")
       install(FILES "${3RDPARTY_VTK_LIBRARY_DIR}/lib${VTK_DLL_NAME}"
               CONFIGURATIONS RelWithDebInfo
-              DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib"
+              DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libi"
               RENAME "lib${VTK_DLL_NAME}")
       install(FILES "${3RDPARTY_VTK_LIBRARY_DIR}/lib${VTK_DLL_NAME}"
               CONFIGURATIONS Debug
index 95d1257..110e363 100644 (file)
@@ -6,6 +6,8 @@ if /I ["%ARCH%"] == ["win32"] set "ARCH=32"
 if /I ["%ARCH%"] == ["win64"] set "ARCH=64"
 if /I ["%3"]     == ["debug"] set "CASDEB=d"
 if /I ["%3"]     == ["d"]     set "CASDEB=d"
+if /I ["%3"]     == ["i"]     set "CASDEB=i"
+if /I ["%3"]     == ["relwithdeb"] set "CASDEB=i"
 
 rem include other custom.bat files with specific 3rdparty paths
 @ADDITIONAL_CUSTOM_CONTENT@
diff --git a/adm/templates/custom.build.bat.in b/adm/templates/custom.build.bat.in
new file mode 100644 (file)
index 0000000..127a43a
--- /dev/null
@@ -0,0 +1,14 @@
+echo off
+
+if "%VCVER%" == "@COMPILER@" (
+  if "%ARCH%" == "@COMPILER_BITNESS@" (
+    set "TCL_DIR=@3RDPARTY_TCL_DLL_DIR@"
+    set "FREETYPE_DIR=@3RDPARTY_FREETYPE_DLL_DIR@"
+    set "FREEIMAGE_DIR=@3RDPARTY_FREEIMAGE_DLL_DIR@"
+    set "FREEIMAGEPLUS_DIR=@3RDPARTY_FREEIMAGEPLUS_DLL_DIR@"
+    set "GL2PS_DIR=@3RDPARTY_GL2PS_DLL_DIR@"
+    set "TBB_DIR=@3RDPARTY_TBB_DLL_DIR@"
+    set "VTK_DIR=@3RDPARTY_VTK_DLL_DIR@"
+  ) 
+)
+
diff --git a/adm/templates/custom.build.sh.in b/adm/templates/custom.build.sh.in
new file mode 100644 (file)
index 0000000..fbc1323
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+if [ "$COMPILER" == "@COMPILER@" ]; then
+  if [ "$ARCH" == "@COMPILER_BITNESS@" ]; then
+    export TCL_DIR="@3RDPARTY_TCL_LIBRARY_DIR@"
+    export FREETYPE_DIR="@3RDPARTY_FREETYPE_LIBRARY_DIR@"
+    export FREEIMAGE_DIR="@3RDPARTY_FREEIMAGE_LIBRARY_DIR@"
+    export GL2PS_DIR="@3RDPARTY_GL2PS_LIBRARY_DIR@"
+    export TBB_DIR="@3RDPARTY_TBB_LIBRARY_DIR@"
+    export VTK_DIR="@3RDPARTY_VTK_LIBRARY_DIR@"
+  fi
+fi
+
similarity index 90%
rename from adm/templates/custom.bat.in
rename to adm/templates/custom.install.bat.in
index 2b80b91..084de68 100644 (file)
@@ -9,7 +9,6 @@ if "%VCVER%" == "@COMPILER@" (
     set "GL2PS_DIR=@USED_3RDPARTY_GL2PS_DIR@"
     set "TBB_DIR=@USED_3RDPARTY_TBB_DIR@"
     set "VTK_DIR=@USED_3RDPARTY_VTK_DIR@"
-    set "CSF_TestDataPath=@TESTS_SHAPES_DIR@"
   ) 
 )
 
similarity index 89%
rename from adm/templates/custom.sh.in
rename to adm/templates/custom.install.sh.in
index 209a00a..d9231bc 100644 (file)
@@ -8,7 +8,6 @@ if [ "$COMPILER" == "@COMPILER@" ]; then
     export GL2PS_DIR="@USED_3RDPARTY_GL2PS_DIR@"
     export TBB_DIR="@USED_3RDPARTY_TBB_DIR@"
     export VTK_DIR="@USED_3RDPARTY_VTK_DIR@"
-    export CSF_TestDataPath="@TESTS_SHAPES_DIR@"
   fi
 fi
 
index ac9bfa7..0501038 100644 (file)
@@ -42,12 +42,18 @@ if /I ["%ARCH%"] == ["win32"] set "ARCH=32"
 if /I ["%ARCH%"] == ["win64"] set "ARCH=64"
 if /I ["%3"]     == ["debug"] set "CASDEB=d"
 if /I ["%3"]     == ["d"]     set "CASDEB=d"
+if /I ["%3"]     == ["i"]     set "CASDEB=i"
+if /I ["%3"]     == ["relwithdeb"] set "CASDEB=i"
 
 set "CSF_OPT_INC=%CSF_OPT_INC%;%CASROOT%\inc"
 set "CSF_OPT_LIB32D=%CSF_OPT_LIB32%;%CASROOT%\win32\%VCVER%\libd"
 set "CSF_OPT_LIB64D=%CSF_OPT_LIB64%;%CASROOT%\win64\%VCVER%\libd"
 set "CSF_OPT_BIN32D=%CSF_OPT_BIN32%;%CASROOT%\win32\%VCVER%\bind"
 set "CSF_OPT_BIN64D=%CSF_OPT_BIN64%;%CASROOT%\win64\%VCVER%\bind"
+set "CSF_OPT_LIB32I=%CSF_OPT_LIB32%;%CASROOT%\win32\%VCVER%\libi"
+set "CSF_OPT_LIB64I=%CSF_OPT_LIB64%;%CASROOT%\win64\%VCVER%\libi"
+set "CSF_OPT_BIN32I=%CSF_OPT_BIN32%;%CASROOT%\win32\%VCVER%\bini"
+set "CSF_OPT_BIN64I=%CSF_OPT_BIN64%;%CASROOT%\win64\%VCVER%\bini"
 set "CSF_OPT_LIB32=%CSF_OPT_LIB32%;%CASROOT%\win32\%VCVER%\lib"
 set "CSF_OPT_LIB64=%CSF_OPT_LIB64%;%CASROOT%\win64\%VCVER%\lib"
 set "CSF_OPT_BIN32=%CSF_OPT_BIN32%;%CASROOT%\win32\%VCVER%\bin"
@@ -93,23 +99,24 @@ for %%a in ("%CSF_OPT_LIB64:;=";"%") do (
   if not ["%%~a"] == [""] call :concatLib64 %%~a
 )
 
-set "CSF_OPT_LNK32="
-set "CSF_OPT_LNK64="
-set "CSF_OPT_LNK32D="
-set "CSF_OPT_LNK64D="
 set "CSF_OPT_LNK32=%CSF_OPT_LNK32% %OPT_LIB32%"
-set "CSF_OPT_LNK32D=%CSF_OPT_LNK32D% %OPT_LIB32%"
 set "CSF_OPT_LNK64=%CSF_OPT_LNK64% %OPT_LIB64%"
+set "CSF_OPT_LNK32D=%CSF_OPT_LNK32D% %OPT_LIB32%"
 set "CSF_OPT_LNK64D=%CSF_OPT_LNK64D% %OPT_LIB64%"
+set "CSF_OPT_LNK32I=%CSF_OPT_LNK32I% %OPT_LIB32%"
+set "CSF_OPT_LNK64I=%CSF_OPT_LNK64I% %OPT_LIB64%"
 
 set "CASBIN=win%ARCH%\%VCVER%"
 
 rem ----- Set path to 3rd party and OCCT libraries -----
 set "PATH=%SCRIPTROOT%\%CASBIN%\bin%CASDEB%;%PATH%"
-if     ["%CASDEB%"] == [""] if ["%ARCH%"] == ["32"] set "PATH=%CSF_OPT_BIN32%;%PATH%"
-if     ["%CASDEB%"] == [""] if ["%ARCH%"] == ["64"] set "PATH=%CSF_OPT_BIN64%;%PATH%"
-if not ["%CASDEB%"] == [""] if ["%ARCH%"] == ["32"] set "PATH=%CSF_OPT_BIN32D%;%PATH%"
-if not ["%CASDEB%"] == [""] if ["%ARCH%"] == ["64"] set "PATH=%CSF_OPT_BIN64D%;%PATH%"
+if ["%CASDEB%"] == [""] if ["%ARCH%"] == ["32"] set "PATH=%CSF_OPT_BIN32%;%PATH%"
+if ["%CASDEB%"] == [""] if ["%ARCH%"] == ["64"] set "PATH=%CSF_OPT_BIN64%;%PATH%"
+if ["%CASDEB%"] == ["d"] if ["%ARCH%"] == ["32"] set "PATH=%CSF_OPT_BIN32D%;%PATH%"
+if ["%CASDEB%"] == ["d"] if ["%ARCH%"] == ["64"] set "PATH=%CSF_OPT_BIN64D%;%PATH%"
+
+if ["%CASDEB%"] == ["i"] if ["%ARCH%"] == ["32"] set "PATH=%CSF_OPT_BIN32I%;%PATH%"
+if ["%CASDEB%"] == ["i"] if ["%ARCH%"] == ["64"] set "PATH=%CSF_OPT_BIN64I%;%PATH%"
 
 rem ----- Set envoronment variables used by OCCT -----
 set CSF_LANGUAGE=us
index 77de2fd..04fa2c8 100644 (file)
@@ -15,6 +15,8 @@ if /I ["%ARCH%"] == ["win32"] set "ARCH=32"
 if /I ["%ARCH%"] == ["win64"] set "ARCH=64"
 if /I ["%3"]     == ["debug"] set "CASDEB=d"
 if /I ["%3"]     == ["d"]     set "CASDEB=d"
+if /I ["%3"]     == ["i"]     set "CASDEB=i"
+if /I ["%3"]     == ["relwithdeb"] set "CASDEB=i"
 
 if exist "%~dp0custom.bat" (
   call "%~dp0custom.bat" %1 %2 %3
index f42b034..89da909 100644 (file)
@@ -13,6 +13,8 @@ shopt -s nocasematch
 export CASDEB="";
 if [[ "$1" == "debug" ]]; then export CASDEB="d"; fi
 if [[ "$1" == "d" ]]; then export CASDEB="d"; fi
+if [[ "$1" == "relwithdeb" ]]; then export CASDEB="i"; fi
+if [[ "$1" == "i" ]]; then export CASDEB="i"; fi
 shopt -u nocasematch
 
 export COMPILER="@COMPILER@"
similarity index 95%
rename from adm/templates/env.bat.in
rename to adm/templates/env.install.bat.in
index 6c9f154..4358137 100644 (file)
@@ -5,7 +5,7 @@ set "SCRIPTROOT=%SCRIPTROOT:~0,-1%"
 
 set "VCVER=@COMPILER@"
 set "ARCH=@COMPILER_BITNESS@"
-set "CASDEB="
+set "CASDEB=@BUILD_LETTER@"
 
 if not ["%1"]    == [""]      set "VCVER=%1"
 if not ["%2"]    == [""]      set "ARCH=%2"
@@ -13,6 +13,8 @@ if /I ["%ARCH%"] == ["win32"] set "ARCH=32"
 if /I ["%ARCH%"] == ["win64"] set "ARCH=64"
 if /I ["%3"]     == ["debug"] set "CASDEB=d"
 if /I ["%3"]     == ["d"]     set "CASDEB=d"
+if /I ["%3"]     == ["i"]     set "CASDEB=i"
+if /I ["%3"]     == ["relwithdeb"] set "CASDEB=i"
 
 if exist "%~dp0custom.bat" (
   call "%~dp0custom.bat" %VCVER% %ARCH% %CASDEB%
similarity index 97%
rename from adm/templates/env.sh.in
rename to adm/templates/env.install.sh.in
index d340448..200b7d2 100644 (file)
@@ -11,6 +11,8 @@ shopt -s nocasematch
 export CASDEB="";
 if [[ "$1" == "debug" ]]; then export CASDEB="d"; fi
 if [[ "$1" == "d" ]]; then export CASDEB="d"; fi
+if [[ "$1" == "relwithdeb" ]]; then export CASDEB="i"; fi
+if [[ "$1" == "i" ]]; then export CASDEB="i"; fi
 shopt -u nocasematch
 
 export COMPILER="@COMPILER@"
index 99885be..803cd7d 100644 (file)
@@ -36,6 +36,8 @@ for i in $*
 do
   if [ "$i" == "d" ] || [ "$i" == "debug" ]; then
     export CASDEB="d"
+  elif [ "$i" == "i" ] || [ "$i" == "relwithdeb" ]; then
+    export CASDEB="i"
   elif [ "$i" == "cbp" ]; then
     export TARGET="cbp";
   elif [ "$i" == "xcd" ] || [ "$i" == "xcode" ]; then
@@ -74,11 +76,15 @@ if [ "${TARGET}" == "cbp" ]; then
   export CSF_OPT_LIB64D="${CSF_OPT_LIB64}:${CASROOT}/${CASBIN}/libd"
   export CSF_OPT_LIB32="${CSF_OPT_LIB32}:${CASROOT}/${CASBIN}/lib"
   export CSF_OPT_LIB64="${CSF_OPT_LIB64}:${CASROOT}/${CASBIN}/lib"
+  export CSF_OPT_LIB32I="${CSF_OPT_LIB32}:${CASROOT}/${CASBIN}/libi"
+  export CSF_OPT_LIB64I="${CSF_OPT_LIB64}:${CASROOT}/${CASBIN}/libi"
 elif [ "${TARGET}" == "xcd" ]; then
   export CSF_OPT_LIB32D="${CSF_OPT_LIB32}:${CASROOT}/${CASBIN}/Debug"
   export CSF_OPT_LIB64D="${CSF_OPT_LIB64}:${CASROOT}/${CASBIN}/Debug"
   export CSF_OPT_LIB32="${CSF_OPT_LIB32}:${CASROOT}/${CASBIN}/Release"
   export CSF_OPT_LIB64="${CSF_OPT_LIB64}:${CASROOT}/${CASBIN}/Release"
+  export CSF_OPT_LIB32I="${CSF_OPT_LIB32}:${CASROOT}/${CASBIN}/RelWithDebInfo"
+  export CSF_OPT_LIB64I="${CSF_OPT_LIB64}:${CASROOT}/${CASBIN}/RelWithDebInfo"
 fi
 
 export CSF_OPT_CMPL=""
@@ -122,11 +128,15 @@ if [ "$ARCH" == "32" ]; then
   declare -a aPartiesLibs=($*)
   set -- "$CSF_OPT_LIB32D"
   declare -a aPartiesLibsDeb=($*)
+  set -- "$CSF_OPT_LIB32I"
+  declare -a aPartiesLibsRelWithDebInfo=($*)
 else
   set -- "$CSF_OPT_LIB64"
   declare -a aPartiesLibs=($*)
   set -- "$CSF_OPT_LIB64D"
   declare -a aPartiesLibsDeb=($*)
+  set -- "$CSF_OPT_LIB64I"
+  declare -a aPartiesLibsRelWithDebInfo=($*)
 fi
 
 # Turn back value
@@ -138,6 +148,12 @@ do
   OPT_LINKER_OPTIONS_DEB="${OPT_LINKER_OPTIONS_DEB} -L${anItem}"
 done
 
+OPT_LINKER_OPTIONS_REL_WITH_DEB_INFO=""
+for anItem in ${aPartiesLibsRelWithDebInfo[*]}
+do
+  OPT_LINKER_OPTIONS_REL_WITH_DEB_INFO="${OPT_LINKER_OPTIONS_REL_WITH_DEB_INFO} -L${anItem}"
+done
+
 OPT_LINKER_OPTIONS=""
 for anItem in ${aPartiesLibs[*]}
 do
@@ -152,9 +168,11 @@ done
 if [ "$ARCH" == "64" ]; then
   export CSF_OPT_LNK64="$OPT_LINKER_OPTIONS"
   export CSF_OPT_LNK64D="$OPT_LINKER_OPTIONS_DEB"
+  export CSF_OPT_LNK64I="$OPT_LINKER_OPTIONS_REL_WITH_DEB_INFO"
 else
   export CSF_OPT_LNK32="$OPT_LINKER_OPTIONS"
   export CSF_OPT_LNK32D="$OPT_LINKER_OPTIONS_DEB"
+  export CSF_OPT_LNK32I="$OPT_LINKER_OPTIONS_REL_WITH_DEB_INFO"
 fi
 
 
index 49d8326..2dfd3fc 100644 (file)
@@ -13,15 +13,8 @@ you need to:
    - \subpage occt_dev_guides__building_3rdparty_linux
    - \subpage occt_dev_guides__building_3rdparty_osx
 
-2. If you use bare OCCT sources from Git repository or made some changes affecting
-   CDL files or dependencies of OCCT toolkits, you need to update header files generated
-   from \ref occt_dev_guides__cdl "CDL", and regenerate build scripts for your environment using WOK.
-   See \subpage occt_dev_guides__building_wok for details.
 
-   Skip to step 3 if you use complete source package (e.g. official OCCT 
-   release) without changes in CDL.
-
-3. Build using your preferred build tool.
+2. Build using your preferred build tool.
    - \subpage occt_dev_guides__building_automake "Building on Linux with Autotools"
    - \subpage occt_dev_guides__building_cmake "Building with CMake (cross-platform)"
    - \subpage occt_dev_guides__building_android "Building with CMake and ADT for Android (cross-platform)"
index 58acfbf..9e267ff 100644 (file)
@@ -3,121 +3,135 @@ Building with CMake {#occt_dev_guides__building_cmake}
 
 @tableofcontents
 
-This file describes the steps to build OCCT libraries from a complete source package
-with **CMake**. CMake is free software that can create GNU Makefiles, KDevelop, 
-XCode, Eclipse and Visual Studio project files. **CMake** version 3.0 or above is 
-required.
+This article describes **CMake**-based build process which is now suggested as a standard way to produce the binaries of Open CASCADE Technology from sources. *OCCT requires CMake version 3.0 or later*.
 
-If you build OCCT from bare sources (as in Git repository) or make some 
-changes affecting CDL files, you need to use WOK to re-generate header files
-and build scripts / projects. See \ref occt_dev_guides__building_wok for instructions.
+**Note**: Comparing to the previous (6.x) releases of Open CASCADE Technology, OCCT 7.0 comes with a complete set of CMake scripts and projects, so that there is no need to use WOK anymore. Moreover, CMake gives you a powerful configuration tool which allows to control many aspects of OCCT deployment. At the same time this tool is quite intuitive which is a significant advantage over the legacy WOK utilities.
 
-Before building OCCT, you need to install the required third-party libraries; see the
-instructions for your platform in @ref occt_dev_guides__building.
+**Note**: We discuss the build procedure on example of Windows platform. However, the workflow is almost the same for *nix and Mac operating systems.
 
-## Define the location of build and install directories.
+All the examples in the article will be based on Windows x64 platform and Visual Studio 2010 solution will be the target IDE. The solution will be generated by CMake from the OCCT sources, the one will be built by an user and ready-to-go OCCT binaries will be deployed into a user specified directory by building *INSTALL* project.
 
-The build directory is where intermediate files (projects / makefiles, objects, binaries) will be created.
+You can get all the required 3-rd party products visiting the official download page [**insert link**]; see @ref occt_dev_guides__building for more detailed information also.
 
-The install directory is where binaries will be installed after build, along with header files and resources required for OCCT use in applications. 
-It is possible to install several configurations of OCCT (differentiated by platform, bitness, compiler, and build type) into the same directory.
+## Get sources
 
-It is recommended to separate build and install directories from OCCT source directory, for example:
+The sources of OCCT can be obtained from the official development web-site [**insert link**] by either downloading the universal source package (available at official download page [**insert link**]) or by cloning the Git repository:
 
-       /user/home/occt/                   - sources
-       /user/home/tmp/occt-build-vc10-x64 - intermediate files
-       /user/home/occt-install            - installed binaries
+    git clone ssh://gitolite@git.dev.opencascade.org/occt occt
 
-## CMake usage
+As a result, you obtain the following directory structure in your filesystem (*workbench* name is used for example):
+    
+    workbench\occt\adm
+                  \data
+                  \dox
+                  \samples
+                  \src
+                  \tests
+                  ...
 
-Run CMake indicating the path to OCCT sources <i>($CASROOT)</i> and selected build directory.
+The bare sources distribution contains not only the sources of Open CASCADE Technology, but also documentation, samples and non-regression test scripts. The official manual [**insert link**] is refered for details on the distribution contents.
 
-It is recommended to use GUI tools provided by CMake: *cmake-gui* on Windows, Mac and Linux (*ccmake* also can be used on Linux).
+## The usage of CMake
 
-### Windows:
+Now it is time to run a CMake tool which will generate the actual project files for the target IDE (e.g., Visual Studio 2010 solution).
 
-Specify the root folder of OCCT (<i>$CASROOT</i>, which contains *CMakelists.txt* file) by clicking **Browse Source**.
+It is recommended to use *cmake-gui* - cross-platform GUI tool provided by CMake on Windows, Mac and Linux. As a command-line alternative, *ccmake* also can be used.
 
-@figure{/dev_guides/building/cmake/images/cmake_image001.png}
-
-Specify the location (build folder) for Cmake generated project files by clicking **Browse Build**.
+CMake deals with three directories: source, build or binary and install.
 
-Each configuration of the project should be built in its own directory. When building multiple configurations it is recommended to indicate in the name of build directories the system, bitness, compiler, and build type (e.g., <i>d:/occt/build/win32-vc9</i> ).
+* The source directory is where the sources of OCCT are located in your filesystem
+* The build or binary directory is where all the files created during CMake configuration [**insert link**] and generation [**insert link**] process will be located. The mentioned process will be described below.
+* The installation directory is where binaries will be installed after build the *INSTALL* project that is created by CMake generation process, along with header files and resources required for OCCT use in applications. 
 
-**Configure** opens the window with a drop-down list of generators supported by CMake project. Select the required generator (e.g., Visual Studio 2008) and click **Finish**.
+**Note**: It is possible to choose one installation directory for several configurations of OCCT (differentiated by platform, bitness, compiler and build type).
 
-@figure{/dev_guides/building/cmake/images/cmake_image002.png}
+**Note**: The good practice is not to mix up different build configurations [**insert link**] in a single directory and not to use the source directory as a build one, for example:
+      
+    workbench/occt/                   - the source directory
+    workbench/tmp/occt-build-vc10-x64 - the build directory with the generated
+                                        solution and other intermediate files created during a CMake tool working
+    workbench/occt-install            - the installation directory that is
+                                        able to contain several OCCT configuratoion
 
-### Linux (ccmake variant):
+## Configuration process
 
-In the console, change to the build directory and call *ccmake* with the path to the source directory of the project:
+If the command-line tool is used, run the tool from the source directory with a single argument indicating the build (binary) (relative or absolute path) directory:
 
-       > cd ~/occt/build
-       > ccmake ~/occt
+    cd <the source directory>
+    ccmake <the build directory>
 
-@figure{/dev_guides/building/cmake/images/cmake_image003.png}
+@figure{/dev_guides/building/cmake/images/cmake_image000.png}
 
 Press *c* to configure.
 
-*cmake-gui* is used in the same way as described above for Windows.
-
-### Mac OS:
-
-Use *cmake-gui* **Applications -> CMake 2.8-10.app** to generate project files for the chosen build environment (e.g., XCode).
-
-@figure{/dev_guides/building/cmake/images/cmake_image004.png}
-
-## OCCT Configuration
-
-The error message, which appears at the end of configuration process, informs you about the required variables, 
-which need to be defined. This error will appear until all required variables are defined correctly.
-
-Note: In *cmake-gui* there is "grouped" option, which groups variables with a common prefix.
+All required actions in the configuration process will be described with using the GUI tool below.
 
-**Note**: If a single-configuration generator is chosen (such as make), there is the need to specify *CMAKE_BUILD_TYPE* variable
-with the value of further build type: Debug, Release or RelWithDebInfo.
+If the gui-tool is used, run the tool without additional arguments and after that specify the source directory by clicking **Browse Source** and the build (binary) one by clicking **Browse Build**.
 
-### Selection of the components to be built
-
-The variables with <i>BUILD_</i> prefix allow specifying OCCT components and
-configuration to be built:
-
-* *BUILD_LIBRARY_TYPE*     - specifies whether static or shared libraries should be built.
-* <i>BUILD_<MODULE></i>    - specifies whether the corresponding OCCT module should be 
-                             built (all toolkits). Note that even if the whole module is not 
-                             selected for build, its toolkits used by other toolkits 
-                             selected for build will be included automatically.
-* *BUILD_TOOLKITS*         - allows including additional toolkits from non-selected 
-                             modules (should be list of toolkit names separated by a 
-                             space or a semicolon).
-* *BUILD_MFC_SAMPLES*      - specifies whether OCCT MFC samples should be built.
-* *BUILD_OCCT_OVERVIEW*    - specifies whether OCCT overview documentation should be generated.
-* *BUILD_PATCH_DIR*        - optionally specifies additional folder containing patched OCCT source files.
-                             The patch may contain arbitrary subset of OCCT source files (including CMake scripts, templates, etc.), organized in the same structure of folders as OCCT.
-                             The projects generated by CMake will use files found in the patch folder instead of the corresponding files of OCCT.
-
-Check variables with <i>USE_</i> prefix (<i>USE_FREEIMAGE, USE_GL2PS, USE_TBB,</i>) if there is the need to enable use of the corresponding optional 3rd-party 
-library.
-
-### 3rd-party configuration (The variables with <i>3RDPARTY_</i> prefix)
-
-If you have 3rd-party libraries in a non-default location 
-(e.g., on Windows, binaries downloaded from http://www.opencascade.org/getocc/download/3rdparty/") 
-*3RDPARTY_DIR* variable should be specified with the path to the folders where required 3rd-party libraries will be sought
+@figure{/dev_guides/building/cmake/images/cmake_image001.png}
 
-The results of search for 3rd-party directories will be stored in *3RDPARTY_\<LIBRARY\>_DIR* variables. If *3RDPARTY_DIR* directory is defined, required libraries are sought in *3RDPARTY_DIR* location.
+**Note**: Each configuration of the project should be built in its own directory. When building multiple configurations it is recommended to indicate in the name of build directories the system, bitness and compiler (e.g., <i>d:/occt/build/win32-vc10</i> ).
 
-The procedure expects to find binary and header files of each 3rd-party library in its own sub-directory: *bin*, *lib* and *include*.
+Once the source and build directories are selected, "Configure" button should be pressed in order to start manual configuration process. It begins with selection of a target configurator. It is "Visual Studio 10 2010 Win64" in our example.
 
-Press **Configure** (**c** key for ccmake).
+@figure{/dev_guides/building/cmake/images/cmake_image002.png}
 
-The result of the search are recorded in the corresponding variables:
+Once "Finish" button is pressed, the first pass the configuration process is executed. At the end of the process, CMake outputs the list of environment variables which have to be properly specified for successful configuration. 
+
+The error message provides an information about these variables. This message will appear after each pass of the process until all required variables are specified correctly.
+
+The change of the state of some variables can lead to a new variable appearance. The new variables appeared after the pass of the configuration process is notified with red color by CMake GUI tool.
+
+Note: There is "grouped" option which groups variables with a common prefix.
+
+The following table enumerates the full list of environment variables used at configuration stage:
+
+| Variable | Type | Purpose |
+|----------|------|---------|
+| CMAKE_BUILD_TYPE | String | Specifies the build type on single-configuration generators (sush as make).  Possible values are Debug, Release and RelWithDebInfo |
+| USE_FREEIMAGE | Boolean flag | Indicates whether Freeimage product should be used in OCCT visualization module for support of popular graphics image formats (PNG, BMP etc) |
+| USE_GL2PS | Boolean flag | Indicates whether GL2PS product should be used in OCCT visualization module for support of vector image formats (PS, EPS etc) |
+| USE_TBB | Boolean flag | Indicates whether TBB 3-rd party is used or not. TBB stands for Threading Building Blocks, the technology of Intel Corp, which comes with different mechanisms and patterns for injecting parallelism into your application. OCCT remains parallel even without TBB product |
+| USE_VTK | Boolean flag | Indicates whether VTK 3-rd party is used or not. VTK stands for Visualization ToolKit, the technology of Kitware Inc intended for general-purpose scientific visualization. OCCT comes with a bridge between CAD data representation and VTK by means of its dedicated VIS component (VTK Integration Services). You may skip this 3-rd party unless you are planning to use VTK visualization for OCCT geometry. The official documentation [**insert link**] \("VTK Integration Services" user's guide\) for the details on VIS |
+| 3RDPARTY_DIR | Path | Defines the root directory where all required 3-rd party products will be searched. Once you define this path it is very convenient to click "Configure" button in order to let CMake automatically detect all necessary products|
+| 3RDPARTY_FREETYPE_* | Path | Path to Freetype binaries |
+| 3RDPARTY_TCL_* 3RDPARTY_TK_* | Path | Path to Tcl/Tk binaries |
+| 3RDPARTY_FREEIMAGE* | Path | Path to Freeimage binaries |
+| 3RDPARTY_GL2PS_* | Path | Path to GL2PS binaries |
+| 3RDPARTY_TBB* | Path | Path to TBB binaries |
+| 3RDPARTY_VTK_* | Path | Path to VTK binaries |
+| BUILD_MODULE_<MODULE>| Boolean flag | Indicates whether the corresponding OCCT module should be built or not. It should be noted that some toolkits of a module can be built even if this module is not checked (this happens if some other modules depend on these toolkits). The main modules and their descriptions can be found in [**insert link**] \("User Guides" chapter\) and partially in [**insert link**] |
+| BUILD_LIBRARY_TYPE | String |  Specifies the type of library to be created. "Shared" libraries are linked dynamically and loaded at runtime. "Static" libraries are archives of object files for use when linking other targets |
+| BUILD_ADDITIONAL_TOOLKITS | String | Semicolon-separated individual toolkits to include into build process. If you want to build some particular libraries (toolkits) only, then you may uncheck all modules in the corresponding *BUILD_MODUE_\<MODULE\>* options and provide the list of necessary libraries here. Of course, all dependencies will be resolved automatically |
+| REBUILD_PLATFORM_DEPENDENT_CODE | Boolean flag | Enables Flex/Bison lexical analyzers. OCCT source files relating to STEP reader and ExprIntrp functionality are generated automatically with Flex/Bison. Checking this options leads to automatic search of Flex/Bison binaries and regeneration of the mentioned files |
+| BUILD_MODULE_OcctMfcSamples | Boolean flag | Indicates whether MFC samples should be built together with OCCT. This option is only relevant to Windows platforms |
+| BUILD_DOC_OcctOverview | Boolean flag | Indicates whether OCCT overview documentation project should be created together with OCCT. It is not built together with OCCT. Checking this options leads to automatic search of Doxygen binaries. Building of it will be call Doxygen command to generate the documentation in HTML format |
+| APPLY_OCCT_PATH_DIR | Boolean flag | Points to the directory recognized as a "patch" for OCCT. If specified, the files from this directory take precedence over the corresponding native OCCT sources. This way you are able to introduce patches to Open CASCADE Technology not affecting the original source distribution |
+| CMAKE_CONFIGURATION_TYPES | String | Semicolon-separated CMake configurations |
+| INSTALL_DIR | Path | Points to the installation directory |
+| INSTALL_FREETYPE | Boolean flag | Indicates whether Freetype binaries should be installed into the installation directory |
+| INSTALL_FREEIMAGE* | Boolean flag | Indicates whether Freeimage binaries should be installed into the installation directory |
+| INSTALL_GL2PS | Boolean flag | Indicates whether GL2PS binaries should be installed into the installation directory |
+| INSTALL_TBB | Boolean flag | Indicates whether TBB binaries should be installed into the installation directory |
+| INSTALL_VTK | Boolean flag | Indicates whether VTK binaries should be installed into the installation directory |
+| INSTALL_TCL | Boolean flag | Indicates whether TCL binaries should be installed into the installation directory |
+| INSTALL_OCCT_SAMPLES | Boolean flag | Indicates whether non-regression OCCT test scripts should be installed into the installation directory |
+| INSTALL_DOC_OcctOverview | Boolean flag | Indicates whether OCCT overview documentation should be installed into the installation directory |
+
+**Note:** In those CMake options defining paths only the forward slashes ("/") are acceptable.
+
+### 3rd-party search mechanism (The variables with <i>3RDPARTY_</i> prefix)
+
+If *3RDPARTY_DIR* directory is defined, required 3rd-party binaries are sought in it, default system folders are ignored.
+
+The procedure expects to find binary and header files of each 3rd-party product in its own sub-directory: *bin*, *lib* and *include*.
+
+The result of the search (achived on the next pass of the configuration process) are recorded in the corresponding variables:
 
 * *3RDPARTY_\<PRODUCT\>_DIR* - path to the 3rdparty directory (with directory name) (e.g. <i>D:/3rdparty/tcltk-86-32</i>)
 * *3RDPARTY_\<PRODUCT\>_LIBRARY_DIR* - path to directory containing a library (e.g. <i>D:/3rdparty/tcltk-86-32/lib</i>). 
 * *3RDPARTY_\<PRODUCT\>_INCLUDE_DIR* - path to the directory containing a header file (e.g., <i>D:/3rdparty/tcltk-86-32/include</i>)
-* *3RDPARTY_\<PRODUCT\>_DLL_DIR* - path to the directory containing a shared library (e.g., <i>D:/3rdparty/tcltk-86-32/bin</i>) This variable is able just in windows case
-
+* *3RDPARTY_\<PRODUCT\>_DLL_DIR* - path to the directory containing a shared library (e.g., <i>D:/3rdparty/tcltk-86-32/bin</i>) This variable is only relevant to Windows platforms
 
 Note: each library and include directory should be the children of product directory if the last one is defined.
 
@@ -130,18 +144,9 @@ The search process is as follows:
    2. *3RDPARTY_\<PRODUCT\>_LIBRARY_DIR*
    3. *3RDPARTY_\<PRODUCT\>_DLL_DIR*
 
-If a variable of any level is not defined (empty or <i> \<variable name\>-NOTFOUND </i>) 
-and the upper level variable is defined, the content of the non-defined variable 
-will be sought at the next configuration step. If search process at level 3 does not find the required files, it seeks in default places.
-
-Important: If *BUILD_CONFIGURATION* variable is changed, at the next configuration 
-*3RDPARTY_ variables* will be replaced by the search process result, except for the *3RDPARTY_DIR* variable.
+If a variable of any level is not defined (empty or <i> \<variable name\>-NOTFOUND </i>) and the upper level variable is defined, the content of the non-defined variable will be sought at the next configuration step. If search process at level 3 does not find the required files, it seeks in default places.
 
-**Note** : CMake will produce an error after the configuration step until all required variables are defined correctly.
-If the search result (include path, or library path, or dll path) does not meet your expectations, 
-you can  change *3RDPARTY_\<PRODUCT\>_*_DIR variable*, clear (if they are not empty) 
-*3RDPARTY_\<PRODUCT\>_DLL_DIR, 3RDPARTY_\<PRODUCT\>_INCLUDE_DIR* and 3RDPARTY_\<PRODUCT\>_LIBRARY_DIR variables 
-(or clear one of them) and run the configuration process again. 
+If a search result (include path, or library path, or dll path) does not meet your expectations, you can change *3RDPARTY_\<PRODUCT\>_*_DIR variable*, clear (if they are not empty) *3RDPARTY_\<PRODUCT\>_DLL_DIR, 3RDPARTY_\<PRODUCT\>_INCLUDE_DIR* and 3RDPARTY_\<PRODUCT\>_LIBRARY_DIR variables (or clear one of them) and run the configuration process again.
 
 At this time the search will be performed in the newly identified directory 
 and the result will be recorded to corresponding variables (replace old value if it is necessary).
@@ -154,86 +159,51 @@ can be changed to
 
     /PRODUCTS/maintenance/Mandriva2010/freetype-2.5.3
 
-During the configuration process and the related variables (*3RDPARTY_FREETYPE_DLL_DIR*, *3RDPARTY_FREETYPE_INCLUDE_DIR* and *3RDPARTY_FREETYPE_LIBRARY_DIR*) will be filled with new found values
+During the configuration process the related variables (*3RDPARTY_FREETYPE_DLL_DIR*, *3RDPARTY_FREETYPE_INCLUDE_DIR* and *3RDPARTY_FREETYPE_LIBRARY_DIR*) will be filled with new found values
 
-**Note**: The names of searched libraries and header files are hard-coded. If there is the need to change their names,
-change appropriate cmake variables (edit CMakeCache.txt file or edit in cmake-gui in advance mode) without reconfiguration: *3RDPARTY_\<PRODUCT\>_INCLUDE* for include, *3RDPARTY_\<PRODUCT\>_LIB* for library and *3RDPARTY_\<PRODUCT\>_DLL* for shared library.
+**Note**: The names of searched libraries and header files are hard-coded. If there is the need to change their names, change appropriate cmake variables (edit CMakeCache.txt file or edit in cmake-gui in advance mode) without reconfiguration: *3RDPARTY_\<PRODUCT\>_INCLUDE* for include, *3RDPARTY_\<PRODUCT\>_LIB* for library and *3RDPARTY_\<PRODUCT\>_DLL* for shared library.
 
-###The variables with INSTALL_ prefix:
+### OCCT Generation
 
-Define *INSTALL_DIR* variable as the path will be contain the built OCCT files (libraries, executables and headers)
-If <i>INSTALL_\<PRODUCT\></i> variable is checked, 3rd-party products will be copied to the install directory.
+Once the configuration process is done, "Generate" button is used to prepare project files for the target IDE. In our exercise the Visual Studio solution will be automatically created in the buid directory.
 
-Additional INSTALL_ variables:
-
-* INSTALL_SAMPLES       - copy all OCCT samples into the install folder
-* INSTALL_OCCT_OVERVIEW - copy generated OCCT overview documentation into the install folder
-
-At the end of the configuration process "configuring done" message will be shown and the generation process can be started.
-
-## OCCT Generation
-
-This procedure will create makefiles or project files for your build system.
-
-### Windows
-
-Click **Generate** button and wait until the generation process is finished. 
-Then the project files will appear in the build folder (e.g. <i> d:/occt/build/win32-vc9-release </i>). 
-
-### Linux
-
-Click **Generate** button (if you use cmake-gui) or press **g** (for ccmake) to start the generation process.
-
-### Mac OS X
-
-Click **Generate** button and wait until the generation process is finished. 
-Then the project files will appear in the build folder (e.g. <i> /Developer/occt/build/XCode </i>).
-
-## OCCT Building
-
-The install folder contains the scripts to run *DRAWEXE* (*draw.bat* or *draw.sh*) and samples (if its were built; (see below **MFC samples**)); the directory structure is follow:
-* **data**    - data files for OCCT (brep, iges, stp)
-* **inc**     - header files
-* **samples** - tcl sample files
-* **src**     - all required source files for OCCT
-* **tests**   - OCCT test suite
-* **win32/vc10/bind**> - example relative directory tree of binary files (3rdparty and occt)
-* **win32/vc9/lib**>   - example relative directory tree of libraries (3rdparty and occt)
-
-### Windows (Visual studio)
+### OCCT Building
 
 Go to the build folder, start the Visual Studio solution *OCCT.sln* and build it by clicking **Build -> Build Solution**.
 
-When the building process is finished, build the *INSTALL* project (by default the build solution process skips the building of the INSTALL project) to move the above files to *INSTALL_DIR*. 
-
-For this, right-click on the *INSTALL* project and select **Project Only -> Build Only** -> *INSTALL* in the solution explorer. 
-
-### Linux (make)
-
-Change directory to the directory with binaries and run *make* command
-
-       > make 
+By default the build solution process skips the building of the INSTALL and Overview project.
 
-To copy all libraries, executables and chosen 3rd-party libraries run *make* command with *install* argument
+When the building process is finished build:
+* Overview project to generate OCCT overview documentation (if BUILD_DOC_OcctOverview variable is checked)
+* the *INSTALL* project to run **the installation process** [**insert link**].
 
-       > make install
+For this, right-click on the *Overview/INSTALL* project and select **Project Only -> Build Only** -> *Overview/INSTALL* in the solution explorer. 
 
-This command will move the above files to *INSTALL_DIR*.
+## Installation process
 
-### Mac OS X (XCode)
+Installation is a process of extracting redistributable resources (binaries,include files etc) from the build directory into the installation one. The installation directory will be free of project files, intermediate object files and any other information related to the build routines. 
 
-Go to the build folder, start XCode solution *OCCT.xcodeproj* and build it by clicking **Build -> Build**. 
-Please notice that XCode may lag because it processes sources at the first start.
+Normally you use the installation directory of OCCT to link against your specific application. 
 
-When the building process has finished, build the *INSTALL* project (by default the build solution process skips the building of *INSTALL* project) to move the above files to *INSTALL_DIR*. 
-Notice that *env.sh* (which configures *PATH* and *DYLD_LIBRARY_PATH* environment variables 
-as well as Draw Harness extra variables) and *draw.sh* (to launch *DRAWEXE* ) will be created in the target directory. 
+the directory structure is follow:
+    
+    data            - data files for OCCT (brep, iges, stp)
+    doc             - OCCT overview documentation in HTML format
+    inc             - header files
+    samples         - samples
+    src             - all required source files for OCCT
+    tests           - OCCT test suite
+    win32\vc10\bind - binary files (installed 3rdparties and occt)
+              \libd - libraries (installed 3rdparties and occt)
 
-### MFC samples
+**Note:** The above example is given for debug configuration. However, it is generally safe to use the same installation directory for the release build. In the latter case the contents of install directory will be enriched with subdirectories and files related to the release configuration. In particular, the binaries directory win64 will be expanded as
+follows:
 
-On Windows you can also build binaries of MFC samples together with OCCT. For this, activate **BUILD_Samples** check-box in CMake configuration dialog.
+    \win32\vc10\bind
+               \libd
+               \bin
+               \lib
 
-@figure{/dev_guides/building/cmake/images/cmake_image007.png}
+If CMake installation flags are enabled for the 3-rd party products (e.g. INSTALL_FREETYPE), then the corresponding binaries will be copied to the same bin(d) and lib(d) directories together with the native binaries of OCCT. Such organization of libraries can be especially helpful if your OCCT-based software does not use itself the 3-rd parties of Open CASCADE Technology (thus, there is no sense to pack them into dedicated directories)
 
-Please take into account that MFC sample binaries will be installed  in the same folder as OCCT binaries during building of *INSTALL* project.
-To run an MFC sample use *sample.bat* launcher. The command format is: <i>sample.bat *SampleName*</i> (e.g. <i>sample.bat ImportExport</i>).
+The installation folder contains the scripts to run *DRAWEXE* (*draw.bat* or *draw.sh*), samples (if its were installed) and overview.html (short-cut for installed OCCT overview documentation).
index 543a6ca..b237346 100644 (file)
Binary files a/dox/dev_guides/building/cmake/images/cmake_image001.png and b/dox/dev_guides/building/cmake/images/cmake_image001.png differ
index eeae785..e37ddbc 100644 (file)
Binary files a/dox/dev_guides/building/cmake/images/cmake_image002.png and b/dox/dev_guides/building/cmake/images/cmake_image002.png differ
index 1f95458..541a052 100644 (file)
Binary files a/dox/dev_guides/building/cmake/images/cmake_image007.png and b/dox/dev_guides/building/cmake/images/cmake_image007.png differ
index ded5792..34887e0 100644 (file)
@@ -1,9 +1,7 @@
 project(DRAWEXE)
 
-set (isEXE TRUE)
-
 set (TOOLKIT_MODULES
   DRAWEXE
 )
 
-include(${OCCT_SOURCE_DIR}/adm/cmake/BuildToolkit.cmake)
+include(${OCCT_SOURCE_DIR}/adm/cmake/occt_toolkit.cmake)
index 0cea167..3f9fbaf 100644 (file)
@@ -4,4 +4,4 @@ set (TOOLKIT_MODULES
   FWOSDriver
 )
 
-include(${OCCT_SOURCE_DIR}/adm/cmake/BuildToolkit.cmake)
+include(${OCCT_SOURCE_DIR}/adm/cmake/occt_toolkit.cmake)
index 2751498..0e090c7 100644 (file)
@@ -9,4 +9,4 @@ set (TOOLKIT_MODULES
   BOPTools
 )
 
-include(${OCCT_SOURCE_DIR}/adm/cmake/BuildToolkit.cmake)
+include(${OCCT_SOURCE_DIR}/adm/cmake/occt_toolkit.cmake)
index 95b5b68..764fa23 100644 (file)
@@ -11,4 +11,4 @@ set (TOOLKIT_MODULES
   BinTools
 )
 
-include(${OCCT_SOURCE_DIR}/adm/cmake/BuildToolkit.cmake)
+include(${OCCT_SOURCE_DIR}/adm/cmake/occt_toolkit.cmake)
index 417665c..8404547 100644 (file)
@@ -7,4 +7,4 @@ set (TOOLKIT_MODULES
   BinMNaming
 )
 
-include(${OCCT_SOURCE_DIR}/adm/cmake/BuildToolkit.cmake)
+include(${OCCT_SOURCE_DIR}/adm/cmake/occt_toolkit.cmake)
index 6db83a8..feecd95 100644 (file)
@@ -9,4 +9,4 @@ set (TOOLKIT_MODULES
   BinLDrivers
 )
 
-include(${OCCT_SOURCE_DIR}/adm/cmake/BuildToolkit.cmake)
+include(${OCCT_SOURCE_DIR}/adm/cmake/occt_toolkit.cmake)
index 64b3de6..f653281 100644 (file)
@@ -4,4 +4,4 @@ set (TOOLKIT_MODULES
   BinTObjDrivers
 )
 
-include(${OCCT_SOURCE_DIR}/adm/cmake/BuildToolkit.cmake)
+include(${OCCT_SOURCE_DIR}/adm/cmake/occt_toolkit.cmake)
index 9835abc..c0aa812 100644 (file)
@@ -5,4 +5,4 @@ set (TOOLKIT_MODULES
   BinMXCAFDoc
 )
 
-include(${OCCT_SOURCE_DIR}/adm/cmake/BuildToolkit.cmake)
+include(${OCCT_SOURCE_DIR}/adm/cmake/occt_toolkit.cmake)
index 216f5cf..fcce913 100644 (file)
@@ -10,4 +10,4 @@ set (TOOLKIT_MODULES
   BRepProj
 )
 
-include(${OCCT_SOURCE_DIR}/adm/cmake/BuildToolkit.cmake)
+include(${OCCT_SOURCE_DIR}/adm/cmake/occt_toolkit.cmake)
index 024a17d..2a3f238 100644 (file)
@@ -7,4 +7,4 @@ set (TOOLKIT_MODULES
   AppStd
 )
 
-include(${OCCT_SOURCE_DIR}/adm/cmake/BuildToolkit.cmake)
+include(${OCCT_SOURCE_DIR}/adm/cmake/occt_toolkit.cmake)
index 6e33d7a..4e17091 100644 (file)
@@ -8,4 +8,4 @@ set (TOOLKIT_MODULES
   LDOM
 )
 
-include(${OCCT_SOURCE_DIR}/adm/cmake/BuildToolkit.cmake)
+include(${OCCT_SOURCE_DIR}/adm/cmake/occt_toolkit.cmake)
index 1e8e0c3..1861c78 100644 (file)
@@ -9,4 +9,4 @@ set (TOOLKIT_MODULES
   DrawDim
 )
 
-include(${OCCT_SOURCE_DIR}/adm/cmake/BuildToolkit.cmake)
+include(${OCCT_SOURCE_DIR}/adm/cmake/occt_toolkit.cmake)
index e63ef73..f0aa195 100644 (file)
@@ -34,4 +34,4 @@ else()
   endif()
 endif()
 
-include(${OCCT_SOURCE_DIR}/adm/cmake/BuildToolkit.cmake)
+include(${OCCT_SOURCE_DIR}/adm/cmake/occt_toolkit.cmake)
index 4fc453b..fd99cd5 100644 (file)
@@ -5,4 +5,4 @@ set (TOOLKIT_MODULES
   BRepFeat
 )
 
-include(${OCCT_SOURCE_DIR}/adm/cmake/BuildToolkit.cmake)
+include(${OCCT_SOURCE_DIR}/adm/cmake/occt_toolkit.cmake)
index b41e3ef..3acac83 100644 (file)
@@ -12,4 +12,4 @@ set (TOOLKIT_MODULES
   FilletSurf
 )
 
-include(${OCCT_SOURCE_DIR}/adm/cmake/BuildToolkit.cmake)
+include(${OCCT_SOURCE_DIR}/adm/cmake/occt_toolkit.cmake)
index 0159004..d96971c 100644 (file)
@@ -10,4 +10,4 @@ set (TOOLKIT_MODULES
   GProp
 )
 
-include(${OCCT_SOURCE_DIR}/adm/cmake/BuildToolkit.cmake)
+include(${OCCT_SOURCE_DIR}/adm/cmake/occt_toolkit.cmake)
index 8bae786..f76dd25 100644 (file)
@@ -11,4 +11,4 @@ set (TOOLKIT_MODULES
   TopAbs
 )
 
-include(${OCCT_SOURCE_DIR}/adm/cmake/BuildToolkit.cmake)
+include(${OCCT_SOURCE_DIR}/adm/cmake/occt_toolkit.cmake)
index 9656677..9325cbb 100644 (file)
@@ -36,4 +36,4 @@ set (TOOLKIT_MODULES
   TopClass
 )
 
-include(${OCCT_SOURCE_DIR}/adm/cmake/BuildToolkit.cmake)
+include(${OCCT_SOURCE_DIR}/adm/cmake/occt_toolkit.cmake)
index 979f1a2..a224d41 100644 (file)
@@ -25,4 +25,4 @@ set (TOOLKIT_MODULES
   gce
 )
 
-include(${OCCT_SOURCE_DIR}/adm/cmake/BuildToolkit.cmake)
+include(${OCCT_SOURCE_DIR}/adm/cmake/occt_toolkit.cmake)
index 5d6f1dd..9aec77f 100644 (file)
@@ -11,4 +11,4 @@ set (TOOLKIT_MODULES
   Contap
 )
 
-include(${OCCT_SOURCE_DIR}/adm/cmake/BuildToolkit.cmake)
+include(${OCCT_SOURCE_DIR}/adm/cmake/occt_toolkit.cmake)
index f467514..9411e2f 100644 (file)
@@ -21,4 +21,4 @@ set (TOOLKIT_MODULES
   IGESControl
 )
 
-include(${OCCT_SOURCE_DIR}/adm/cmake/BuildToolkit.cmake)
+include(${OCCT_SOURCE_DIR}/adm/cmake/occt_toolkit.cmake)
index 555d206..6e9278f 100644 (file)
@@ -16,4 +16,4 @@ else()
   endforeach()
 endif()
 
-include(${OCCT_SOURCE_DIR}/adm/cmake/BuildToolkit.cmake)
+include(${OCCT_SOURCE_DIR}/adm/cmake/occt_toolkit.cmake)
index fe1a10c..5252018 100644 (file)
@@ -13,4 +13,4 @@ else()
   endforeach()
 endif()
 
-include(${OCCT_SOURCE_DIR}/adm/cmake/BuildToolkit.cmake)
+include(${OCCT_SOURCE_DIR}/adm/cmake/occt_toolkit.cmake)
index 9c297d3..ef4ac9c 100644 (file)
@@ -8,4 +8,4 @@ set (TOOLKIT_MODULES
   AppStdL
 )
 
-include(${OCCT_SOURCE_DIR}/adm/cmake/BuildToolkit.cmake)
+include(${OCCT_SOURCE_DIR}/adm/cmake/occt_toolkit.cmake)
index 1e9319a..b1e13bc 100644 (file)
@@ -21,4 +21,4 @@ set (TOOLKIT_MODULES
   ExprIntrp
 )
 
-include(${OCCT_SOURCE_DIR}/adm/cmake/BuildToolkit.cmake)
+include(${OCCT_SOURCE_DIR}/adm/cmake/occt_toolkit.cmake)
index bb9d8a8..5ae4ebd 100644 (file)
@@ -11,4 +11,4 @@ if(NOT WIN32)
   endif()
 endif()
 
-include(${OCCT_SOURCE_DIR}/adm/cmake/BuildToolkit.cmake)
+include(${OCCT_SOURCE_DIR}/adm/cmake/occt_toolkit.cmake)
index af9e7c2..3271daf 100644 (file)
@@ -4,4 +4,4 @@ set (TOOLKIT_MODULES
   MeshVS
 )
 
-include(${OCCT_SOURCE_DIR}/adm/cmake/BuildToolkit.cmake)
+include(${OCCT_SOURCE_DIR}/adm/cmake/occt_toolkit.cmake)
index 2e7a2a3..d1b8eac 100644 (file)
@@ -7,4 +7,4 @@ set (TOOLKIT_MODULES
   BiTgte
 )
 
-include(${OCCT_SOURCE_DIR}/adm/cmake/BuildToolkit.cmake)
+include(${OCCT_SOURCE_DIR}/adm/cmake/occt_toolkit.cmake)
index bcb3ff3..150e5a3 100644 (file)
@@ -37,4 +37,4 @@ if (NOT WIN32)
   endif()
 endif()
 
-include(${OCCT_SOURCE_DIR}/adm/cmake/BuildToolkit.cmake)
+include(${OCCT_SOURCE_DIR}/adm/cmake/occt_toolkit.cmake)
index fc93473..2a6db72 100644 (file)
@@ -7,4 +7,4 @@ set (TOOLKIT_MODULES
   BRepPrimAPI
 )
 
-include(${OCCT_SOURCE_DIR}/adm/cmake/BuildToolkit.cmake)
+include(${OCCT_SOURCE_DIR}/adm/cmake/occt_toolkit.cmake)
index 175f79a..ef15485 100644 (file)
@@ -21,4 +21,4 @@ else()
   endif()
 endif()
 
-include(${OCCT_SOURCE_DIR}/adm/cmake/BuildToolkit.cmake)
+include(${OCCT_SOURCE_DIR}/adm/cmake/occt_toolkit.cmake)
index dc02e34..93ed1a6 100644 (file)
@@ -20,4 +20,4 @@ if (WIN32)
   list( APPEND USED_LIBS wsock32.lib )
 endif()
 
-include(${OCCT_SOURCE_DIR}/adm/cmake/BuildToolkit.cmake)
+include(${OCCT_SOURCE_DIR}/adm/cmake/occt_toolkit.cmake)
index 012c0a1..13b9ddc 100644 (file)
@@ -7,4 +7,4 @@ set (TOOLKIT_MODULES
   RWStepFEA
 )
 
-include(${OCCT_SOURCE_DIR}/adm/cmake/BuildToolkit.cmake)
+include(${OCCT_SOURCE_DIR}/adm/cmake/occt_toolkit.cmake)
index 9b2fa59..a49265f 100644 (file)
@@ -7,4 +7,4 @@ set (TOOLKIT_MODULES
   RWStepDimTol
 )
 
-include(${OCCT_SOURCE_DIR}/adm/cmake/BuildToolkit.cmake)
+include(${OCCT_SOURCE_DIR}/adm/cmake/occt_toolkit.cmake)
index 8eb14e6..0482a36 100644 (file)
@@ -11,4 +11,4 @@ set (TOOLKIT_MODULES
   RWStepShape
 )
 
-include(${OCCT_SOURCE_DIR}/adm/cmake/BuildToolkit.cmake)
+include(${OCCT_SOURCE_DIR}/adm/cmake/occt_toolkit.cmake)
index 83f97dc..3e390c8 100644 (file)
@@ -7,4 +7,4 @@ set (TOOLKIT_MODULES
   RWStl
 )
 
-include(${OCCT_SOURCE_DIR}/adm/cmake/BuildToolkit.cmake)
+include(${OCCT_SOURCE_DIR}/adm/cmake/occt_toolkit.cmake)
index 4550dc4..afdd069 100644 (file)
@@ -55,4 +55,4 @@ if (NOT WIN32)
   list( APPEND USED_LIBS freetype )
 endif()
 
-include(${OCCT_SOURCE_DIR}/adm/cmake/BuildToolkit.cmake)
+include(${OCCT_SOURCE_DIR}/adm/cmake/occt_toolkit.cmake)
index d9b87ef..b78040d 100644 (file)
@@ -17,4 +17,4 @@ if (WIN32)
   list( APPEND USED_LIBS wsock32.lib )
 endif()
 
-include(${OCCT_SOURCE_DIR}/adm/cmake/BuildToolkit.cmake)
+include(${OCCT_SOURCE_DIR}/adm/cmake/occt_toolkit.cmake)
index c3ea9eb..7cc9a99 100644 (file)
@@ -4,4 +4,4 @@ set (TOOLKIT_MODULES
   TObj
 )
 
-include(${OCCT_SOURCE_DIR}/adm/cmake/BuildToolkit.cmake)
+include(${OCCT_SOURCE_DIR}/adm/cmake/occt_toolkit.cmake)
index 77d83cd..7f5e16d 100644 (file)
@@ -4,4 +4,4 @@ set (TOOLKIT_MODULES
   TObjDRAW
 )
 
-include(${OCCT_SOURCE_DIR}/adm/cmake/BuildToolkit.cmake)
+include(${OCCT_SOURCE_DIR}/adm/cmake/occt_toolkit.cmake)
index 57767f1..4f1a349 100644 (file)
@@ -19,4 +19,4 @@ set (TOOLKIT_MODULES
   BRepApprox
 )
 
-include(${OCCT_SOURCE_DIR}/adm/cmake/BuildToolkit.cmake)
+include(${OCCT_SOURCE_DIR}/adm/cmake/occt_toolkit.cmake)
index 23092d9..fca276b 100644 (file)
@@ -14,4 +14,4 @@ set (TOOLKIT_MODULES
   SWDRAW
 )
 
-include(${OCCT_SOURCE_DIR}/adm/cmake/BuildToolkit.cmake)
+include(${OCCT_SOURCE_DIR}/adm/cmake/occt_toolkit.cmake)
index a6e4a4e..9650b50 100644 (file)
@@ -34,4 +34,4 @@ else()
   list( APPEND USED_LIBS freetype )
 endif()
 
-include(${OCCT_SOURCE_DIR}/adm/cmake/BuildToolkit.cmake)
+include(${OCCT_SOURCE_DIR}/adm/cmake/occt_toolkit.cmake)
index 4aca687..c6d9db6 100644 (file)
@@ -7,4 +7,4 @@ set (TOOLKIT_MODULES
   VrmlData
 )
 
-include(${OCCT_SOURCE_DIR}/adm/cmake/BuildToolkit.cmake)
+include(${OCCT_SOURCE_DIR}/adm/cmake/occt_toolkit.cmake)
index 7ea8932..06a5955 100644 (file)
@@ -36,4 +36,4 @@ else()
   list( APPEND USED_LIBS freetype )
 endif()
 
-include(${OCCT_SOURCE_DIR}/adm/cmake/BuildToolkit.cmake)
+include(${OCCT_SOURCE_DIR}/adm/cmake/occt_toolkit.cmake)
index f0ceb8a..7e2a829 100644 (file)
@@ -4,4 +4,4 @@ set (TOOLKIT_MODULES
   Voxel
 )
 
-include(${OCCT_SOURCE_DIR}/adm/cmake/BuildToolkit.cmake)
+include(${OCCT_SOURCE_DIR}/adm/cmake/occt_toolkit.cmake)
index 39b457b..af71185 100644 (file)
@@ -6,4 +6,4 @@ set (TOOLKIT_MODULES
   XCAFPrs
 )
 
-include(${OCCT_SOURCE_DIR}/adm/cmake/BuildToolkit.cmake)
+include(${OCCT_SOURCE_DIR}/adm/cmake/occt_toolkit.cmake)
index 0db7395..8683ce7 100644 (file)
@@ -4,4 +4,4 @@ set (TOOLKIT_MODULES
   XDEDRAW
 )
 
-include(${OCCT_SOURCE_DIR}/adm/cmake/BuildToolkit.cmake)
+include(${OCCT_SOURCE_DIR}/adm/cmake/occt_toolkit.cmake)
index f3724bc..0164d91 100644 (file)
@@ -4,4 +4,4 @@ set (TOOLKIT_MODULES
   IGESCAFControl
 )
 
-include(${OCCT_SOURCE_DIR}/adm/cmake/BuildToolkit.cmake)
+include(${OCCT_SOURCE_DIR}/adm/cmake/occt_toolkit.cmake)
index 9ef2c04..73faa92 100644 (file)
@@ -4,4 +4,4 @@ set (TOOLKIT_MODULES
   STEPCAFControl
 )
 
-include(${OCCT_SOURCE_DIR}/adm/cmake/BuildToolkit.cmake)
+include(${OCCT_SOURCE_DIR}/adm/cmake/occt_toolkit.cmake)
index 6b596cc..afa66fa 100644 (file)
@@ -4,4 +4,4 @@ set (TOOLKIT_MODULES
   XBRepMesh
 )
 
-include(${OCCT_SOURCE_DIR}/adm/cmake/BuildToolkit.cmake)
+include(${OCCT_SOURCE_DIR}/adm/cmake/occt_toolkit.cmake)
index 8deeba1..694b4d3 100644 (file)
@@ -19,4 +19,4 @@ set (TOOLKIT_MODULES
   MoniTool
 )
 
-include(${OCCT_SOURCE_DIR}/adm/cmake/BuildToolkit.cmake)
+include(${OCCT_SOURCE_DIR}/adm/cmake/occt_toolkit.cmake)
index 08da31b..fdcc7dc 100644 (file)
@@ -7,4 +7,4 @@ set (TOOLKIT_MODULES
   XSDRAWSTLVRML
 )
 
-include(${OCCT_SOURCE_DIR}/adm/cmake/BuildToolkit.cmake)
+include(${OCCT_SOURCE_DIR}/adm/cmake/occt_toolkit.cmake)
index 9f71165..6bdd7e3 100644 (file)
@@ -7,4 +7,4 @@ set (TOOLKIT_MODULES
   XmlMPrsStd
 )
 
-include(${OCCT_SOURCE_DIR}/adm/cmake/BuildToolkit.cmake)
+include(${OCCT_SOURCE_DIR}/adm/cmake/occt_toolkit.cmake)
index 3e492f3..07575b0 100644 (file)
@@ -9,4 +9,4 @@ set (TOOLKIT_MODULES
   XmlObjMgt
 )
 
-include(${OCCT_SOURCE_DIR}/adm/cmake/BuildToolkit.cmake)
+include(${OCCT_SOURCE_DIR}/adm/cmake/occt_toolkit.cmake)
index 78f426a..9745f24 100644 (file)
@@ -4,4 +4,4 @@ set (TOOLKIT_MODULES
   XmlTObjDrivers
 )
 
-include(${OCCT_SOURCE_DIR}/adm/cmake/BuildToolkit.cmake)
+include(${OCCT_SOURCE_DIR}/adm/cmake/occt_toolkit.cmake)
index b87fc87..2e38bcf 100644 (file)
@@ -5,4 +5,4 @@ set (TOOLKIT_MODULES
   XmlMXCAFDoc
 )
 
-include(${OCCT_SOURCE_DIR}/adm/cmake/BuildToolkit.cmake)
+include(${OCCT_SOURCE_DIR}/adm/cmake/occt_toolkit.cmake)
index 8ca64cd..cae9986 100644 (file)
@@ -36,4 +36,4 @@ else()
   endif()
 endif()
 
-include(${OCCT_SOURCE_DIR}/adm/cmake/BuildToolkit.cmake)
+include(${OCCT_SOURCE_DIR}/adm/cmake/occt_toolkit.cmake)