]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Preparation of the SALOME7.2.0 win32 version.
authorrnv <rnv@opencascade.com>
Mon, 24 Jun 2013 07:55:06 +0000 (07:55 +0000)
committerrnv <rnv@opencascade.com>
Mon, 24 Jun 2013 07:55:06 +0000 (07:55 +0000)
salome_adm/cmake_files/CMakeLists.txt
salome_adm/cmake_files/FindOMNIORB.cmake
salome_adm/cmake_files/FindPTHREAD.cmake [new file with mode: 0755]
salome_adm/cmake_files/FindSalomeHDF5.cmake
salome_adm/cmake_files/FindSalomeLIBBATCH.cmake
salome_adm/cmake_files/FindSalomePTHREAD.cmake [new file with mode: 0755]
salome_adm/cmake_files/FindSalomePYTHON.cmake
salome_adm/cmake_files/Makefile.am
salome_adm/cmake_files/UseOMNIORB.cmake

index 03e167cd0318980f27bef590e414fdbba11f6403..fa751a0bff2337c210cbb9267b57745c36dbe4f0 100755 (executable)
@@ -31,6 +31,7 @@ SET(DATA
   UseOMNIORB.cmake
   FindPLATFORM.cmake
   FindSPHINX.cmake
+  FindPTHREAD.cmake 
   FindSalomeBOOST.cmake
   FindSalomeCPPUNIT.cmake
   FindSalomeDOXYGEN.cmake
@@ -38,6 +39,7 @@ SET(DATA
   FindSalomeLIBBATCH.cmake
   FindSalomeLIBXML2.cmake
   FindSalomeMPI.cmake
+  FindSalomePTHREAD.cmake
   FindSalomePYTHON.cmake
   FindSalomeSPHINX.cmake
   FindSalomeSWIG.cmake
index 354ac157c2e4759329e14cc48e0f3d49ba948578..f3e9990f8e1062ce4da70e0326740b8b237aa6a0 100644 (file)
@@ -62,6 +62,15 @@ find_path(OMNIORB_INCLUDE_DIR omniORB4/CORBA.h
 
 find_path(OMNIORB_INCLUDE_DIR omniORB4/CORBA.h)
 
+IF(WIN32)
+  IF(CMAKE_BUILD_TYPE STREQUAL Release)
+    SET(OMNIORB_LIB_SUFFIX _rt)
+  ELSE(CMAKE_BUILD_TYPE STREQUAL Release)
+    SET(OMNIORB_LIB_SUFFIX _rtd)
+  ENDIF(CMAKE_BUILD_TYPE STREQUAL Release)
+ENDIF(WIN32)
+
+
 
 ##############################################################################
 # find libraries
@@ -69,12 +78,12 @@ find_path(OMNIORB_INCLUDE_DIR omniORB4/CORBA.h)
 if (WIN32)
   find_library(OMNIORB_LIBRARY_omniORB4
        NAMES
-       ${CMAKE_STATIC_LIBRARY_PREFIX}omniORB4${CMAKE_STATIC_LIBRARY_SUFFIX}
+       ${CMAKE_STATIC_LIBRARY_PREFIX}omniORB4${OMNIORB_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}
        PATHS ${OMNIORB_DIR}/lib/x86_win32 $ENV{OMNIORB_DIR}/lib/x86_win32
        NO_DEFAULT_PATH
   )
   find_library(OMNIORB_LIBRARY_omniORB4 NAMES
-    ${CMAKE_STATIC_LIBRARY_PREFIX}omniORB4${CMAKE_STATIC_LIBRARY_SUFFIX}
+    ${CMAKE_STATIC_LIBRARY_PREFIX}omniORB4$${OMNIORB_LIB_SUFFIX}{CMAKE_STATIC_LIBRARY_SUFFIX}
   )
 else (WIN32)
   find_library(OMNIORB_LIBRARY_omniORB4
@@ -89,14 +98,14 @@ endif (WIN32)
 if (WIN32)
   FIND_LIBRARY( OMNIORB_LIBRARY_omnithread
        NAMES
-       ${CMAKE_STATIC_LIBRARY_PREFIX}omnithread${CMAKE_STATIC_LIBRARY_SUFFIX}
+       ${CMAKE_STATIC_LIBRARY_PREFIX}omnithread${OMNIORB_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}
        PATHS ${OMNIORB_DIR}/lib/x86_win32 $ENV{OMNIORB_DIR}/lib/x86_win32
        NO_DEFAULT_PATH
   )
 
   FIND_LIBRARY( OMNIORB_LIBRARY_omnithread
        NAMES
-       ${CMAKE_STATIC_LIBRARY_PREFIX}omnithread${CMAKE_STATIC_LIBRARY_SUFFIX}
+       ${CMAKE_STATIC_LIBRARY_PREFIX}omnithread${OMNIORB_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}
   )
 else (WIN32)
   find_library(OMNIORB_LIBRARY_omnithread
@@ -112,14 +121,14 @@ endif (WIN32)
 if (WIN32)
   FIND_LIBRARY( OMNIORB_LIBRARY_omniDynamic4
     NAMES
-      ${CMAKE_STATIC_LIBRARY_PREFIX}omniDynamic4${CMAKE_STATIC_LIBRARY_SUFFIX}
+      ${CMAKE_STATIC_LIBRARY_PREFIX}omniDynamic4${OMNIORB_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}
     PATHS ${OMNIORB_DIR}/lib/x86_win32 $ENV{OMNIORB_DIR}/lib/x86_win32
     NO_DEFAULT_PATH
   )
 
   FIND_LIBRARY( OMNIORB_LIBRARY_omniDynamic4
     NAMES
-      ${CMAKE_STATIC_LIBRARY_PREFIX}omniDynamic4${CMAKE_STATIC_LIBRARY_SUFFIX}
+      ${CMAKE_STATIC_LIBRARY_PREFIX}omniDynamic4${OMNIORB_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}
   )
 else (WIN32)
   find_library(OMNIORB_LIBRARY_omniDynamic4
@@ -136,14 +145,14 @@ endif (WIN32)
 if (WIN32)
   FIND_LIBRARY( OMNIORB_LIBRARY_COS4
     NAMES
-      ${CMAKE_STATIC_LIBRARY_PREFIX}COS4${CMAKE_STATIC_LIBRARY_SUFFIX}
+      ${CMAKE_STATIC_LIBRARY_PREFIX}COS4${OMNIORB_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}
     PATHS ${OMNIORB_DIR}/lib/x86_win32 $ENV{OMNIORB_DIR}/lib/x86_win32
     NO_DEFAULT_PATH 
   )
 
   FIND_LIBRARY( OMNIORB_LIBRARY_COS4
     NAMES
-      ${CMAKE_STATIC_LIBRARY_PREFIX}COS4${CMAKE_STATIC_LIBRARY_SUFFIX}
+      ${CMAKE_STATIC_LIBRARY_PREFIX}COS4$${OMNIORB_LIB_SUFFIX}{CMAKE_STATIC_LIBRARY_SUFFIX}
   )
 else (WIN32)
   find_library(OMNIORB_LIBRARY_COS4
@@ -158,14 +167,14 @@ endif (WIN32)
 if (WIN32)
   FIND_LIBRARY( OMNIORB_LIBRARY_COSDynamic4
     NAMES
-      ${CMAKE_STATIC_LIBRARY_PREFIX}COSDynamic4${CMAKE_STATIC_LIBRARY_SUFFIX}
+      ${CMAKE_STATIC_LIBRARY_PREFIX}COSDynamic4${OMNIORB_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}
     PATHS ${OMNIORB_DIR}/lib/x86_win32 $ENV{OMNIORB_DIR}/lib/x86_win32
     NO_DEFAULT_PATH
   )
 
   FIND_LIBRARY( OMNIORB_LIBRARY_COSDynamic4
     NAMES
-      ${CMAKE_STATIC_LIBRARY_PREFIX}COSDynamic4${CMAKE_STATIC_LIBRARY_SUFFIX}
+      ${CMAKE_STATIC_LIBRARY_PREFIX}COSDynamic4${OMNIORB_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}
   )
 
 else (WIN32)
@@ -225,15 +234,20 @@ ENDIF (WIN32)
 ##############################################################################
 FIND_PATH( OMNIORB_PYTHON_BACKEND
   NAMES python.py
-  PATHS $ENV{OMNIORB_DIR}/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages/omniidl_be $ENV{OMNIORBPY_DIR}/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages/omniidl_be
+  PATHS $ENV{OMNIORB_DIR}/lib/python/omniidl_be
+        $ENV{OMNIORB_DIR}/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages/omniidl_be $ENV{OMNIORBPY_DIR}/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages/omniidl_be
         ${OMNIORB_DIR}/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages/omniidl_be ${OMNIORBPY_DIR}/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages/omniidl_be
   DOC "Path to python-backend directory (omniidl_be) including python.py file"
   NO_DEFAULT_PATH )
 
+IF (NOT OMNIORB_PYTHON_BACKEND)
 FIND_PATH( OMNIORB_PYTHON_BACKEND
   NAMES python.py
   PATHS /usr/lib/omniidl/omniidl_be
   DOC "Path to python-backend directory (omniidl_be) including python.py file" )
+ENDIF (NOT OMNIORB_PYTHON_BACKEND)
+
+
 ##############################################################################
 # cook our stuff
 ##############################################################################
diff --git a/salome_adm/cmake_files/FindPTHREAD.cmake b/salome_adm/cmake_files/FindPTHREAD.cmake
new file mode 100755 (executable)
index 0000000..7742111
--- /dev/null
@@ -0,0 +1,138 @@
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+# ------
+
+MESSAGE(STATUS "Check for pthreads ...")
+
+# ------
+
+IF(PTHREAD_IS_MANDATORY STREQUAL 0)
+  SET(PTHREAD_IS_MANDATORY 0)
+  SET(PTHREAD_IS_OPTIONAL 1)
+ENDIF(PTHREAD_IS_MANDATORY STREQUAL 0)
+IF(PTHREAD_IS_OPTIONAL STREQUAL 0)
+  SET(PTHREAD_IS_MANDATORY 1)
+  SET(PTHREAD_IS_OPTIONAL 0)
+ENDIF(PTHREAD_IS_OPTIONAL STREQUAL 0)
+IF(NOT PTHREAD_IS_MANDATORY AND NOT PTHREAD_IS_OPTIONAL)
+  SET(PTHREAD_IS_MANDATORY 1)
+  SET(PTHREAD_IS_OPTIONAL 0)
+ENDIF(NOT PTHREAD_IS_MANDATORY AND NOT PTHREAD_IS_OPTIONAL)
+
+# ------
+
+SET(PTHREAD_STATUS 1)
+IF(WITHOUT_PTHREAD OR WITH_PTHREAD STREQUAL 0)
+  SET(PTHREAD_STATUS 0)
+  MESSAGE(STATUS "pthreads disabled from command line.")
+ENDIF(WITHOUT_PTHREAD OR WITH_PTHREAD STREQUAL 0)
+
+# ------
+
+IF(PTHREAD_STATUS)
+  IF(WITH_PTHREAD)
+    SET(PTHREAD_ROOT_USER ${WITH_PTHREAD})
+  ELSE(WITH_PTHREAD)
+    SET(PTHREAD_ROOT_USER $ENV{PTHREADS_ROOT})
+  ENDIF(WITH_PTHREAD)
+ENDIF(PTHREAD_STATUS)
+
+# -----
+
+IF(PTHREAD_STATUS)
+  IF(PTHREAD_ROOT_USER)
+    SET(PTHREAD_FIND_PATHS_OPTION NO_DEFAULT_PATH)
+  ELSE(PTHREAD_ROOT_USER)
+    SET(PTHREAD_FIND_PATHS_OPTION)
+  ENDIF(PTHREAD_ROOT_USER)
+ENDIF(PTHREAD_STATUS)
+
+# -----
+
+IF(PTHREAD_STATUS)
+  IF(PTHREAD_ROOT_USER)
+    SET(PTHREAD_INCLUDE_PATHS ${PTHREAD_ROOT_USER}/include)
+  ELSE(PTHREAD_ROOT_USER)
+    SET(PTHREAD_INCLUDE_PATHS)
+  ENDIF(PTHREAD_ROOT_USER)
+  SET(PTHREAD_INCLUDE_TO_FIND pthread.h)
+  FIND_PATH(PTHREAD_INCLUDE_DIR ${PTHREAD_INCLUDE_TO_FIND} PATHS ${PTHREAD_INCLUDE_PATHS} ${PTHREAD_FIND_PATHS_OPTION})
+  IF(PTHREAD_INCLUDE_DIR)
+    IF(PTHREAD_ROOT_USER)
+      SET(PTHREAD_INCLUDE_DIRS ${PTHREAD_INCLUDE_DIR})
+    ENDIF(PTHREAD_ROOT_USER)
+    MESSAGE(STATUS "${PTHREAD_INCLUDE_TO_FIND} found in ${PTHREAD_INCLUDE_DIR}")
+  ELSE(PTHREAD_INCLUDE_DIR)
+    SET(PTHREAD_STATUS 0)
+    IF(PTHREAD_ROOT_USER)
+      MESSAGE(STATUS "${PTHREAD_INCLUDE_TO_FIND} not found in ${PTHREAD_INCLUDE_PATHS}, check your PTHREAD installation.")
+    ELSE(PTHREAD_ROOT_USER)
+      MESSAGE(STATUS "${PTHREAD_INCLUDE_TO_FIND} not found on system, try to use WITH_PTHREAD option or PTHREADS_ROOT environment variable.")
+    ENDIF(PTHREAD_ROOT_USER)
+  ENDIF(PTHREAD_INCLUDE_DIR)
+ENDIF(PTHREAD_STATUS)
+
+# ----
+
+IF(PTHREAD_STATUS)
+  IF(PTHREAD_ROOT_USER)
+    SET(PTHREAD_LIB_PATHS ${PTHREAD_ROOT_USER}/lib)
+  ELSE(PTHREAD_ROOT_USER)
+    SET(PTHREAD_LIB_PATHS)
+  ENDIF(PTHREAD_ROOT_USER)
+ENDIF(PTHREAD_STATUS)
+
+IF(PTHREAD_STATUS)
+  IF(WINDOWS)
+    IF(CMAKE_BUILD_TYPE STREQUAL Release)
+      FIND_LIBRARY(PTHREAD_LIB pthreadVSE2 pthreadVC2 PATHS ${PTHREAD_LIB_PATHS} ${PTHREAD_FIND_PATHS_OPTION})
+    ELSE(CMAKE_BUILD_TYPE STREQUAL Release)
+      FIND_LIBRARY(PTHREAD_LIB pthreadVSE2d pthreadVC2d PATHS ${PTHREAD_LIB_PATHS} ${PTHREAD_FIND_PATHS_OPTION})
+    ENDIF(CMAKE_BUILD_TYPE STREQUAL Release)
+  ELSE(WINDOWS)
+    FIND_LIBRARY(PTHREAD_LIB pthread PATHS ${PTHREAD_LIB_PATHS} ${PTHREAD_FIND_PATHS_OPTION})
+  ENDIF(WINDOWS)
+  SET(PTHREAD_LIBS)
+  IF(PTHREAD_LIB)
+    SET(CMAKE_THREAD_LIBS_INIT ${CMAKE_THREAD_LIBS_INIT} ${PTHREAD_LIB})
+    MESSAGE(STATUS "pthread lib found: ${PTHREAD_LIB}")
+  ELSE(PTHREAD_LIB)
+    SET(PTHREAD_STATUS 0)
+    IF(PTHREAD_ROOT_USER)
+      MESSAGE(STATUS "pthread lib not found in ${PTHREAD_LIB_PATHS}, check your PTHREADS installation.")
+    ELSE(PTHREAD_ROOT_USER)
+      MESSAGE(STATUS "pthread lib not found on system, try to use WITH_PTHREAD option or PTHREAD_ROOT environment variable.")
+    ENDIF(PTHREAD_ROOT_USER)
+  ENDIF(PTHREAD_LIB)
+ENDIF(PTHREAD_STATUS)
+
+# ----
+
+IF(PTHREAD_STATUS)
+ELSE(PTHREAD_STATUS)
+  IF(PTHREAD_IS_MANDATORY)
+    MESSAGE(FATAL_ERROR "pthreads not found ... mandatory ... abort")
+  ELSE(PTHREAD_IS_MANDATORY)
+    MESSAGE(STATUS "pthreads not found ... optional ... disabled")
+  ENDIF(PTHREAD_IS_MANDATORY)
+ENDIF(PTHREAD_STATUS)
index 3745a99b75f3050e732deb4b2643ff7be030373b..b3b149edcc407209ca9efcb1d4dcda918e1ea5a6 100644 (file)
 set(HDF5_ROOT_DIR $ENV{HDF5_ROOT_DIR} CACHE PATH "Path to Hdf5 directory")
 if(EXISTS ${HDF5_ROOT_DIR})
   set(CMAKE_INCLUDE_PATH ${HDF5_ROOT_DIR}/include)
-  set(CMAKE_LIBRARY_PATH ${HDF5_ROOT_DIR}/lib)
+  
+  if(WINDOWS)
+    set(PREV_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
+    set(CMAKE_LIBRARY_PATH ${HDF5_ROOT_DIR}/dll)
+    set(CMAKE_FIND_LIBRARY_SUFFIXES dll${CMAKE_IMPORT_LIBRARY_SUFFIX})
+  else(WINDOWS)
+    set(CMAKE_LIBRARY_PATH ${HDF5_ROOT_DIR}/lib)
+  endif(WINDOWS)
+
   set(CMAKE_PROGRAM_PATH ${HDF5_ROOT_DIR}/bin)
 endif(EXISTS ${HDF5_ROOT_DIR})
 find_package(HDF5 COMPONENTS C REQUIRED)
@@ -32,3 +40,7 @@ if (HDF5_FOUND)
     set(HDF5_DEFINITIONS "-D_HDF5USEDLL_ ${HDF5_DEFINITIONS}" )
   endif(WINDOWS)
 endif(HDF5_FOUND)
+
+if(WINDOWS)
+  set(CMAKE_FIND_LIBRARY_SUFFIXES ${PREV_CMAKE_FIND_LIBRARY_SUFFIXES})
+endif(WINDOWS)
index 5344953fb45e1064e7a54f94783afebd81d109da..48449e3eabfbbcec4e45713b5aa7aa6e2a68caa5 100644 (file)
 # LIBBATCH detection for Salome
 
 include(FindPackageHandleStandardArgs)
-
 set(LIBBATCH_ROOT_DIR $ENV{LIBBATCH_ROOT_DIR} CACHE PATH "Path to libbatch directory")
+
 if(EXISTS ${LIBBATCH_ROOT_DIR})
+  if(WINDOWS)
+    set(PREV_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
+    set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_IMPORT_LIBRARY_SUFFIX})
+  endif(WINDOWS)
   find_package(libbatch QUIET CONFIG PATHS ${LIBBATCH_ROOT_DIR}/lib NO_DEFAULT_PATH)
 endif(EXISTS ${LIBBATCH_ROOT_DIR})
+
 find_package(libbatch QUIET CONFIG)
+
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(libbatch DEFAULT_MSG
   LIBBATCH_ROOT_DIR LIBBATCH_INCLUDE_DIRS LIBBATCH_LIBRARIES
   LIBBATCH_RUNTIME_LIBRARY_DIRS LIBBATCH_PYTHONPATH)
+
+message("LIBBATCH_LIBRARIES ${LIBBATCH_LIBRARIES}")
+message("LIBBATCH_INCLUDE_DIRS ${LIBBATCH_INCLUDE_DIRS}")
+message("LIBBATCH_RUNTIME_LIBRARY_DIRS ${LIBBATCH_RUNTIME_LIBRARY_DIRS}")
+message("LIBBATCH_PYTHONPATH ${LIBBATCH_PYTHONPATH}")
+
+if(WINDOWS)
+  set(CMAKE_FIND_LIBRARY_SUFFIXES ${PREV_CMAKE_FIND_LIBRARY_SUFFIXES})
+endif(WINDOWS)
diff --git a/salome_adm/cmake_files/FindSalomePTHREAD.cmake b/salome_adm/cmake_files/FindSalomePTHREAD.cmake
new file mode 100755 (executable)
index 0000000..0793a61
--- /dev/null
@@ -0,0 +1,13 @@
+
+# PTHREAD detection for Salome on Windows
+
+if(WINDOWS)
+  set(PTHREAD_ROOT_DIR $ENV{PTHREAD_ROOT_DIR} CACHE PATH "Path to Pthread directory")  
+  
+  if(EXISTS ${PTHREAD_ROOT_DIR})    
+    set(CMAKE_INCLUDE_PATH ${PTHREAD_ROOT_DIR}/include)
+    set(CMAKE_LIBRARY_PATH ${PTHREAD_ROOT_DIR}/lib)    
+  endif(EXISTS ${PTHREAD_ROOT_DIR})
+  
+  find_package(pthread REQUIRED)  
+endif(WINDOWS)
\ No newline at end of file
index a75238b41a56dc991e7983cfac8cf5f202a121ef..8ceb05e81376ec48a9bb8da54b4907ebea8880b2 100644 (file)
@@ -25,12 +25,32 @@ if(EXISTS ${PYTHON_ROOT_DIR})
   set(CMAKE_LIBRARY_PATH ${PYTHON_ROOT_DIR}/lib)
   set(CMAKE_PROGRAM_PATH ${PYTHON_ROOT_DIR}/bin)
 endif(EXISTS ${PYTHON_ROOT_DIR})
+
+if(WINDOWS)
+ if(CMAKE_BUILD_TYPE STREQUAL Debug)
+  SET(PythonInterp_FIND_VERSION _d)
+  SET(PYTHON_DEFINITIONS "-DHAVE_DEBUG_PYTHON")
+ endif(CMAKE_BUILD_TYPE STREQUAL Debug)
+endif(WINDOWS)
+
 find_package(PythonInterp REQUIRED)
+# Set PythonLibs_FIND_VERSION To avoid problems when several versions are in the system
+SET(PythonLibs_FIND_VERSION ${PYTHON_VERSION_STRING})
 if(EXISTS ${PYTHON_ROOT_DIR})
-  set(PYTHON_INCLUDE_DIR ${PYTHON_ROOT_DIR}/include/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR})
-  set(PYTHON_LIBRARY ${PYTHON_ROOT_DIR}/lib/libpython${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}${CMAKE_SHARED_LIBRARY_SUFFIX})
+  if(WINDOWS)
+   if(CMAKE_BUILD_TYPE STREQUAL Debug)
+    SET(PYTHON_LIB_SUFFIX _d)
+   else(CMAKE_BUILD_TYPE STREQUAL Debug)
+    SET(PYTHON_LIB_SUFFIX)   
+   endif(CMAKE_BUILD_TYPE STREQUAL Debug)
+   set(PYTHON_INCLUDE_DIR ${PYTHON_ROOT_DIR}/include)
+   set(PYTHON_LIBRARY ${PYTHON_ROOT_DIR}/libs/python${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR}${PYTHON_LIB_SUFFIX}${CMAKE_IMPORT_LIBRARY_SUFFIX})
+  else(WINDOWS)
+   set(PYTHON_INCLUDE_DIR ${PYTHON_ROOT_DIR}/include/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR})
+   set(PYTHON_LIBRARY ${PYTHON_ROOT_DIR}/lib/libpython${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}${CMAKE_SHARED_LIBRARY_SUFFIX})
+  endif(WINDOWS)
 endif(EXISTS ${PYTHON_ROOT_DIR})
-find_package(PythonLibs ${PYTHON_VERSION_STRING} EXACT REQUIRED)
+find_package(PythonLibs REQUIRED)
 MESSAGE("Python includes : " ${PYTHON_INCLUDE_DIR})
 MESSAGE("Python library  : " ${PYTHON_LIBRARY})
 MESSAGE("Python binary   : " ${PYTHON_EXECUTABLE})
index d1d3ed8bef401ff6cc37cbf1fd2f24570e997df1..dcf1e79f4ba9a1c814ce15bf23aed64f41f16e15 100644 (file)
@@ -31,6 +31,7 @@ FindOMNIORB.cmake \
 UseOMNIORB.cmake \
 FindPLATFORM.cmake \
 FindSPHINX.cmake \
+FindPTHREAD.cmake \
 SalomeMacros.cmake \
 FindSalomeBOOST.cmake \
 FindSalomeCPPUNIT.cmake \
@@ -40,6 +41,7 @@ FindSalomeLIBBATCH.cmake \
 FindSalomeLIBXML2.cmake \
 FindSalomeMPI.cmake \
 FindSalomePYTHON.cmake \
+FindSalomePTHREAD.cmake \
 FindSalomeSPHINX.cmake \
 FindSalomeSWIG.cmake \
 InstallAndCompilePythonFile.cmake
index 1efa8b206219ad58a6e18e4eed1c88c0e4e47f34..919cd00def0745ffb2fffb29d852c739ad81ad97 100644 (file)
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-INSTALL( CODE "
-SET(INSTALL_PYIDL_DIR lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages/salome) # R1 CHECK
+
 IF(WINDOWS)
-  SET(INSTALL_PYIDL_DIR bin/salome) # R1 CHECK
+  INSTALL( CODE "SET(INSTALL_PYIDL_DIR bin/salome)") # R1 CHECK
+ELSE(WINDOWS)
+  INSTALL( CODE "SET(INSTALL_PYIDL_DIR lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages/salome)") # R1 CHECK
 ENDIF(WINDOWS)
 
-MACRO(OMNIORB_COMPILE_IDL_FORPYTHON_ON_INSTALL MYOMNIORBIDLPYTHON MYIDLPYFLAGS MYIDLFILE MYFULLDIR)
+
+INSTALL(CODE "MACRO(OMNIORB_COMPILE_IDL_FORPYTHON_ON_INSTALL MYOMNIORBIDLPYTHON MYIDLPYFLAGS MYIDLFILE MYFULLDIR)
   FILE(MAKE_DIRECTORY \${MYFULLDIR})
   STRING(REPLACE \" \" \";\" MYIDLPYFLAGS2 \${MYIDLPYFLAGS})
   MESSAGE(STATUS \"Compiling \${MYIDLFILE} into \${MYFULLDIR}\")