Salome HOME
updated copyright message
[modules/gui.git] / tools / CurvePlot / CMakeLists.txt
index 45c12f8f148d9e1ef0c863c0c5f89972801f419b..53909a89afb938ab2086e31e36d3762bc41378ac 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2019  CEA/DEN, EDF R&D
+# Copyright (C) 2012-2023  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
@@ -21,9 +21,6 @@ INCLUDE(CMakeDependentOption)
 
 PROJECT(SalomeCURVEPLOT C CXX)
 
-# Ensure a proper linker behavior:
-CMAKE_POLICY(SET CMP0003 NEW)
-
 # Versioning
 # ===========
 # Project name, upper case
@@ -47,7 +44,7 @@ OPTION(SALOME_BUILD_TESTS "Generate SALOME CURVEPLOT tests" ON)
 SET(CONFIGURATION_ROOT_DIR $ENV{CONFIGURATION_ROOT_DIR} CACHE PATH "Path to the Salome CMake configuration files")
 IF(EXISTS ${CONFIGURATION_ROOT_DIR})
   LIST(APPEND CMAKE_MODULE_PATH "${CONFIGURATION_ROOT_DIR}/cmake")
-  INCLUDE(SalomeMacros)
+  INCLUDE(SalomeMacros NO_POLICY_SCOPE)
 ELSE()
   MESSAGE(FATAL_ERROR "We absolutely need the Salome CMake configuration files, please define CONFIGURATION_ROOT_DIR !")
 ENDIF()
@@ -57,7 +54,6 @@ IF(NOT SALOME_CURVEPLOT_STANDALONE)
     # ==============
     SET(KERNEL_ROOT_DIR $ENV{KERNEL_ROOT_DIR} CACHE PATH "Path to the Salome KERNEL")
     IF( EXISTS ${KERNEL_ROOT_DIR} )
-      LIST(APPEND CMAKE_MODULE_PATH "${KERNEL_ROOT_DIR}/salome_adm/cmake_files")
       FIND_PACKAGE(SalomeKERNEL REQUIRED)
       KERNEL_WITH_CORBA() # check whether KERNEL builded with CORBA
       ADD_DEFINITIONS(${KERNEL_DEFINITIONS} -DSALOME_KERNEL)
@@ -66,31 +62,31 @@ IF(NOT SALOME_CURVEPLOT_STANDALONE)
       MESSAGE(FATAL_ERROR "We absolutely need a Salome KERNEL, please define KERNEL_ROOT_DIR or turn option SALOME_CURVEPLOT_STANDALONE to ON!")
     ENDIF( EXISTS ${KERNEL_ROOT_DIR} )
     
-    # Find SALOME GUI (needed for the C++ part - PyUtils)
     # ==============
     SET(GUI_ROOT_DIR $ENV{GUI_ROOT_DIR} CACHE PATH "Path to the Salome GUI")
-    IF(EXISTS ${GUI_ROOT_DIR})
-      LIST(APPEND CMAKE_MODULE_PATH "${GUI_ROOT_DIR}/adm_local/cmake_files")
-      FIND_PACKAGE(SalomeGUI)
-    ELSE(EXISTS ${GUI_ROOT_DIR})
-      MESSAGE(FATAL_ERROR "We absolutely need a Salome GUI, please define GUI_ROOT_DIR or turn option SALOME_CURVEPLOT_STANDALONE to ON!")
-    ENDIF(EXISTS ${GUI_ROOT_DIR})
+    # Are we compiled being into GUI/tools directory or have we been extracted somewhere else?
+    IF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../../src/Session/SALOME_Session.hxx")  # we are in GUI
+      # Re-define GUI_INCLUDE_DIRS 
+      SET(GUI_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../PyInterp/src)
+    ELSE()      
+      IF(EXISTS ${GUI_ROOT_DIR})
+        FIND_PACKAGE(SalomeGUI)
+      ELSE()
+        MESSAGE(FATAL_ERROR "We absolutely need a Salome GUI, please define GUI_ROOT_DIR or turn option SALOME_CURVEPLOT_STANDALONE to ON!")
+      ENDIF()
+    ENDIF()
     
-    # Platform setup
-    # ==============
-    INCLUDE(SalomeSetupPlatform)   # From KERNEL
 ENDIF(NOT SALOME_CURVEPLOT_STANDALONE)
 
+# Platform setup
+# ==============
+INCLUDE(SalomeSetupPlatform)
+
 # Always build libraries as shared objects:
 SET(BUILD_SHARED_LIBS TRUE)
 # Local macros:
 LIST(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/adm_local/cmake_files")
 
-IF(SALOME_CURVEPLOT_STANDALONE)
-    INCLUDE(SalomeMacros)
-ENDIF()
-
-
 # Prerequisites
 # =============
 # Find "big" prerequisites first - they reference themselves many others