From 9264071f299a453842a162a8fe9cbf7f364b8743 Mon Sep 17 00:00:00 2001 From: vsr Date: Tue, 19 Jul 2011 06:36:24 +0000 Subject: [PATCH] Merge from V6_3_1_WIN (Win32 porting) 19/07/2011 --- bin/killSalomeWithPort.py | 20 +++++++++++++------- bin/runSalome.py | 7 +++++-- salome_adm/cmake_files/FindBOOST.cmake | 16 +++++++++++++++- salome_adm/cmake_files/am2cmake.py | 15 ++++++++++++++- 4 files changed, 47 insertions(+), 11 deletions(-) diff --git a/bin/killSalomeWithPort.py b/bin/killSalomeWithPort.py index 99c092c1f..bcc148004 100755 --- a/bin/killSalomeWithPort.py +++ b/bin/killSalomeWithPort.py @@ -208,7 +208,7 @@ def killMyPort(port): try: if sys.platform == "win32": import win32pm - win32pm.killpid(int(pid),0) + win32pm.killpid(int(pid),0) else: os.kill(int(pid),signal.SIGKILL) pass @@ -265,13 +265,19 @@ def killNotifdAndClean(port): def killMyPortSpy(pid, port): dt = 1.0 while 1: - from os import kill - try: - kill(int(pid), 0) - except OSError, e: - if e.errno != 3: + if sys.platform == "win32": + from win32pm import killpid + if killpid(int(pid), 0) != 0: return - break + else: + from os import kill + try: + kill(int(pid), 0) + except OSError, e: + if e.errno != 3: + return + break + pass from time import sleep sleep(dt) pass diff --git a/bin/runSalome.py b/bin/runSalome.py index 62b19a4f4..e8dd6845c 100755 --- a/bin/runSalome.py +++ b/bin/runSalome.py @@ -984,8 +984,11 @@ def foreGround(clt, args): port = getPortNumber() # -- server = Server({}) - server.CMD = ["killSalomeWithPort.py", "--spy", "%s"%(os.getpid()), "%s"%(port)] - server.run() + if sys.platform == "win32": + server.CMD = [os.getenv("PYTHONBIN"), "-m", "killSalomeWithPort", "--spy", "%s"%(os.getpid()), "%s"%(port)] + else: + server.CMD = ["killSalomeWithPort.py", "--spy", "%s"%(os.getpid()), "%s"%(port)] + server.run() # os.system("killSalomeWithPort.py --spy %s %s &"%(os.getpid(), port)) # -- dt = 1.0 diff --git a/salome_adm/cmake_files/FindBOOST.cmake b/salome_adm/cmake_files/FindBOOST.cmake index de85bc5ae..cbdc974f7 100644 --- a/salome_adm/cmake_files/FindBOOST.cmake +++ b/salome_adm/cmake_files/FindBOOST.cmake @@ -105,7 +105,12 @@ IF(BOOST_STATUS) ENDIF(BOOST_ROOT_USER) ENDIF(BOOST_STATUS) - +IF(WINDOWS) + SET(BOOST_ENABLE_DLL 1) +ELSE(WINDOWS) + SET(BOOST_ENABLE_DLL 0) +ENDIF(WINDOWS) + IF(BOOST_STATUS) SET(BOOST_LIBS) FOREACH(name thread date_time signals filesystem system regex) @@ -116,10 +121,16 @@ IF(BOOST_STATUS) SET(EXTENSION) ENDIF(CMAKE_BUILD_TYPE STREQUAL Debug) SET(LIB_NAMES) + SET(STATIC_LIB_NAMES) FOREACH(version 1_35 1_38 1_42 1_46_1) SET(LIB_NAMES ${LIB_NAMES} boost_${name}-vc90-mt${EXTENSION}-${version}) + SET(STATIC_LIB_NAMES ${LIB_NAMES} libboost_${name}-vc90-mt${EXTENSION}-${version}) ENDFOREACH(version 1_35 1_38 1_42 1_46_1) FIND_LIBRARY(BOOST_LIB_${name} NAMES ${LIB_NAMES} PATHS ${BOOST_LIB_PATHS} ${BOOST_FIND_PATHS_OPTION}) + IF(NOT BOOST_LIB_${name}) + FIND_LIBRARY(BOOST_LIB_${name} NAMES ${STATIS_LIB_NAMES} PATHS ${BOOST_LIB_PATHS} ${BOOST_FIND_PATHS_OPTION}) + SET(BOOST_ENABLE_DLL 0) + ENDIF(NOT BOOST_LIB_${name}) ELSE(WINDOWS) FIND_LIBRARY(BOOST_LIB_${name} boost_${name} PATHS ${BOOST_LIB_PATHS} ${BOOST_FIND_PATHS_OPTION}) ENDIF(WINDOWS) @@ -137,6 +148,9 @@ ENDIF(BOOST_STATUS) IF(BOOST_STATUS) IF(WINDOWS) SET(BOOST_CPPFLAGS ${BOOST_CPPFLAGS} -DBOOST_DISABLE_ASSERTS) + IF(BOOST_ENABLE_DLL) + SET(BOOST_CPPFLAGS ${BOOST_CPPFLAGS} -DBOOST_ALL_DYN_LINK) + ENDIF(BOOST_ENABLE_DLL) ENDIF(WINDOWS) ELSE(BOOST_STATUS) IF(BOOST_IS_MANDATORY) diff --git a/salome_adm/cmake_files/am2cmake.py b/salome_adm/cmake_files/am2cmake.py index 9d10c2b20..703906ded 100644 --- a/salome_adm/cmake_files/am2cmake.py +++ b/salome_adm/cmake_files/am2cmake.py @@ -817,6 +817,13 @@ class CMakeFile(object): SET(AM_CXXFLAGS ${AM_CXXFLAGS} -DWITH_SMESH_CANCEL_COMPUTE) ''') pass + if self.module == "ghs3dplugin": + # TODO: Auto-detect TetGen-GHS3D version automatically + newlines.append(r''' + SET(AM_CPPFLAGS ${AM_CPPFLAGS} -DGHS3D_VERSION=42) + SET(AM_CXXFLAGS ${AM_CXXFLAGS} -DGHS3D_VERSION=42) + ''') + pass if self.module == "hxx2salome": key = "_SRC" if self.the_root[-len(key):] != key: @@ -1072,6 +1079,10 @@ class CMakeFile(object): ) ''') self.files.append("static/header.html.in") + + if mod in ['geom', 'smesh', 'visu'] and self.root[-len(mod):] == mod.upper(): + self.files.append("static/header_py.html.in") + if self.module == "yacs": key = "salomegui" if self.root[-len(key):] == key: @@ -1122,7 +1133,7 @@ class CMakeFile(object): else: copytree_src = "$ENV{KERNEL_ROOT_DIR}/salome_adm/cmake_files" str = "import re \nimport sys \noutfile = open(sys.argv[1], 'wb') \nfor line in open(sys.argv[2], 'rb').readlines():" - str += "\n if re.match('class '+sys.argv[3]+'DC', line): \n continue \n line = re.sub(r'^\s+\#', '#', line) \n line = re.sub(r'^\s+def', 'def', line) \n line = re.sub(sys.argv[3]+'DC', sys.argv[3], line)" + str += "\n if re.match('class '+sys.argv[3]+'DC', line): \n continue \n line = re.sub(r'^\\\\s+\#', '#', line) \n line = re.sub(r'^\\\\s+def', 'def', line) \n line = re.sub(sys.argv[3]+'DC', sys.argv[3], line)" str += "\n outfile.write(line) \noutfile.close()" if mod in ['kernel', 'gui'] and self.root[-len('gui'):] == 'gui' or mod == 'med' and operator.contains(self.root, 'doxygen'): @@ -1665,6 +1676,8 @@ class CMakeFile(object): SET(targets ${targets} MEDEngine) SET(targets ${targets} SMESHEngine) SET(targets ${targets} SMESH) + SET(targets ${targets} StdMeshersEngine) + SET(targets ${targets} VISUEngineImpl) FOREACH(target ${targets}) IF(name STREQUAL ${target}) SET(var ${var} -DNOGDI) -- 2.39.2