From 42d29dd28e350707f70d535e21f8a3f6b570d111 Mon Sep 17 00:00:00 2001 From: michael Date: Sat, 30 Oct 2021 22:33:05 +0200 Subject: [PATCH] SImplified swig CMakeLists --- CDMATH/swig/CMakeLists.txt | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/CDMATH/swig/CMakeLists.txt b/CDMATH/swig/CMakeLists.txt index 924fe3d..664a261 100755 --- a/CDMATH/swig/CMakeLists.txt +++ b/CDMATH/swig/CMakeLists.txt @@ -2,19 +2,18 @@ INCLUDE(${SWIG_USE_FILE}) INCLUDE_DIRECTORIES( ${Python_INCLUDE_DIRS} + ${MEDFILE_INCLUDE_DIRS} ${MEDCOUPLING_INCLUDE_DIR} ${BASE_DIR}/inc ${MESH_DIR}/inc ) -SET(_extra_lib_SWIG) if (CDMATH_WITH_PETSC) INCLUDE_DIRECTORIES( ${PETSC_INCLUDES} ${SLEPC_INCLUDES} ${LINEARSOLVER_DIR}/inc ) - SET(_extra_lib_SWIG linearsolver ${PETSC_LIBRARIES} ${SLEPC_LIBRARIES}) file(COPY cdmath_with_petsc.i DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) file(RENAME ${CMAKE_CURRENT_BINARY_DIR}/cdmath_with_petsc.i ${CMAKE_CURRENT_BINARY_DIR}/cdmath.i) else (CDMATH_WITH_PETSC) @@ -39,8 +38,12 @@ IF (${CMAKE_VERSION} VERSION_LESS "3.8.0") ELSE (${CMAKE_VERSION} VERSION_LESS "3.8.0") SWIG_ADD_LIBRARY(cdmath TYPE SHARED LANGUAGE python SOURCES ${CMAKE_CURRENT_BINARY_DIR}/cdmath.i) ENDIF(${CMAKE_VERSION} VERSION_LESS "3.8.0") - -SWIG_LINK_LIBRARIES(cdmath ${Python_LIBRARIES} base mesh ${medloader} ${medcoupling} ${_extra_lib_SWIG}) + +if (CDMATH_WITH_PETSC) + SWIG_LINK_LIBRARIES(cdmath ${Python_LIBRARIES} base mesh ${medloader} ${medcoupling} linearsolver ${PETSC_LIBRARIES} ${SLEPC_LIBRARIES}) +else (CDMATH_WITH_PETSC) + SWIG_LINK_LIBRARIES(cdmath ${Python_LIBRARIES} base mesh ${medloader} ${medcoupling} ) +endif (CDMATH_WITH_PETSC) INSTALL(TARGETS _cdmath DESTINATION lib/cdmath) INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/cdmath.py DESTINATION bin/cdmath) -- 2.39.2