From: bruneton Date: Tue, 18 Jun 2013 09:34:50 +0000 (+0000) Subject: CMake: minor tweaks giving successful configuration on Win32 platform. X-Git-Tag: V7_2_0_WIN~18 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e540fd4cfc3ba0fb070c139d057137cd8b7301c1;p=modules%2Fkernel.git CMake: minor tweaks giving successful configuration on Win32 platform. --- diff --git a/salome_adm/cmake_files/FindOmniORB.cmake b/salome_adm/cmake_files/FindOmniORB.cmake index 357c53256..61754a913 100644 --- a/salome_adm/cmake_files/FindOmniORB.cmake +++ b/salome_adm/cmake_files/FindOmniORB.cmake @@ -42,6 +42,11 @@ # 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 diff --git a/salome_adm/cmake_files/FindPThread.cmake b/salome_adm/cmake_files/FindPThread.cmake index 5df33ace9..406ed2d95 100644 --- a/salome_adm/cmake_files/FindPThread.cmake +++ b/salome_adm/cmake_files/FindPThread.cmake @@ -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) diff --git a/salome_adm/cmake_files/FindSalomeLibXml2.cmake b/salome_adm/cmake_files/FindSalomeLibXml2.cmake index dfe4148e3..a12966926 100644 --- a/salome_adm/cmake_files/FindSalomeLibXml2.cmake +++ b/salome_adm/cmake_files/FindSalomeLibXml2.cmake @@ -21,6 +21,10 @@ # # !! 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() diff --git a/salome_adm/cmake_files/FindSalomePython.cmake b/salome_adm/cmake_files/FindSalomePython.cmake index f20071707..754248dcf 100644 --- a/salome_adm/cmake_files/FindSalomePython.cmake +++ b/salome_adm/cmake_files/FindSalomePython.cmake @@ -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})