From 76696150988f7ec8125bc44a53e32e0981ced631 Mon Sep 17 00:00:00 2001 From: vsr Date: Fri, 16 Aug 2013 09:14:00 +0000 Subject: [PATCH] Minor improvements --- CMakeLists.txt | 35 ++++++++----------- .../cmake_files/SalomeKERNELConfig.cmake.in | 1 - salome_adm/cmake_files/SalomeMacros.cmake | 24 +++++++++++++ 3 files changed, 38 insertions(+), 22 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5e62058e2..f4cfd56b9 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -132,8 +132,6 @@ SET(SALOME_INSTALL_APPLISKEL_SCRIPTS ${SALOME_INSTALL_BINS}/appliskel CACHE PATH SET(SALOME_INSTALL_APPLISKEL_PYTHON ${SALOME_INSTALL_BINS}/appliskel CACHE PATH "Install path: SALOME application skeleton - Python") SET(SALOME_INSTALL_CMAKE salome_adm/cmake_files CACHE PATH "Install path: SALOME CMake files") -SET(SALOME_INSTALL_CMAKE_LOCAL adm_local/cmake_files CACHE PATH - "Install path: local SALOME CMake files") SET(_pydir lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages) SET(SALOME_INSTALL_PYTHON ${_pydir}/salome CACHE PATH "Install path: SALOME Python stuff") @@ -148,7 +146,7 @@ SET(SALOME_KERNEL_INSTALL_RES_SCRIPTS "${SALOME_INSTALL_RES}/kernel" CACHE PATH MARK_AS_ADVANCED(SALOME_INSTALL_BINS SALOME_INSTALL_LIBS SALOME_INSTALL_IDLS SALOME_INSTALL_HEADERS) MARK_AS_ADVANCED(SALOME_INSTALL_SCRIPT_SCRIPTS SALOME_INSTALL_SCRIPT_DATA SALOME_INSTALL_SCRIPT_PYTHON) -MARK_AS_ADVANCED(SALOME_INSTALL_APPLISKEL_SCRIPTS SALOME_INSTALL_APPLISKEL_PYTHON SALOME_INSTALL_CMAKE SALOME_INSTALL_CMAKE_LOCAL SALOME_INSTALL_RES) +MARK_AS_ADVANCED(SALOME_INSTALL_APPLISKEL_SCRIPTS SALOME_INSTALL_APPLISKEL_PYTHON SALOME_INSTALL_CMAKE SALOME_INSTALL_RES) MARK_AS_ADVANCED(SALOME_INSTALL_PYTHON SALOME_INSTALL_PYTHON_SHARED SALOME_KERNEL_INSTALL_RES_DATA SALOME_KERNEL_INSTALL_RES_SCRIPTS) # Sources @@ -166,13 +164,8 @@ ENDIF() # Header configuration # ==================== -EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "import sys; t=sys.argv[-1].split(\".\") ; t[:]=(int(elt) for elt in t) ; sys.stdout.write(\"0x%02x%02x%02x\"%tuple(t))" ${${PROJECT_NAME_UC}_VERSION} - OUTPUT_VARIABLE ${PROJECT_NAME_UC}_XVERSION) -SET(input ${CMAKE_CURRENT_SOURCE_DIR}/KERNEL_version.h.in) -SET(output ${CMAKE_CURRENT_BINARY_DIR}/KERNEL_version.h) -MESSAGE(STATUS "Creation of ${output}") -CONFIGURE_FILE(${input} ${output} @ONLY) -INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/KERNEL_version.h DESTINATION ${SALOME_INSTALL_HEADERS}) +SALOME_XVERSION(${PROJECT_NAME}) +SALOME_CONFIGURE_FILE(KERNEL_version.h.in ${CMAKE_CURRENT_BINARY_DIR}/KERNEL_version.h INSTALL ${SALOME_INSTALL_HEADERS}) # Configuration export # ==================== @@ -231,18 +224,18 @@ CONFIGURE_PACKAGE_CONFIG_FILE(salome_adm/cmake_files/${PROJECT_NAME}Config.cmake PTHREAD_ROOT_DIR BOOST_ROOT_DIR HDF5_ROOT_DIR LIBXML2_ROOT_DIR PYTHON_ROOT_DIR SWIG_ROOT_DIR) -# - in the install tree: +# - in the install tree (VSR 16/08/2013: TEMPORARILY COMMENT THIS - TO REMOVE?): # Get the relative path of the include directory so # we can register it in the generated configuration files: -SET(CONF_INCLUDE_DIRS "${CMAKE_INSTALL_PREFIX}/${INSTALL_INCLUDE_DIR}") -CONFIGURE_PACKAGE_CONFIG_FILE(salome_adm/cmake_files/${PROJECT_NAME}Config.cmake.in - ${PROJECT_BINARY_DIR}/to_install/${PROJECT_NAME}Config.cmake - INSTALL_DESTINATION "${SALOME_INSTALL_CMAKE}" - PATH_VARS CONF_INCLUDE_DIRS SALOME_INSTALL_CMAKE CMAKE_INSTALL_PREFIX - CPPUNIT_ROOT_DIR GRAPHVIZ_ROOT_DIR DOXYGEN_ROOT_DIR - SPHINX_ROOT_DIR MPI_ROOT_DIR OMNIORB_ROOT_DIR OMNIORBPY_ROOT_DIR LIBBATCH_ROOT_DIR - PTHREAD_ROOT_DIR BOOST_ROOT_DIR HDF5_ROOT_DIR LIBXML2_ROOT_DIR - PYTHON_ROOT_DIR SWIG_ROOT_DIR) +#SET(CONF_INCLUDE_DIRS "${CMAKE_INSTALL_PREFIX}/${INSTALL_INCLUDE_DIR}") +#CONFIGURE_PACKAGE_CONFIG_FILE(salome_adm/cmake_files/${PROJECT_NAME}Config.cmake.in +# ${PROJECT_BINARY_DIR}/to_install/${PROJECT_NAME}Config.cmake +# INSTALL_DESTINATION "${SALOME_INSTALL_CMAKE}" +# PATH_VARS CONF_INCLUDE_DIRS SALOME_INSTALL_CMAKE CMAKE_INSTALL_PREFIX +# CPPUNIT_ROOT_DIR GRAPHVIZ_ROOT_DIR DOXYGEN_ROOT_DIR +# SPHINX_ROOT_DIR MPI_ROOT_DIR OMNIORB_ROOT_DIR OMNIORBPY_ROOT_DIR LIBBATCH_ROOT_DIR +# PTHREAD_ROOT_DIR BOOST_ROOT_DIR HDF5_ROOT_DIR LIBXML2_ROOT_DIR +# PYTHON_ROOT_DIR SWIG_ROOT_DIR) WRITE_BASIC_PACKAGE_VERSION_FILE(${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake VERSION ${${PROJECT_NAME_UC}_VERSION} @@ -250,7 +243,7 @@ WRITE_BASIC_PACKAGE_VERSION_FILE(${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVers # Install the CMake configuration files: INSTALL(FILES - "${PROJECT_BINARY_DIR}/to_install/${PROJECT_NAME}Config.cmake" + "${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake" "${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake" DESTINATION "${SALOME_INSTALL_CMAKE}") diff --git a/salome_adm/cmake_files/SalomeKERNELConfig.cmake.in b/salome_adm/cmake_files/SalomeKERNELConfig.cmake.in index 53844ac81..06cf8e3ef 100644 --- a/salome_adm/cmake_files/SalomeKERNELConfig.cmake.in +++ b/salome_adm/cmake_files/SalomeKERNELConfig.cmake.in @@ -117,7 +117,6 @@ 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 "@SALOME_INSTALL_CMAKE@") -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@") diff --git a/salome_adm/cmake_files/SalomeMacros.cmake b/salome_adm/cmake_files/SalomeMacros.cmake index 3498c355b..d26725b51 100755 --- a/salome_adm/cmake_files/SalomeMacros.cmake +++ b/salome_adm/cmake_files/SalomeMacros.cmake @@ -462,3 +462,27 @@ MACRO(SALOME_ADD_MPI_TO_HDF5) SET(HDF5_DEFINITIONS "${HDF5_DEFINITIONS} ${MPI_DEFINITIONS}") SET(HDF5_LIBRARIES ${HDF5_LIBRARIES} ${MPI_LIBRARIES}) ENDMACRO(SALOME_ADD_MPI_TO_HDF5) + +#################################################################### +# SALOME_XVERSION() +# +# Computes hexadecimal version of SALOME package +# +# USAGE: SALOME_XVERSION(package) +# +# ARGUMENTS: +# +# package: IN: SALOME package name +# +# The macro reads SALOME package version from PACKAGE_VERSION variable +# (note package name in uppercase as assumed for SALOME modules); +# hexadecimal version value in form 0xAABBCC (where AA, BB and CC are +# major, minor and maintenance components of package version in +# hexadecimal form) is put to the PACKAGE_XVERSION variable +MACRO(SALOME_XVERSION pkg) + STRING(TOUPPER ${pkg} _pkg_UC) + IF(${_pkg_UC}_VERSION) + EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "import sys; t=sys.argv[-1].split(\".\") ; t[:]=(int(elt) for elt in t) ; sys.stdout.write(\"0x%02x%02x%02x\"%tuple(t))" ${${_pkg_UC}_VERSION} + OUTPUT_VARIABLE ${_pkg_UC}_XVERSION) + ENDIF() +ENDMACRO(SALOME_XVERSION) -- 2.39.2