Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Mar 28th, 2011  |  syntax: None  |  size: 6.31 KB  |  views: 75  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. cmake_minimum_required(VERSION 2.6)
  2.  
  3. project(ImageCompleter)
  4.  
  5. ########### Eigen ##############
  6. include_directories(/media/portable/src/Eigen /media/portable/src/Eigen/unsupported)
  7.  
  8. set(CMAKE_MODULE_PATH /media/portable/src/Eigen/cmake)
  9.  
  10. FIND_PACKAGE(Umfpack REQUIRED)
  11. FIND_PACKAGE(BLAS REQUIRED)
  12.  
  13. include_directories(${UMFPACK_INCLUDES})
  14.  
  15. #SET(MAIN_BUILD_FLAGS "${MAIN_BUILD_FLAGS} -DEIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET")
  16. SET(MAIN_BUILD_DEFINITIONS "${MAIN_BUILD_DEFINITIONS} EIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET;")
  17. # must link to umfpack
  18.  
  19. ################################
  20.  
  21. find_package(wxWidgets COMPONENTS core base REQUIRED)
  22. include( ${wxWidgets_USE_FILE} )
  23.  
  24. set(cmdsrc src/image-completer-cmd)
  25. set(ImageCompleterDir src/image-completer-lib/impl)
  26. set(tech src/tech)
  27.  
  28. include_directories(src/image-completer-cmd src/image-completer-lib src/image-completer-lib/api src/image-completer-lib/impl src/image-completer-lib/impl/compositors src/image-completer-lib/impl/energy-calculators src/tech/tech src/tech)
  29.  
  30. #If you want to enable the patches to be composited using Poisson blending, set this flag to ON (requires TAUCS to be installed).
  31. set(USE_POISSON OFF CACHE BOOL "Use Poisson blending?")
  32. if(USE_POISSON)
  33.   #set(MAIN_BUILD_FLAGS "${MAIN_BUILD_FLAGS} -DUSE_POISSON")
  34.   set(MAIN_BUILD_DEFINITIONS "${MAIN_BUILD_DEFINITIONS} USE_POISSON;")
  35.   set(LibrariesToLink ${LibrariesToLink} umfpack)
  36. endif(USE_POISSON)
  37.  
  38. #If you want to enable the per-pixel energy calculator to use multiple hardware threads, set this flag to ON.
  39. set(USE_THREADS OFF CACHE BOOL "Use threads?" FORCE)
  40. if(USE_THREADS)
  41.   #set(MAIN_BUILD_FLAGS "${MAIN_BUILD_FLAGS} -DUSE_THREADS")
  42.   set(MAIN_BUILD_DEFINITIONS "${MAIN_BUILD_DEFINITIONS} USE_THREADS;")
  43. endif(USE_THREADS)
  44.  
  45. IF(UNIX)
  46.   #set(MAIN_BUILD_FLAGS "${MAIN_BUILD_FLAGS} -DUNIX")
  47.   set(MAIN_BUILD_DEFINITIONS "${MAIN_BUILD_DEFINITIONS} UNIX;")
  48. ENDIF(UNIX)
  49.  
  50. set(USE_ITK OFF CACHE BOOL "Use ITK?")
  51. IF(USE_ITK)
  52.   #set(MAIN_BUILD_FLAGS "${MAIN_BUILD_FLAGS} -DUSE_ITK")
  53.   set(MAIN_BUILD_DEFINITIONS "${MAIN_BUILD_DEFINITIONS} USE_ITK;")
  54. ENDIF(USE_ITK)
  55.  
  56. set(USE_FLOAT_PIXELS OFF CACHE BOOL "Use float pixels?")
  57. IF(USE_FLOAT_PIXELS)
  58.   #set(MAIN_BUILD_FLAGS "${MAIN_BUILD_FLAGS} -DUSE_FLOAT_PIXELS")
  59.   set(MAIN_BUILD_DEFINITIONS "${MAIN_BUILD_DEFINITIONS} USE_FLOAT_PIXELS;")
  60. ENDIF(USE_FLOAT_PIXELS)
  61.  
  62. set(PIXEL_DIMENSION 3 CACHE STRING "Dimensionality of pixels?") #cmake doesn't have an "INT" variable type, so treat it as a string
  63. #set(MAIN_BUILD_FLAGS "${MAIN_BUILD_FLAGS} -DPIXEL_DIMENSION=${PIXEL_DIMENSION}")
  64. set(MAIN_BUILD_DEFINITIONS "${MAIN_BUILD_DEFINITIONS} PIXEL_DIMENSION=${PIXEL_DIMENSION};")
  65.  
  66. ###############
  67. #if Eigen is setup correctly, we would want to enable Poisson blending
  68. IF(USE_POISSON)
  69.   set(ImageCompleterSources ${ImageCompleterSources}
  70.   ${ImageCompleterDir}/compositors/PatchTypePoisson.cpp
  71.   ${ImageCompleterDir}/compositors/PoissonSolver.cpp)
  72. ENDIF(USE_POISSON)
  73.  
  74. set(ImageCompleterSources ${ImageCompleterSources}
  75.  
  76. ${cmdsrc}/AppData.cpp
  77.  
  78. ${ImageCompleterDir}/Compositor.cpp
  79. ${ImageCompleterDir}/ConstNodeLabels.cpp
  80. ${ImageCompleterDir}/EnergyCalculatorContainer.cpp
  81. ${ImageCompleterDir}/ImageConst.cpp
  82. ${ImageCompleterDir}/ImageScalable.cpp
  83. ${ImageCompleterDir}/Label.cpp
  84. ${ImageCompleterDir}/LfnIc.cpp
  85. ${ImageCompleterDir}/MaskScalable.cpp
  86. ${ImageCompleterDir}/MaskWritable.cpp
  87. ${ImageCompleterDir}/NeighborEdge.cpp
  88. ${ImageCompleterDir}/Node.cpp
  89. ${ImageCompleterDir}/NodeSet.cpp
  90. ${ImageCompleterDir}/Pch.cpp
  91. ${ImageCompleterDir}/PriorityBpRunner.cpp
  92. ${ImageCompleterDir}/ScalableDebugging.cpp
  93. ${ImageCompleterDir}/Settings.cpp
  94.  
  95. ${ImageCompleterDir}/compositors/CompositorRoot.cpp
  96. ${ImageCompleterDir}/compositors/CompositorUtils.cpp
  97. ${ImageCompleterDir}/compositors/ImageFloat.cpp
  98. ${ImageCompleterDir}/compositors/OutputBlenderDebugSoftMaskIntensity.cpp
  99. ${ImageCompleterDir}/compositors/OutputBlenderSoftMask.cpp
  100. ${ImageCompleterDir}/compositors/OutputBlenderNone.cpp
  101. ${ImageCompleterDir}/compositors/PatchBlenderNone.cpp
  102. ${ImageCompleterDir}/compositors/PatchBlenderPriority.cpp
  103. ${ImageCompleterDir}/compositors/PatchTypeDebugPatchOrder.cpp
  104. ${ImageCompleterDir}/compositors/PatchTypeNormal.cpp
  105.  
  106. ${ImageCompleterDir}/energy-calculators/EnergyCalculatorFft.cpp
  107. ${ImageCompleterDir}/energy-calculators/EnergyCalculatorFftUtils.cpp
  108. ${ImageCompleterDir}/energy-calculators/EnergyCalculatorPerPixel.cpp
  109.  
  110. )
  111.  
  112. add_library(ImageCompleterLib ${ImageCompleterSources})
  113.  
  114. add_library(Tech
  115. ${tech}/Pch.cpp
  116. ${tech}/tech/Atomic.cpp
  117. ${tech}/tech/Core.cpp
  118. ${tech}/tech/ImageUtils.cpp
  119. ${tech}/tech/Profile.cpp
  120. ${tech}/tech/StrUtils.cpp
  121. ${tech}/tech/Time.cpp
  122. )
  123.  
  124. #####################################
  125. set(AppSources
  126.     ${cmdsrc}/Main.cpp
  127.     ${cmdsrc}/CommandLineOptions.cpp
  128.     ${cmdsrc}/Pch.cpp
  129.     ${cmdsrc}/SettingsText.cpp
  130. )
  131.  
  132. set(LibrariesToLink ${wxWidgets_LIBRARIES} Tech ImageCompleterLib)
  133.  
  134. IF(USE_ITK)
  135.   message("using ITK")
  136.   find_package(ITK REQUIRED)
  137.   include(${ITK_USE_FILE})
  138.  
  139.   set(MainAppSources ${AppSources}
  140.     ${cmdsrc}/AppITKImage.cpp
  141.     ${cmdsrc}/AppITKMask.cpp
  142.     )
  143.   set(LibrariesToLink ${LibrariesToLink} ${ITK_LIBRARIES})
  144. else(USE_ITK)
  145.   message("using wx")
  146.   set(MainAppSources ${AppSources}
  147.     ${cmdsrc}/AppWxImage.cpp
  148.     ${cmdsrc}/AppWxMask.cpp
  149.     )
  150. ENDIF(USE_ITK)
  151. #
  152. # add_executable(ImageCompleter ${MainAppSources})
  153. # target_link_libraries(ImageCompleter ${LibrariesToLink})
  154. # message("Main build definitions: " ${MAIN_BUILD_DEFINITIONS})
  155. # set_target_properties(ImageCompleter PROPERTIES COMPILE_DEFINITIONS "${MAIN_BUILD_DEFINITIONS}")
  156.  
  157. # # Special builds
  158. add_executable(ImageCompleter1f ${AppSources} ${cmdsrc}/AppITKImage.cpp ${cmdsrc}/AppITKMask.cpp)
  159. target_link_libraries(ImageCompleter1f ${LibrariesToLink})
  160. set(my_definitions "EIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET\; UNIX\; USE_ITK\; USE_FLOAT_PIXELS\; PIXEL_DIMENSION=1")
  161. message("my definitions: " ${my_definitions})
  162. set_target_properties(ImageCompleter1f PROPERTIES COMPILE_DEFINITIONS ${my_definitions})
  163. #
  164. # add_executable(ImageCompleter3uc ${AppSources} ${cmdsrc}/AppITKImage.cpp ${cmdsrc}/AppITKMask.cpp)
  165. # target_link_libraries(ImageCompleter3uc ${LibrariesToLink})
  166. # set_target_properties(ImageCompleter3uc PROPERTIES COMPILE_FLAGS "-DEIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET -DUNIX -DUSE_ITK -DPIXEL_DIMENSION=3")