]> SALOME platform Git repositories - modules/shaper.git/blob - CMakeCommon/FindPlaneGCS.cmake
Salome HOME
Issue #2543: Provide completion on editing.
[modules/shaper.git] / CMakeCommon / FindPlaneGCS.cmake
1 # - Try to  find PlaneGCS (sketcher part of FreeCAD)
2 # Once done this will define
3 #
4 #  PLANEGCS_FOUND - system has PlaneGCS
5 #  PLANEGCS_INCLUDE_DIRS - the Plaine include directory
6 #  PLANEGCS_LIBRARIES - Link these to use PlaneGCS
7
8 #=============================================================================
9 ## Copyright (C) 2014-20xx CEA/DEN, EDF R&D
10 #=============================================================================
11
12 IF(NOT PLANEGCS_FIND_QUIETLY)
13   MESSAGE(STATUS "Try to find PlainGCS at $ENV{PLANEGCS_ROOT_DIR}...")
14 ENDIF()
15
16 FIND_PATH(PLANEGCS_INCLUDE_DIR NAMES GCS.h
17   HINTS ENV PLANEGCS_ROOT_DIR
18   PATH_SUFFIXES include
19 )
20
21 FIND_PATH(PLANEGCS_CMAKE_DIR NAMES FindEigen3.cmake
22   HINTS ENV PLANEGCS_ROOT_DIR
23   PATH_SUFFIXES cmake
24 )
25
26 FIND_LIBRARY(PLANEGCS_LIBRARY NAMES PlaneGCS
27   HINTS ENV PLANEGCS_ROOT_DIR
28   PATH_SUFFIXES lib
29 )
30
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)
37
38 IF(Boost_FOUND AND EIGEN3_FOUND)
39   SET(PLANEGCS_INCLUDE_DIRS ${PLANEGCS_INCLUDE_DIR})
40   SET(PLANEGCS_LIBRARIES ${PLANEGCS_LIBRARY})
41 ENDIF()
42
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)
48
49 MARK_AS_ADVANCED(PLANEGCS_LIBRARY PLANEGCS_INCLUDE_DIR)