Skip to content

Commit

Permalink
Made file extensions explicit for CMake CMP0115.
Browse files Browse the repository at this point in the history
Converted the CMake files to explicit source file extensions,
as needed for CMake policy CMP0115, introduced with CMake 3.20,
which is not set to OLD anymore.

Thanks to Github user Kurt Sansom (kayarre) for the pull request.
This closes Github pull request DCMTK#31.
  • Loading branch information
Marco Eichelberg committed Aug 25, 2021
1 parent 9e196fd commit d090b6d
Show file tree
Hide file tree
Showing 52 changed files with 1,211 additions and 152 deletions.
6 changes: 0 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,6 @@ else()
endif()
cmake_policy(VERSION "${DCMTK_CMAKE_POLICY_VERSION}")

if (POLICY CMP0115)
# suppress warnings about missing filename extensions caused by policy
# CMP0115, introduced with CMake 3.20
cmake_policy(SET CMP0115 OLD)
endif()

# Declare project
project(DCMTK)

Expand Down
7 changes: 5 additions & 2 deletions dcmdata/apps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@ include_directories(${LIBXML_INCDIR})

# declare executables
foreach(PROGRAM dcm2xml dcmconv dcmcrle dcmdrle dcmdump dcmftest dcmgpdir dump2dcm xml2dcm stl2dcm pdf2dcm dcm2pdf img2dcm dcm2json cda2dcm)
DCMTK_ADD_EXECUTABLE(${PROGRAM} ${PROGRAM})
DCMTK_ADD_EXECUTABLE(${PROGRAM} ${PROGRAM}.cc)
endforeach()
DCMTK_ADD_EXECUTABLE(dcmodify dcmodify mdfconen mdfdsman)
DCMTK_ADD_EXECUTABLE(dcmodify
dcmodify.cc
mdfconen.cc
mdfdsman.cc)

# make sure executables are linked to the corresponding libraries
foreach(PROGRAM dcm2xml dcmconv dcmcrle dcmdrle dcmdump dcmgpdir dcmodify dump2dcm xml2dcm stl2dcm pdf2dcm dcm2pdf img2dcm dcm2json cda2dcm)
Expand Down
11 changes: 10 additions & 1 deletion dcmdata/libi2d/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@
include_directories(${LIBXML_INCDIR})

# create library from source files
DCMTK_ADD_LIBRARY(i2d i2d i2dplvlp i2djpgs i2dbmps i2dplsc i2dplnsc i2dplop i2doutpl)
DCMTK_ADD_LIBRARY(i2d
i2d.cc
i2dplvlp.cc
i2djpgs.cc
i2dbmps.cc
i2dplsc.cc
i2dplnsc.cc
i2dplop.cc
i2doutpl.cc
)

DCMTK_TARGET_LINK_MODULES(i2d dcmdata)
124 changes: 113 additions & 11 deletions dcmdata/libsrc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,99 @@ include_directories("${CMAKE_CURRENT_SOURCE_DIR}")
include_directories(${LIBXML_INCDIR})

DCMTK_ADD_LIBRARY(dcmdata
cmdlnarg dcbytstr dcchrstr dccodec dcdatset dcdatutl dcddirif dcdicdir dcdicent
dcdict dcdictbi dcdirrec dcelem dcencdoc dcerror dcfilefo dcfilter dchashdi dcistrma
dcistrmb dcistrmf dcistrmz dcitem dcjson dclist dcmatch dcmetinf dcobject dcostrma
dcostrmb dcostrmf dcostrmz dcpath dcpcache dcpixel dcpixseq dcpxitem dcrleccd
dcrlecce dcrlecp dcrledrg dcrleerg dcrlerp dcsequen dcspchrs dcstack dcswap dctag
dctagkey dctypes dcuid dcvr dcvrae dcvras dcvrat dcvrcs dcvrda dcvrds dcvrdt
dcvrfd dcvrfl dcvris dcvrlo dcvrlt dcvrobow dcvrod dcvrof dcvrol dcvrov dcvrpn
dcvrpobw dcvrsh dcvrsl dcvrss dcvrst dcvrsv dcvrtm dcvruc dcvrui dcvrul dcvrulup
dcvrur dcvrus dcvrut dcvruv dcwcache dcxfer vrscan vrscanl dcistrms dcostrms xml2dcm)
cmdlnarg.cc
dcbytstr.cc
dcchrstr.cc
dccodec.cc
dcdatset.cc
dcdatutl.cc
dcddirif.cc
dcdicdir.cc
dcdicent.cc
dcdict.cc
dcdictbi.cc
dcdirrec.cc
dcelem.cc
dcencdoc.cc
dcerror.cc
dcfilefo.cc
dcfilter.cc
dchashdi.cc
dcistrma.cc
dcistrmb.cc
dcistrmf.cc
dcistrms.cc
dcistrmz.cc
dcitem.cc
dcjson.cc
dclist.cc
dcmatch.cc
dcmetinf.cc
dcobject.cc
dcostrma.cc
dcostrmb.cc
dcostrmf.cc
dcostrms.cc
dcostrmz.cc
dcpath.cc
dcpcache.cc
dcpixel.cc
dcpixseq.cc
dcpxitem.cc
dcrleccd.cc
dcrlecce.cc
dcrlecp.cc
dcrledrg.cc
dcrleerg.cc
dcrlerp.cc
dcsequen.cc
dcspchrs.cc
dcstack.cc
dcswap.cc
dctag.cc
dctagkey.cc
dctypes.cc
dcuid.cc
dcvr.cc
dcvrae.cc
dcvras.cc
dcvrat.cc
dcvrcs.cc
dcvrda.cc
dcvrds.cc
dcvrdt.cc
dcvrfd.cc
dcvrfl.cc
dcvris.cc
dcvrlo.cc
dcvrlt.cc
dcvrobow.cc
dcvrod.cc
dcvrof.cc
dcvrol.cc
dcvrov.cc
dcvrpn.cc
dcvrpobw.cc
dcvrsh.cc
dcvrsl.cc
dcvrss.cc
dcvrst.cc
dcvrsv.cc
dcvrtm.cc
dcvruc.cc
dcvrui.cc
dcvrul.cc
dcvrulup.cc
dcvrur.cc
dcvrus.cc
dcvrut.cc
dcvruv.cc
dcwcache.cc
dcxfer.cc
vrscan.cc
vrscanl.c
xml2dcm.cc
)

DCMTK_TARGET_LINK_MODULES(dcmdata ofstd oflog)
DCMTK_TARGET_LINK_LIBRARIES(dcmdata ${ZLIB_LIBS} ${LIBXML_LIBS})
Expand All @@ -24,8 +108,26 @@ set(DICTIONARIES "${DICOMDIC}" "${PRIVATEDIC}")

if(BUILD_APPS)
# don't use DCMTK_ADD_EXECUTABLE() since we don't want to install the files
add_executable(mkdictbi EXCLUDE_FROM_ALL mkdictbi dctagkey dcdicent dcdict dcvr dchashdi cmdlnarg dctypes)
add_executable(mkdeftag EXCLUDE_FROM_ALL mkdeftag dctagkey dcdicent dcdict dcvr dchashdi cmdlnarg dctypes)
add_executable(mkdictbi EXCLUDE_FROM_ALL
cmdlnarg.cc
dcdicent.cc
dcdict.cc
dchashdi.cc
dctagkey.cc
dctypes.cc
dcvr.cc
mkdictbi.cc
)
add_executable(mkdeftag EXCLUDE_FROM_ALL
cmdlnarg.cc
dcdicent.cc
dcdict.cc
dchashdi.cc
dctagkey.cc
dctypes.cc
dcvr.cc
mkdeftag.cc
)
# workaround for Visual Studio to disable dll storage specifiers when linking directly into the executable.
# this is needed since the built-in dictionary code is created by the tools below and thus those tools
# statically link the few required dcmdata source files instead of linking to dcmdata as a whole.
Expand Down
30 changes: 29 additions & 1 deletion dcmdata/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
# declare executables
DCMTK_ADD_EXECUTABLE(dcmdata_tests tests tpread ti2dbmp tchval tpath tvrdatim telemlen tparser tdict tvrds tvrfd tvrpn tvrui tvrol tvrov tvrsv tvruv tstrval tspchrs tparent tfilter tvrcomp tmatch tnewdcme tgenuid tsequen titem)
DCMTK_ADD_EXECUTABLE(dcmdata_tests
tchval.cc
tdict.cc
telemlen.cc
tests.cc
tfilter.cc
tgenuid.cc
ti2dbmp.cc
titem.cc
tmatch.cc
tnewdcme.cc
tparent.cc
tparser.cc
tpath.cc
tpread.cc
tsequen.cc
tspchrs.cc
tstrval.cc
tvrcomp.cc
tvrdatim.cc
tvrds.cc
tvrfd.cc
tvrol.cc
tvrov.cc
tvrpn.cc
tvrsv.cc
tvrui.cc
tvruv.cc
)

# make sure executables are linked to the corresponding libraries
DCMTK_TARGET_LINK_MODULES(dcmdata_tests i2d dcmdata oflog ofstd)
Expand Down
4 changes: 3 additions & 1 deletion dcmect/libsrc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# create library from source files
DCMTK_ADD_LIBRARY(dcmect enhanced_ct types)
DCMTK_ADD_LIBRARY(dcmect
enhanced_ct.cc
types.cc)

DCMTK_TARGET_LINK_MODULES(dcmect dcmfg dcmiod dcmdata ofstd oflog)
7 changes: 4 additions & 3 deletions dcmect/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# declare executables
DCMTK_ADD_EXECUTABLE(dcmect_tests
tests
t_huge_concat
t_roundtrip)
tests.cc
t_huge_concat.cc
t_roundtrip.cc
)

# make sure executables are linked to the corresponding libraries
DCMTK_TARGET_LINK_MODULES(dcmect_tests dcmect dcmfg dcmdata oflog ofstd)
Expand Down
72 changes: 36 additions & 36 deletions dcmfg/libsrc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
# create library from source files
DCMTK_ADD_LIBRARY(dcmfg
concatenationcreator
concatenationloader
fg
fgbase
fgctacquisitiondetails
fgctacquisitiontype
fgctadditionalxraysource
fgctexposure
fgctgeometry
fgctimageframetype
fgctposition
fgctreconstruction
fgcttabledynamics
fgctxraydetails
fgderimg
fgfact
fgfracon
fgframeanatomy
fgframevoilut
fgpixeltransform
fgimagedatatype
fginterface
fgirradiationeventid
fgpixmsr
fgparametricmapframetype
fgplanor
fgplanorvol
fgplanpo
fgplanposvol
fgrealworldvaluemapping
fgseg
fgtemporalposition
fgusimagedescription
fgtypes
stack
stackinterface)
concatenationcreator.cc
concatenationloader.cc
fg.cc
fgbase.cc
fgctacquisitiondetails.cc
fgctacquisitiontype.cc
fgctadditionalxraysource.cc
fgctexposure.cc
fgctgeometry.cc
fgctimageframetype.cc
fgctposition.cc
fgctreconstruction.cc
fgcttabledynamics.cc
fgctxraydetails.cc
fgderimg.cc
fgfact.cc
fgfracon.cc
fgframeanatomy.cc
fgframevoilut.cc
fgpixeltransform.cc
fgimagedatatype.cc
fginterface.cc
fgirradiationeventid.cc
fgpixmsr.cc
fgparametricmapframetype.cc
fgplanor.cc
fgplanorvol.cc
fgplanpo.cc
fgplanposvol.cc
fgrealworldvaluemapping.cc
fgseg.cc
fgtemporalposition.cc
fgusimagedescription.cc
fgtypes.cc
stack.cc
stackinterface.cc)

DCMTK_TARGET_LINK_MODULES(dcmfg dcmiod dcmdata ofstd oflog)
23 changes: 12 additions & 11 deletions dcmfg/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
# declare executables
DCMTK_ADD_EXECUTABLE(dcmfg_tests
tests
t_concatenation_creator
t_concatenation_loader
t_ct_acquisition_details
t_ct_acquisition_type
t_ct_image_frame_type
t_ct_position
t_ct_table_dynamics
t_deriv_image
t_frame_content
t_irradiation_event_identification)
tests.cc
t_concatenation_creator.cc
t_concatenation_loader.cc
t_ct_acquisition_details.cc
t_ct_acquisition_type.cc
t_ct_image_frame_type.cc
t_ct_position.cc
t_ct_table_dynamics.cc
t_deriv_image.cc
t_frame_content.cc
t_irradiation_event_identification.cc
)

# make sure executables are linked to the corresponding libraries
DCMTK_TARGET_LINK_MODULES(dcmfg_tests dcmfg dcmdata oflog ofstd)
Expand Down
2 changes: 1 addition & 1 deletion dcmimage/apps/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# declare executables
foreach(PROGRAM dcm2pnm dcmquant dcmscale dcmicmp)
DCMTK_ADD_EXECUTABLE(${PROGRAM} ${PROGRAM})
DCMTK_ADD_EXECUTABLE(${PROGRAM} ${PROGRAM}.cc)
endforeach()

# make sure executables are linked to the corresponding libraries
Expand Down
25 changes: 24 additions & 1 deletion dcmimage/libsrc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
# create library from source files
DCMTK_ADD_LIBRARY(dcmimage diargimg dicmyimg dicoimg dicoopx dicopx dihsvimg dilogger dipalimg dipipng dipitiff diqtctab diqtfs diqthash diqthitl diqtpbox diquant diregist dirgbimg diybrimg diyf2img diyp2img dcmicmph)
DCMTK_ADD_LIBRARY(dcmimage
dcmicmph.cc
diargimg.cc
dicmyimg.cc
dicoimg.cc
dicoopx.cc
dicopx.cc
dihsvimg.cc
dilogger.cc
dipalimg.cc
dipipng.cc
dipitiff.cc
diqtctab.cc
diqtfs.cc
diqthash.cc
diqthitl.cc
diqtpbox.cc
diquant.cc
diregist.cc
dirgbimg.cc
diybrimg.cc
diyf2img.cc
diyp2img.cc
)

DCMTK_TARGET_LINK_MODULES(dcmimage oflog dcmdata dcmimgle)
DCMTK_TARGET_LINK_LIBRARIES(dcmimage ${LIBTIFF_LIBS} ${LIBPNG_LIBS})
2 changes: 1 addition & 1 deletion dcmimgle/apps/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# declare executables
foreach(PROGRAM dcmdspfn dcod2lum dconvlum)
DCMTK_ADD_EXECUTABLE(${PROGRAM} ${PROGRAM})
DCMTK_ADD_EXECUTABLE(${PROGRAM} ${PROGRAM}.cc)
endforeach()

# make sure executables are linked to the corresponding libraries
Expand Down
Loading

0 comments on commit d090b6d

Please sign in to comment.