1 # Copyright (C) 2014-2019 CEA/DEN, EDF R&D
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License, or (at your option) any later version.
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 # Lesser General Public License for more details.
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 # - Try to find PlaneGCS (sketcher part of FreeCAD)
21 # Once done this will define
23 # PLANEGCS_FOUND - system has PlaneGCS
24 # PLANEGCS_INCLUDE_DIRS - the Plaine include directory
25 # PLANEGCS_LIBRARIES - Link these to use PlaneGCS
27 IF(NOT PLANEGCS_FIND_QUIETLY)
28 MESSAGE(STATUS "Try to find PlainGCS at $ENV{PLANEGCS_ROOT_DIR}...")
31 FIND_PATH(PLANEGCS_INCLUDE_DIR NAMES GCS.h
32 HINTS ENV PLANEGCS_ROOT_DIR
36 FIND_PATH(PLANEGCS_CMAKE_DIR NAMES FindEigen3.cmake
37 HINTS ENV PLANEGCS_ROOT_DIR
41 FIND_LIBRARY(PLANEGCS_LIBRARY NAMES PlaneGCS
42 HINTS ENV PLANEGCS_ROOT_DIR
46 # verify Eigen and Boost libraries are found
47 FILE(TO_CMAKE_PATH "$ENV{EIGEN_ROOT_DIR}/include/eigen3" EIGEN3_INCLUDE_DIR)
48 FILE(TO_CMAKE_PATH "$ENV{BOOST_ROOT_DIR}" BOOST_ROOT)
49 SET(CMAKE_MODULE_PATH "${PLANEGCS_CMAKE_DIR}" ${CMAKE_MODULE_PATH})
50 FIND_PACKAGE(Eigen3 3.2.5 REQUIRED)
51 FIND_PACKAGE(Boost COMPONENTS graph REQUIRED)
53 IF(Boost_FOUND AND EIGEN3_FOUND)
54 SET(PLANEGCS_INCLUDE_DIRS ${PLANEGCS_INCLUDE_DIR})
55 SET(PLANEGCS_LIBRARIES ${PLANEGCS_LIBRARY})
58 # handle the QUIETLY and REQUIRED arguments and set PLANEGCS_FOUND to TRUE
59 # if all listed variables are TRUE
60 INCLUDE(FindPackageHandleStandardArgs)
61 FIND_PACKAGE_HANDLE_STANDARD_ARGS(PlaneGCS
62 REQUIRED_VARS PLANEGCS_LIBRARY PLANEGCS_INCLUDE_DIR)
64 MARK_AS_ADVANCED(PLANEGCS_LIBRARY PLANEGCS_INCLUDE_DIR)