]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Win32 compatibility
authorana <ana@opencascade.com>
Wed, 16 Apr 2014 12:31:00 +0000 (16:31 +0400)
committerana <ana@opencascade.com>
Wed, 16 Apr 2014 12:31:00 +0000 (16:31 +0400)
adm_local/cmake_files/FindQwt.cmake
adm_local/cmake_files/UsePyQt4.cmake

index fb4f66adc543c4c07524316fa22e764676388189..f6130c2300d5ba34cd7f0e3998150de77880f1b2 100644 (file)
@@ -39,17 +39,15 @@ IF(WIN32)
   SET(QWT_DEFINITIONS "-DQWT_DLL")
   
   IF(CMAKE_BUILD_TYPE STREQUAL Debug)
-    FIND_LIBRARY(QWT_LIBRARY qwtd5)
-  ELSE()
-    FIND_LIBRARY(QWT_LIBRARY qwt5)
+    FIND_LIBRARY(QWT_LIBRARY qwtd)
   ENDIF()
 ELSE(WIN32)
   # Give precedence to qwt-qt4 library:
   FIND_LIBRARY(QWT_LIBRARY qwt-qt4 PATH_SUFFIXES lib lib64)
   FIND_LIBRARY(QWT_LIBRARY qwt-qt4)
   FIND_LIBRARY(QWT_LIBRARY qwt PATH_SUFFIXES lib lib64)
-  FIND_LIBRARY(QWT_LIBRARY qwt)
 ENDIF(WIN32)
+FIND_LIBRARY(QWT_LIBRARY qwt)
 
 INCLUDE(FindPackageHandleStandardArgs)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(Qwt REQUIRED_VARS QWT_INCLUDE_DIR QWT_LIBRARY)
index a6048af450bc1aa92c8903ee6050f569c52a987c..52a9742953ebbf3322e80edf0b679c8b6b224c07 100644 (file)
@@ -63,6 +63,9 @@ ENDFUNCTION()
 # 
 ####################################################################
 MACRO(PYQT4_WRAP_UIC outfiles)
+
+ IF(NOT WIN32)
+
   FOREACH(_input ${ARGN})
     GET_FILENAME_COMPONENT(_input_name ${_input} NAME)
     STRING(REPLACE ".ui" "_ui.py" _input_name ${_input_name})
@@ -76,6 +79,33 @@ MACRO(PYQT4_WRAP_UIC outfiles)
   ENDFOREACH()
   _PYQT4_WRAP_GET_UNIQUE_TARGET_NAME(BUILD_UI_PY_FILES _uniqueTargetName)
   ADD_CUSTOM_TARGET(${_uniqueTargetName} ALL DEPENDS ${${outfiles}})
+
+ ELSE(WIN32)
+####
+# ANA: Workaround for the Microsoft Visual Studio 2010. Seems there is a bug in 
+# the Microsoft Visual Studio 2010 or CMake 2.8.10.2: custom target doesn't work 
+# for the list of the dependencies. It works only for the first dependency in the 
+# list. So generate separate target for the each input file. This problem will be 
+#investigated in the future.
+####
+
+  SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON)
+  _PYQT4_WRAP_GET_UNIQUE_TARGET_NAME(BUILD_UI_PY_FILES _uniqueTargetName)
+  ADD_CUSTOM_TARGET(${_uniqueTargetName} ALL)
+  FOREACH(_input ${ARGN})
+    GET_FILENAME_COMPONENT(_input_name ${_input} NAME)
+    STRING(REPLACE ".ui" "_ui.py" _input_name ${_input_name})
+    SET(_output ${CMAKE_CURRENT_BINARY_DIR}/${_input_name})
+    _PYQT4_WRAP_GET_UNIQUE_TARGET_NAME(BUILD_UI_PY_FILES _TgName)
+    ADD_CUSTOM_TARGET(${_TgName} ${PYQT_PYUIC_PATH} -o ${_output} ${CMAKE_CURRENT_SOURCE_DIR}/${_input}
+      COMMENT ANA:${_output}
+      DEPENDS ${_input}
+      )
+    SET_TARGET_PROPERTIES(${_TgName} PROPERTIES FOLDER PYQT4_WRAP_UIC_TARGETS)
+    ADD_DEPENDENCIES(${_uniqueTargetName} DEPEND ${_TgName})
+    SET(${outfiles} ${${outfiles}} ${_output})
+  ENDFOREACH()
+ ENDIF(WIN32)
 ENDMACRO(PYQT4_WRAP_UIC)
 
 ####################################################################