# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8 FATAL_ERROR)
+INCLUDE(CMakeDependentOption)
+
PROJECT(SalomeGEOM C CXX)
# Ensure a proper linker behavior:
# Advanced options:
OPTION(SALOME_BUILD_GUI "Enable GUI" ON)
-OPTION(SALOME_GEOM_USE_OPENCV "Enable shape recognition from picture" OFF)
-
+CMAKE_DEPENDENT_OPTION(SALOME_GEOM_USE_OPENCV "Enable shape recognition from picture" OFF
+ "SALOME_BUILD_GUI" OFF)
MARK_AS_ADVANCED(SALOME_BUILD_GUI SALOME_GEOM_USE_OPENCV)
# Prerequisites
FIND_PACKAGE(SalomeCAS REQUIRED)
FIND_PACKAGE(SalomeVTK 6.0 REQUIRED)
-
-IF(SALOME_BUILD_GUI)
- # OpenCV
- IF(SALOME_GEOM_USE_OPENCV)
- FIND_PACKAGE(SalomeOpenCV)
- SALOME_LOG_OPTIONAL_PACKAGE(OpenCV SALOME_GEOM_USE_OPENCV)
- ENDIF(SALOME_GEOM_USE_OPENCV)
-ELSE()
- SET(SALOME_GEOM_USE_OPENCV OFF)
-ENDIF(SALOME_BUILD_GUI)
+# OpenCV
IF(SALOME_GEOM_USE_OPENCV)
- SET(OPENCV_DEFINITIONS "-DWITH_OPENCV")
-ENDIF()
+ FIND_PACKAGE(SalomeOpenCV REQUIRED)
+ SALOME_LOG_OPTIONAL_PACKAGE(OpenCV SALOME_GEOM_USE_OPENCV)
+ ADD_DEFINITIONS(-DWITH_OPENCV)
+ENDIF(SALOME_GEOM_USE_OPENCV)
# Detection summary:
SALOME_PACKAGE_REPORT_AND_CHECK()
ENDIF()
IF(SALOME_GEOM_USE_OPENCV)
SET_AND_CHECK(OPENCV_ROOT_DIR_EXP "@PACKAGE_OPENCV_ROOT_DIR@")
+ ADD_DEFINITIONS(-DWITH_OPENCV)
ENDIF()
# For all prerequisites, load the corresponding targets if the package was used