From dcfe2ad0459b19aae23f9971a70438b8e783c01b Mon Sep 17 00:00:00 2001 From: spo Date: Thu, 23 Jun 2016 11:12:58 +0300 Subject: [PATCH] Fix cmake error with LibXml2 --- CMakeCommon/XMLProcessing.cmake | 10 ---------- CMakeLists.txt | 10 ++++++++++ 2 files changed, 10 insertions(+), 10 deletions(-) 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) -- 2.39.2