X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=CMakeCommon%2FFindSolveSpace.cmake;h=f7c6f98e2bfe0d2a7a2db7a68f38f4c245ee80f9;hb=c2703b4647f9b1ebc6ec1f4a378721dde523159f;hp=d3c0811e0d30278be45bebf4a42eb4b028160174;hpb=503b5444d4a5fa95a3046a754f69f5b79e677e33;p=modules%2Fshaper.git diff --git a/CMakeCommon/FindSolveSpace.cmake b/CMakeCommon/FindSolveSpace.cmake index d3c0811e0..f7c6f98e2 100644 --- a/CMakeCommon/FindSolveSpace.cmake +++ b/CMakeCommon/FindSolveSpace.cmake @@ -1,6 +1,50 @@ -SET(SLVS_ROOT_DIR $ENV{SOLVESPACE_ROOT_DIR}) +# Copyright (C) 2014-2021 CEA/DEN, EDF R&D +# +# 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 +# -INCLUDE_DIRECTORIES(${SLVS_ROOT_DIR}/include) -LINK_DIRECTORIES(${SLVS_ROOT_DIR}/lib) +# - Try to find SolveSpace +# Once done this will define +# +# SOLVESPACE_FOUND - system has SolveSpace +# SOLVESPACE_INCLUDE_DIRS - the SolveSpace include directory +# SOLVESPACE_LIBRARIES - Link these to use SolveSpace -SET(SLVS_LIBRARIES slvs) +IF(NOT SOLVESPACE_FIND_QUIETLY) + MESSAGE(STATUS "Try to find SolveSpace at $ENV{SOLVESPACE_ROOT_DIR}...") +ENDIF() + +FIND_PATH(SOLVESPACE_INCLUDE_DIR NAMES slvs.h + HINTS ENV SOLVESPACE_ROOT_DIR + PATH_SUFFIXES include +) + +FIND_LIBRARY(SOLVESPACE_LIBRARY NAMES slvs + HINTS ENV SOLVESPACE_ROOT_DIR + PATH_SUFFIXES lib +) + +SET(SOLVESPACE_INCLUDE_DIRS ${SOLVESPACE_INCLUDE_DIR}) +SET(SOLVESPACE_LIBRARIES ${SOLVESPACE_LIBRARY}) + +# handle the QUIETLY and REQUIRED arguments and set SOLVESPACE_FOUND to TRUE +# if all listed variables are TRUE +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(SolveSpace + REQUIRED_VARS SOLVESPACE_LIBRARY SOLVESPACE_INCLUDE_DIR) + +MARK_AS_ADVANCED(SOLVESPACE_LIBRARY SOLVESPACE_INCLUDE_DIR) \ No newline at end of file