# - Find OCCT Canonical recognition (CR) product # Sets the following variables: # CR_INCLUDE_DIRS - path to the OCCT CR include directory # CR_LIBRARIES - path to the OCCT CR libraries to be linked against # ######################################################################### # Copyright (C) 2014-2016 OPEN CASCADE # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # # ------ MESSAGE(STATUS "Check for OCCT Canonical recognition product ...") # ------ SET(CR_ROOT_DIR $ENV{CR_ROOT_DIR}) SET(OCCLICENSE_ROOT_DIR $ENV{OCCLICENSE_ROOT_DIR}) IF(CR_ROOT_DIR) LIST(APPEND CMAKE_PREFIX_PATH "${CR_ROOT_DIR}") ENDIF(CR_ROOT_DIR) IF(OCCLICENSE_ROOT_DIR) LIST(APPEND CMAKE_PREFIX_PATH "${OCCLICENSE_ROOT_DIR}") ENDIF(OCCLICENSE_ROOT_DIR) FIND_PATH(CR_INCLUDE_DIRS ShapeConvert.hxx PATH_SUFFIXES include/opencascade include/products) IF(CR_INCLUDE_DIRS) SET(CR_UPCOUNT 2) ELSE(CR_INCLUDE_DIRS) FIND_PATH(CR_INCLUDE_DIRS ShapeConvert.hxx PATH_SUFFIXES include inc) ENDIF(CR_INCLUDE_DIRS) FIND_PATH(OCCTLICENSE_INCLUDE_DIRS OCCLicense_Activate.hxx PATH_SUFFIXES include/opencascade include/products) IF(NOT OCCTLICENSE_INCLUDE_DIRS) FIND_PATH(OCCTLICENSE_INCLUDE_DIRS OCCLicense_Activate.hxx PATH_SUFFIXES include inc) ENDIF(NOT OCCTLICENSE_INCLUDE_DIRS) IF(CR_INCLUDE_DIRS AND OCCTLICENSE_INCLUDE_DIRS) FILE(TO_NATIVE_PATH ${CR_INCLUDE_DIRS} _cr_dir) FILE(TO_NATIVE_PATH ${OCCTLICENSE_INCLUDE_DIRS} _lic_dir) STRING(COMPARE NOTEQUAL ${_cr_dir} ${_lic_dir} _diff_dir) IF(_diff_dir) LIST(APPEND CR_INCLUDE_DIRS ${OCCTLICENSE_INCLUDE_DIRS}) ENDIF() ENDIF(CR_INCLUDE_DIRS AND OCCTLICENSE_INCLUDE_DIRS) FIND_LIBRARY(CR_TKCR NAMES TKCR PATH_SUFFIXES lib lin64/gcc/lib bin) FIND_LIBRARY(CRKOCCLicense NAMES TKOCCLicense PATH_SUFFIXES lib lin64/gcc/lib bin) SET(CR_LIBRARIES ${CR_TKCR} ${CR_TKOCCLicense} ) INCLUDE(FindPackageHandleStandardArgs) FIND_PACKAGE_HANDLE_STANDARD_ARGS(CR REQUIRED_VARS CR_INCLUDE_DIRS CR_LIBRARIES)