]> Creatis software - clitk.git/blobdiff - vv/CMakeLists.txt
COMP: First Mac 10.9 build fixes.
[clitk.git] / vv / CMakeLists.txt
index 0f95400ad18a431e9a45a4fd3c261999f02498ce..e5e20f97d30f5a5799d8c2e2fef961192e01db77 100644 (file)
@@ -17,19 +17,19 @@ SET(vv_TOOLS
   vvToolBinarize
   vvToolImageArithm
   vvToolResample
-#   vvToolExtractPatient
-#  vvToolExtractLung
-  vvToolStructureSetManager
   vvToolMIP
   vvToolConvert ## with dummy vvToolConvert.ui
   vvToolROIManager
   vvToolSegmentation
-
   ## these ones are for tests (not working)
   # vvToolFoo
   # vvToolFooWithWidgetBase
   # vvToolPlastimatch
   # vvToolConnectedComponentLabeling  
+  ## these ones are old ones
+  # vvToolExtractPatient
+  # vvToolExtractLung
+  # vvToolStructureSetManager
 )
 # dependencies of the tools
 # Future issues : when tool depend on other tools ... how to manage that ?
@@ -43,6 +43,7 @@ SET(vvToolCropImage_LIBS clitkCropImageLib)
 SET(vvToolMIP_LIBS clitkMIPLib)
 SET(vvToolMedianFilter_LIBS clitkMedianImageFilterLib)
 SET(vvToolImageArithm_LIBS clitkImageArithmImageLib)
+SET(vvToolROIManager_LIBS clitkDicomRTStruct)
 
 #=========================================================
 # List of vv source files
@@ -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,12 +197,12 @@ INCLUDE_DIRECTORIES(
   ../segmentation
   )
 
-LINK_DIRECTORIES(${QT_LIBRARY_DIR})
 #=========================================================
 #Add each tool's dependencies
 foreach(tool ${vv_TOOLS})
   SET(toolLibs ${toolLibs} ${${tool}_LIBS})
 endforeach(tool)
+
 #=========================================================
 #Add Foundation Libraries (this should be after our libraries, since we depend
 #on them)
@@ -215,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 clitkDicomRTStruct ${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})
@@ -229,10 +248,8 @@ ELSE(WIN32)
   ADD_EXECUTABLE(vv vv.cxx)
 ENDIF(WIN32)
 
-#TARGET_LINK_LIBRARIES(vv vvLib)
 TARGET_LINK_LIBRARIES(vv vvLib)
 
-
 #=========================================================
 # Install options (also used by CPack)
 INSTALL (TARGETS vv DESTINATION bin PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE)