Salome HOME
Porting PYHELLO SALOME module build procedure to the CMake build system: some correct...
authorrnv <rnv@opencascade.com>
Mon, 14 Oct 2013 07:51:01 +0000 (07:51 +0000)
committerrnv <rnv@opencascade.com>
Mon, 14 Oct 2013 07:51:01 +0000 (07:51 +0000)
1) Move module configuration file to the root directory.
2) Remove deprecated files.

CMakeLists.txt
SalomePYHELLOConfig.cmake.in [new file with mode: 0644]
adm_local/cmake_files/CMakeLists.txt
adm_local/cmake_files/FindPYHELLO.cmake [deleted file]
adm_local/cmake_files/SalomePYHELLOConfig.cmake.in [deleted file]

index a51b9c376fbad7fa64adc163a3800bb55ab94104..fbc2b0cc515bdf9d0d32a757e2967cc369da892a 100755 (executable)
@@ -162,7 +162,7 @@ EXPORT(TARGETS ${_${PROJECT_NAME}_exposed_targets}
 SET(GUI_ROOT_DIR "${GUI_ROOT_DIR}")
 
 SET(CONF_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/include" "${PROJECT_BINARY_DIR}/include")
-CONFIGURE_PACKAGE_CONFIG_FILE(adm_local/cmake_files/${PROJECT_NAME}Config.cmake.in 
+CONFIGURE_PACKAGE_CONFIG_FILE(${PROJECT_NAME}Config.cmake.in
     ${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake
     INSTALL_DESTINATION "${SALOME_INSTALL_CMAKE_LOCAL}"
     PATH_VARS CONF_INCLUDE_DIRS SALOME_INSTALL_CMAKE_LOCAL CMAKE_INSTALL_PREFIX
diff --git a/SalomePYHELLOConfig.cmake.in b/SalomePYHELLOConfig.cmake.in
new file mode 100644 (file)
index 0000000..5cf7ad4
--- /dev/null
@@ -0,0 +1,99 @@
+# - Config file for the @PROJECT_NAME@ package
+# It defines the following variables. 
+# Specific to the pacakge @PROJECT_NAME@ itself:
+#  @PROJECT_NAME_UC@_ROOT_DIR_EXP - the root path of the installation providing this CMake file
+#
+
+###############################################################
+#  Copyright (C) 2007-2013  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  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.
+#
+#  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
+###############################################################
+
+### Initialisation performed by CONFIGURE_PACKAGE_CONFIG_FILE:
+@PACKAGE_INIT@
+
+
+# Package root dir:
+SET_AND_CHECK(PYHELLO_ROOT_DIR_EXP "@PACKAGE_CMAKE_INSTALL_PREFIX@")
+
+# Include directories
+SET_AND_CHECK(PYHELLO_INCLUDE_DIRS "${PYHELLO_ROOT_DIR_EXP}/@SALOME_INSTALL_HEADERS@")
+
+# Load the dependencies for the libraries of @PROJECT_NAME@ 
+# (contains definitions for IMPORTED targets). This is only 
+# imported if we are not built as a subproject (in this case targets are already there)
+IF(NOT TARGET SalomeIDLPYHELLO AND NOT @PROJECT_NAME@_BINARY_DIR)
+  INCLUDE("${PYHELLO_ROOT_DIR_EXP}/${SALOME_INSTALL_CMAKE_LOCAL}/SalomePYHELLOTargets.cmake")
+ENDIF()   
+
+#### Now the specificities
+
+# Options exported by the package:
+#SET(SALOME_BUILD_TESTS @SALOME_BUILD_TESTS@)
+SET(SALOME_BUILD_DOC   @SALOME_BUILD_DOC@)
+
+# Level 1 prerequisites:
+SET_AND_CHECK(GUI_ROOT_DIR_EXP "@PACKAGE_GUI_ROOT_DIR@")
+
+# For all prerequisites, load the corresponding targets if the package was used 
+# in CONFIG mode. This ensures dependent projects link correctly
+# without having to set LD_LIBRARY_PATH:
+SET(_PREREQ)
+SET(_PREREQ_CONFIG_DIR)
+LIST(LENGTH _PREREQ_CONFIG_DIR _list_len)
+# Another CMake stupidity - FOREACH(... RANGE r) generates r+1 numbers ...
+MATH(EXPR _range "${_list_len}-1")
+FOREACH(_p RANGE ${_range})  
+  LIST(GET _PREREQ            ${_p} _pkg    )
+  LIST(GET _PREREQ_CONFIG_DIR ${_p} _pkg_dir)
+  IF(_pkg_dir)
+     MESSAGE(STATUS "===> Reloading targets from ${_pkg} ...")
+     FIND_PACKAGE(${_pkg} REQUIRED NO_MODULE 
+          PATHS "${_pkg_dir}" 
+          NO_DEFAULT_PATH)
+  ENDIF()
+ENDFOREACH()
+
+# Installation directories
+SET(SALOME_INSTALL_BINS "@SALOME_INSTALL_BINS@")
+SET(SALOME_INSTALL_LIBS "@SALOME_INSTALL_LIBS@")
+SET(SALOME_INSTALL_IDLS "@SALOME_INSTALL_IDLS@")
+SET(SALOME_INSTALL_HEADERS "@SALOME_INSTALL_HEADERS@")
+SET(SALOME_INSTALL_SCRIPT_SCRIPTS "@SALOME_INSTALL_SCRIPT_SCRIPTS@")
+SET(SALOME_INSTALL_SCRIPT_DATA "@SALOME_INSTALL_SCRIPT_DATA@")
+SET(SALOME_INSTALL_SCRIPT_PYTHON "@SALOME_INSTALL_SCRIPT_PYTHON@")
+SET(SALOME_INSTALL_APPLISKEL_SCRIPTS "@SALOME_INSTALL_APPLISKEL_SCRIPTS@")
+SET(SALOME_INSTALL_APPLISKEL_PYTHON "@SALOME_INSTALL_APPLISKEL_PYTHON@") 
+SET(SALOME_INSTALL_CMAKE_LOCAL "@SALOME_INSTALL_CMAKE_LOCAL@")
+SET(SALOME_INSTALL_PYTHON "@SALOME_INSTALL_PYTHON@")
+SET(SALOME_INSTALL_PYTHON_SHARED "@SALOME_INSTALL_PYTHON_SHARED@")
+SET(SALOME_INSTALL_RES "@SALOME_INSTALL_RES@")
+SET(SALOME_INSTALL_DOC "@SALOME_INSTALL_DOC@")
+SET(SALOME_INSTALL_AMCONFIG_LOCAL "@SALOME_INSTALL_AMCONFIG_LOCAL@")
+
+# Include GUI targets if they were not already loaded:
+IF(NOT (TARGET Event)) 
+  INCLUDE("${GUI_ROOT_DIR_EXP}/${SALOME_INSTALL_CMAKE}/SalomeGUITargets.cmake")
+ENDIF()
+
+# Exposed PYHELLO targets:
+SET(PYHELLO_SalomeIDLPYHELLO SalomeIDLPYHELLO)
\ No newline at end of file
index c488036a789ed8a5144b95b60bb8295fcfe0a1d9..4091377c2392b15e5c11f13d30b5a6843c7f7f31 100755 (executable)
@@ -23,7 +23,6 @@
 
 # These files are data, module or lib files
 SET(_adm_data
-  FindPYHELLO.cmake
   FindSalomePYHELLO.cmake
 )
 INSTALL(FILES ${_adm_data} DESTINATION ${SALOME_INSTALL_CMAKE_LOCAL})
diff --git a/adm_local/cmake_files/FindPYHELLO.cmake b/adm_local/cmake_files/FindPYHELLO.cmake
deleted file mode 100644 (file)
index 73f4174..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-# Copyright (C) 2007-2013  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# 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.
-#
-# 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
-#
-#
-
-SET(PYHELLO_CXXFLAGS -I${PYHELLO_ROOT_DIR}/include/salome) # to be removed
-SET(PYHELLO_INCLUDE_DIRS ${PYHELLO_ROOT_DIR}/include/salome)
-
-FIND_LIBRARY(PYHELLO_SalomeIDLPYHELLO SalomeIDLPYHELLO ${PYHELLO_ROOT_DIR}/lib/salome)
\ No newline at end of file
diff --git a/adm_local/cmake_files/SalomePYHELLOConfig.cmake.in b/adm_local/cmake_files/SalomePYHELLOConfig.cmake.in
deleted file mode 100644 (file)
index 5cf7ad4..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-# - Config file for the @PROJECT_NAME@ package
-# It defines the following variables. 
-# Specific to the pacakge @PROJECT_NAME@ itself:
-#  @PROJECT_NAME_UC@_ROOT_DIR_EXP - the root path of the installation providing this CMake file
-#
-
-###############################################################
-#  Copyright (C) 2007-2013  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-#
-#  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.
-#
-#  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
-###############################################################
-
-### Initialisation performed by CONFIGURE_PACKAGE_CONFIG_FILE:
-@PACKAGE_INIT@
-
-
-# Package root dir:
-SET_AND_CHECK(PYHELLO_ROOT_DIR_EXP "@PACKAGE_CMAKE_INSTALL_PREFIX@")
-
-# Include directories
-SET_AND_CHECK(PYHELLO_INCLUDE_DIRS "${PYHELLO_ROOT_DIR_EXP}/@SALOME_INSTALL_HEADERS@")
-
-# Load the dependencies for the libraries of @PROJECT_NAME@ 
-# (contains definitions for IMPORTED targets). This is only 
-# imported if we are not built as a subproject (in this case targets are already there)
-IF(NOT TARGET SalomeIDLPYHELLO AND NOT @PROJECT_NAME@_BINARY_DIR)
-  INCLUDE("${PYHELLO_ROOT_DIR_EXP}/${SALOME_INSTALL_CMAKE_LOCAL}/SalomePYHELLOTargets.cmake")
-ENDIF()   
-
-#### Now the specificities
-
-# Options exported by the package:
-#SET(SALOME_BUILD_TESTS @SALOME_BUILD_TESTS@)
-SET(SALOME_BUILD_DOC   @SALOME_BUILD_DOC@)
-
-# Level 1 prerequisites:
-SET_AND_CHECK(GUI_ROOT_DIR_EXP "@PACKAGE_GUI_ROOT_DIR@")
-
-# For all prerequisites, load the corresponding targets if the package was used 
-# in CONFIG mode. This ensures dependent projects link correctly
-# without having to set LD_LIBRARY_PATH:
-SET(_PREREQ)
-SET(_PREREQ_CONFIG_DIR)
-LIST(LENGTH _PREREQ_CONFIG_DIR _list_len)
-# Another CMake stupidity - FOREACH(... RANGE r) generates r+1 numbers ...
-MATH(EXPR _range "${_list_len}-1")
-FOREACH(_p RANGE ${_range})  
-  LIST(GET _PREREQ            ${_p} _pkg    )
-  LIST(GET _PREREQ_CONFIG_DIR ${_p} _pkg_dir)
-  IF(_pkg_dir)
-     MESSAGE(STATUS "===> Reloading targets from ${_pkg} ...")
-     FIND_PACKAGE(${_pkg} REQUIRED NO_MODULE 
-          PATHS "${_pkg_dir}" 
-          NO_DEFAULT_PATH)
-  ENDIF()
-ENDFOREACH()
-
-# Installation directories
-SET(SALOME_INSTALL_BINS "@SALOME_INSTALL_BINS@")
-SET(SALOME_INSTALL_LIBS "@SALOME_INSTALL_LIBS@")
-SET(SALOME_INSTALL_IDLS "@SALOME_INSTALL_IDLS@")
-SET(SALOME_INSTALL_HEADERS "@SALOME_INSTALL_HEADERS@")
-SET(SALOME_INSTALL_SCRIPT_SCRIPTS "@SALOME_INSTALL_SCRIPT_SCRIPTS@")
-SET(SALOME_INSTALL_SCRIPT_DATA "@SALOME_INSTALL_SCRIPT_DATA@")
-SET(SALOME_INSTALL_SCRIPT_PYTHON "@SALOME_INSTALL_SCRIPT_PYTHON@")
-SET(SALOME_INSTALL_APPLISKEL_SCRIPTS "@SALOME_INSTALL_APPLISKEL_SCRIPTS@")
-SET(SALOME_INSTALL_APPLISKEL_PYTHON "@SALOME_INSTALL_APPLISKEL_PYTHON@") 
-SET(SALOME_INSTALL_CMAKE_LOCAL "@SALOME_INSTALL_CMAKE_LOCAL@")
-SET(SALOME_INSTALL_PYTHON "@SALOME_INSTALL_PYTHON@")
-SET(SALOME_INSTALL_PYTHON_SHARED "@SALOME_INSTALL_PYTHON_SHARED@")
-SET(SALOME_INSTALL_RES "@SALOME_INSTALL_RES@")
-SET(SALOME_INSTALL_DOC "@SALOME_INSTALL_DOC@")
-SET(SALOME_INSTALL_AMCONFIG_LOCAL "@SALOME_INSTALL_AMCONFIG_LOCAL@")
-
-# Include GUI targets if they were not already loaded:
-IF(NOT (TARGET Event)) 
-  INCLUDE("${GUI_ROOT_DIR_EXP}/${SALOME_INSTALL_CMAKE}/SalomeGUITargets.cmake")
-ENDIF()
-
-# Exposed PYHELLO targets:
-SET(PYHELLO_SalomeIDLPYHELLO SalomeIDLPYHELLO)
\ No newline at end of file