Commit c64f22ec authored by Chris Harris's avatar Chris Harris

Fix libary link overflow on MacOS

On MacOS (Snow Leopard and probably others) there is a limit (253)
to the number of libaries you can link against, we are over this limit.
Need to remove transitive dependencies from these libaries by seting
LINK_INTERFACE_LIBRARIES to "" or a limited set.

Change-Id: Idf8c8a974802a1dc3ce5cb6275c0dc343e66eb89
parent c5f22926
......@@ -384,8 +384,6 @@ IF(VTK_FOUND)
include(${ParaView_BINARY_DIR}/VTK/VTKConfig.cmake)
ENDIF()
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS ${VTK_DEFINITIONS})
include_directories(${VTK_INCLUDE_DIRS})
set(VTK_INCLUDE_DIR ${VTK_INCLUDE_DIRS})
......
......@@ -483,3 +483,12 @@ function(build_help_project name)
WORKING_DIRECTORY "${arg_DESTINATION_DIRECTORY}"
)
endfunction(build_help_project)
macro(pv_set_link_interface_libs target)
# if not lion then we need to set LINK_INTERFACE_LIBRARIES to reduce the number
# of libraries we link against there is a limit of 253.
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND CMAKE_SYSTEM_VERSION VERSION_LESS 11.0)
set_property(TARGET ${target}
PROPERTY LINK_INTERFACE_LIBRARIES "${ARGN}")
endif()
endmacro()
CMAKE_MINIMUM_REQUIRED(VERSION 2.6.3 FATAL_ERROR)
cmake_minimum_required(VERSION 2.8.5 FATAL_ERROR)
# On Macs earlier than Lion we set LINK_INTERFACE_LIBRARIES however, there is a
# bug in 2.8.7 (http://public.kitware.com/Bug/view.php?id=12647) that cause problems
# so require 2.8.8 in this case
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND
CMAKE_SYSTEM_VERSION VERSION_LESS 11.0 AND
CMAKE_VERSION VERSION_EQUAL 2.8.7)
cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)
endif()
FOREACH(policy CMP0012 CMP0013 CMP0014)
IF(POLICY ${policy})
......
PROJECT(ParaViewCore)
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS ${VTK_DEFINITIONS})
ADD_SUBDIRECTORY(Common)
ADD_SUBDIRECTORY(VTKExtensions)
ADD_SUBDIRECTORY(ClientServerCore)
......
......@@ -682,13 +682,19 @@ PVVTK_ADD_LIBRARY(pqComponents
${RCS_SOURCES}
${UI_BUILT_SOURCES}
)
TARGET_LINK_LIBRARIES(pqComponents
pqCore
${PYTHON_LINK_LIBRARIES}
${QT_QTNETWORK_LIBRARY}
)
set(_link_interface "pqCore")
if(PARAVIEW_ENABLE_PYTHON)
list(APPEND _link_interface QtPython)
endif()
pv_set_link_interface_libs(pqComponents ${_link_interface})
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/pqComponentsExport.h.in"
"${CMAKE_CURRENT_BINARY_DIR}/pqComponentsExport.h")
SET(dynamicHeaders
......
......@@ -6,6 +6,12 @@ QT4_WRAP_CPP(MOC_SRCS FilteredPipelineBrowserApp.h)
SET_DIRECTORY_PROPERTIES(PROPERTIES INCLUDE_DIRECTORIES "${include_dirs_tmp}")
ADD_EXECUTABLE(pqPipelineApp FilteredPipelineBrowserApp.cxx FilteredPipelineBrowserApp.h ${MOC_SRCS})
TARGET_LINK_LIBRARIES(pqPipelineApp pqCore pqComponents QtTesting ${QT_LIBRARIES} )
TARGET_LINK_LIBRARIES(pqPipelineApp
pqCore
pqComponents
QtTesting
vtkPVClientServerCore
vtkPVServerManager
${QT_LIBRARIES} )
#ADD_TEST(pqPipelineApp "${EXECUTABLE_OUTPUT_PATH}/pqPipelineApp" -dr "--test-directory=${PARAVIEW_TEST_DIR}")
......@@ -398,6 +398,10 @@ TARGET_LINK_LIBRARIES(pqCore
vtkPVServerManager
)
pv_set_link_interface_libs(pqCore
pqWidgets
vtkPVServerManager)
IF(QT_TESTING_WITH_PYTHON)
TARGET_LINK_LIBRARIES(pqCore
${PYTHON_LIBRARIES}
......
......@@ -27,7 +27,11 @@ IF(QT_TESTING_WITH_PYTHON)
ADD_EXECUTABLE(pqFileDialogTest
pqFileDialogTest.cxx pqFileDialogTest.h
${MOC_SRCS})
TARGET_LINK_LIBRARIES(pqFileDialogTest pqCore QtTesting ${QT_LIBRARIES} )
TARGET_LINK_LIBRARIES(pqFileDialogTest
pqCore
QtTesting
vtkPVClientServerCore
${QT_LIBRARIES} )
ADD_TEST(pqFileDialogTest "${EXECUTABLE_OUTPUT_PATH}/pqFileDialogTest" -dr
"--test-directory=${PARAVIEW_TEST_DIR}"
"--test-script=${CMAKE_CURRENT_SOURCE_DIR}/pqFileDialogTest.py"
......
......@@ -60,6 +60,7 @@ TARGET_LINK_LIBRARIES(QtPython
${QT_LIBRARIES}
${PYTHON_LIBRARIES}
vtkPVPythonInterpretor
vtkPVClientServerCore
)
CONFIGURE_FILE(
......
......@@ -99,6 +99,7 @@ MACRO(PV_WRAP_VTK_CS kit ukit deps)
PV_PRE_WRAP_VTK_CS("vtk${kit}CS" "${kit}" "${ukit}" "${deps}")
PVVTK_ADD_LIBRARY(vtk${kit}CS ${vtk${kit}CS_SRCS})
TARGET_LINK_LIBRARIES(vtk${kit}CS vtkClientServer vtk${kit})
pv_set_link_interface_libs(vtk${kit}CS "")
FOREACH(dep ${deps})
#MESSAGE("Link vtk${kit}CS to vtk${dep}CS")
TARGET_LINK_LIBRARIES(vtk${kit}CS vtk${dep}CS)
......
......@@ -110,6 +110,8 @@ TARGET_LINK_LIBRARIES(vtkPVPythonInterpretor
${VTK_PYTHON_LIBRARIES}
${PYTHON_UTIL_LIBRARY_LIB})
pv_set_link_interface_libs(vtkPVPythonInterpretor "")
# Link against all the kit wrappers.
SET(_PVPYTHON_LINK_LIBS
vtkPVServerManagerPythonD
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment