diff --git a/CMakeLists.txt b/CMakeLists.txt index ca40232e1b..9a0c1da3b7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -85,6 +85,13 @@ elseif (DEFINED MSVC11) else() SET(COMPILER ${CMAKE_GENERATOR}) endif() +if (WIN32) + SET(OS_WITH_BIT "win${COMPILER_BITNESS}") +elseif(APPLE) + SET(OS_WITH_BIT "mac${COMPILER_BITNESS}") +else() + SET(OS_WITH_BIT "lin${COMPILER_BITNESS}") +endif() add_definitions(-DCSFDB) if(WIN32) @@ -145,10 +152,12 @@ install(FILES "${CMAKE_SOURCE_DIR}/src/UnitsAPI/Lexi_Expr.dat" DESTINATION "${I install(FILES "${CMAKE_SOURCE_DIR}/src/UnitsAPI/Units.dat" DESTINATION "${INSTALL_DIR}/src/UnitsAPI" ) install(FILES "${CMAKE_SOURCE_DIR}/src/TObj/TObj.msg" DESTINATION "${INSTALL_DIR}/src/TObj" ) -IF("${BUILD_CONFIGURATION}" STREQUAL "Release") - SET(BUILD_SUFFIX "") +IF("${BUILD_CONFIGURATION}" STREQUAL "Debug") + SET(3RDPARTY_BUILD_SUFFIX "") # debug == release + SET(BUILD_SUFFIX "d") ELSE() - SET(BUILD_SUFFIX "") # debug == release + SET(3RDPARTY_BUILD_SUFFIX "") + SET(BUILD_SUFFIX "") ENDIF() FUNCTION(SUBDIRECTORY_NAMES MAIN_DIRECTORY RESULT) @@ -314,7 +323,7 @@ MACRO(THIRDPARTY_PRODUCT PRODUCT_NAME HEADER_NAME LIBRARY_NAME) ENDIF() IF(INSTALL_${PRODUCT_NAME}) - INSTALL(FILES "${3RDPARTY_${PRODUCT_NAME}_DLL}" DESTINATION "${INSTALL_DIR}/${DLL_SO_FOLDER}") + INSTALL(FILES "${3RDPARTY_${PRODUCT_NAME}_DLL}" DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/${DLL_SO_FOLDER}${BUILD_SUFFIX}") SET(3RDPARTY_${PRODUCT_NAME}_DLL_DIR "") ELSE() GET_FILENAME_COMPONENT(3RDPARTY_${PRODUCT_NAME}_DLL_DIR "${3RDPARTY_${PRODUCT_NAME}_DLL}" PATH) @@ -342,13 +351,14 @@ IF(INSTALL_TCL) SET (TCL_FOLDER_VERSION "") ENDIF() - INSTALL(FILES "${3RDPARTY_TCL_DLL_DIR_INSIDE}/${DLL_SO_PREFIX}tcl${TCL_VERSION}.${DLL_SO}" DESTINATION "${INSTALL_DIR}/${DLL_SO_FOLDER}") - INSTALL(FILES "${3RDPARTY_TCL_DLL_DIR_INSIDE}/${DLL_SO_PREFIX}tk${TCL_VERSION}.${DLL_SO}" DESTINATION "${INSTALL_DIR}/${DLL_SO_FOLDER}") + INSTALL(FILES "${3RDPARTY_TCL_DLL_DIR_INSIDE}/${DLL_SO_PREFIX}tcl${TCL_VERSION}.${DLL_SO}" DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/${DLL_SO_FOLDER}${BUILD_SUFFIX}") + INSTALL(FILES "${3RDPARTY_TCL_DLL_DIR_INSIDE}/${DLL_SO_PREFIX}tk${TCL_VERSION}.${DLL_SO}" DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/${DLL_SO_FOLDER}${BUILD_SUFFIX}") IF (IS_TCL_VERSION_FOUND) - INSTALL(DIRECTORY "${3RDPARTY_TCL_LIB_DIR_INSIDE}/tcl8" DESTINATION "${INSTALL_DIR}/lib") - INSTALL(DIRECTORY "${3RDPARTY_TCL_LIB_DIR_INSIDE}/tcl${TCL_FOLDER_VERSION}" DESTINATION "${INSTALL_DIR}/lib") - INSTALL(DIRECTORY "${3RDPARTY_TCL_LIB_DIR_INSIDE}/tk${TCL_FOLDER_VERSION}" DESTINATION "${INSTALL_DIR}/lib") + # tcl is required to install in lib folder (without ${BUILD_SUFFIX}) + INSTALL(DIRECTORY "${3RDPARTY_TCL_LIB_DIR_INSIDE}/tcl8" DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib") + INSTALL(DIRECTORY "${3RDPARTY_TCL_LIB_DIR_INSIDE}/tcl${TCL_FOLDER_VERSION}" DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib") + INSTALL(DIRECTORY "${3RDPARTY_TCL_LIB_DIR_INSIDE}/tk${TCL_FOLDER_VERSION}" DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib") ELSE() MESSAGE(STATUS "\nWarning: tclX.X and tkX.X subdirs won't be copyied during the installation process.") MESSAGE(STATUS "Try seeking tcl within another folder by changing 3RDPARTY_TCL_DIR variable.") @@ -390,9 +400,9 @@ IF(USE_GLX) ENDIF() # FREETYPE -THIRDPARTY_PRODUCT("FREETYPE" "ft2build.h" "freetype${BUILD_SUFFIX}") +THIRDPARTY_PRODUCT("FREETYPE" "ft2build.h" "freetype${3RDPARTY_BUILD_SUFFIX}") -IF("${3RDPARTY_FREETYPE_INCLUDE_DIR}" STREQUAL "" OR "${3RDPARTY_FREETYPE_INCLUDE_DIR}" STREQUAL "3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR-NOTFOUND") +IF("${3RDPARTY_FREETYPE_INCLUDE_DIR}" STREQUAL "" OR "${3RDPARTY_FREETYPE_INCLUDE_DIR}" STREQUAL "3RDPARTY_FREETYPE_INCLUDE_DIR-NOTFOUND") ELSEIF(EXISTS "${3RDPARTY_FREETYPE_INCLUDE_DIR}/freetype2/") SET(3RDPARTY_INCLUDE_DIRS "${3RDPARTY_INCLUDE_DIRS};${3RDPARTY_FREETYPE_INCLUDE_DIR}/freetype2") @@ -402,14 +412,14 @@ ENDIF() IF(USE_FREEIMAGE) ADD_DEFINITIONS(-DHAVE_FREEIMAGE) - THIRDPARTY_PRODUCT("FREEIMAGE" "FreeImage.h" "freeimage${BUILD_SUFFIX}") + THIRDPARTY_PRODUCT("FREEIMAGE" "FreeImage.h" "freeimage${3RDPARTY_BUILD_SUFFIX}") IF(WIN32) IF("${3RDPARTY_FREEIMAGE_DIR}" STREQUAL "") ELSE() SET (3RDPARTY_FREEIMAGEPLUS_DIR "${3RDPARTY_FREEIMAGE_DIR}") ENDIF() - THIRDPARTY_PRODUCT("FREEIMAGEPLUS" "FreeImagePlus.h" "freeimageplus${BUILD_SUFFIX}") + THIRDPARTY_PRODUCT("FREEIMAGEPLUS" "FreeImagePlus.h" "freeimageplus${3RDPARTY_BUILD_SUFFIX}") ENDIF() ELSE() @@ -422,7 +432,7 @@ ENDIF() # GL2PS IF(USE_GL2PS) ADD_DEFINITIONS(-DHAVE_GL2PS) - THIRDPARTY_PRODUCT("GL2PS" "gl2ps.h" "gl2ps${BUILD_SUFFIX}") + THIRDPARTY_PRODUCT("GL2PS" "gl2ps.h" "gl2ps${3RDPARTY_BUILD_SUFFIX}") ELSE() CHECK_AND_UNSET_GROUP ("3RDPARTY_GL2PS") CHECK_AND_UNSET ("INSTALL_GL2PS") @@ -451,14 +461,17 @@ IF(USE_OPENCL) ENDIF() - THIRDPARTY_PRODUCT("OPENCL" "CL/cl.h" "OpenCL${BUILD_SUFFIX}") + THIRDPARTY_PRODUCT("OPENCL" "CL/cl.h" "OpenCL${3RDPARTY_BUILD_SUFFIX}") # if CL/cl.h isn't found (and 3RDPARTY_OPENCL_INCLUDE_DIR isn't defined) # then try to find OpenCL/cl.h (all other variable won't be changed) - THIRDPARTY_PRODUCT("OPENCL" "OpenCL/cl.h" "OpenCL${BUILD_SUFFIX}") + IF("${3RDPARTY_OPENCL_INCLUDE_DIR}" STREQUAL "" OR "${3RDPARTY_OPENCL_INCLUDE_DIR}" STREQUAL "3RDPARTY_OPENCL_INCLUDE_DIR-NOTFOUND") + THIRDPARTY_PRODUCT("OPENCL" "OpenCL/cl.h" "OpenCL${3RDPARTY_BUILD_SUFFIX}") + ENDIF() + ELSE() CHECK_AND_UNSET_GROUP ("3RDPARTY_OPENCL") - CHECK_AND_UNSET ("3RDPARTY_OPENCL_ADDITIONAL_PATH_FOR_LIB") + CHECK_AND_UNSET ("3RDPARTY_OPENCL_ADDITIONAL_PATH_FOR_HEADER") CHECK_AND_UNSET ("3RDPARTY_OPENCL_ADDITIONAL_PATH_FOR_LIB") CHECK_AND_UNSET ("INSTALL_OPENCL") ENDIF() @@ -470,7 +483,7 @@ IF (USE_TBB) INCLUDE(adm/templates/tbb.cmake) IF(INSTALL_TBB) - INSTALL(FILES "${3RDPARTY_TBB_DLL}" "${3RDPARTY_TBB_MALLOC_DLL}" DESTINATION "${INSTALL_DIR}/${DLL_SO_FOLDER}") + INSTALL(FILES "${3RDPARTY_TBB_DLL}" "${3RDPARTY_TBB_MALLOC_DLL}" DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/${DLL_SO_FOLDER}${BUILD_SUFFIX}") SET(3RDPARTY_TBB_DLL_DIR "") SET(3RDPARTY_TBB_MALLOC_DLL_DIR "") @@ -506,9 +519,9 @@ IF("${INSTALL_DIR}" STREQUAL "") MESSAGE(FATAL_ERROR "INSTALL_DIR is empty") ELSE() # inc,data,tests DIRECTORY - install(DIRECTORY "${CMAKE_SOURCE_DIR}/inc" DESTINATION "${INSTALL_DIR}" ) - - install(DIRECTORY "${CMAKE_SOURCE_DIR}/data" DESTINATION "${INSTALL_DIR}" ) + install(DIRECTORY "${CMAKE_SOURCE_DIR}/inc" DESTINATION "${INSTALL_DIR}") + install(DIRECTORY "${CMAKE_SOURCE_DIR}/data" DESTINATION "${INSTALL_DIR}") + install(DIRECTORY "${CMAKE_SOURCE_DIR}/samples/tcl" DESTINATION "${INSTALL_DIR}/samples") IF(INSTALL_TESTS) install(DIRECTORY "${CMAKE_SOURCE_DIR}/tests" DESTINATION "${INSTALL_DIR}" ) ENDIF() @@ -539,6 +552,41 @@ ELSE() OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_WRITE WORLD_EXECUTE) ENDIF() + + SET(CUSTOM_CUR "custom_${COMPILER}_${COMPILER_BITNESS}_${BUILD_SUFFIX}.${SCRIPT_EXT}") + + if (WIN32) + SET (CUSTOM_ADD_CONTENT "\nif exist \"%~dp0${CUSTOM_CUR}\" (\n call \"%~dp0${CUSTOM_CUR}\" %1 %2 %3 \n)") + else() + SET (CUSTOM_ADD_CONTENT "\nif [ -e \"\${aScriptPath}/${CUSTOM_CUR}\" ]; then\n source \"\${aScriptPath}/${CUSTOM_CUR}\" \"\${COMPILER}\" \"\${WOKSTATION}\${ARCH}\" \"\${CASDEB}\" \nfi") + endif() + + # change custom.bat/sh + if (EXISTS "${INSTALL_DIR}/custom.${SCRIPT_EXT}") + FILE(READ "${INSTALL_DIR}/custom.${SCRIPT_EXT}" CUSTOM_CONTENT) + + SET (CUSTOM_CONTENT "${CUSTOM_CONTENT} ${CUSTOM_ADD_CONTENT}") + + FILE(WRITE "${INSTALL_DIR}/custom.${SCRIPT_EXT}" "${CUSTOM_CONTENT}") + else() + IF(NOT "${BUILD_PATCH_DIR}" STREQUAL "" AND EXISTS "${BUILD_PATCH_DIR}/adm/templates/custom.${SCRIPT_EXT}.main") + configure_file("${BUILD_PATCH_DIR}/adm/templates/custom.${SCRIPT_EXT}.main" "custom.${SCRIPT_EXT}" @ONLY) + ELSE() + configure_file("${CMAKE_SOURCE_DIR}/adm/templates/custom.${SCRIPT_EXT}.main" "custom.${SCRIPT_EXT}" @ONLY) + ENDIF() + + install(FILES "${OCCT_BINARY_DIR}/custom.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR}") + endif() + + # write current custom.bat/sh + IF(NOT "${BUILD_PATCH_DIR}" STREQUAL "" AND EXISTS "${BUILD_PATCH_DIR}/adm/templates/custom.${SCRIPT_EXT}.in") + configure_file("${BUILD_PATCH_DIR}/adm/templates/custom.${SCRIPT_EXT}.in" ${CUSTOM_CUR} @ONLY) + ELSE() + configure_file("${CMAKE_SOURCE_DIR}/adm/templates/custom.${SCRIPT_EXT}.in" ${CUSTOM_CUR} @ONLY) + ENDIF() + + install(FILES "${OCCT_BINARY_DIR}/${CUSTOM_CUR}" DESTINATION "${INSTALL_DIR}" ) + IF (BUILD_Samples) IF(NOT "${BUILD_PATCH_DIR}" STREQUAL "" AND EXISTS "${BUILD_PATCH_DIR}/adm/templates/sample.bat") install(FILES "${BUILD_PATCH_DIR}/adm/templates/sample.bat" DESTINATION "${INSTALL_DIR}") diff --git a/adm/templates/custom.bat.in b/adm/templates/custom.bat.in new file mode 100644 index 0000000000..b25681c6b3 --- /dev/null +++ b/adm/templates/custom.bat.in @@ -0,0 +1,14 @@ +echo off + +if "%VCVER%" == "@COMPILER@" ( + if "%ARCH%" == "@COMPILER_BITNESS@" ( + if "%CASDEB%" == "@BUILD_SUFFIX@" ( + set "TCL_DIR=@3RDPARTY_TCL_DLL_DIR@" + set "FREETYPE_DIR=@3RDPARTY_FREETYPE_DLL_DIR@" + set "FREEIMAGE_DIR=@3RDPARTY_FREEIMAGE_DLL_DIR@" + set "GL2PS_DIR=@3RDPARTY_GL2PS_DLL_DIR@" + set "TBB_DIR=@3RDPARTY_TBB_DLL_DIR@" + ) + ) +) + diff --git a/adm/templates/custom.bat.main b/adm/templates/custom.bat.main new file mode 100644 index 0000000000..e1bb56d477 --- /dev/null +++ b/adm/templates/custom.bat.main @@ -0,0 +1,12 @@ +echo off + +if not ["%1"] == [""] set "VCVER=%1" +if not ["%2"] == [""] set "ARCH=%2" +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" + +rem include other custom.bat files with specific 3rdparty paths +@CUSTOM_ADD_CONTENT@ + diff --git a/adm/templates/custom.sh.in b/adm/templates/custom.sh.in new file mode 100644 index 0000000000..8a68095e4b --- /dev/null +++ b/adm/templates/custom.sh.in @@ -0,0 +1,14 @@ +#!/bin/bash + +if [ "$COMPILER" == "@COMPILER@" ]; then + if [ "$ARCH" == "@COMPILER_BITNESS@" ]; then + if [ "$CASDEB" == "@BUILD_SUFFIX@" ]; then + export TCL_DIR="@3RDPARTY_TCL_DLL_DIR@" + export FREETYPE_DIR="@3RDPARTY_FREETYPE_DLL_DIR@" + export FREEIMAGE_DIR="@3RDPARTY_FREEIMAGE_DLL_DIR@" + export GL2PS_DIR="@3RDPARTY_GL2PS_DLL_DIR@" + export TBB_DIR="@3RDPARTY_TBB_DLL_DIR@" + fi + fi +fi + diff --git a/adm/templates/custom.sh.main b/adm/templates/custom.sh.main new file mode 100644 index 0000000000..946ec067d0 --- /dev/null +++ b/adm/templates/custom.sh.main @@ -0,0 +1,4 @@ +#!/bin/bash + +@CUSTOM_ADD_CONTENT@ + diff --git a/adm/templates/draw.bat b/adm/templates/draw.bat index 7c964e96bb..9f92bc1a29 100644 --- a/adm/templates/draw.bat +++ b/adm/templates/draw.bat @@ -1,7 +1,10 @@ @echo off rem Setup environment and launch DRAWEXE -call "%~dp0env.bat" +call "%~dp0env.bat" %1 %2 %3 echo Hint: use "pload ALL" command to load standard commands -DRAWEXE.exe +"%CASROOT%/%BIN_TAIL%/DRAWEXE.exe" + +set "PATH=%ORIGIN_PATH%" + diff --git a/adm/templates/draw.sh b/adm/templates/draw.sh index cf063fc005..5dc0f24e62 100644 --- a/adm/templates/draw.sh +++ b/adm/templates/draw.sh @@ -2,7 +2,7 @@ aScriptPath=${BASH_SOURCE%/*}; if [ -d "${aScriptPath}" ]; then cd "$aScriptPath"; fi; aScriptPath="$PWD"; -source "${aScriptPath}/env.sh" +source "${aScriptPath}/env.sh" "$1" echo 'Hint: use "pload ALL" command to load standard commands' DRAWEXE diff --git a/adm/templates/env.bat.in b/adm/templates/env.bat.in index f270e6b444..72120b221f 100644 --- a/adm/templates/env.bat.in +++ b/adm/templates/env.bat.in @@ -3,25 +3,34 @@ echo off set "SCRIPTROOT=%~dp0" set "SCRIPTROOT=%SCRIPTROOT:~0,-1%" +set "VCVER=@COMPILER@" +set "ARCH=@COMPILER_BITNESS@" +set "CASDEB=@BUILD_SUFFIX@" + +if not ["%1"] == [""] set "VCVER=%1" +if not ["%2"] == [""] set "ARCH=%2" +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 exist "%~dp0custom.bat" ( + call "%~dp0custom.bat" %1 %2 %3 +) + if ["%CASROOT%"] == [""] set "CASROOT=%SCRIPTROOT%" -set "TCL_DIR=@3RDPARTY_TCL_DLL_DIR@" -if not ["%TCL_DIR%"] == [""] set "PATH=%TCL_DIR%;%PATH%" +set "ORIGIN_PATH=%PATH%" -set "FREETYPE_DIR=@3RDPARTY_FREETYPE_DLL_DIR@" -if not ["%FREETYPE_DIR%"] == [""] set "PATH=%FREETYPE_DIR%;%PATH%" - -set "FREEIMAGE_DIR=@3RDPARTY_FREEIMAGE_DLL_DIR@" +if not ["%TCL_DIR%"] == [""] set "PATH=%TCL_DIR%;%PATH%" +if not ["%FREETYPE_DIR%"] == [""] set "PATH=%FREETYPE_DIR%;%PATH%" if not ["%FREEIMAGE_DIR%"] == [""] set "PATH=%FREEIMAGE_DIR%;%PATH%" - -set "GL2PS_DIR=@3RDPARTY_GL2PS_DLL_DIR@" -if not ["%GL2PS_DIR%"] == [""] set "PATH=%GL2PS_DIR%;%PATH%" - -set "TBB_DIR=@3RDPARTY_TBB_DLL_DIR@" -if not ["%TBB_DIR%"] == [""] set "PATH=%TBB_DIR%;%PATH%" +if not ["%GL2PS_DIR%"] == [""] set "PATH=%GL2PS_DIR%;%PATH%" +if not ["%TBB_DIR%"] == [""] set "PATH=%TBB_DIR%;%PATH%" rem ----- Set path to 3rd party and OCCT libraries ----- -set "PATH=%CASROOT%\bin;%PATH%" +set "BIN_TAIL=win%ARCH%/%VCVER%/bin%CASDEB%" +set "PATH=%CASROOT%/%BIN_TAIL%;%PATH%" rem ----- Set envoronment variables used by OCCT ----- set CSF_LANGUAGE=us @@ -56,4 +65,5 @@ if exist "%CASROOT%\src\DrawResources" ( if exist "%CASROOT%\src\DrawResourcesProducts" ( set "CSF_DrawPluginProductsDefaults=%CASROOT%\src\DrawResourcesProducts" -) \ No newline at end of file +) + diff --git a/adm/templates/env.sh.in b/adm/templates/env.sh.in index 1c4aca28ec..7bdd0ce25c 100644 --- a/adm/templates/env.sh.in +++ b/adm/templates/env.sh.in @@ -6,63 +6,75 @@ if [ "${CASROOT}" == "" ]; then export CASROOT="${aScriptPath}" fi -aLibPath="${CASROOT}/lib" +# Read script arguments +shopt -s nocasematch +export CASDEB="@BUILD_SUFFIX@"; +if [[ "$1" == "debug" ]]; then export CASDEB="d"; fi +if [[ "$1" == "d" ]]; then export CASDEB="d"; fi +shopt -u nocasematch -TCL_DIR="@3RDPARTY_TCL_DLL_DIR@" -if [ "$TCL_DIR" != "" ]; then - aLibPath="${TCL_DIR}:${aLibPath}" -fi - -FREETYPE_DIR="@3RDPARTY_FREETYPE_DLL_DIR@" -if [ "$FREETYPE_DIR" != "" ]; then - aLibPath="${FREETYPE_DIR}:${aLibPath}" -fi - -FREEIMAGE_DIR="@3RDPARTY_FREEIMAGE_DLL_DIR@" -if [ "$FREEIMAGE_DIR" != "" ]; then - aLibPath="${FREEIMAGE_DIR}:${aLibPath}" -fi - -GL2PS_DIR="@3RDPARTY_GL2PS_DLL_DIR@" -if [ "$GL2PS_DIR" != "" ]; then - aLibPath="${GL2PS_DIR}:${aLibPath}" -fi - -TBB_DIR="@3RDPARTY_TBB_DLL_DIR@" -if [ "$TBB_DIR" != "" ]; then - aLibPath="${TBB_DIR}:${aLibPath}" -fi +export COMPILER="@COMPILER@" # ----- Set path to 3rd party and OCCT libraries ----- -aSystem=`uname -s` -if [ "$aSystem" == "Darwin" ]; then - export WOKSTATION="mac"; - if [ "$DYLD_LIBRARY_PATH" != "" ]; then - export DYLD_LIBRARY_PATH="${aLibPath}:${DYLD_LIBRARY_PATH}" - else - export DYLD_LIBRARY_PATH="${aLibPath}" - fi -else - export WOKSTATION="lin"; - if [ "$LD_LIBRARY_PATH" != "" ]; then - export LD_LIBRARY_PATH="${aLibPath}:${LD_LIBRARY_PATH}" - else - export LD_LIBRARY_PATH="${aLibPath}" - fi -fi - -# ----- Set path to OCCT executables ----- -PATH="${PATH}:${CASROOT}/bin" - -# ----- Setup Environment Variables ----- anArch=`uname -m` if [ "$anArch" != "x86_64" ] && [ "$anArch" != "ia64" ]; then export ARCH="32"; else export ARCH="64"; fi + +aSystem=`uname -s` if [ "$aSystem" == "Darwin" ]; then + export WOKSTATION="mac"; export ARCH="64"; +else + export WOKSTATION="lin"; +fi + +# ----- Set local settings ----- +if [ -e "${aScriptPath}/custom.sh" ]; then + source "${aScriptPath}/custom.sh" "${COMPILER}" "${WOKSTATION}${ARCH}" "${CASDEB}" +fi + +THRDPARTY_PATH="" +if [ "$TCL_DIR" != "" ]; then + THRDPARTY_PATH="${TCL_DIR}:${THRDPARTY_PATH}" +fi + +if [ "$FREETYPE_DIR" != "" ]; then + THRDPARTY_PATH="${FREETYPE_DIR}:${THRDPARTY_PATH}" +fi + +if [ "$FREEIMAGE_DIR" != "" ]; then + THRDPARTY_PATH="${FREEIMAGE_DIR}:${THRDPARTY_PATH}" +fi + +if [ "$GL2PS_DIR" != "" ]; then + THRDPARTY_PATH="${GL2PS_DIR}:${THRDPARTY_PATH}" +fi + +if [ "$TBB_DIR" != "" ]; then + THRDPARTY_PATH="${TBB_DIR}:${THRDPARTY_PATH}" +fi + +BIN_PATH="${WOKSTATION}${ARCH}/${COMPILER}/bin${CASDEB}" +LIBS_PATH="${WOKSTATION}${ARCH}/${COMPILER}/lib${CASDEB}" + +export PATH="${CASROOT}/${BIN_PATH}:${THRDPARTY_PATH}:${PATH}" + +if [ "$LD_LIBRARY_PATH" != "" ]; then + export LD_LIBRARY_PATH="${CASROOT}/${LIBS_PATH}:${LD_LIBRARY_PATH}" + else + export LD_LIBRARY_PATH="${CASROOT}/${LIBS_PATH}" + fi +fi + +if [ "$WOKSTATION" == "mac" ]; then + if [ "$DYLD_LIBRARY_PATH" != "" ]; then + export DYLD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${DYLD_LIBRARY_PATH}" + else + export DYLD_LIBRARY_PATH="${LD_LIBRARY_PATH}" + fi fi # ----- Set envoronment variables used by OCCT ----- @@ -98,4 +110,5 @@ fi if [ -e "${CASROOT}/src/DrawResourcesProducts" ]; then export CSF_DrawPluginProductsDefaults="${CASROOT}/src/DrawResourcesProducts" -fi \ No newline at end of file +fi + diff --git a/adm/templates/sample.bat b/adm/templates/sample.bat index 424a36fd3c..513fe1c8a8 100644 --- a/adm/templates/sample.bat +++ b/adm/templates/sample.bat @@ -2,7 +2,9 @@ if ["%1"] == [""] ( echo Launch selected sample as follows: - echo sample.bat SampleName + echo sample.bat SampleName vc10 win32 d + echo or to use last sample build configuration: + echo sample.bat SampleName echo available samples: echo Geometry echo Modeling @@ -17,12 +19,13 @@ if ["%1"] == [""] ( exit /B ) -if not exist "%~dp0/bin/%1.exe" ( - echo Executable %~dp0/bin/%4.exe not found. +call "%~dp0env.bat" %2 %3 %4 + +if not exist "%~dp0/%BIN_TAIL%/%1.exe" ( + echo Executable %~dp0/%BIN_TAIL%/%1.exe not found. echo Probably you didn't compile the application. exit /B ) -call "%~dp0/env.bat" +"%~dp0/%BIN_TAIL%/%1.exe" -"%~dp0/bin/%1.exe" diff --git a/dox/dev_guides/building/cmake/cmake.md b/dox/dev_guides/building/cmake/cmake.md index 9f6dd40747..eecbae8237 100644 --- a/dox/dev_guides/building/cmake/cmake.md +++ b/dox/dev_guides/building/cmake/cmake.md @@ -18,58 +18,55 @@ instructions for your platform in @ref occt_dev_guides__building. ## Decide on location of build and install directories. The build directory is the one where intermediate files will be created (projects / makefiles, objects, binaries). -The install directory is the one where binaries will be installed after build, -along with header files and resources required for OCCT use in applications. +Each configuration to be built should have its own build directory. -OCCT CMake scripts assume use of separate build and one install directories -for each configuration (Debug or Release). +The install directory is the one 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. It is recommended to separate build and install directories from OCCT source directory, for example: - /user/home/occt/ - sources - /user/home/tmp/occt-build-release - intermediate files (release) - /user/home/occt-install-release - installed binaries (release) + /user/home/occt/ - sources + /user/home/tmp/occt-build-vc10-x64-release - intermediate files + /user/home/occt-install - installed binaries ## CMake usage -Run CMake indicating path to OCCT sources ($CASROOT; in previous example -CASROOT equal to /user/home/occt in lin case, and d:/occt in windows case) -and selected build directory (in prev example build directory is -/user/home/tmp/occt-build-release). +Run CMake indicating path to OCCT sources ($CASROOT) and selected build directory. -It is recommended to use GUI tools provided by CMake: cmake-gui on Windows -and Mac, ccmake on Linux. +It is recommended to use GUI tools provided by CMake: cmake-gui on Windows and Mac, ccmake or cmake-gui on Linux. ### Windows: -@image html /dev_guides/building/cmake/images/cmake_image001.png -@image latex /dev_guides/building/cmake/images/cmake_image001.png +Specify the root folder of OCCT ($CASROOT, it contains CMakelists.txt file) by clicking Browse Source. -* Specify "main" CMakelists.txt meta-project location by clicking Browse Source (e.g., $CASROOT) -* Specify location (build folder) for Cmake generated project files by clicking Browse Build (e.g., d:/occt/build/win32-vc9-debug) (each cmake configuration of the project uses a specific build directory and a specific directory for installed files. It is recommended to compose names of the binary and install directory from system, bitness, compiler and build type.) -* 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) +@figure{/dev_guides/building/cmake/images/cmake_image001.png} -@image html /dev_guides/building/cmake/images/cmake_image002.png -@image latex /dev_guides/building/cmake/images/cmake_image002.png +Specify location (build folder) for Cmake generated project files by clicking Browse Build. +Each configuration of the project should be built in its own directory. +When building multiple configurations it is recommended to compose name of build directories including system, bitness, compiler, and build type (e.g., d:/occt/build/win32-vc9-debug). -### Linux: +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. + +@figure{/dev_guides/building/cmake/images/cmake_image002.png} + +### Linux (ccmake variant): In the console, change to the build directory and call ccmake with the path to the source directory of the project: > cd ~/occt/build/debug > ccmake ~/occt -@image html /dev_guides/building/cmake/images/cmake_image003.png -@image latex /dev_guides/building/cmake/images/cmake_image003.png +@figure{/dev_guides/building/cmake/images/cmake_image003.png} Press "c" to configure. +Use of *cmake-gui* is the same 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). -@image html /dev_guides/building/cmake/images/cmake_image004.png -@image latex /dev_guides/building/cmake/images/cmake_image004.png +@figure{/dev_guides/building/cmake/images/cmake_image004.png} ## OCCT Configuration @@ -83,36 +80,37 @@ The variables with "BUILD_" prefix allow specifying OCCT components and configuration to be built: * BUILD_CONFIGURATION - defines configuration to be built (Release by default). -* BUILD_ - specify whether corresponding OCCT module should be - built (all toolkits). Note that even if 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_SAMPLES - specify whether OCCT MFC samples should be built. +* BUILD_ - specify whether corresponding OCCT module should be + built (all toolkits). Note that even if 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_SAMPLES - specify whether OCCT MFC samples should be built. +* BUILD_PATCH_DIR - optionally specify 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 corresponding files of OCCT. Check variables with "USE_" prefix (USE_FREEIMAGE, USE_GL2PS, USE_TBB, and USE_OPENCL) if you want to enable use of the corresponding optional 3rd-party library. -### 3rd-party configuration - ### 3rd-party configuration (The variables with 3RDPARTY_ 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/"), -specify 3RDPARTY_DIR variable that points to the folders of 3rdparty products (some or all). -At the next configuration 3rd-party product paths stored in 3RDPARTY_\_DIR variable -will be searched for in 3RDPARTY_DIR directory. If the structure of 3RDPARTY_DIR directory -is the same as adopted in the OCCT, the directory will contain product dir, lib and header files. +specify 3RDPARTY_DIR variable that points to the folders of 3rdparty libraries (some or all). +At the next configuration step the 3rd-party libraries will be searched for in 3RDPARTY_DIR directory, and stored in 3RDPARTY_\_DIR variables. +The procedure expects to find binary and header files of each 3rd-party library in its own sub-directory, separated by sub-directories *bin*, *lib*, and *include*. Press "Configure" ("c" key for ccmake). The result of the 3rdparty product search will be recorded in the corresponding variables: * 3RDPARTY_\_DIR - path to the product directory (with directory name) (e.g., D:/3rdparty/Tcl-8.5.12.0-32) -* 3RDPARTY_\_LIBRARY - path to the .lib libraries (with the library name) (e.g., D:/3rdparty/Tcl-8.5.12.0-32/lib/tcl85.lib). In non-windows case, this variable is the same as 3RDPARTY_\_DLL. +* 3RDPARTY_\_LIBRARY - path to the .lib libraries (with the library name) (e.g., D:/3rdparty/Tcl-8.5.12.0-32/lib/tcl85.lib). + In non-windows case, this variable is the same as 3RDPARTY_\_DLL. * 3RDPARTY_\_INCLUDE - path to the include directory that contains the required header file (with "include" name) (e.g., D:/3rdparty/Tcl-8.5.12.0-32/include including tcl.h) * 3RDPARTY_\_DLL - path to the .dll/.so/.dylib library (with the library name) (e.g., D:/3rdparty/Tcl-8.5.12.0-32/bin/tcl85.dll) @@ -156,8 +154,7 @@ can be changed to and the related variables: 3RDPARTY_FREETYPE_DLL, 3RDPARTY_FREETYPE_INCLUDE_DIR and 3RDPARTY_FREETYPE_LIBRARY will be cleared. -@image html /dev_guides/building/cmake/images/cmake_image005.png -@image latex /dev_guides/building/cmake/images/cmake_image005.png +@figure{/dev_guides/building/cmake/images/cmake_image005.png} During configuration process the cleaned variables will be filled with new found values. @@ -181,8 +178,7 @@ Then the project files will appear in the build folder (e.g., d:/occt/build/win3 When the configuration is complete, start the generation process by pressing "g". -@image html /dev_guides/building/cmake/images/cmake_image006.png -@image latex /dev_guides/building/cmake/images/cmake_image006.png +@figure{/dev_guides/building/cmake/images/cmake_image006.png} ### Mac OS X @@ -227,6 +223,3 @@ When the building process finished, build the INSTALL project to move the above files to INSTALL_DIR. Notice that env.sh (configure PATH and DYLD_LIBRARY_PATH environment variables as well as Draw Harness extra variables) and draw.sh (to launch DRAWEXE) will be created in target directory. - -## OCCT project debugging for Visual Studio -Run OCCT.bat from the build directory to start Visual Studio with required environment for debugging. \ No newline at end of file diff --git a/dox/dev_guides/building/cmake/images/cmake_image001.png b/dox/dev_guides/building/cmake/images/cmake_image001.png index ead63df7dc..543a6ca32c 100644 Binary files a/dox/dev_guides/building/cmake/images/cmake_image001.png and b/dox/dev_guides/building/cmake/images/cmake_image001.png differ diff --git a/samples/mfc/standard/01_Geometry/CMakeLists.txt b/samples/mfc/standard/01_Geometry/CMakeLists.txt index 5eeaef640c..8471c071a4 100644 --- a/samples/mfc/standard/01_Geometry/CMakeLists.txt +++ b/samples/mfc/standard/01_Geometry/CMakeLists.txt @@ -70,9 +70,9 @@ add_executable (Geometry WIN32 ${Geometry_SOURCE_FILES} set_property(TARGET Geometry PROPERTY FOLDER Samples) -install (TARGETS Geometry RUNTIME DESTINATION "${INSTALL_DIR}/bin" - ARCHIVE DESTINATION "${INSTALL_DIR}/lib" - LIBRARY DESTINATION "${INSTALL_DIR}/lib") +install (TARGETS Geometry RUNTIME DESTINATION "${INSTALL_DIR}/win${COMPILER_BITNESS}/${COMPILER}/bin${BUILD_SUFFIX}" + ARCHIVE DESTINATION "${INSTALL_DIR}/win${COMPILER_BITNESS}/${COMPILER}/lib${BUILD_SUFFIX}" + LIBRARY DESTINATION "${INSTALL_DIR}/win${COMPILER_BITNESS}/${COMPILER}/lib${BUILD_SUFFIX}") include_directories (${OCCT_ROOT}/inc ${Geometry_SRC_DIR} diff --git a/samples/mfc/standard/02_Modeling/CMakeLists.txt b/samples/mfc/standard/02_Modeling/CMakeLists.txt index d8ed27f2d4..a054777166 100644 --- a/samples/mfc/standard/02_Modeling/CMakeLists.txt +++ b/samples/mfc/standard/02_Modeling/CMakeLists.txt @@ -38,9 +38,9 @@ add_executable ( Modeling WIN32 ${Modeling_SOURCE_FILES} set_property (TARGET Modeling PROPERTY FOLDER Samples) -install (TARGETS Modeling RUNTIME DESTINATION "${INSTALL_DIR}/bin" - ARCHIVE DESTINATION "${INSTALL_DIR}/lib" - LIBRARY DESTINATION "${INSTALL_DIR}/lib") +install (TARGETS Modeling RUNTIME DESTINATION "${INSTALL_DIR}/win${COMPILER_BITNESS}/${COMPILER}/bin${BUILD_SUFFIX}" + ARCHIVE DESTINATION "${INSTALL_DIR}/win${COMPILER_BITNESS}/${COMPILER}/lib${BUILD_SUFFIX}" + LIBRARY DESTINATION "${INSTALL_DIR}/win${COMPILER_BITNESS}/${COMPILER}/lib${BUILD_SUFFIX}") include_directories (${OCCT_ROOT}/inc ${MFC_STANDARD_SAMPLES_DIR}/02_Modeling diff --git a/samples/mfc/standard/03_Viewer2d/CMakeLists.txt b/samples/mfc/standard/03_Viewer2d/CMakeLists.txt index 365f722fa1..9819c85e59 100644 --- a/samples/mfc/standard/03_Viewer2d/CMakeLists.txt +++ b/samples/mfc/standard/03_Viewer2d/CMakeLists.txt @@ -34,9 +34,9 @@ add_executable (Viewer2d WIN32 ${Viewer2d_SOURCE_FILES} set_property (TARGET Viewer2d PROPERTY FOLDER Samples) -install (TARGETS Viewer2d RUNTIME DESTINATION "${INSTALL_DIR}/bin" - ARCHIVE DESTINATION "${INSTALL_DIR}/lib" - LIBRARY DESTINATION "${INSTALL_DIR}/lib") +install (TARGETS Viewer2d RUNTIME DESTINATION "${INSTALL_DIR}/win${COMPILER_BITNESS}/${COMPILER}/bin${BUILD_SUFFIX}" + ARCHIVE DESTINATION "${INSTALL_DIR}/win${COMPILER_BITNESS}/${COMPILER}/lib${BUILD_SUFFIX}" + LIBRARY DESTINATION "${INSTALL_DIR}/win${COMPILER_BITNESS}/${COMPILER}/lib${BUILD_SUFFIX}") include_directories (${OCCT_ROOT}/inc ${MFC_STANDARD_SAMPLES_DIR}/03_Viewer2d diff --git a/samples/mfc/standard/04_Viewer3d/CMakeLists.txt b/samples/mfc/standard/04_Viewer3d/CMakeLists.txt index d3181f6313..7b87f98ebe 100644 --- a/samples/mfc/standard/04_Viewer3d/CMakeLists.txt +++ b/samples/mfc/standard/04_Viewer3d/CMakeLists.txt @@ -62,9 +62,9 @@ add_executable (Viewer3d WIN32 ${Viewer3d_SOURCE_FILES} set_property (TARGET Viewer3d PROPERTY FOLDER Samples) -install (TARGETS Viewer3d RUNTIME DESTINATION "${INSTALL_DIR}/bin" - ARCHIVE DESTINATION "${INSTALL_DIR}/lib" - LIBRARY DESTINATION "${INSTALL_DIR}/lib") +install (TARGETS Viewer3d RUNTIME DESTINATION "${INSTALL_DIR}/win${COMPILER_BITNESS}/${COMPILER}/bin${BUILD_SUFFIX}" + ARCHIVE DESTINATION "${INSTALL_DIR}/win${COMPILER_BITNESS}/${COMPILER}/lib${BUILD_SUFFIX}" + LIBRARY DESTINATION "${INSTALL_DIR}/win${COMPILER_BITNESS}/${COMPILER}/lib${BUILD_SUFFIX}") include_directories (${OCCT_ROOT}/inc ${Viewer3d_SRC_DIR} diff --git a/samples/mfc/standard/05_ImportExport/CMakeLists.txt b/samples/mfc/standard/05_ImportExport/CMakeLists.txt index 0d4d8eee2b..915f1b8e6e 100644 --- a/samples/mfc/standard/05_ImportExport/CMakeLists.txt +++ b/samples/mfc/standard/05_ImportExport/CMakeLists.txt @@ -38,9 +38,9 @@ add_executable (ImportExport WIN32 ${ImportExport_SOURCE_FILES} set_property (TARGET ImportExport PROPERTY FOLDER Samples) -install (TARGETS ImportExport RUNTIME DESTINATION "${INSTALL_DIR}/bin" - ARCHIVE DESTINATION "${INSTALL_DIR}/lib" - LIBRARY DESTINATION "${INSTALL_DIR}/lib") +install (TARGETS ImportExport RUNTIME DESTINATION "${INSTALL_DIR}/win${COMPILER_BITNESS}/${COMPILER}/bin${BUILD_SUFFIX}" + ARCHIVE DESTINATION "${INSTALL_DIR}/win${COMPILER_BITNESS}/${COMPILER}/lib${BUILD_SUFFIX}" + LIBRARY DESTINATION "${INSTALL_DIR}/win${COMPILER_BITNESS}/${COMPILER}/lib${BUILD_SUFFIX}") include_directories (${OCCT_ROOT}/inc ${MFC_STANDARD_SAMPLES_DIR}/05_ImportExport diff --git a/samples/mfc/standard/06_Ocaf/CMakeLists.txt b/samples/mfc/standard/06_Ocaf/CMakeLists.txt index 7233a27ea7..e0d27fc001 100644 --- a/samples/mfc/standard/06_Ocaf/CMakeLists.txt +++ b/samples/mfc/standard/06_Ocaf/CMakeLists.txt @@ -54,9 +54,9 @@ add_executable (Ocaf WIN32 ${Ocaf_SOURCE_FILES} set_property (TARGET Ocaf PROPERTY FOLDER Samples) -install (TARGETS Ocaf RUNTIME DESTINATION "${INSTALL_DIR}/bin" - ARCHIVE DESTINATION "${INSTALL_DIR}/lib" - LIBRARY DESTINATION "${INSTALL_DIR}/lib") +install (TARGETS Ocaf RUNTIME DESTINATION "${INSTALL_DIR}/win${COMPILER_BITNESS}/${COMPILER}/bin${BUILD_SUFFIX}" + ARCHIVE DESTINATION "${INSTALL_DIR}/win${COMPILER_BITNESS}/${COMPILER}/lib${BUILD_SUFFIX}" + LIBRARY DESTINATION "${INSTALL_DIR}/win${COMPILER_BITNESS}/${COMPILER}/lib${BUILD_SUFFIX}") include_directories (${OCCT_ROOT}/inc ${MFC_STANDARD_SAMPLES_DIR}/06_Ocaf diff --git a/samples/mfc/standard/07_Triangulation/CMakeLists.txt b/samples/mfc/standard/07_Triangulation/CMakeLists.txt index 79f7b7f549..af393635d2 100644 --- a/samples/mfc/standard/07_Triangulation/CMakeLists.txt +++ b/samples/mfc/standard/07_Triangulation/CMakeLists.txt @@ -40,9 +40,9 @@ add_executable (Triangulation WIN32 ${Triangulation_SOURCE_FILES} set_property (TARGET Triangulation PROPERTY FOLDER Samples) -install (TARGETS Triangulation RUNTIME DESTINATION "${INSTALL_DIR}/bin" - ARCHIVE DESTINATION "${INSTALL_DIR}/lib" - LIBRARY DESTINATION "${INSTALL_DIR}/lib") +install (TARGETS Triangulation RUNTIME DESTINATION "${INSTALL_DIR}/win${COMPILER_BITNESS}/${COMPILER}/bin${BUILD_SUFFIX}" + ARCHIVE DESTINATION "${INSTALL_DIR}/win${COMPILER_BITNESS}/${COMPILER}/lib${BUILD_SUFFIX}" + LIBRARY DESTINATION "${INSTALL_DIR}/win${COMPILER_BITNESS}/${COMPILER}/lib${BUILD_SUFFIX}") include_directories (${OCCT_ROOT}/inc ${MFC_STANDARD_SAMPLES_DIR}/07_Triangulation diff --git a/samples/mfc/standard/08_HLR/CMakeLists.txt b/samples/mfc/standard/08_HLR/CMakeLists.txt index d7b35c9ede..bdd8b66a52 100644 --- a/samples/mfc/standard/08_HLR/CMakeLists.txt +++ b/samples/mfc/standard/08_HLR/CMakeLists.txt @@ -62,9 +62,9 @@ add_executable (HLR WIN32 ${HLR_SOURCE_FILES} set_property (TARGET HLR PROPERTY FOLDER Samples) -install (TARGETS HLR RUNTIME DESTINATION "${INSTALL_DIR}/bin" - ARCHIVE DESTINATION "${INSTALL_DIR}/lib" - LIBRARY DESTINATION "${INSTALL_DIR}/lib") +install (TARGETS HLR RUNTIME DESTINATION "${INSTALL_DIR}/win${COMPILER_BITNESS}/${COMPILER}/bin${BUILD_SUFFIX}" + ARCHIVE DESTINATION "${INSTALL_DIR}/win${COMPILER_BITNESS}/${COMPILER}/lib${BUILD_SUFFIX}" + LIBRARY DESTINATION "${INSTALL_DIR}/win${COMPILER_BITNESS}/${COMPILER}/lib${BUILD_SUFFIX}") include_directories (${OCCT_ROOT}/inc ${HLR_RESOURCE_DIR} diff --git a/samples/mfc/standard/09_Animation/CMakeLists.txt b/samples/mfc/standard/09_Animation/CMakeLists.txt index c504dd0dac..5c6fb429e1 100644 --- a/samples/mfc/standard/09_Animation/CMakeLists.txt +++ b/samples/mfc/standard/09_Animation/CMakeLists.txt @@ -45,9 +45,9 @@ add_executable (Animation WIN32 ${Animation_SOURCE_FILES} set_property (TARGET Animation PROPERTY FOLDER Samples) -install (TARGETS Animation RUNTIME DESTINATION "${INSTALL_DIR}/bin" - ARCHIVE DESTINATION "${INSTALL_DIR}/lib" - LIBRARY DESTINATION "${INSTALL_DIR}/lib") +install (TARGETS Animation RUNTIME DESTINATION "${INSTALL_DIR}/win${COMPILER_BITNESS}/${COMPILER}/bin${BUILD_SUFFIX}" + ARCHIVE DESTINATION "${INSTALL_DIR}/win${COMPILER_BITNESS}/${COMPILER}/lib${BUILD_SUFFIX}" + LIBRARY DESTINATION "${INSTALL_DIR}/win${COMPILER_BITNESS}/${COMPILER}/lib${BUILD_SUFFIX}") include_directories (${OCCT_ROOT}/inc ${Animation_RESOURCE_DIR} diff --git a/samples/mfc/standard/10_Convert/CMakeLists.txt b/samples/mfc/standard/10_Convert/CMakeLists.txt index 1405ed9aba..d5c7e4dcc4 100644 --- a/samples/mfc/standard/10_Convert/CMakeLists.txt +++ b/samples/mfc/standard/10_Convert/CMakeLists.txt @@ -62,9 +62,9 @@ add_executable (Convert WIN32 ${Convert_SOURCE_FILES} set_property (TARGET Convert PROPERTY FOLDER Samples) -install (TARGETS Convert RUNTIME DESTINATION "${INSTALL_DIR}/bin" - ARCHIVE DESTINATION "${INSTALL_DIR}/lib" - LIBRARY DESTINATION "${INSTALL_DIR}/lib") +install (TARGETS Convert RUNTIME DESTINATION "${INSTALL_DIR}/win${COMPILER_BITNESS}/${COMPILER}/bin${BUILD_SUFFIX}" + ARCHIVE DESTINATION "${INSTALL_DIR}/win${COMPILER_BITNESS}/${COMPILER}/lib${BUILD_SUFFIX}" + LIBRARY DESTINATION "${INSTALL_DIR}/win${COMPILER_BITNESS}/${COMPILER}/lib${BUILD_SUFFIX}") include_directories (${OCCT_ROOT}/inc ${Convert_SRC_DIR} diff --git a/samples/mfc/standard/mfcsample/CMakeLists.txt b/samples/mfc/standard/mfcsample/CMakeLists.txt index 63144b163f..bd4662dbd4 100644 --- a/samples/mfc/standard/mfcsample/CMakeLists.txt +++ b/samples/mfc/standard/mfcsample/CMakeLists.txt @@ -139,9 +139,9 @@ add_library ( mfcsample SHARED ${mfcsample_SOURCE_FILES} set_property (TARGET mfcsample PROPERTY FOLDER Samples) -install (TARGETS mfcsample RUNTIME DESTINATION "${INSTALL_DIR}/bin" - ARCHIVE DESTINATION "${INSTALL_DIR}/lib" - LIBRARY DESTINATION "${INSTALL_DIR}/lib") +install (TARGETS mfcsample RUNTIME DESTINATION "${INSTALL_DIR}/win${COMPILER_BITNESS}/${COMPILER}/bin${BUILD_SUFFIX}" + ARCHIVE DESTINATION "${INSTALL_DIR}/win${COMPILER_BITNESS}/${COMPILER}/lib${BUILD_SUFFIX}" + LIBRARY DESTINATION "${INSTALL_DIR}/win${COMPILER_BITNESS}/${COMPILER}/lib${BUILD_SUFFIX}") include_directories( ${OCCT_ROOT}/inc ${MFC_STANDARD_COMMON_SAMPLES_DIR}