2009-10-30 18:48:44 +03:00
|
|
|
# - find DCMTK libraries and applications
|
2004-04-23 00:16:15 +04:00
|
|
|
#
|
|
|
|
|
2010-06-15 11:51:14 +04:00
|
|
|
# DCMTK_INCLUDE_DIRS - Directories to include to use DCMTK
|
2005-12-14 21:51:08 +03:00
|
|
|
# DCMTK_LIBRARIES - Files to link against to use DCMTK
|
|
|
|
# DCMTK_FOUND - If false, don't try to use DCMTK
|
|
|
|
# DCMTK_DIR - (optional) Source directory for DCMTK
|
2004-04-23 00:16:15 +04:00
|
|
|
#
|
|
|
|
# DCMTK_DIR can be used to make it simpler to find the various include
|
|
|
|
# directories and compiled libraries if you've just compiled it in the
|
|
|
|
# source tree. Just set it to the root of the tree where you extracted
|
2009-10-30 18:48:44 +03:00
|
|
|
# the source (default to /usr/include/dcmtk/)
|
2009-09-28 19:45:50 +04:00
|
|
|
|
|
|
|
#=============================================================================
|
|
|
|
# Copyright 2004-2009 Kitware, Inc.
|
2010-06-15 11:51:14 +04:00
|
|
|
# Copyright 2009-2010 Mathieu Malaterre <mathieu.malaterre@gmail.com>
|
|
|
|
# Copyright 2010 Thomas Sondergaard <ts@medical-insight.com>
|
2009-09-28 19:45:50 +04:00
|
|
|
#
|
|
|
|
# Distributed under the OSI-approved BSD License (the "License");
|
|
|
|
# see accompanying file Copyright.txt for details.
|
|
|
|
#
|
|
|
|
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
|
|
|
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
# See the License for more information.
|
|
|
|
#=============================================================================
|
2010-08-07 04:48:47 +04:00
|
|
|
# (To distribute this file outside of CMake, substitute the full
|
2009-09-28 19:45:50 +04:00
|
|
|
# License text for the above reference.)
|
|
|
|
|
2004-04-23 00:16:15 +04:00
|
|
|
#
|
|
|
|
# Written for VXL by Amitha Perera.
|
2009-10-30 18:48:44 +03:00
|
|
|
# Upgraded for GDCM by Mathieu Malaterre.
|
2010-06-15 11:51:14 +04:00
|
|
|
# Modified for EasyViz by Thomas Sondergaard.
|
|
|
|
#
|
|
|
|
|
|
|
|
if(NOT DCMTK_FOUND AND NOT DCMTK_DIR)
|
|
|
|
set(DCMTK_DIR
|
|
|
|
"/usr/include/dcmtk/"
|
|
|
|
CACHE
|
|
|
|
PATH
|
|
|
|
"Root of DCMTK source tree (optional).")
|
|
|
|
mark_as_advanced(DCMTK_DIR)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
foreach(lib
|
|
|
|
dcmdata
|
|
|
|
dcmimage
|
|
|
|
dcmimgle
|
|
|
|
dcmjpeg
|
|
|
|
dcmnet
|
|
|
|
dcmpstat
|
|
|
|
dcmqrdb
|
|
|
|
dcmsign
|
|
|
|
dcmsr
|
|
|
|
dcmtls
|
|
|
|
ijg12
|
|
|
|
ijg16
|
|
|
|
ijg8
|
|
|
|
ofstd)
|
|
|
|
|
|
|
|
find_library(DCMTK_${lib}_LIBRARY
|
|
|
|
${lib}
|
|
|
|
PATHS
|
|
|
|
${DCMTK_DIR}/${lib}/libsrc
|
|
|
|
${DCMTK_DIR}/${lib}/libsrc/Release
|
|
|
|
${DCMTK_DIR}/${lib}/libsrc/Debug
|
|
|
|
${DCMTK_DIR}/${lib}/Release
|
|
|
|
${DCMTK_DIR}/${lib}/Debug
|
|
|
|
${DCMTK_DIR}/lib)
|
|
|
|
|
|
|
|
mark_as_advanced(DCMTK_${lib}_LIBRARY)
|
|
|
|
|
|
|
|
if(DCMTK_${lib}_LIBRARY)
|
|
|
|
list(APPEND DCMTK_LIBRARIES ${DCMTK_${lib}_LIBRARY})
|
|
|
|
endif()
|
|
|
|
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
|
|
|
|
set(DCMTK_config_TEST_HEADER osconfig.h)
|
|
|
|
set(DCMTK_dcmdata_TEST_HEADER dctypes.h)
|
|
|
|
set(DCMTK_dcmimage_TEST_HEADER dicoimg.h)
|
|
|
|
set(DCMTK_dcmimgle_TEST_HEADER dcmimage.h)
|
|
|
|
set(DCMTK_dcmjpeg_TEST_HEADER djdecode.h)
|
|
|
|
set(DCMTK_dcmnet_TEST_HEADER assoc.h)
|
|
|
|
set(DCMTK_dcmpstat_TEST_HEADER dcmpstat.h)
|
|
|
|
set(DCMTK_dcmqrdb_TEST_HEADER dcmqrdba.h)
|
|
|
|
set(DCMTK_dcmsign_TEST_HEADER sicert.h)
|
|
|
|
set(DCMTK_dcmsr_TEST_HEADER dsrtree.h)
|
|
|
|
set(DCMTK_dcmtls_TEST_HEADER tlslayer.h)
|
|
|
|
set(DCMTK_ofstd_TEST_HEADER ofstdinc.h)
|
|
|
|
|
|
|
|
foreach(dir
|
|
|
|
config
|
|
|
|
dcmdata
|
|
|
|
dcmimage
|
|
|
|
dcmimgle
|
|
|
|
dcmjpeg
|
|
|
|
dcmnet
|
|
|
|
dcmpstat
|
|
|
|
dcmqrdb
|
|
|
|
dcmsign
|
|
|
|
dcmsr
|
|
|
|
dcmtls
|
|
|
|
ofstd)
|
|
|
|
find_path(DCMTK_${dir}_INCLUDE_DIR
|
|
|
|
${DCMTK_${dir}_TEST_HEADER}
|
|
|
|
PATHS
|
|
|
|
${DCMTK_DIR}/${dir}/include
|
|
|
|
${DCMTK_DIR}/${dir}
|
|
|
|
${DCMTK_DIR}/include/${dir})
|
|
|
|
|
|
|
|
mark_as_advanced(DCMTK_${dir}_INCLUDE_DIR)
|
|
|
|
|
|
|
|
if(DCMTK_${dir}_INCLUDE_DIR)
|
|
|
|
list(APPEND
|
|
|
|
DCMTK_INCLUDE_DIRS
|
|
|
|
${DCMTK_${dir}_INCLUDE_DIR})
|
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
if(WIN32)
|
|
|
|
list(APPEND DCMTK_LIBRARIES netapi32 wsock32)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(DCMTK_ofstd_INCLUDE_DIR)
|
|
|
|
get_filename_component(DCMTK_dcmtk_INCLUDE_DIR
|
2004-04-23 00:16:15 +04:00
|
|
|
${DCMTK_ofstd_INCLUDE_DIR}
|
2010-06-15 11:51:14 +04:00
|
|
|
PATH
|
|
|
|
CACHE)
|
|
|
|
list(APPEND DCMTK_INCLUDE_DIRS ${DCMTK_dcmtk_INCLUDE_DIR})
|
|
|
|
mark_as_advanced(DCMTK_dcmtk_INCLUDE_DIR)
|
|
|
|
endif()
|
|
|
|
|
2010-12-20 23:56:51 +03:00
|
|
|
include(FindPackageHandleStandardArgs)
|
2010-06-15 11:51:14 +04:00
|
|
|
find_package_handle_standard_args(DCMTK DEFAULT_MSG
|
2009-10-30 18:48:44 +03:00
|
|
|
DCMTK_config_INCLUDE_DIR
|
2010-06-15 11:51:14 +04:00
|
|
|
DCMTK_ofstd_INCLUDE_DIR
|
|
|
|
DCMTK_ofstd_LIBRARY
|
2009-10-30 18:48:44 +03:00
|
|
|
DCMTK_dcmdata_INCLUDE_DIR
|
|
|
|
DCMTK_dcmdata_LIBRARY
|
|
|
|
DCMTK_dcmimgle_INCLUDE_DIR
|
2010-06-15 11:51:14 +04:00
|
|
|
DCMTK_dcmimgle_LIBRARY)
|
|
|
|
|
|
|
|
# Compatibility: This variable is deprecated
|
|
|
|
set(DCMTK_INCLUDE_DIR ${DCMTK_INCLUDE_DIRS})
|
2009-10-30 18:48:44 +03:00
|
|
|
|
2010-06-15 11:51:14 +04:00
|
|
|
foreach(executable dcmdump dcmdjpeg dcmdrle)
|
|
|
|
string(TOUPPER ${executable} EXECUTABLE)
|
|
|
|
find_program(DCMTK_${EXECUTABLE}_EXECUTABLE ${executable} ${DCMTK_DIR}/bin)
|
|
|
|
mark_as_advanced(DCMTK_${EXECUTABLE}_EXECUTABLE)
|
|
|
|
endforeach()
|