From b14e05d38fa7c7093a22673adebce86b97d69fa0 Mon Sep 17 00:00:00 2001 From: Hans Johnson Date: Thu, 5 Jun 2014 09:43:10 -0500 Subject: [PATCH] COMP: First Mac 10.9 build fixes. This patch probably includes a few items that are not strictly necessary, but during the fumbling around to find a working solution, these were the identified failures. Updating VTK and ITK were key components to make this process work. --- make_new_tool.sh | 2 ++ superbuild/CMakeLists.txt | 22 +++++++++++++++++----- vv/CMakeLists.txt | 23 ++++++++++++++++++++--- 3 files changed, 39 insertions(+), 8 deletions(-) diff --git a/make_new_tool.sh b/make_new_tool.sh index a616e76..24f914e 100755 --- a/make_new_tool.sh +++ b/make_new_tool.sh @@ -12,6 +12,8 @@ do cp $i ${i/FooImage/$1} if test "$(uname)" = "Darwin" then + echo $(pwd) + echo sed -i "" "s/FooImage/$1/g" ${i/FooImage/$1} sed -i "" "s/FooImage/$1/g" ${i/FooImage/$1} else sed -i "s/FooImage/$1/ig" ${i/FooImage/$1} diff --git a/superbuild/CMakeLists.txt b/superbuild/CMakeLists.txt index c90b286..1a44162 100644 --- a/superbuild/CMakeLists.txt +++ b/superbuild/CMakeLists.txt @@ -38,15 +38,21 @@ set(install_prefix ${base}/Install) find_package(Git REQUIRED) +if( 1 EQUAL 1) #========================================================= # QT +if(WIN32) SET(QtWinSpecFiles "${source_prefix}/qt/mkspecs/win32-msvc2003/qmake.conf;${source_prefix}/qt/mkspecs/win32-msvc2005/qmake.conf;${source_prefix}/qt/mkspecs/win32-msvc2008/qmake.conf;${source_prefix}/qt/mkspecs/win32-msvc2010/qmake.conf") +set(WINPATCH "sed -i \"s/\\-MD/-MT/g\" ${QtWinSpecFiles}") +else() +set(WINPATCH "") +endif() ExternalProject_Add( QT SOURCE_DIR ${source_prefix}/qt GIT_REPOSITORY git://gitorious.org/qt/qt.git - GIT_TAG v4.8.3 - PATCH_COMMAND sed -i "s/\\-MD/-MT/g" ${QtWinSpecFiles} + GIT_TAG v4.8.6 + PATCH_COMMAND ${WINPATCH} CONFIGURE_COMMAND ${source_prefix}/qt/configure -confirm-license -static -fast @@ -63,6 +69,12 @@ ExternalProject_Add( INSTALL_COMMAND "" ) SET(qmake_executable "${build_prefix}/QT/bin/qmake") +set(VTK_DEPEND_QT QT) + +else() + find_package(qt4 REQUIRED) + set(VTK_DEPEND_QT "") +endif() #========================================================= #========================================================= @@ -73,10 +85,10 @@ IF(MSVC) ENDIF(MSVC) ExternalProject_Add( VTK - DEPENDS QT + DEPENDS ${VTK_DEPEND_QT} SOURCE_DIR ${source_prefix}/vtk GIT_REPOSITORY git://vtk.org/VTK.git - GIT_TAG v5.10.1 + GIT_TAG release-5.10 INSTALL_COMMAND "" CMAKE_ARGS -DQT_QMAKE_EXECUTABLE:FILEPATH=${qmake_executable} @@ -168,7 +180,7 @@ endif(MSVC) ExternalProject_Add( VV - DEPENDS QT VTK ITK GDCM + DEPENDS ${VTK_DEPEND_QT} VTK ITK GDCM SOURCE_DIR ${source_prefix}/vv GIT_REPOSITORY git://git.creatis.insa-lyon.fr/clitk INSTALL_DIR ${install_prefix} diff --git a/vv/CMakeLists.txt b/vv/CMakeLists.txt index 9895570..e5e20f9 100644 --- a/vv/CMakeLists.txt +++ b/vv/CMakeLists.txt @@ -7,6 +7,7 @@ if(COMMAND cmake_policy) endif(COMMAND cmake_policy) #========================================================= + #========================================================= #List of vv tools to compile SET(vv_TOOLS @@ -106,6 +107,8 @@ SET(vv_SRCS #========================================================= # Qt related commands FIND_PACKAGE(Qt4 REQUIRED) +LINK_DIRECTORIES(${QT_LIBRARY_DIR}) + QT4_WRAP_CPP(vv_SRCS vvMainWindowBase.h @@ -194,8 +197,6 @@ INCLUDE_DIRECTORIES( ../segmentation ) -LINK_DIRECTORIES(${QT_LIBRARY_DIR}) - #========================================================= #Add each tool's dependencies foreach(tool ${vv_TOOLS}) @@ -217,9 +218,25 @@ IF(CLITK_EXPERIMENTAL) ENDIF(CLITK_EXPERIMENTAL) #========================================================= +#----------------------------------------------------------------------------- +# Avoid linker bug in Mac OS 10.5 +# See http://wiki.finkproject.org/index.php/Fink:Packaging:Preparing_for_10.5#OpenGL_Bug +# +if(APPLE) + FIND_LIBRARY(CoreFoundation_LIBRARY CoreFoundation REQUIRED) + FIND_LIBRARY(ApplicationServices_LIBRARY ApplicationServices REQUIRED) + FIND_LIBRARY(SystemConfiguration_LIBRARY SystemConfiguration REQUIRED) + FIND_LIBRARY(Security_LIBRARY Security REQUIRED) + set(APPLE_FRAMEWORKS ${CoreFoundation_LIBRARY} + ${ApplicationServices_LIBRARY} + ${SystemConfiguration_LIBRARY} + ${Security_LIBRARY} + ) + message(STATUS "===== ${APPLE_FRAMEWORKS}") +endif() #========================================================= #Create binary and libs for tests -SET(vvExternalLibs ${QT_QTNETWORK_LIBRARY} clitkSegmentationGgoLib ${toolLibs} ${foundationLibraries} ${vvCxImage}) +SET(vvExternalLibs clitkSegmentationGgoLib ${toolLibs} ${foundationLibraries} ${vvCxImage} ${QT_LIBRARIES} ${QT_QTNETWORK_LIBRARY} ${APPLE_FRAMEWORKS}) # QtNetwork is required by vvRegisterForm ADD_LIBRARY(vvLib ${vv_SRCS} ${vv_UI_CXX}) -- 2.47.1