diff --git a/ng/CMakeLists.txt b/ng/CMakeLists.txt index 1a553edc..9fca6c27 100644 --- a/ng/CMakeLists.txt +++ b/ng/CMakeLists.txt @@ -19,11 +19,20 @@ if(USE_GUI) add_library(gui SHARED ${gui_sources}) add_executable(netgen ${netgen_sources}) - target_link_libraries( gui PUBLIC nglib ${TK_LIBRARY} ${TCL_LIBRARY} ${ZLIB_LIBRARIES} ${JPEG_LIBRARIES} ${FFMPEG_LIBRARIES} ${X11_X11_LIB} ${OCC_LIBRARIES} ) + target_link_libraries( gui PUBLIC nglib ${ZLIB_LIBRARIES} ${JPEG_LIBRARIES} ${FFMPEG_LIBRARIES} ${X11_X11_LIB} ${OCC_LIBRARIES} ) target_link_libraries( gui PRIVATE ${LIBTOGL}) target_link_libraries( netgen nglib gui ) + if(APPLE) + # Leave decision about which tcl/tk version to use open to python (and it's tkinter package). + # Thus, only link tcl/tk to the netgen executable and not to the gui library. + target_link_libraries( netgen ${TK_LIBRARY} ${TCL_LIBRARY}) + else(APPLE) + # On other systems assume that the found libraries are compatible with python/tkinter + target_link_libraries( gui PUBLIC ${TK_LIBRARY} ${TCL_LIBRARY}) + endif(APPLE) + if(NOT WIN32) target_link_libraries( netgen mesh stlvis stl geom2dvis interface geom2d csg stl visual csgvis ) target_link_libraries( gui PUBLIC mesh stlvis stl geom2dvis interface geom2d csg stl visual csgvis )