]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
CMake: tweaks for Win32 platform: configuration is successful
authorbruneton <bruneton>
Tue, 18 Jun 2013 09:41:38 +0000 (09:41 +0000)
committerbruneton <bruneton>
Tue, 18 Jun 2013 09:41:38 +0000 (09:41 +0000)
salome_adm/cmake_files/FindOmniORB.cmake
salome_adm/cmake_files/FindPThread.cmake
salome_adm/cmake_files/FindSalomeLibXml2.cmake
salome_adm/cmake_files/FindSalomePython.cmake

index 357c53256b558a51b4094131d9d9f72582567e82..61754a913cb5388c9edf5d882b922fc1fc30ce20 100644 (file)
 # 4.0.6 has known bug float/double marshalling using CORBA::Any
 set(OMNIORB_MINIMUM_VERSION "4.1.2")
 
+IF(WIN32)
+  # Guide the FIND_LIBRARY command towards the correct directory <...>/lib/x86_win32:
+  SET(CMAKE_LIBRARY_ARCHITECTURE x86_win32)
+ENDIF()
+
 ##############################################################################
 # find headers
 ##############################################################################
@@ -52,14 +57,11 @@ 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}
-    PATHS lib/x86_win32)
+    NAMES ${CMAKE_STATIC_LIBRARY_PREFIX}omniORB4${CMAKE_STATIC_LIBRARY_SUFFIX})
   FIND_LIBRARY( OMNIORB_LIBRARY_omnithread
-    NAMES ${CMAKE_STATIC_LIBRARY_PREFIX}omnithread${CMAKE_STATIC_LIBRARY_SUFFIX}
-    PATHS lib/x86_win32)
+    NAMES ${CMAKE_STATIC_LIBRARY_PREFIX}omnithread${CMAKE_STATIC_LIBRARY_SUFFIX})
   FIND_LIBRARY( OMNIORB_LIBRARY_omniDynamic4
-    NAMES ${CMAKE_STATIC_LIBRARY_PREFIX}omniDynamic4${CMAKE_STATIC_LIBRARY_SUFFIX}
-    PATHS lib/x86_win32)
+    NAMES ${CMAKE_STATIC_LIBRARY_PREFIX}omniDynamic4${CMAKE_STATIC_LIBRARY_SUFFIX})
 ELSE (WIN32)
   FIND_LIBRARY(OMNIORB_LIBRARY_omniORB4 NAMES omniORB4)
   FIND_LIBRARY(OMNIORB_LIBRARY_omnithread NAMES omnithread)
@@ -70,11 +72,9 @@ ENDIF (WIN32)
 
 IF (WIN32)
   FIND_LIBRARY( OMNIORB_LIBRARY_COS4
-    NAMES ${CMAKE_STATIC_LIBRARY_PREFIX}COS4${CMAKE_STATIC_LIBRARY_SUFFIX}
-    PATHS lib/x86_win32 )
+    NAMES ${CMAKE_STATIC_LIBRARY_PREFIX}COS4${CMAKE_STATIC_LIBRARY_SUFFIX})
   FIND_LIBRARY( OMNIORB_LIBRARY_COSDynamic4
-    NAMES ${CMAKE_STATIC_LIBRARY_PREFIX}COSDynamic4${CMAKE_STATIC_LIBRARY_SUFFIX}
-    PATHS lib/x86_win32) 
+    NAMES ${CMAKE_STATIC_LIBRARY_PREFIX}COSDynamic4${CMAKE_STATIC_LIBRARY_SUFFIX}) 
 ELSE (WIN32)
   FIND_LIBRARY(OMNIORB_LIBRARY_COS4 NAMES COS4)
   FIND_LIBRARY(OMNIORB_LIBRARY_COSDynamic4 NAMES COSDynamic4)
@@ -100,11 +100,17 @@ ENDIF (WIN32)
 ##############################################################################
 
 SET(_py_version "${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}")
-SET(CMAKE_FIND_ROOT_PATH ${CMAKE_FIND_ROOT_PATH} ${CMAKE_PREFIX_PATH})
-FIND_PATH(OMNIORB_PYTHON_BACKEND
-  NAMES python.py
-  PATHS "/lib/python${_py_version}/site-packages/omniidl_be" "/usr/lib/omniidl/omniidl_be" 
-  DOC "Path to python-backend directory (omniidl_be) including python.py file" )
+SET(CMAKE_FIND_ROOT_PATH ${CMAKE_PREFIX_PATH})
+SET(_doc "Path to python-backend directory (omniidl_be) including python.py file")
+IF(WIN32)
+  FIND_PATH(OMNIORB_PYTHON_BACKEND
+     NAMES python.py PATHS "/lib/python/omniidl_be" DOC ${_doc}) 
+ELSE()
+  FIND_PATH(OMNIORB_PYTHON_BACKEND
+     NAMES python.py
+     PATHS "/lib/python${_py_version}/site-packages/omniidl_be" "/usr/lib/omniidl/omniidl_be" 
+     DOC ${_doc})
+ENDIF()
 
 ##############################################################################
 # Cook our stuff
index 5df33ace921bc57cd4eec9f8faf2feba0c01d640..406ed2d95445b8066733af405435bf7080fb7352 100644 (file)
@@ -10,9 +10,9 @@
 # Libraries are searched with following names: 
 #    pthread
 # On Win32:
-#    pthreadVSE2 pthreadVC2
+#    pthreadVC2
 # or in Debug mode:
-#    pthreadVSE2d pthreadVC2d
+#    pthreadVC2d
 #
 
 
@@ -49,9 +49,9 @@ IF(WIN32)
     FIND_PATH(PTHREAD_INCLUDE_DIR ${PTHREADS_INCLUDE_TO_FIND})
     # Default build type is assumed to be Release:
     IF(NOT CMAKE_BUILD_TYPE STREQUAL Debug)
-        FIND_LIBRARY(PTHREAD_LIBRARIES pthreadVSE2 pthreadVC2)
+        FIND_LIBRARY(PTHREAD_LIBRARIES pthreadVC2)
     ELSE()
-        FIND_LIBRARY(PTHREAD_LIBRARIES pthreadVSE2d pthreadVC2d)
+        FIND_LIBRARY(PTHREAD_LIBRARIES pthreadVC2d)
     ENDIF()
 ELSE(WIN32)
     FIND_PATH(PTHREAD_INCLUDE_DIR pthread.h)
index dfe4148e374b03c045036a23bc48ef605e92eea9..a129669260538babf23e5028d621a9bb9402a219 100644 (file)
 #
 #  !! Please read the generic detection procedure in SalomeMacros.cmake !!
 #
-SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(LibXml2 LIBXML2_INCLUDE_DIR 2)
+IF(WIN32)
+  SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(LibXml2 LIBXML2_INCLUDE_DIR 1)
+ELSE()
+  SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(LibXml2 LIBXML2_INCLUDE_DIR 2)
+ENDIF()
 #MARK_AS_ADVANCED()
 
index f20071707ca63584e529e3a720fbcd797a700af1..754248dcff10f81559e1a8ecba38d88ee6a353b6 100644 (file)
@@ -104,7 +104,9 @@ IF (SALOMEPYTHON_FOUND)
   # For Python this is the grand-parent of the
   # include directory:
   GET_FILENAME_COMPONENT(_tmp_ROOT_DIR "${PYTHON_INCLUDE_DIR}" PATH)
-  GET_FILENAME_COMPONENT(_tmp_ROOT_DIR "${_tmp_ROOT_DIR}" PATH)
+  IF(NOT WIN32)
+    GET_FILENAME_COMPONENT(_tmp_ROOT_DIR "${_tmp_ROOT_DIR}" PATH)
+  ENDIF()
 
   # 4. Warn if CMake found something not located under ENV(XYZ_ROOT_DIR)
   IF(DEFINED ENV{PYTHON_ROOT_DIR})