]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #2553 Error while compiling Shaper on UB16
authormpv <mpv@opencascade.com>
Thu, 5 Jul 2018 13:14:23 +0000 (16:14 +0300)
committermpv <mpv@opencascade.com>
Mon, 9 Jul 2018 07:58:44 +0000 (10:58 +0300)
Added usage of SALOME procedure for searching Python is SALOME is found.

CMakeCommon/Common.cmake
CMakeLists.txt

index 5c45426fdccce1062cbf02b673b85803cb8b9504..3e5d6abb3f82b7ffecf2bd9148fc3d9b1b44f108 100644 (file)
@@ -17,7 +17,7 @@ ENDIF(WIN32)
 IF(UNIX)
   IF(CMAKE_COMPILER_IS_GNUCC)
     #C++11 is not supported on some platforms, disable it
-    MESSAGE(STATUS "Setting -std=c++0x flag for the gcc...")
+    #MESSAGE(STATUS "Setting -std=c++0x flag for the gcc...")
     SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
 
     #Supporting test coverage checks (gcov) in the DEBUG mode
@@ -36,7 +36,7 @@ IF(UNIX)
     ENDIF(USE_TEST_COVERAGE)
 
     #SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -E")
-    MESSAGE(STATUS "gcc flags are: " ${CMAKE_CXX_FLAGS})
-    MESSAGE(STATUS "linker flags are: " ${CMAKE_SHARED_LINKER_FLAGS})
+    #MESSAGE(STATUS "gcc flags are: " ${CMAKE_CXX_FLAGS})
+    #MESSAGE(STATUS "linker flags are: " ${CMAKE_SHARED_LINKER_FLAGS})
   ENDIF(CMAKE_COMPILER_IS_GNUCC)
 ENDIF(UNIX)
index d8884967969f041dd21838a416f12997550bc557..b28a3d5cbc1931c8be043f4c0e7d0597713bd3a1 100644 (file)
@@ -36,12 +36,41 @@ INCLUDE(SalomeMacros)
 INCLUDE(FindEclipse)
 INCLUDE(Common)
 INCLUDE(FindSalomeQt5)
-INCLUDE(FindPython)
 INCLUDE(FindSalome)
 INCLUDE(FindCAS)
 INCLUDE(FindSUIT)
 INCLUDE(FindTInspector)
 
+IF(${HAVE_SALOME})
+  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)
+  ELSE()
+    MESSAGE(FATAL_ERROR "We absolutely need the Salome CMake configuration files, please define CONFIGURATION_ROOT_DIR !")
+  ENDIF()
+  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)
+    ADD_DEFINITIONS(${KERNEL_DEFINITIONS})
+    INCLUDE_DIRECTORIES(${KERNEL_INCLUDE_DIRS})
+  ELSE(EXISTS ${KERNEL_ROOT_DIR})
+    MESSAGE(FATAL_ERROR "We absolutely need a Salome KERNEL, please define KERNEL_ROOT_DIR")
+  ENDIF(EXISTS ${KERNEL_ROOT_DIR})
+  INCLUDE(SalomeSetupPlatform)   # From CONFIGURATION
+
+  FIND_PACKAGE(SalomePythonInterp REQUIRED)
+  FIND_PACKAGE(SalomePythonLibs REQUIRED)
+
+ELSE(${HAVE_SALOME})
+  INCLUDE(FindPython)
+ENDIF(${HAVE_SALOME})
+
+# Common CMake macros
+# ===================
+
+
 # Find LibXml2
 IF(DEFINED ENV{LIBXML2_ROOT_DIR})
     IF(WIN32)