From c1a407c4f67da7c933424804dee637bf7db9f646 Mon Sep 17 00:00:00 2001 From: Matthias Hochsteger Date: Tue, 13 Nov 2018 11:22:37 +0100 Subject: [PATCH] [cmake] Set link interface of dependencies to PRIVATE --- ng/CMakeLists.txt | 8 ++++---- nglib/CMakeLists.txt | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ng/CMakeLists.txt b/ng/CMakeLists.txt index 75de5b1c..4d4440bb 100644 --- a/ng/CMakeLists.txt +++ b/ng/CMakeLists.txt @@ -24,10 +24,10 @@ if(USE_GUI) add_executable(netgen ngappinit.cpp onetcl.cpp) - 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( gui PUBLIC nglib ) + target_link_libraries( gui PRIVATE ${ZLIB_LIBRARIES} ${JPEG_LIBRARIES} ${FFMPEG_LIBRARIES} ${X11_Xmu_LIB} ${X11_X11_LIB} ${OCC_LIBRARIES} ${LIBTOGL} ) - target_link_libraries( netgen nglib gui ) + target_link_libraries( netgen nglib gui ${ZLIB_LIBRARIES} ${JPEG_LIBRARIES} ${FFMPEG_LIBRARIES} ${X11_Xmu_LIB} ${X11_X11_LIB} ${OCC_LIBRARIES} ${LIBTOGL} ) if(APPLE) # Leave decision about which tcl/tk version to use open to python (and it's tkinter package). @@ -57,7 +57,7 @@ endif(USE_GUI) if(USE_PYTHON) add_library(ngpy SHARED netgenpy.cpp) - target_link_libraries( ngpy nglib ) + target_link_libraries( ngpy PUBLIC nglib PRIVATE ${PYTHON_LIBRARIES}) if(APPLE) set_target_properties( ngpy PROPERTIES SUFFIX ".so") elseif(WIN32) diff --git a/nglib/CMakeLists.txt b/nglib/CMakeLists.txt index cf5e192d..5429ffe6 100644 --- a/nglib/CMakeLists.txt +++ b/nglib/CMakeLists.txt @@ -26,20 +26,20 @@ endif(WIN32) add_library(nglib SHARED nglib.cpp ${nglib_objects}) if(NOT WIN32) - target_link_libraries( nglib mesh stl interface geom2d csg stl visual) + target_link_libraries( nglib PUBLIC mesh stl interface geom2d csg stl visual) if(USE_GUI) - target_link_libraries( nglib stlvis geom2dvis csgvis ) + target_link_libraries( nglib PUBLIC stlvis geom2dvis csgvis ) endif(USE_GUI) endif(NOT WIN32) -target_link_libraries( nglib ${OCC_LIBRARIES} ${MPI_CXX_LIBRARIES} ${OPENGL_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${X11_Xmu_LIB} ${JPEG_LIBRARIES} ${MKL_LIBRARIES} ${ZLIB_LIBRARIES} ${OCC_LIBRARIES} ) +target_link_libraries( nglib PRIVATE ${OCC_LIBRARIES} ${MPI_CXX_LIBRARIES} ${OPENGL_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${X11_Xmu_LIB} ${JPEG_LIBRARIES} ${MKL_LIBRARIES} ${ZLIB_LIBRARIES} ${OCC_LIBRARIES} ) if(USE_OCC AND NOT WIN32) - target_link_libraries(nglib occ) + target_link_libraries(nglib PUBLIC occ) endif(USE_OCC AND NOT WIN32) if(USE_PYTHON) - target_link_libraries(nglib ${PYTHON_LIBRARIES}) + target_link_libraries(nglib PRIVATE ${PYTHON_LIBRARIES}) endif(USE_PYTHON) install(TARGETS nglib ${NG_INSTALL_DIR})