]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Second phase of SketchSolver refactoring
authorazv <azv@opencascade.com>
Tue, 15 Dec 2015 14:15:46 +0000 (17:15 +0300)
committerazv <azv@opencascade.com>
Tue, 22 Dec 2015 08:13:48 +0000 (11:13 +0300)
1. Environment for PlaneGCS solver

CMakeCommon/FindPlaneGCS.cmake [new file with mode: 0644]
env_Salome.bat
env_linux.sh
msvc10_env.bat
src/SketchSolver/CMakeLists.txt

diff --git a/CMakeCommon/FindPlaneGCS.cmake b/CMakeCommon/FindPlaneGCS.cmake
new file mode 100644 (file)
index 0000000..7e51104
--- /dev/null
@@ -0,0 +1,49 @@
+# - Try to  find PlaneGCS (sketcher part of FreeCAD)
+# Once done this will define
+#
+#  PLANEGCS_FOUND - system has PlaneGCS
+#  PLANEGCS_INCLUDE_DIRS - the Plaine include directory
+#  PLANEGCS_LIBRARIES - Link these to use PlaneGCS
+
+#=============================================================================
+## Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+#=============================================================================
+
+IF(NOT PLANEGCS_FIND_QUIETLY)
+  MESSAGE(STATUS "Try to find PlainGCS at $ENV{PLANEGCS_ROOT_DIR}...")
+ENDIF()
+
+FIND_PATH(PLANEGCS_INCLUDE_DIR NAMES GCS.h
+  HINTS ENV PLANEGCS_ROOT_DIR
+  PATH_SUFFIXES include
+)
+
+FIND_PATH(PLANEGCS_CMAKE_DIR NAMES FindEigen3.cmake
+  HINTS ENV PLANEGCS_ROOT_DIR
+  PATH_SUFFIXES cmake
+)
+
+FIND_LIBRARY(PLANEGCS_LIBRARY NAMES PlaneGCS
+  HINTS ENV PLANEGCS_ROOT_DIR
+  PATH_SUFFIXES lib
+)
+
+# verify Eigen and Boost libraries are found
+FILE(TO_CMAKE_PATH "$ENV{EIGEN_ROOT_DIR}/include/eigen3" EIGEN3_INCLUDE_DIR)
+FILE(TO_CMAKE_PATH "$ENV{BOOST_ROOT_DIR}" BOOST_ROOT)
+SET(CMAKE_MODULE_PATH "${PLANEGCS_CMAKE_DIR}" ${CMAKE_MODULE_PATH})
+FIND_PACKAGE(Eigen3 3.2.5 REQUIRED)
+FIND_PACKAGE(Boost COMPONENTS graph REQUIRED)
+
+IF(Boost_FOUND AND EIGEN3_FOUND)
+  SET(PLANEGCS_INCLUDE_DIRS ${PLANEGCS_INCLUDE_DIR})
+  SET(PLANEGCS_LIBRARIES ${PLANEGCS_LIBRARY})
+ENDIF()
+
+# handle the QUIETLY and REQUIRED arguments and set PLANEGCS_FOUND to TRUE
+# if all listed variables are TRUE
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(PlaneGCS
+                                  REQUIRED_VARS PLANEGCS_LIBRARY PLANEGCS_INCLUDE_DIR)
+
+MARK_AS_ADVANCED(PLANEGCS_LIBRARY PLANEGCS_INCLUDE_DIR)
\ No newline at end of file
index 7b147b26d7a10f542f501ef327e2f0f35e77e640..c20699bd4402a72738efc2a304b8b50571688d3f 100644 (file)
@@ -23,6 +23,19 @@ if "%SOLVESPACE_ROOT_DIR%" == "" (
 )
 SET PATH=%SOLVESPACE_ROOT_DIR%\lib;%PATH%
 
+if "%PLANEGCS_ROOT_DIR%" == "" (
+  SET PLANEGCS_ROOT_DIR=%ROOT_DIR%\products\planegcs-0.16
+)
+SET PATH=%PLANEGCS_ROOT_DIR%\lib;%PATH%
+
+if "%EIGEN_ROOT_DIR%" == "" (
+  SET EIGEN_ROOT_DIR=%ROOT_DIR%\products\eigen-3.2.7
+)
+
+if "%BOOST_ROOT_DIR%" == "" (
+  SET BOOST_ROOT_DIR=%ROOT_DIR%\products\boost-1.52.0
+)
+
 cd %SALOME_ROOT_DIR%\WORK
 call set_env.bat %1
 call "%PDIR%\env_compile.bat"
index ef10d0d7dbd4e8aa71e7169036021bcdfd70f856..2aaa7dbbd50f67697ac7d27597e46beb9f98d558 100644 (file)
@@ -24,6 +24,19 @@ export SOLVESPACE_ROOT_DIR=${NEWGEOM_PDIR}/solvespace-2.1
 export LD_LIBRARY_PATH=${SOLVESPACE_ROOT_DIR}/lib:${LD_LIBRARY_PATH}
 ##
 
+#------ PlaneGCS ------
+export PLANEGCS_ROOT_DIR=${NEWGEOM_PDIR}/planegcs-0.16
+export LD_LIBRARY_PATH=${PLANEGCS_ROOT_DIR}/lib:${LD_LIBRARY_PATH}
+##
+
+#------ Eigen ------
+export EIGEN_ROOT_DIR=${NEWGEOM_PDIR}/eigen-3.2.7
+##
+
+#------ Boost ------
+export BOOST_ROOT_DIR=${NEWGEOM_PDIR}/boost-1.52.0
+##
+
 #------ lcov ------
 export LCOV_ROOT_DIR=${NEWGEOM_PDIR}/lcov-1.11
 export PATH=${LCOV_ROOT_DIR}/bin:${PATH}
index 246307098222cbb07a247986d823e0948db44284..0d63c8b4fc5be5776b76356322611cc37b2590f4 100644 (file)
@@ -123,6 +123,19 @@ set PATH=%CMAKEDIR%\bin;%PATH%
 @SET _NO_DEBUG_HEAP=1
 @REM -------------------------
 
+@REM -------------------------
+@SET PLANEGCS_ROOT_DIR=%PDIR%\planegcs-0.16
+@SET PATH=%PLANEGCS_ROOT_DIR%\lib;%PATH%
+@REM -------------------------
+
+@REM -------------------------
+@SET EIGEN_ROOT_DIR=%PDIR%\eigen-3.2.7
+@REM -------------------------
+
+@REM -------------------------
+@SET BOOST_ROOT_DIR=%PDIR%\boost-1.52.0
+@REM -------------------------
+
 @REM -------------------------
 @REM PTHREAD
 @SET PATH=%PDIR%\pthreads-2.9.1\lib;%PATH%
index c75eb93ba2cea6bf5c9ecbec8ee0526fd3b94c4f..25c5a8c268f8074082a3aa81cfdd6674b5ffbdaa 100644 (file)
@@ -79,7 +79,7 @@ INSTALL(TARGETS SketchSolver DESTINATION plugins)
 # Include specific solvers
 FIND_FILE(SSPath "SolveSpaceSolver/CMakeLists.txt" PATHS "${CMAKE_CURRENT_SOURCE_DIR}")
 STRING(COMPARE NOTEQUAL ${SSPath} "SSPath-NOTFOUND" SSPath_FOUND)
-FIND_FILE(GCSPath "PlainGCSSolver/CMakeLists.txt" PATHS "${CMAKE_CURRENT_SOURCE_DIR}")
+FIND_FILE(GCSPath "PlaneGCSSolver/CMakeLists.txt" PATHS "${CMAKE_CURRENT_SOURCE_DIR}")
 STRING(COMPARE NOTEQUAL ${GCSPath} "GCSPath-NOTFOUND" GCSPath_FOUND)
 
 IF(${SSPath_FOUND} OR ${GCSPath_FOUND})
@@ -88,8 +88,8 @@ IF(${SSPath_FOUND} OR ${GCSPath_FOUND})
     ADD_SUBDIRECTORY(SolveSpaceSolver)
   ENDIF()
   IF(${GCSPath_FOUND})
-    MESSAGE(STATUS "PlainGCSSolver plugin found in ${GCSPath}")
-    ADD_SUBDIRECTORY(PlainGCSSolver)
+    MESSAGE(STATUS "PlaneGCSSolver plugin found in ${GCSPath}")
+    ADD_SUBDIRECTORY(PlaneGCSSolver)
   ENDIF()
 ELSE()
   MESSAGE(WARNING "No sketch solver plugin is found")