diff --git a/CMakeLists.txt b/CMakeLists.txt index 637908da53..9764d2b746 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,9 +47,6 @@ if (OCCT_ALGO_EXTENDED_OUTPUT_DESCR) add_definitions (-DOCCT_DEBUG) 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_OCCT_SAMPLES OFF CACHE BOOL "${INSTALL_OCCT_SAMPLES_DESCR}") @@ -72,15 +69,8 @@ if (APPLE) set (USE_GLX OFF CACHE BOOL "${USE_GLX_DESCR}") endif() -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 "${USE_GL2PS_DESCR}") - set (USE_TBB OFF CACHE BOOL "${USE_TBB_DESCR}") - #set (USE_OPENCL OFF CACHE BOOL "Is OpenCL used or not") -endif() - # include occt macros OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros") @@ -132,6 +122,16 @@ OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_defs_flags") OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/3rdparty_macro") +# Rebuild *.yacc and *.lex files that are contained by TKMath toolkit +list (FIND BUILD_TOOLKITS TKMath CAN_REBUILD_PDC_FOR_TKMATH) +list (FIND BUILD_TOOLKITS StepFile CAN_REBUILD_PDC_FOR_STEPFILE) + +if (NOT "${CAN_REBUILD_PDC_FOR_TKMATH}" STREQUAL "-1" OR NOT "${CAN_REBUILD_PDC_FOR_STEPFILE}" STREQUAL "-1") + set (REBUILD_PLATFORM_DEPENDENT_CODE OFF CACHE BOOL "${REBUILD_PLATFORM_DEPENDENT_CODE_DESCR}") +else() + OCCT_CHECK_AND_UNSET (REBUILD_PLATFORM_DEPENDENT_CODE) +endif() + if (NOT DEFINED 3RDPARTY_DIR) set (3RDPARTY_DIR "" CACHE PATH ${3RDPARTY_DIR_DESCR}) endif() @@ -151,23 +151,26 @@ endif() OCCT_IS_PRODUCT_REQUIRED (CSF_TclLibs USE_TCL) if ("${USE_TCL}" STREQUAL ON) - message (STATUS "Info: tcl is used by OCCT") + message (STATUS "Info: TCL is used by OCCT") OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/tcl") else() OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TCL") OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TK") + + OCCT_CHECK_AND_UNSET ("INSTALL_TCL") endif() # search for CSF_FREETYPE variable in EXTERNLIB of each being used toolkit OCCT_IS_PRODUCT_REQUIRED (CSF_FREETYPE USE_FREETYPE) if ("${USE_FREETYPE}" STREQUAL ON) - message (STATUS "Info: freetype is used by OCCT") + message (STATUS "Info: Freetype is used by OCCT") OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/freetype") else() OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_FREETYPE") OCCT_CHECK_AND_UNSET ("3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2") OCCT_CHECK_AND_UNSET ("3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build") + OCCT_CHECK_AND_UNSET ("INSTALL_FREETYPE") endif() # VTK @@ -186,11 +189,26 @@ if (USE_GLX) endif() # FREEIMAGE -if (USE_FREEIMAGE) - add_definitions (-DHAVE_FREEIMAGE) - OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/freeimage") - OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/freeimageplus") +# search for CSF_FREEIMAGE variable in EXTERNLIB of each being used toolkit +OCCT_IS_PRODUCT_REQUIRED (CSF_FREEIMAGE CAN_USE_FREEIMAGE) +OCCT_IS_PRODUCT_REQUIRED (CSF_FreeImagePlus CAN_USE_FREEIMAGEPLUS) + +if (CAN_USE_FREEIMAGE OR CAN_USE_FREEIMAGEPLUS) + set (USE_FREEIMAGE OFF CACHE BOOL "${USE_FREEIMAGE_DESCR}") + + if (USE_FREEIMAGE) + add_definitions (-DHAVE_FREEIMAGE) + OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/freeimage") + OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/freeimageplus") + else() + OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_FREEIMAGE") + OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_FREEIMAGEPLUS") + OCCT_CHECK_AND_UNSET ("INSTALL_FREEIMAGE") + OCCT_CHECK_AND_UNSET ("INSTALL_FREEIMAGEPLUS") + endif() else() + OCCT_CHECK_AND_UNSET ("USE_FREEIMAGE") + OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_FREEIMAGE") OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_FREEIMAGEPLUS") OCCT_CHECK_AND_UNSET ("INSTALL_FREEIMAGE") @@ -198,30 +216,44 @@ else() endif() # GL2PS -if (USE_GL2PS) - add_definitions (-DHAVE_GL2PS) - OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/gl2ps") +# search for CSF_GL2PS variable in EXTERNLIB of each being used toolkit +OCCT_IS_PRODUCT_REQUIRED (CSF_GL2PS CAN_USE_GL2PS) + +if (NOT DEFINED ANDROID AND CAN_USE_GL2PS) + set (USE_GL2PS OFF CACHE BOOL "${USE_GL2PS_DESCR}") + + if (USE_GL2PS) + add_definitions (-DHAVE_GL2PS) + OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/gl2ps") + else() + OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_GL2PS") + OCCT_CHECK_AND_UNSET ("INSTALL_GL2PS") + endif() else() + OCCT_CHECK_AND_UNSET ("USE_GL2PS") + OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_GL2PS") OCCT_CHECK_AND_UNSET ("INSTALL_GL2PS") endif() -# OPENCL -#if (USE_OPENCL) -# add_definitions (-DHAVE_OPENCL) -# OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/opencl") -#else() -# OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_OPENCL") -# OCCT_CHECK_AND_UNSET ("3RDPARTY_OPENCL_ADDITIONAL_PATH_FOR_HEADER") -# OCCT_CHECK_AND_UNSET ("3RDPARTY_OPENCL_ADDITIONAL_PATH_FOR_LIB") -# OCCT_CHECK_AND_UNSET ("INSTALL_OPENCL") -#endif() - # TBB -if (USE_TBB) - add_definitions (-DHAVE_TBB) - OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/tbb") +# search for CSF_TBB variable in EXTERNLIB of each being used toolkit +OCCT_IS_PRODUCT_REQUIRED (CSF_TBB CAN_USE_TBB) + +if (NOT DEFINED ANDROID AND CAN_USE_TBB) + set (USE_TBB OFF CACHE BOOL "${USE_TBB_DESCR}") + + if (USE_TBB) + add_definitions (-DHAVE_TBB) + OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/tbb") + else() + OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TBB") + OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TBBMALLOC") + OCCT_CHECK_AND_UNSET ("INSTALL_TBB") + endif() else() + OCCT_CHECK_AND_UNSET ("USE_TBB") + OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TBB") OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TBBMALLOC") OCCT_CHECK_AND_UNSET ("INSTALL_TBB")