From a2f760c000acc88f3d2962bf4fc05823992b8ed1 Mon Sep 17 00:00:00 2001 From: sbh Date: Wed, 20 Aug 2014 13:34:06 +0400 Subject: [PATCH] Corrections in Windows MSVC10 environment according to the Linux environment --- CMakeCommon/FindPython.cmake | 5 +++-- CMakeCommon/XMLProcessing.cmake | 32 +++++++++----------------------- msvc10_env.bat | 12 ++++-------- src/XGUI/CMakeLists.txt | 5 +++-- 4 files changed, 19 insertions(+), 35 deletions(-) diff --git a/CMakeCommon/FindPython.cmake b/CMakeCommon/FindPython.cmake index dc990bfb4..97f5f2644 100644 --- a/CMakeCommon/FindPython.cmake +++ b/CMakeCommon/FindPython.cmake @@ -8,6 +8,7 @@ IF(WIN32) ElSE() SET(PYTHON_LIBRARY_FILE "libpython2.7.so") ENDIF() + IF(WIN32) FILE(TO_CMAKE_PATH "$ENV{PYTHONHOME}/libs/${PYTHON_LIBRARY_FILE}" PYTHON_LIBRARY) ElSE() @@ -19,5 +20,5 @@ FIND_PACKAGE(PythonLibs REQUIRED) FIND_PACKAGE(PythonInterp REQUIRED) INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_DIR}) -MESSAGE(STATUS "PYTHON_LIBRARIES: " ${PYTHON_LIBRARIES}) -MESSAGE(STATUS "PYTHON_INCLUDE_DIR: " ${PYTHON_INCLUDE_DIR}) +#MESSAGE(STATUS "PYTHON_LIBRARIES: " ${PYTHON_LIBRARIES}) +#MESSAGE(STATUS "PYTHON_INCLUDE_DIR: " ${PYTHON_INCLUDE_DIR}) diff --git a/CMakeCommon/XMLProcessing.cmake b/CMakeCommon/XMLProcessing.cmake index 3595cbb33..9abfef07a 100644 --- a/CMakeCommon/XMLProcessing.cmake +++ b/CMakeCommon/XMLProcessing.cmake @@ -1,28 +1,14 @@ -SET(LIBXMLDIR $ENV{LIBXML_DIR}) IF(WIN32) - INCLUDE_DIRECTORIES(${LIBXMLDIR}/include) + FILE(TO_CMAKE_PATH $ENV{LIBXML_DIR}/lib/libxml2.lib LIBXML2_LIBRARIES) + FILE(TO_CMAKE_PATH $ENV{LIBXML_DIR}/include LIBXML2_INCLUDE_DIR) ELSE() - INCLUDE_DIRECTORIES(${LIBXMLDIR}/include/libxml2) -ENDIF(WIN32) - -LINK_DIRECTORIES (${LIBXMLDIR}/lib) - -IF(WIN32) - SET(LIBXML2_LIBRARIES ${LIBXMLDIR}/lib/libxml2.lib) - INCLUDE_DIRECTORIES(${LIBXMLDIR}/include/libxml2) -ELSE() - SET(LIBXML2_LIBRARIES ${LIBXMLDIR}/lib/libxml2.so) - SET(LIBXML2_INCLUDE_DIR ${LIBXMLDIR}/include/libxml2) - FIND_PACKAGE(LibXml2 REQUIRED) - if(LIBXML2_FOUND) - message(STATUS "Found libxml2 ver. " ${LIBXML2_VERSION_STRING}) - message(STATUS "LIBXML2_LIBRARIES " ${LIBXML2_LIBRARIES}) - message(STATUS "LIBXML2_INCLUDE_DIR " ${LIBXML2_INCLUDE_DIR}) - endif(LIBXML2_FOUND) - - INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) - ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) + FILE(TO_CMAKE_PATH $ENV{LIBXML_DIR}/lib/libxml2.so LIBXML2_LIBRARIES) + FILE(TO_CMAKE_PATH $ENV{LIBXML_DIR}/include/libxml2 LIBXML2_INCLUDE_DIR) ENDIF() -LINK_DIRECTORIES (${LIBXMLDIR}/lib) +FIND_PACKAGE(LibXml2 REQUIRED) + +ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) +INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) +LINK_DIRECTORIES (${LIBXML2_LIBRARIES}) diff --git a/msvc10_env.bat b/msvc10_env.bat index bac9fdbe3..03a087af4 100644 --- a/msvc10_env.bat +++ b/msvc10_env.bat @@ -92,7 +92,7 @@ set PATH=%CMAKEDIR%\bin;%PATH% @REM PYTHON @SET PYTHONHOME=%PDIR%\python-2.7.3 @SET PYTHON_INCLUDE=%PYTHONHOME%\include -@SET PATH=%PYTHONHOME%;%PATH% +@SET PATH=%PYTHONHOME%;%PYTHONHOME%\libs;%PATH% @SET PYTHONPATH=%PYTHONHOME%\Lib;%PYTHONPATH% @SET PYTHONPATH=%PYTHONHOME%\DLLs;%PYTHONPATH% @SET PYTHON_VERSION=2.7 @@ -105,13 +105,9 @@ set PATH=%CMAKEDIR%\bin;%PATH% @REM ------------------------- @REM LIBXML2 -@SET LIBXML2_ROOT_DIR=%PDIR%\libxml2-2.9.0 -@REM DO NOT rename following 3 variables, -@REM they are required by CMake "find(Libxml2)" procedure -@SET LIBXML2_INCLUDE_DIR=%LIBXML2_ROOT_DIR%\include\libxml2 -@SET LIBXML2_LIB_DIR=%LIBXML2_ROOT_DIR%\lib -@SET LIBXML2_BIN_DIR=%LIBXML2_ROOT_DIR%\bin -@SET PATH=%LIBXML2_BIN_DIR%;%LIBXML2_LIB_DIR%;%PATH% +@SET LIBXML_DIR=%PDIR%\libxml2-2.9.0 +@SET PATH=%LIBXML_DIR%\lib;%PATH% +@SET PATH=%LIBXML_DIR%\bin;%PATH% @REM ------------------------- @REM ------------------------- diff --git a/src/XGUI/CMakeLists.txt b/src/XGUI/CMakeLists.txt index eca046d10..8c338271a 100644 --- a/src/XGUI/CMakeLists.txt +++ b/src/XGUI/CMakeLists.txt @@ -81,15 +81,16 @@ SET(TEXT_RESOURCES SET(PROJECT_LIBRARIES Events Config + ModelAPI + ModuleBase ${QT_LIBRARIES} ${CAS_VIEWER} ${CAS_KERNEL} + ${PYTHON_LIBRARIES} ${PyConsole} ${PyInterp} ${suit} ${qtx} - ModelAPI - ModuleBase ) IF(WIN32) -- 2.39.2