From b6113571b7ba6968f25f2afb380ec73b03d7f576 Mon Sep 17 00:00:00 2001 From: Paul RASCLE Date: Wed, 20 Mar 2019 15:43:09 +0100 Subject: [PATCH] redispatch ADAO files between tool and module --- CMakeLists.txt | 42 +++++++++++++++---------------- bin/CMakeLists.txt | 2 +- resources/CMakeLists.txt | 6 ++++- resources/SalomeApp.xml | 6 ++--- src/CMakeLists.txt | 8 +++--- src/daComposant/CMakeLists.txt | 2 +- src/daEficas/CMakeLists.txt | 2 +- src/daSalome/CMakeLists.txt | 6 ++++- src/daSalome/daGUI/CMakeLists.txt | 15 ++++++++--- 9 files changed, 52 insertions(+), 37 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a791c12..68ff208 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -44,28 +44,33 @@ set(ADAO_RES "share/salome/resources/adao") set(ADAO_BIN "bin/salome") set(ADAO_BIN_TEST "bin/salome/test") +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() + if(ADAO_PYTHON_MODULE) + + if(ADAO_BUILD_DOC) + find_package(SalomeSphinx) + if(NOT SPHINX_FOUND) + message(FATAL_ERROR "Sphinx has not been found !") + endif(NOT SPHINX_FOUND) + endif(ADAO_BUILD_DOC) add_subdirectory(src) + add_subdirectory(resources) + add_subdirectory(bin) + add_subdirectory(test) + add_subdirectory(i18n) + add_subdirectory(doc) else(ADAO_PYTHON_MODULE) # ADAO_SALOME_MODULE - 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) - - if(ADAO_BUILD_DOC) - find_package(SalomeSphinx) - if(NOT SPHINX_FOUND) - message(FATAL_ERROR "Sphinx has not been found !") - endif(NOT SPHINX_FOUND) - endif(ADAO_BUILD_DOC) - - else() - message(FATAL_ERROR "We absolutely need the Salome CMake configuration files, please define CONFIGURATION_ROOT_DIR !") - endif() find_package(SalomeOmniORB REQUIRED) find_package(SalomeOmniORBPy REQUIRED) @@ -75,7 +80,7 @@ else(ADAO_PYTHON_MODULE) if(NOT ADAO_PYTHON_ROOT_DIR) message(FATAL_ERROR "ADAO_PYTHON_ROOT_DIR cmake variable has to be set if ADAO_SALOME_MODULE option is ON.") endif(NOT ADAO_PYTHON_ROOT_DIR) - find_file(FILE_OF_ADAO_PYTHON_MODULE "daCore/__init__.py" PATHS "${ADAO_PYTHON_ROOT_DIR}/${ADAO_SCRIPT_PYTHON_SALOME}/adao") + find_file(FILE_OF_ADAO_PYTHON_MODULE "daCore/__init__.py" PATHS "${ADAO_PYTHON_ROOT_DIR}/${ADAO_SCRIPT_PYTHON}/adao") if(NOT FILE_OF_ADAO_PYTHON_MODULE) message(FATAL_ERROR "Could not locate daCore/__init__.py into specified ADAO_PYTHON_ROOT_DIR directory ! Sounds bad !") endif(NOT FILE_OF_ADAO_PYTHON_MODULE) @@ -93,10 +98,5 @@ else(ADAO_PYTHON_MODULE) add_subdirectory(src) add_subdirectory(idl) add_subdirectory(resources) - add_subdirectory(bin) - add_subdirectory(examples) - add_subdirectory(test) - add_subdirectory(i18n) - add_subdirectory(doc) endif(ADAO_PYTHON_MODULE) diff --git a/bin/CMakeLists.txt b/bin/CMakeLists.txt index 7e2fcc6..54cce6a 100644 --- a/bin/CMakeLists.txt +++ b/bin/CMakeLists.txt @@ -29,4 +29,4 @@ set(ENV{PYTHONPATH} \${CATA_ADD_PYTHONPATH}:\$ENV{PYTHONPATH}) EXECUTE_PROCESS(COMMAND \${PY_EXE_CATA} \${ADAO_CATA_GEN_FILE} \${OUTPUT_DIR} ADAO_Cata_V0.py) ENDMACRO(GENERATE_EFICAS_CATA_FOR_ADAO)" ) -INSTALL(CODE "GENERATE_EFICAS_CATA_FOR_ADAO( \"${PYTHON_EXECUTABLE}\" \"${CMAKE_CURRENT_SOURCE_DIR}/AdaoCatalogGenerator.py\" \"${CMAKE_INSTALL_PREFIX}/${ADAO_SCRIPT_PYTHON_SALOME}/adao/daEficas\" \"${CMAKE_INSTALL_PREFIX}/${ADAO_SCRIPT_PYTHON_SALOME}:${ADAO_PYTHON_ROOT_DIR}/${ADAO_SCRIPT_PYTHON}\" )") +INSTALL(CODE "GENERATE_EFICAS_CATA_FOR_ADAO( \"${PYTHON_EXECUTABLE}\" \"${CMAKE_CURRENT_SOURCE_DIR}/AdaoCatalogGenerator.py\" \"${CMAKE_INSTALL_PREFIX}/${ADAO_SCRIPT_PYTHON}/adao/daEficas\" \"${CMAKE_INSTALL_PREFIX}/${ADAO_SCRIPT_PYTHON}\" )") diff --git a/resources/CMakeLists.txt b/resources/CMakeLists.txt index c815e77..b5845b2 100644 --- a/resources/CMakeLists.txt +++ b/resources/CMakeLists.txt @@ -18,4 +18,8 @@ # # Author: Anthony Geay, anthony.geay@edf.fr, EDF R&D -install(FILES ADAOCatalog.xml ADAOSchemaCatalog.xml SalomeApp.xml DESTINATION ${ADAO_RES}) +if(ADAO_SALOME_MODULE) + install(FILES SalomeApp.xml DESTINATION ${ADAO_RES}) +else(ADAO_SALOME_MODULE) + install(FILES ADAOCatalog.xml ADAOSchemaCatalog.xml DESTINATION ${ADAO_RES}) +endif(ADAO_SALOME_MODULE) diff --git a/resources/SalomeApp.xml b/resources/SalomeApp.xml index 06f1013..9ec5610 100644 --- a/resources/SalomeApp.xml +++ b/resources/SalomeApp.xml @@ -32,10 +32,10 @@
- +
- - + +
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0d7714c..0d7263a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -20,14 +20,14 @@ if(ADAO_SALOME_MODULE) - install(FILES daSalome/adaoBuilder.py daSalome/__init__.py DESTINATION "${ADAO_SCRIPT_PYTHON_SALOME}/adao") - add_subdirectory(daComposant) + #install(FILES daSalome/adaoBuilder.py daSalome/__init__.py DESTINATION "${ADAO_SCRIPT_PYTHON_SALOME}/adao") add_subdirectory(daSalome) - add_subdirectory(daEficas) else(ADAO_SALOME_MODULE) - install(FILES daSalome/adaoBuilder.py daSalome/__init__.py DESTINATION "${ADAO_SCRIPT_PYTHON_SALOME}/adao") + #install(FILES daSalome/adaoBuilder.py daSalome/__init__.py DESTINATION "${ADAO_SCRIPT_PYTHON_SALOME}/adao") + add_subdirectory(daSalome) add_subdirectory(daComposant) + add_subdirectory(daEficas) endif(ADAO_SALOME_MODULE) diff --git a/src/daComposant/CMakeLists.txt b/src/daComposant/CMakeLists.txt index 9e076b4..8d41f37 100644 --- a/src/daComposant/CMakeLists.txt +++ b/src/daComposant/CMakeLists.txt @@ -18,4 +18,4 @@ # # Author: Anthony Geay, anthony.geay@edf.fr, EDF R&D -install(DIRECTORY daCore daAlgorithms daNumerics DESTINATION ${ADAO_SCRIPT_PYTHON_SALOME}/adao) +install(DIRECTORY daCore daAlgorithms daNumerics DESTINATION ${ADAO_SCRIPT_PYTHON}/adao) diff --git a/src/daEficas/CMakeLists.txt b/src/daEficas/CMakeLists.txt index d38a2a5..c5cb5aa 100644 --- a/src/daEficas/CMakeLists.txt +++ b/src/daEficas/CMakeLists.txt @@ -45,4 +45,4 @@ set(DAEFICAS_FILES traduitADAOV9_2_0ToV9_3_0.py ) -install(FILES ${DAEFICAS_FILES} DESTINATION "${ADAO_SCRIPT_PYTHON_SALOME}/adao/daEficas") +install(FILES ${DAEFICAS_FILES} DESTINATION "${ADAO_SCRIPT_PYTHON}/adao/daEficas") diff --git a/src/daSalome/CMakeLists.txt b/src/daSalome/CMakeLists.txt index 96080ab..c7e8dbd 100644 --- a/src/daSalome/CMakeLists.txt +++ b/src/daSalome/CMakeLists.txt @@ -20,4 +20,8 @@ add_subdirectory(daGUI) -install(DIRECTORY daYacsSchemaCreator daYacsIntegration DESTINATION "${ADAO_SCRIPT_PYTHON_SALOME}/adao") +if( NOT ADAO_SALOME_MODULE) + install(DIRECTORY daYacsSchemaCreator daYacsIntegration DESTINATION "${ADAO_SCRIPT_PYTHON}/adao") + install(FILES __init__.py adaoBuilder.py DESTINATION "${ADAO_SCRIPT_PYTHON}/adao") + +endif(ADAO_SALOME_MODULE) diff --git a/src/daSalome/daGUI/CMakeLists.txt b/src/daSalome/daGUI/CMakeLists.txt index 23373b1..fccd508 100644 --- a/src/daSalome/daGUI/CMakeLists.txt +++ b/src/daSalome/daGUI/CMakeLists.txt @@ -18,10 +18,17 @@ # # Author: Anthony Geay, anthony.geay@edf.fr, EDF R&D -install(FILES ADAOGUI.py ADAO.py DESTINATION ${ADAO_SCRIPT_PYTHON_SALOME}) +if(ADAO_SALOME_MODULE) -install(FILES daUtils/__init__.py daUtils/adaoEficasEvent.py daUtils/adaoLogger.py daUtils/enumerate.py DESTINATION "${ADAO_SCRIPT_PYTHON_SALOME}/adao/daUtils") + install(FILES ADAOGUI.py ADAO.py DESTINATION ${ADAO_SCRIPT_PYTHON_SALOME}) + +else(ADAO_SALOME_MODULE) -install(FILES daGuiImpl/__init__.py daGuiImpl/ADAOGUI_impl.py daGuiImpl/adaoGuiManager.py daGuiImpl/adaoGuiHelper.py daGuiImpl/adaoModuleHelper.py daGuiImpl/adaoStudyEditor.py daGuiImpl/adaoCase.py DESTINATION "${ADAO_SCRIPT_PYTHON_SALOME}/adao/daGuiImpl") + install(FILES daUtils/__init__.py daUtils/adaoEficasEvent.py daUtils/adaoLogger.py daUtils/enumerate.py DESTINATION "${ADAO_SCRIPT_PYTHON}/adao/daUtils") + + install(FILES daGuiImpl/__init__.py daGuiImpl/ADAOGUI_impl.py daGuiImpl/adaoGuiManager.py daGuiImpl/adaoGuiHelper.py daGuiImpl/adaoModuleHelper.py daGuiImpl/adaoStudyEditor.py daGuiImpl/adaoCase.py DESTINATION "${ADAO_SCRIPT_PYTHON}/adao/daGuiImpl") + + install(FILES daEficasWrapper/__init__.py daEficasWrapper/adaoEficasWrapper.py DESTINATION "${ADAO_SCRIPT_PYTHON}/adao/daEficasWrapper") + +endif(ADAO_SALOME_MODULE) -install(FILES daEficasWrapper/__init__.py daEficasWrapper/adaoEficasWrapper.py DESTINATION "${ADAO_SCRIPT_PYTHON_SALOME}/adao/daEficasWrapper") -- 2.39.2