From 385040333b3be3cd1255955f933f9969744f22ee Mon Sep 17 00:00:00 2001 From: Matthias Hochsteger Date: Wed, 27 Nov 2019 14:03:20 +0100 Subject: [PATCH] [cmake] Fix non-gui build --- ng/CMakeLists.txt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ng/CMakeLists.txt b/ng/CMakeLists.txt index 99b11ef6..67f42ea0 100644 --- a/ng/CMakeLists.txt +++ b/ng/CMakeLists.txt @@ -51,10 +51,12 @@ if(USE_GUI) endif(USE_GUI) if(USE_PYTHON) - if(${BUILD_FOR_CONDA} AND UNIX AND NOT APPLE) - target_link_libraries( netgen -Wl,--no-as-needed ${PYTHON_LIBRARIES}) - else() - target_link_libraries( netgen ${PYTHON_LIBRARIES}) + if(USE_GUI) + if(${BUILD_FOR_CONDA} AND UNIX AND NOT APPLE) + target_link_libraries( netgen -Wl,--no-as-needed ${PYTHON_LIBRARIES}) + elseif() + target_link_libraries( netgen ${PYTHON_LIBRARIES}) + endif() endif() add_library(ngpy SHARED netgenpy.cpp)