From 30692c08e0ae9c88670e56997c1f0dbce7ca99b7 Mon Sep 17 00:00:00 2001 From: ana Date: Mon, 8 Oct 2012 08:09:05 +0000 Subject: [PATCH] CMake: fix importError during runSalome on win32 >>"ImportError: No module named SalomePyQt" --- src/SALOME_PY/CMakeLists.txt | 7 +++++++ src/SALOME_PYQT/SalomePyQt/CMakeLists.txt | 17 +++++++++-------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/SALOME_PY/CMakeLists.txt b/src/SALOME_PY/CMakeLists.txt index 60694b899..8322d0186 100755 --- a/src/SALOME_PY/CMakeLists.txt +++ b/src/SALOME_PY/CMakeLists.txt @@ -56,3 +56,10 @@ SET_TARGET_PROPERTIES(SalomePy PROPERTIES COMPILE_FLAGS "${COMMON_FLAGS}") TARGET_LINK_LIBRARIES(SalomePy ${COMMON_LIBS}) INSTALL(TARGETS SalomePy DESTINATION ${GUI_salomelib_LIBS}) +IF(WINDOWS) + IF(CMAKE_BUILD_TYPE STREQUAL Release) + INSTALL(FILES ${CMAKE_INSTALL_PREFIX}/${GUI_salomelib_LIBS}/SalomePy.dll DESTINATION ${GUI_salomelib_LIBS} RENAME libSalomePy.pyd) + ELSE(CMAKE_BUILD_TYPE STREQUAL Release) + INSTALL(FILES ${CMAKE_INSTALL_PREFIX}/${GUI_salomelib_LIBS}/SalomePy.dll DESTINATION ${GUI_salomelib_LIBS} RENAME libSalomePy_d.pyd) + ENDIF(CMAKE_BUILD_TYPE STREQUAL Release) +ENDIF(WINDOWS) diff --git a/src/SALOME_PYQT/SalomePyQt/CMakeLists.txt b/src/SALOME_PYQT/SalomePyQt/CMakeLists.txt index f9b76003f..5d5ab7292 100755 --- a/src/SALOME_PYQT/SalomePyQt/CMakeLists.txt +++ b/src/SALOME_PYQT/SalomePyQt/CMakeLists.txt @@ -103,11 +103,12 @@ SET_TARGET_PROPERTIES(SalomePyQt PROPERTIES COMPILE_FLAGS "${COMMON_FLAGS}") TARGET_LINK_LIBRARIES(SalomePyQt ${COMMON_LIBS}) INSTALL(TARGETS SalomePyQt DESTINATION ${GUI_salomelib_LIBS}) -IF(NOT WINDOWS) - ADD_CUSTOM_COMMAND(TARGET SalomePyQt - POST_BUILD - COMMAND ln -sf libSalomePyQt.so SalomePyQt.so - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} - ) - INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/SalomePyQt.so DESTINATION ${GUI_salomelib_LIBS}) -ENDIF(NOT WINDOWS) +IF(WINDOWS) + IF(CMAKE_BUILD_TYPE STREQUAL Release) + INSTALL(FILES ${CMAKE_INSTALL_PREFIX}/${GUI_salomelib_LIBS}/SalomePyQt.dll DESTINATION ${GUI_salomelib_LIBS} RENAME SalomePyQt.pyd) + ELSE(CMAKE_BUILD_TYPE STREQUAL Release) + INSTALL(FILES ${CMAKE_INSTALL_PREFIX}/${GUI_salomelib_LIBS}/SalomePyQt.dll DESTINATION ${GUI_salomelib_LIBS} RENAME SalomePyQt_d.pyd) + ENDIF(CMAKE_BUILD_TYPE STREQUAL Release) +ELSE(WINDOWS) + INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/libSalomePyQt.so DESTINATION ${GUI_salomelib_LIBS} RENAME SalomePyQt.so) +ENDIF(WINDOWS) -- 2.39.2