1 # - Try to find PlaneGCS (sketcher part of FreeCAD)
2 # Once done this will define
4 # PLANEGCS_FOUND - system has PlaneGCS
5 # PLANEGCS_INCLUDE_DIRS - the Plaine include directory
6 # PLANEGCS_LIBRARIES - Link these to use PlaneGCS
8 #=============================================================================
9 ## Copyright (C) 2014-20xx CEA/DEN, EDF R&D
10 #=============================================================================
12 IF(NOT PLANEGCS_FIND_QUIETLY)
13 MESSAGE(STATUS "Try to find PlainGCS at $ENV{PLANEGCS_ROOT_DIR}...")
16 FIND_PATH(PLANEGCS_INCLUDE_DIR NAMES GCS.h
17 HINTS ENV PLANEGCS_ROOT_DIR
21 FIND_PATH(PLANEGCS_CMAKE_DIR NAMES FindEigen3.cmake
22 HINTS ENV PLANEGCS_ROOT_DIR
26 FIND_LIBRARY(PLANEGCS_LIBRARY NAMES PlaneGCS
27 HINTS ENV PLANEGCS_ROOT_DIR
31 # verify Eigen and Boost libraries are found
32 FILE(TO_CMAKE_PATH "$ENV{EIGEN_ROOT_DIR}/include/eigen3" EIGEN3_INCLUDE_DIR)
33 FILE(TO_CMAKE_PATH "$ENV{BOOST_ROOT_DIR}" BOOST_ROOT)
34 SET(CMAKE_MODULE_PATH "${PLANEGCS_CMAKE_DIR}" ${CMAKE_MODULE_PATH})
35 FIND_PACKAGE(Eigen3 3.2.5 REQUIRED)
36 FIND_PACKAGE(Boost COMPONENTS graph REQUIRED)
38 IF(Boost_FOUND AND EIGEN3_FOUND)
39 SET(PLANEGCS_INCLUDE_DIRS ${PLANEGCS_INCLUDE_DIR})
40 SET(PLANEGCS_LIBRARIES ${PLANEGCS_LIBRARY})
43 # handle the QUIETLY and REQUIRED arguments and set PLANEGCS_FOUND to TRUE
44 # if all listed variables are TRUE
45 INCLUDE(FindPackageHandleStandardArgs)
46 FIND_PACKAGE_HANDLE_STANDARD_ARGS(PlaneGCS
47 REQUIRED_VARS PLANEGCS_LIBRARY PLANEGCS_INCLUDE_DIR)
49 MARK_AS_ADVANCED(PLANEGCS_LIBRARY PLANEGCS_INCLUDE_DIR)