From: spo Date: Thu, 23 Jun 2016 08:12:58 +0000 (+0300) Subject: Fix cmake error with LibXml2 X-Git-Tag: V_2.4.0~38 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=dcfe2ad0459b19aae23f9971a70438b8e783c01b;p=modules%2Fshaper.git Fix cmake error with LibXml2 --- diff --git a/CMakeCommon/XMLProcessing.cmake b/CMakeCommon/XMLProcessing.cmake index 0cadddbe2..c47a30895 100644 --- a/CMakeCommon/XMLProcessing.cmake +++ b/CMakeCommon/XMLProcessing.cmake @@ -1,15 +1,5 @@ ## Copyright (C) 2014-20xx CEA/DEN, EDF R&D -IF(DEFINED ENV{LIBXML2_ROOT_DIR}) - IF(WIN32) - FILE(TO_CMAKE_PATH $ENV{LIBXML2_ROOT_DIR}/lib/libxml2.lib LIBXML2_LIBRARIES) - FILE(TO_CMAKE_PATH $ENV{LIBXML2_ROOT_DIR}/include LIBXML2_INCLUDE_DIR) - ELSE() - FILE(TO_CMAKE_PATH $ENV{LIBXML2_ROOT_DIR}/lib/libxml2.so LIBXML2_LIBRARIES) - FILE(TO_CMAKE_PATH $ENV{LIBXML2_ROOT_DIR}/include/libxml2 LIBXML2_INCLUDE_DIR) - ENDIF() -ENDIF() - ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) LINK_DIRECTORIES (${LIBXML2_LIBRARIES}) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4b2fae4d8..df940b604 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,6 +13,16 @@ INCLUDE(FindSalome) INCLUDE(FindCAS) INCLUDE(FindSUIT) +# Find LibXml2 +IF(DEFINED ENV{LIBXML2_ROOT_DIR}) + IF(WIN32) + FILE(TO_CMAKE_PATH $ENV{LIBXML2_ROOT_DIR}/lib/libxml2.lib LIBXML2_LIBRARIES) + FILE(TO_CMAKE_PATH $ENV{LIBXML2_ROOT_DIR}/include LIBXML2_INCLUDE_DIR) + ELSE() + FILE(TO_CMAKE_PATH $ENV{LIBXML2_ROOT_DIR}/lib/libxml2.so LIBXML2_LIBRARIES) + FILE(TO_CMAKE_PATH $ENV{LIBXML2_ROOT_DIR}/include/libxml2 LIBXML2_INCLUDE_DIR) + ENDIF() +ENDIF() # It could be called only once FIND_PACKAGE(LibXml2 REQUIRED)