From 0f3a392eec99fdf9d8df18a759654b586f744906 Mon Sep 17 00:00:00 2001 From: spo Date: Tue, 24 Nov 2015 15:15:23 +0300 Subject: [PATCH] Make XAO compilation --- CMakeCommon/XMLProcessing.cmake | 7 ++----- CMakeLists.txt | 4 ++++ src/XAO/CMakeLists.txt | 33 +++++++++++++-------------------- 3 files changed, 19 insertions(+), 25 deletions(-) diff --git a/CMakeCommon/XMLProcessing.cmake b/CMakeCommon/XMLProcessing.cmake index 36eec9b26..0cadddbe2 100644 --- a/CMakeCommon/XMLProcessing.cmake +++ b/CMakeCommon/XMLProcessing.cmake @@ -1,18 +1,15 @@ ## 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) + 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) + FILE(TO_CMAKE_PATH $ENV{LIBXML2_ROOT_DIR}/include/libxml2 LIBXML2_INCLUDE_DIR) ENDIF() ENDIF() -FIND_PACKAGE(LibXml2 REQUIRED) - ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) LINK_DIRECTORIES (${LIBXML2_LIBRARIES}) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1047795a7..4b2fae4d8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,6 +13,9 @@ INCLUDE(FindSalome) INCLUDE(FindCAS) INCLUDE(FindSUIT) +# It could be called only once +FIND_PACKAGE(LibXml2 REQUIRED) + IF(UNIX) IF(CMAKE_COMPILER_IS_GNUCC) #C++11 is not supported on some platforms, disable it @@ -70,6 +73,7 @@ ADD_SUBDIRECTORY (doc) ADD_SUBDIRECTORY (src/Config) ADD_SUBDIRECTORY (src/Events) ADD_SUBDIRECTORY (src/Model) +ADD_SUBDIRECTORY (src/XAO) ADD_SUBDIRECTORY (src/GeomAPI) ADD_SUBDIRECTORY (src/ModelAPI) ADD_SUBDIRECTORY (src/GeomAlgoAPI) diff --git a/src/XAO/CMakeLists.txt b/src/XAO/CMakeLists.txt index f1097985f..2e9700e84 100644 --- a/src/XAO/CMakeLists.txt +++ b/src/XAO/CMakeLists.txt @@ -17,28 +17,23 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -IF(SALOME_BUILD_TESTS) - ADD_SUBDIRECTORY(tests) -ENDIF(SALOME_BUILD_TESTS) +#IF(SALOME_BUILD_TESTS) +# ADD_SUBDIRECTORY(tests) +#ENDIF(SALOME_BUILD_TESTS) # --- options --- +INCLUDE(Common) +INCLUDE(XMLProcessing) + # additional include directories -INCLUDE_DIRECTORIES( - ${PTHREAD_INCLUDE_DIR} - ${LIBXML2_INCLUDE_DIR} - ${CAS_INCLUDE_DIRS} - ) +INCLUDE_DIRECTORIES(${CAS_INCLUDE_DIRS}) # additional preprocessor / compiler flags -ADD_DEFINITIONS( - ${LIBXML2_DEFINITIONS} - ${CAS_DEFINITIONS} - ) +ADD_DEFINITIONS(-DXAO_EXPORTS ${CAS_DEFINITIONS}) # libraries to link to -SET(_link_LIBRARIES - ${PTHREAD_LIBRARIES} +SET(PROJECT_LIBRARIES ${LIBXML2_LIBRARIES} ${CAS_TKBRep} ${CAS_TKTopAlgo} ${CAS_TKG2d} ) @@ -46,7 +41,7 @@ SET(_link_LIBRARIES # --- headers --- SET(XAO_HEADERS - XAO.hxx + XAO.hxx XAO_BooleanField.hxx XAO_BooleanStep.hxx XAO_BrepGeometry.hxx @@ -91,8 +86,6 @@ SET(XAO_SOURCES # --- rules --- -ADD_LIBRARY(XAO ${XAO_SOURCES}) -TARGET_LINK_LIBRARIES(XAO ${_link_LIBRARIES}) -INSTALL(TARGETS XAO EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) - -INSTALL(FILES ${XAO_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS}) +ADD_LIBRARY(XAO SHARED ${XAO_SOURCES} ${XAO_HEADERS}) +TARGET_LINK_LIBRARIES(XAO ${PROJECT_LIBRARIES}) +INSTALL(TARGETS XAO DESTINATION ${SHAPER_INSTALL_BIN}) -- 2.39.2