From 083a30b9433e4ce94875b26e5aa552b89f1972fb Mon Sep 17 00:00:00 2001 From: vsr Date: Wed, 21 Aug 2013 06:51:13 +0000 Subject: [PATCH] CMake build procedure improvements: - minor general improvements --- salome_adm/cmake_files/SalomeMacros.cmake | 15 ++++++++++----- .../DSC_User/Datastream/Calcium/CMakeLists.txt | 6 +++--- src/KERNEL_PY/kernel/CMakeLists.txt | 6 +++--- src/ModuleGenerator/CMakeLists.txt | 2 +- 4 files changed, 17 insertions(+), 12 deletions(-) diff --git a/salome_adm/cmake_files/SalomeMacros.cmake b/salome_adm/cmake_files/SalomeMacros.cmake index 609566acf..be1631cc9 100755 --- a/salome_adm/cmake_files/SalomeMacros.cmake +++ b/salome_adm/cmake_files/SalomeMacros.cmake @@ -111,14 +111,19 @@ MACRO(SALOME_INSTALL_SCRIPTS file_list path) ENDIF(NOT SALOME_INSTALL_SCRIPTS_DEF_PERMS) FOREACH(file ${file_list}) SET(PREFIX "") - IF(SALOME_INSTALL_SCRIPTS_WORKING_DIRECTORY) - SET(PREFIX "${SALOME_INSTALL_SCRIPTS_WORKING_DIRECTORY}/") - ENDIF(SALOME_INSTALL_SCRIPTS_WORKING_DIRECTORY) + IF(IS_ABSOLUTE ${file}) + GET_FILENAME_COMPONENT(file_name ${file} NAME) + ELSE() + SET(file_name ${file}) + IF(SALOME_INSTALL_SCRIPTS_WORKING_DIRECTORY) + SET(PREFIX "${SALOME_INSTALL_SCRIPTS_WORKING_DIRECTORY}/") + ENDIF(SALOME_INSTALL_SCRIPTS_WORKING_DIRECTORY) + ENDIF(IS_ABSOLUTE ${file}) INSTALL(FILES ${PREFIX}${file} DESTINATION ${path} PERMISSIONS ${PERMS}) GET_FILENAME_COMPONENT(ext ${file} EXT) IF(ext STREQUAL .py) - INSTALL(CODE "MESSAGE(STATUS \"py compiling ${CMAKE_INSTALL_PREFIX}/${path}/${file}\")") - INSTALL(CODE "SET(CMD \"import py_compile ; py_compile.compile('${CMAKE_INSTALL_PREFIX}/${path}/${file}')\")") + INSTALL(CODE "MESSAGE(STATUS \"py compiling ${CMAKE_INSTALL_PREFIX}/${path}/${file_name}\")") + INSTALL(CODE "SET(CMD \"import py_compile ; py_compile.compile('${CMAKE_INSTALL_PREFIX}/${path}/${file_name}')\")") INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c \"\${CMD}\")") INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -O -c \"\${CMD}\")") ENDIF(ext STREQUAL .py) diff --git a/src/DSC/DSC_User/Datastream/Calcium/CMakeLists.txt b/src/DSC/DSC_User/Datastream/Calcium/CMakeLists.txt index 3fc1c2b10..e641c2ea0 100755 --- a/src/DSC/DSC_User/Datastream/Calcium/CMakeLists.txt +++ b/src/DSC/DSC_User/Datastream/Calcium/CMakeLists.txt @@ -73,9 +73,9 @@ INSTALL(TARGETS CalciumC EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_ ADD_EXECUTABLE(test_DataIdContainer_Calcium test_DataIdContainer.cxx) TARGET_LINK_LIBRARIES(test_DataIdContainer_Calcium SalomeDSCSuperv SalomeContainer SalomeCalcium OpUtil SALOMELocalTrace ${OMNIORB_LIBRARIES} ${PLATFORM_LIBS}) -CONFIGURE_FILE(calcium_integer_port_uses.hxx.in calcium_integer_port_uses.hxx @ONLY) -CONFIGURE_FILE(CalciumProvidesPort.hxx.in CalciumProvidesPort.hxx @ONLY) -CONFIGURE_FILE(CalciumFortranInt.h.in CalciumFortranInt.h @ONLY) +SALOME_CONFIGURE_FILE(calcium_integer_port_uses.hxx.in calcium_integer_port_uses.hxx) +SALOME_CONFIGURE_FILE(CalciumProvidesPort.hxx.in CalciumProvidesPort.hxx) +SALOME_CONFIGURE_FILE(CalciumFortranInt.h.in CalciumFortranInt.h) SET(COMMON_HEADERS Calcium.hxx diff --git a/src/KERNEL_PY/kernel/CMakeLists.txt b/src/KERNEL_PY/kernel/CMakeLists.txt index 8689aa9b9..ec20d0ecd 100755 --- a/src/KERNEL_PY/kernel/CMakeLists.txt +++ b/src/KERNEL_PY/kernel/CMakeLists.txt @@ -19,8 +19,8 @@ ADD_SUBDIRECTORY(parametric) -CONFIGURE_FILE(logconfig.py.in logconfig.py @ONLY) -CONFIGURE_FILE(kernelpy_autotest.sh.in kernelpy_autotest.sh @ONLY) +SALOME_CONFIGURE_FILE(logconfig.py.in logconfig.py) +SALOME_CONFIGURE_FILE(kernelpy_autotest.sh.in kernelpy_autotest.sh) # This first set of modules could be used in any context, you just # have to get a python environement. @@ -46,4 +46,4 @@ SET(mypkgpython_PYTHON services.py ) SALOME_INSTALL_SCRIPTS("${mypkgpython_PYTHON}" ${SALOME_INSTALL_PYTHON}/salome/kernel) -INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/logconfig.py DESTINATION ${SALOME_INSTALL_PYTHON}/salome/kernel) \ No newline at end of file +SALOME_INSTALL_SCRIPTS(${CMAKE_CURRENT_BINARY_DIR}/logconfig.py ${SALOME_INSTALL_PYTHON}/salome/kernel) \ No newline at end of file diff --git a/src/ModuleGenerator/CMakeLists.txt b/src/ModuleGenerator/CMakeLists.txt index d8813bd30..3707cd37a 100755 --- a/src/ModuleGenerator/CMakeLists.txt +++ b/src/ModuleGenerator/CMakeLists.txt @@ -17,7 +17,7 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -CONFIGURE_FILE(testIDLparser.in testIDLparser @ONLY) +SALOME_CONFIGURE_FILE(testIDLparser.in testIDLparser) # =============================================================== # Files to be installed -- 2.39.2