Commit 367a75f3 authored by saubatn's avatar saubatn

UPDATED : CamiTKMacros.cmake, CamiTKVariables.cmake => extensions are now...

UPDATED : CamiTKMacros.cmake, CamiTKVariables.cmake => extensions are now compatbile with Debug / Release unique folder on Windows.

git-svn-id: svn+ssh://scm.forge.imag.fr/var/lib/gforge/chroot/scmrepos/svn/camitk/trunk/camitk@730 ec899d31-69d1-42ba-9299-647d76f65fb3
parent 97b4fc8b
......@@ -383,7 +383,7 @@ macro(camitk_extension)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${TYPE_EXTENSION}s)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TYPE_EXTENSION}s)
# Be sure to build in the bin folder with MinGW (no subfolder allowed, except actions / componennts ones).
# Be sure to build in the bin folder with MinGW (no subfolder allowed, except actions / components ones).
if ( ${CMAKE_GENERATOR} MATCHES "MinGW") # MinGW compiler
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CAMITK_BIN_DIR}/${TYPE_EXTENSION}s)
set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CAMITK_BIN_DIR}/${TYPE_EXTENSION}s)
......@@ -400,7 +400,6 @@ macro(camitk_extension)
endforeach( OUTPUTCONFIG CMAKE_CONFIGURATION_TYPES )
endif(${CMAKE_GENERATOR} MATCHES "Visual Studio")
# include directories
include_directories(${CAMITK_INCLUDE_DIRECTORIES})
include_directories(${CMAKE_CURRENT_BINARY_DIR})
......@@ -427,8 +426,13 @@ macro(camitk_extension)
foreach(CEP_LIBRARIES_NEEDED ${${EXTENSION_NAME_CMAKE}_NEEDS_CEP_LIBRARIES})
string(TOUPPER ${CEP_LIBRARIES_NEEDED} ${CEP_LIBRARIES_NEEDED}_INTERNAL)
set(CEP_LIBRARY_${${CEP_LIBRARIES_NEEDED}_INTERNAL} ON CACHE BOOL "Required by action extension ${EXTENSION_NAME}" FORCE )
set(CEP_LIBRARIES ${CEP_LIBRARIES} ${CEP_LIBRARIES_NEEDED})
include_directories(${CAMITK_INCLUDE_DIR}/${CEP_LIBRARIES_NEEDED})
# Add the CEP dependencies libraries
if (WIN32 OR WIN64)
set(CEP_LIBRARIES ${CEP_LIBRARIES} debug ${CEP_LIBRARIES_NEEDED}d optimized ${CEP_LIBRARIES_NEEDED})
else(WIN32 OR WIN64)
set(CEP_LIBRARIES ${CEP_LIBRARIES} ${CEP_LIBRARIES_NEEDED})
endif (WIN32 OR WIN64)
include_directories(${CAMITK_INCLUDE_DIR}/${CEP_LIBRARIES_NEEDED})
include_directories(${CMAKE_BINARY_DIR}/include/${CEP_LIBRARIES_NEEDED})
endforeach()
endif()
......@@ -439,10 +443,46 @@ macro(camitk_extension)
# ITK is required
find_package(ITK REQUIRED)
include(${ITK_USE_FILE})
set(ITK_LIBRARIES ITKBasicFilters ITKCommon ITKIO)
# if (${CMAKE_GENERATOR} MATCHES "Visual Studio" OR "MinGW") # Running on a Windows platform
# set(ITK_LIBRARIES ${ITK_LIBRARIES} ITKBasicFiltersD ITKCommonD ITKIOD)
# endif ($(CMAKE_GENERATOR) MATCHES "Visual Studio" OR "MinGW")
if (WIN32 OR WIN64)
set(ITK_LIBRARIES
debug ITKBasicFiltersd
optimized ITKBasicFilters
debug ITKCommond
optimized ITKCommon
debug ITKIOd
optimized ITKIO
debug ITKNrrdIOd.lib
debug itkgdcmd.lib
debug itkjpeg12d.lib
debug itkjpeg16d.lib
debug itkopenjpegd.lib
debug itkpngd.lib
debug itktiffd.lib
debug itkjpeg8d.lib
debug ITKSpatialObjectd.lib
debug itkvnl_instd.lib
debug itkvnl_algod.lib
debug itkv3p_netlibd.lib
debug itkvnld.lib
debug itkvcld.lib
debug itkv3p_lsqrd.lib
debug ITKMetaIOd.lib
debug itksysd.lib
debug ITKDICOMParserd.lib
debug ITKEXPATd.lib
debug ITKniftiiod.lib
debug ITKznzd.lib
debug itkzlibd.lib
debug snmpapi.lib
debug rpcrt4.lib
debug ws2_32.lib
debug comctl32.lib
debug wsock32.lib
debug opengl32.lib
)
else(WIN32 OR WIN64)
set(ITK_LIBRARIES ITKBasicFilters ITKCommon ITKIO)
endif (WIN32 OR WIN64)
else()
set(ITK_LIBRARIES "")
endif()
......@@ -524,7 +564,11 @@ macro(camitk_extension)
foreach(COMPONENT_NEEDED ${${EXTENSION_NAME_CMAKE}_NEEDS_COMPONENT_EXTENSION})
string(TOUPPER ${COMPONENT_NEEDED} ${COMPONENT_NEEDED}_INTERNAL)
set(COMPONENT_${${COMPONENT_NEEDED}_INTERNAL} ON CACHE BOOL "Required by extension ${EXTENSION_NAME}" FORCE )
set(COMPONENT_EXTENSION_LIBRARIES ${COMPONENT_EXTENSION_LIBRARIES} ${COMPONENT_NEEDED})
if (WIN32 OR WIN64)
set(COMPONENT_EXTENSION_LIBRARIES ${COMPONENT_EXTENSION_LIBRARIES} debug ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/components/${COMPONENT_NEEDED}d optimized ${COMPONENT_NEEDED} )
else(WIN32 OR WIN64)
set(COMPONENT_EXTENSION_LIBRARIES ${COMPONENT_EXTENSION_LIBRARIES} ${COMPONENT_NEEDED})
endif (WIN32 OR WIN64)
include_directories(${CAMITK_INCLUDE_DIR}/components/${COMPONENT_NEEDED})
endforeach()
endif()
......@@ -535,12 +579,16 @@ macro(camitk_extension)
foreach(ACTION_NEEDED ${${EXTENSION_NAME_CMAKE}_NEEDS_ACTION_EXTENSION})
string(TOUPPER ${ACTION_NEEDED} ${ACTION_NEEDED}_INTERNAL)
set(ACTION_${${ACTION_NEEDED}_INTERNAL} ON CACHE BOOL "Required by extension ${EXTENSION_NAME}" FORCE )
set(ACTION_EXTENSION_LIBRARIES ${ACTION_EXTENSION_LIBRARIES} ${ACTION_NEEDED})
if (WIN32 OR WIN64)
set(ACTION_EXTENSION_LIBRARIES ${ACTION_EXTENSION_LIBRARIES} debug ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/actions/${ACTION_NEEDED}d optimized ${ACTION_NEEDED})
else(WIN32 OR WIN64)
set(ACTION_EXTENSION_LIBRARIES ${ACTION_EXTENSION_LIBRARIES} ${ACTION_NEEDED})
endif (WIN32 OR WIN64)
include_directories(${CAMITK_INCLUDE_DIR}/actions/${ACTION_NEEDED})
endforeach()
endif()
# check for libs in all known camitk dir + actions subdir (beware of the plateform bin or lib?)
# check for libs in all known camitk dir + actions subdir (beware of the plateform bin or lib?)
link_directories( ${CAMITK_LIB_DIRECTORIES}
${CAMITK_BIN_DIR}
${CAMITK_BIN_DIR}/components
......@@ -577,7 +625,8 @@ macro(camitk_extension)
# Set the libraries required to link the target
# An component or action has to be linked with ${CAMITK_CORE_LIB} and with all its dependencies
target_link_libraries(${${TYPE_EXTENSION_CMAKE}_TARGET_NAME} ${CAMITK_LIBRARIES} ${QT_LIBRARIES_WITH_QTXML} ${CAMITK_CORE_LIB} ${COMPONENT_EXTENSION_LIBRARIES} ${ACTION_EXTENSION_LIBRARIES} ${ITK_LIBRARIES} ${LIBXML2_LIBRARIES} ${OpenCV_LIBRARIES} ${IGSTK_LIBRARIES} ${XERCESC_LIBRARY} ${CEP_LIBRARIES} ${${EXTENSION_NAME_CMAKE}_LIBRARIES})
target_link_libraries(${${TYPE_EXTENSION_CMAKE}_TARGET_NAME} ${CAMITK_LIBRARIES} ${ITK_LIBRARIES} ${QT_LIBRARIES_WITH_QTXML} ${CAMITK_CORE_LIB} ${COMPONENT_EXTENSION_LIBRARIES} ${ACTION_EXTENSION_LIBRARIES} ${ITK_LIBRARIES} ${LIBXML2_LIBRARIES} ${OpenCV_LIBRARIES} ${IGSTK_LIBRARIES} ${XERCESC_LIBRARY} ${CEP_LIBRARIES} ${${EXTENSION_NAME_CMAKE}_LIBRARIES} )
# dependencies to core (only set for internal build)
if (CAMITK_INTERNAL_BUILD)
......@@ -1085,8 +1134,8 @@ macro(application_extension)
if ( MSVC )
include(CreateLaunchers)
create_target_launcher(
${APPLICATION_TARGET_NAME}
RUNTIME_LIBRARY_DIRS "%VTK_DIR%/bin/$(OutDir)" "%ITK_DIR%/bin/$(OutDir)"
${APPLICATION_TARGET_NAME}-debug
# RUNTIME_LIBRARY_DIRS "%VTK_DIR%/install/bin" "%ITK_DIR%/install/bin"
)
endif( MSVC )
......
......@@ -16,6 +16,12 @@
#
# name of the camitk core lib
set(CAMITK_CORE_LIB camitkcore)
# if (WIN32 OR WIN64)
# set(CAMITK_CORE_LIB debug camitkcored optimized camitkcore)
# else (WIN32 OR WIN64)
# set(CAMITK_CORE_LIB camitkcore)
# endif (WIN32 OR WIN64)
# List of directories where the linker should look for CamiTK core libraries and tools
set (CAMITK_LIB_DIRECTORIES
......@@ -33,60 +39,55 @@ set (CAMITK_INCLUDE_DIRECTORIES
${VTK_INCLUDE_DIRS}
)
# basic list of all libs needed for linking with CamiTK core
set (CAMITK_LIBRARIES
${QT_LIBRARIES}
vtkCommon
vtkFiltering
vtkGenericFiltering
vtkGraphics
vtkHybrid
vtkImaging
vtkIO
vtkRendering
vtkVolumeRendering
vtkftgl
vtkWidgets
QVTK
qtpropertybrowser # in tools
)
# TODO : test when ready
# if (${CMAKE_GENERATOR} MATCHES "Visual Studio" OR "MinGW") # Running on a Windows platform
# set ( CAMITK_LIBRARIES
# ${CAMITK_LIBRARIES}
# vtkCommonD
# vtkFilteringD
# vtkGenericFilteringD
# vtkGraphicsD
# vtkHybridD
# vtkImagingD
# vtkIOD
# vtkRenderingD
# vtkVolumeRenderingD
# vtkftglD
# vtkWidgetsD
# QVTKD
# qtpropertybrowserD # in tools
# )
# endif ($(CMAKE_GENERATOR) MATCHES "Visual Studio" OR "MinGW")
set (CAMITK_LIBRARIES
${QT_LIBRARIES}
vtkCommon
vtkFiltering
vtkGenericFiltering
vtkGraphics
vtkHybrid
vtkImaging
vtkIO
vtkRendering
vtkVolumeRendering
vtkftgl
vtkWidgets
QVTK
qtpropertybrowser # in tools
)
# Required Qt and VTK libraries for linking
if (WIN32 OR WIN64)
set ( CAMITK_LIBRARIES
${QT_LIBRARIES}
debug ${VTK_DIR}/vtkCommond
optimized vtkCommon
debug ${VTK_DIR}/vtkFilteringd
optimized vtkFiltering
debug ${VTK_DIR}/vtkGenericFilteringd
optimized vtkGenericFiltering
debug ${VTK_DIR}/vtkGraphicsd
optimized vtkGraphics
debug ${VTK_DIR}/vtkHybridd
optimized vtkHybrid
debug ${VTK_DIR}/vtkImagingd
optimized vtkImaging
debug ${VTK_DIR}/vtkIOd
optimized vtkIO
debug ${VTK_DIR}/vtkRenderingd
optimized vtkRendering
debug ${VTK_DIR}/vtkVolumeRenderingd
optimized vtkVolumeRendering
debug ${VTK_DIR}/vtkftgld
optimized vtkftgl
debug ${VTK_DIR}/vtkWidgetsd
optimized vtkWidgets
debug ${VTK_DIR}/QVTKd
optimized QVTK
debug ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/qtpropertybrowserd
optimized qtpropertybrowser
)
else(WIN32 OR WIN64)
set ( CAMITK_LIBRARIES
${QT_LIBRARIES}
vtkCommon
vtkFiltering
vtkGenericFiltering
vtkGraphics
vtkHybrid
vtkImaging
vtkIO
vtkRendering
vtkVolumeRendering
vtkftgl
vtkWidgets
QVTK
qtpropertybrowser
)
endif(WIN32 OR WIN64)
if (CMAKE_CROSSCOMPILING)
# there is some tiff dependencies to jpeg that are not well handled
......
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