diff --git a/praat/CMakeLists.txt b/praat/CMakeLists.txt
index c30277fe..4e6fbc70 100644
--- a/praat/CMakeLists.txt
+++ b/praat/CMakeLists.txt
@@ -15,6 +15,15 @@
# You should have received a copy of the GNU General Public License
# along with Parselmouth. If not, see
+function(add_praat_subdir)
+ cmake_parse_arguments(ARG "" "" "SOURCES;INCLUDE_DIRS" ${ARGN})
+
+ target_sources(praat PRIVATE ${ARG_SOURCES})
+ get_target_property(PRAAT_SOURCE_DIR praat SOURCE_DIR)
+ list(TRANSFORM ARG_INCLUDE_DIRS PREPEND "${PRAAT_SOURCE_DIR}/" OUTPUT_VARIABLE ABSOLUTE_INCLUDE_DIRS)
+ set_source_files_properties(${ARG_SOURCES} DIRECTORY "${PRAAT_SOURCE_DIR}" PROPERTIES INCLUDE_DIRECTORIES "${ABSOLUTE_INCLUDE_DIRS}")
+endfunction()
+
set(PRAAT_SUBDIRECTORIES
external/clapack
external/gsl
@@ -42,13 +51,8 @@ set(PRAAT_SUBDIRECTORIES
artsynth
)
-set(PRAAT_INCLUDE_DIRS
- ${PRAAT_SUBDIRECTORIES}
- external/opusfile/opus
- external/opusfile/opus/celt
- external/opusfile/opus/silk
- external/opusfile/opus/silk/float
-)
+set(PRAAT_INCLUDE_DIRS ${PRAAT_SUBDIRECTORIES})
+list(FILTER PRAAT_INCLUDES EXCLUDE REGEX "^external/")
set(PRAAT_FLAGS)
set(PRAAT_FLAGS_PRIVATE)
@@ -86,7 +90,7 @@ foreach(SUBDIR ${PRAAT_SUBDIRECTORIES})
add_subdirectory(${SUBDIR})
endforeach()
-target_include_directories(praat PUBLIC ${PRAAT_INCLUDE_DIRS})
+target_include_directories(praat INTERFACE ${PRAAT_INCLUDE_DIRS})
target_compile_definitions(praat PUBLIC ${PRAAT_DEFINITIONS} PRIVATE ${PRAAT_DEFINITIONS_PRIVATE})
target_compile_options(praat PUBLIC ${PRAAT_FLAGS} PRIVATE ${PRAAT_FLAGS_PRIVATE})
target_link_libraries(praat PUBLIC fmt::fmt)
diff --git a/praat/EEG/CMakeLists.txt b/praat/EEG/CMakeLists.txt
index cdc77454..39a488d0 100644
--- a/praat/EEG/CMakeLists.txt
+++ b/praat/EEG/CMakeLists.txt
@@ -1,5 +1,7 @@
-target_sources(praat PRIVATE
+add_praat_subdir(SOURCES
EEG.cpp EEGArea.cpp EEGAnalysisArea.cpp
EEGWindow.cpp ERPTier.cpp ERP.cpp ERPArea.cpp ERPWindow.cpp
praat_EEG.cpp manual_EEG.cpp
+INCLUDE_DIRS
+ kar melder sys dwsys stat dwtools fon foned
)
diff --git a/praat/FFNet/CMakeLists.txt b/praat/FFNet/CMakeLists.txt
index b3b4a339..d700834e 100644
--- a/praat/FFNet/CMakeLists.txt
+++ b/praat/FFNet/CMakeLists.txt
@@ -1,7 +1,9 @@
-target_sources(praat PRIVATE
+add_praat_subdir(SOURCES
FFNet.cpp
FFNet_Eigen.cpp FFNet_Matrix.cpp FFNet_PatternList.cpp
FFNet_ActivationList_Categories.cpp FFNet_PatternList_ActivationList.cpp
FFNet_PatternList_Categories.cpp
praat_FFNet_init.cpp manual_FFNet.cpp
+INCLUDE_DIRS
+ kar melder sys dwtools fon dwsys stat gram
)
diff --git a/praat/LPC/CMakeLists.txt b/praat/LPC/CMakeLists.txt
index 908aecbb..e8feeddb 100644
--- a/praat/LPC/CMakeLists.txt
+++ b/praat/LPC/CMakeLists.txt
@@ -1,4 +1,4 @@
-target_sources(praat PRIVATE
+add_praat_subdir(SOURCES
Cepstrum.cpp Cepstrumc.cpp Cepstrum_and_Spectrum.cpp
Cepstrogram.cpp
Formant_extensions.cpp
@@ -16,4 +16,6 @@ target_sources(praat PRIVATE
Sound_and_Cepstrum.cpp Tube.cpp
VocalTractTier.cpp
praat_LPC_init.cpp manual_LPC.cpp
+INCLUDE_DIRS
+ LPC kar melder fon foned dwtools sys dwsys stat
)
diff --git a/praat/artsynth/CMakeLists.txt b/praat/artsynth/CMakeLists.txt
index 3a65aaf4..e65f0eca 100644
--- a/praat/artsynth/CMakeLists.txt
+++ b/praat/artsynth/CMakeLists.txt
@@ -1,7 +1,9 @@
-target_sources(praat PRIVATE
+add_praat_subdir(SOURCES
Speaker.cpp Articulation.cpp Artword.cpp
Art_Speaker.cpp Art_Speaker_to_VocalTract.cpp Artword_Speaker.cpp Artword_Speaker_Sound.cpp
Artword_Speaker_to_Sound.cpp Artword_to_Art.cpp
Delta.cpp Speaker_to_Delta.cpp Art_Speaker_Delta.cpp
ArtwordEditor.cpp praat_Artsynth.cpp manual_Artsynth.cpp
+INCLUDE_DIRS
+ kar melder sys fon stat
)
diff --git a/praat/dwsys/CMakeLists.txt b/praat/dwsys/CMakeLists.txt
index 48ac26dc..0b4d1356 100644
--- a/praat/dwsys/CMakeLists.txt
+++ b/praat/dwsys/CMakeLists.txt
@@ -1,4 +1,4 @@
-target_sources(praat PRIVATE
+add_praat_subdir(SOURCES
ChebyshevSeries.cpp Collection_extensions.cpp Command.cpp
DoublyLinkedList.cpp Eigen.cpp
FileInMemory.cpp FileInMemorySet.cpp FileInMemoryManager.cpp
@@ -13,5 +13,6 @@ target_sources(praat PRIVATE
Polynomial.cpp
Roots.cpp
Spline.cpp SVD.cpp WorkvectorPool.cpp
- NUMmachar.cpp
+INCLUDE_DIRS
+ melder stat sys fon external/gsl external/clapack kar dwtools
)
diff --git a/praat/dwtools/CMakeLists.txt b/praat/dwtools/CMakeLists.txt
index 20bdcf72..cd178125 100644
--- a/praat/dwtools/CMakeLists.txt
+++ b/praat/dwtools/CMakeLists.txt
@@ -1,4 +1,4 @@
-target_sources(praat PRIVATE
+add_praat_subdir(SOURCES
ActivationList.cpp AffineTransform.cpp AnalyticSound.cpp
Categories.cpp CategoriesEditor.cpp
Categories_and_Strings.cpp CCA.cpp CCA_and_Correlation.cpp
@@ -53,4 +53,6 @@ target_sources(praat PRIVATE
TextGridTierNavigator.cpp TextGridNavigator.cpp Vector_extensions.cpp VowelEditor.cpp
praat_MDS_init.cpp praat_BSS_init.cpp praat_HMM_init.cpp
praat_KlattGrid_init.cpp praat_MultiSampledSpectrogram.cpp praat_DataModeler_init.cpp praat_David_init.cpp
+INCLUDE_DIRS
+ dwtools kar melder LPC fon foned sys stat dwsys external/portaudio external/espeak external/clapack EEG external/vorbis external/opusfile
)
diff --git a/praat/external/clapack/CMakeLists.txt b/praat/external/clapack/CMakeLists.txt
index b1ee4283..39a19ded 100644
--- a/praat/external/clapack/CMakeLists.txt
+++ b/praat/external/clapack/CMakeLists.txt
@@ -1,5 +1,7 @@
-target_sources(praat PRIVATE
+add_praat_subdir(SOURCES
blas.cpp
lapack.cpp lapack_dg.cpp lapack_dlaq.cpp
lapack_dlar.cpp lapack_ds.cpp lapack_dt.cpp
+INCLUDE_DIRS
+ melder
)
diff --git a/praat/external/espeak/CMakeLists.txt b/praat/external/espeak/CMakeLists.txt
index 353ced76..941e0f92 100644
--- a/praat/external/espeak/CMakeLists.txt
+++ b/praat/external/espeak/CMakeLists.txt
@@ -1,4 +1,4 @@
-target_sources(praat PRIVATE
+add_praat_subdir(SOURCES
case.cpp categories.cpp common.cpp compiledata.cpp compiledict.cpp
dictionary.cpp
encoding.cpp error.cpp espeak_api.cpp
@@ -10,4 +10,6 @@ target_sources(praat PRIVATE
create_espeak_ng_FileInMemoryManager.cpp
create_espeak_ng_FileInMemorySet__ru.cpp create_espeak_ng_FileInMemorySet.cpp
espeak_io.cpp
+INCLUDE_DIRS
+ kar melder dwtools sys dwsys stat
)
diff --git a/praat/external/flac/CMakeLists.txt b/praat/external/flac/CMakeLists.txt
index 47cc2a35..bef20d57 100644
--- a/praat/external/flac/CMakeLists.txt
+++ b/praat/external/flac/CMakeLists.txt
@@ -1,4 +1,4 @@
-target_sources(praat PRIVATE
+add_praat_subdir(SOURCES
flac_bitmath.c
flac_bitreader.c
flac_bitwriter.c
@@ -16,7 +16,9 @@ target_sources(praat PRIVATE
flac_stream_encoder.c
flac_stream_encoder_framing.c
flac_window.c
+INCLUDE_DIRS
+ melder
)
if (WIN32)
- target_sources(praat PRIVATE flac_windows_unicode_filenames.c)
+ add_praat_subdir(SOURCES flac_windows_unicode_filenames.c INCLUDE_DIRS melder)
endif ()
diff --git a/praat/external/glpk/CMakeLists.txt b/praat/external/glpk/CMakeLists.txt
index a1eaaa3b..17198df5 100644
--- a/praat/external/glpk/CMakeLists.txt
+++ b/praat/external/glpk/CMakeLists.txt
@@ -1,4 +1,4 @@
-target_sources(praat PRIVATE
+add_praat_subdir(SOURCES
amd_1.c amd_2.c amd_aat.c amd_control.c amd_defaults.c amd_info.c
amd_order.c amd_post_tree.c amd_postorder.c amd_preprocess.c amd_valid.c
colamd.c
diff --git a/praat/external/gsl/CMakeLists.txt b/praat/external/gsl/CMakeLists.txt
index df11993c..1de42c26 100644
--- a/praat/external/gsl/CMakeLists.txt
+++ b/praat/external/gsl/CMakeLists.txt
@@ -1,4 +1,4 @@
-target_sources(praat PRIVATE
+add_praat_subdir(SOURCES
gsl_blas__blas.c gsl_block__block.c gsl_block__file.c
gsl_block__init.c gsl_bspline__bspline.c gsl_cblas__caxpy.c
gsl_cblas__ccopy.c gsl_cblas__cdotc_sub.c gsl_cblas__cdotu_sub.c
diff --git a/praat/external/lame/CMakeLists.txt b/praat/external/lame/CMakeLists.txt
index 682ed25f..a87be140 100644
--- a/praat/external/lame/CMakeLists.txt
+++ b/praat/external/lame/CMakeLists.txt
@@ -1,6 +1,8 @@
-target_sources(praat PRIVATE
+add_praat_subdir(SOURCES
bitstream.c encoder.c fft.c gain_analysis.c mpglib_interface.c id3tag.c lame.c
newmdct.c psymodel.c quantize.c quantize_pvt.c set_get.c vbrquantize.c
reservoir.c tables.c takehiro.c util.c VbrTag.c
version.c presets.c vector_xmm_quantize_sub.c
+INCLUDE_DIRS
+ melder
)
diff --git a/praat/external/mp3/CMakeLists.txt b/praat/external/mp3/CMakeLists.txt
index 38c84782..0a0abb43 100644
--- a/praat/external/mp3/CMakeLists.txt
+++ b/praat/external/mp3/CMakeLists.txt
@@ -1,4 +1,4 @@
-target_sources(praat PRIVATE
+add_praat_subdir(SOURCES
mp3.cpp
mad_bit.c
mad_decoder.c
@@ -11,4 +11,6 @@ target_sources(praat PRIVATE
mad_synth.c
mad_timer.c
mad_version.c
+INCLUDE_DIRS
+ melder
)
diff --git a/praat/external/opusfile/CMakeLists.txt b/praat/external/opusfile/CMakeLists.txt
index a2549b35..3612c7ae 100644
--- a/praat/external/opusfile/CMakeLists.txt
+++ b/praat/external/opusfile/CMakeLists.txt
@@ -1,4 +1,4 @@
-target_sources(praat PRIVATE
+add_praat_subdir(SOURCES
opusfile.cpp opusfile_info.cpp opusfile_internal.cpp opusfile_stream.cpp
opus/analysis.c opus/mlp.c opus/opus.c opus/opus_decoder.c opus/opus_multistream.c
opus/mapping_matrix.c opus/mlp_data.c opus/opus_multistream_decoder.c
@@ -33,4 +33,6 @@ target_sources(praat PRIVATE
opus/silk/float/process_gains_FLP.c opus/silk/float/regularize_correlations_FLP.c opus/silk/float/residual_energy_FLP.c
opus/silk/float/scale_copy_vector_FLP.c opus/silk/float/scale_vector_FLP.c opus/silk/float/schur_FLP.c opus/silk/float/sort_FLP.c
opus/silk/float/warped_autocorrelation_FLP.c opus/silk/float/wrappers_FLP.c
+INCLUDE_DIRS
+ melder external/vorbis external/opusfile/opus external/opusfile/opus/celt external/opusfile/opus/silk external/opusfile/opus/silk/float
)
diff --git a/praat/external/portaudio/CMakeLists.txt b/praat/external/portaudio/CMakeLists.txt
index 33f43146..87ed459e 100644
--- a/praat/external/portaudio/CMakeLists.txt
+++ b/praat/external/portaudio/CMakeLists.txt
@@ -1,20 +1,21 @@
-target_sources(praat PRIVATE
+add_praat_subdir(
+SOURCES
+ pa_linux_alsa.c pa_jack.c pa_ringbuffer.c
pa_front.c pa_debugprint.c pa_cpuload.c
pa_allocation.c pa_process.c pa_converters.c pa_dither.c
pa_stream.c
)
-
if (UNIX)
- target_sources(praat PRIVATE pa_unix_hostapis.c pa_unix_util.c)
+ add_praat_subdir(SOURCES pa_unix_hostapis.c pa_unix_util.c)
if (CMAKE_SYSTEM_NAME EQUAL "Linux")
- target_sources(praat PRIVATE pa_linux_alsa.c)
+ add_praat_subdir(SOURCES pa_linux_alsa.c)
elseif(CMAKE_SYSTEM_NAME EQUAL "Darwin")
- target_sources(praat PRIVATE
+ add_praat_subdir(SOURCES
pa_mac_core_blocking.c pa_mac_core_utilities.c pa_mac_core.c pa_mac_hostapis.c pa_mac_util.c
pa_jack.c pa_ringbuffer.c pa_trace.c
)
endif()
elseif (WIN32)
- target_sources(praat PRIVATE pa_win_hostapis.c pa_win_util.c pa_win_wmme.c pa_win_waveformat.c)
+ add_praat_subdir(SOURCES pa_win_hostapis.c pa_win_util.c pa_win_wmme.c pa_win_waveformat.c)
endif ()
diff --git a/praat/external/vorbis/CMakeLists.txt b/praat/external/vorbis/CMakeLists.txt
index edbbe7b5..717f76c3 100644
--- a/praat/external/vorbis/CMakeLists.txt
+++ b/praat/external/vorbis/CMakeLists.txt
@@ -1,7 +1,9 @@
-target_sources(praat PRIVATE
+add_praat_subdir(SOURCES
ogg_bitwise.cpp ogg_framing.cpp
vorbis_block.cpp vorbis_bitrate.cpp vorbis_codebook.cpp vorbis_envelope.cpp vorbis_floor0.cpp
vorbis_info.cpp vorbis_mdct.cpp vorbisfile.cpp vorbis_floor0.cpp vorbis_floor1.cpp vorbis_lpc.cpp vorbis_lsp.cpp
vorbis_mapping0.cpp vorbis_psy.cpp vorbis_registry.cpp vorbis_res0.cpp vorbis_sharedbook.cpp vorbis_smallft.cpp
vorbis_synthesis.cpp vorbis_window.cpp
+INCLUDE_DIRS
+ melder
)
diff --git a/praat/fon/CMakeLists.txt b/praat/fon/CMakeLists.txt
index 183e6494..f620c428 100644
--- a/praat/fon/CMakeLists.txt
+++ b/praat/fon/CMakeLists.txt
@@ -1,4 +1,4 @@
-target_sources(praat PRIVATE
+add_praat_subdir(SOURCES
Transition.cpp Distributions_and_Transition.cpp
Function.cpp Sampled.cpp SampledXY.cpp Matrix.cpp Vector.cpp Polygon.cpp PointProcess.cpp
Matrix_and_PointProcess.cpp Matrix_and_Polygon.cpp AnyTier.cpp RealTier.cpp
@@ -30,4 +30,6 @@ target_sources(praat PRIVATE
manual_pointProcess.cpp manual_annotation.cpp
praat_TimeFunction.cpp praat_TimeTier.cpp praat_TimeFrameSampled.cpp
praat_Sound.cpp praat_Matrix.cpp praat_Tiers.cpp praat_TextGrid_init.cpp praat_uvafon_init.cpp
+INCLUDE_DIRS
+ kar melder sys dwsys stat dwtools LPC foned fon external/portaudio external/flac external/mp3 external/espeak
)
diff --git a/praat/foned/CMakeLists.txt b/praat/foned/CMakeLists.txt
index 102cb5c2..3ab4ab79 100644
--- a/praat/foned/CMakeLists.txt
+++ b/praat/foned/CMakeLists.txt
@@ -1,4 +1,4 @@
-target_sources(praat PRIVATE
+add_praat_subdir(SOURCES
SoundRecorder.cpp
FunctionArea.cpp SoundArea.cpp SoundAnalysisArea.cpp TextGridArea.cpp
SpectrumArea.cpp PointArea.cpp PitchArea.cpp SpectrogramArea.cpp
@@ -10,4 +10,6 @@ target_sources(praat PRIVATE
DurationTierEditor.cpp AmplitudeTierEditor.cpp
ManipulationEditor.cpp TextGridEditor.cpp FormantGridEditor.cpp
RunnerMFC.cpp MovieWindow.cpp
+INCLUDE_DIRS
+ kar melder sys dwsys stat dwtools LPC fon external/portaudio external/flac external/mp3 external/espeak
)
diff --git a/praat/gram/CMakeLists.txt b/praat/gram/CMakeLists.txt
index 92b6e56c..2e65ccc0 100644
--- a/praat/gram/CMakeLists.txt
+++ b/praat/gram/CMakeLists.txt
@@ -1,7 +1,9 @@
-target_sources(praat PRIVATE
+add_praat_subdir(SOURCES
Network.cpp
OTGrammar.cpp OTGrammarEditor.cpp manual_gram.cpp praat_gram.cpp OTMulti.cpp OTMultiEditor.cpp
OTGrammar_ex_metrics.cpp OTGrammar_ex_NoCoda.cpp OTGrammar_ex_NPA.cpp OTGrammar_ex_tongueRoot.cpp
OTMulti_ex_metrics.cpp Layer.cpp Net.cpp
NoulliGrid.cpp NoulliGridArea.cpp NoulliGridEditor.cpp CubeGrid.cpp CubeGridArea.cpp CubeGridEditor.cpp
+INCLUDE_DIRS
+ kar melder sys dwsys stat dwtools fon foned
)
diff --git a/praat/kar/CMakeLists.txt b/praat/kar/CMakeLists.txt
index 4b459207..b5c2083c 100644
--- a/praat/kar/CMakeLists.txt
+++ b/praat/kar/CMakeLists.txt
@@ -1,3 +1,5 @@
-target_sources(praat PRIVATE
+add_praat_subdir(SOURCES
ipaSerifRegularPS.cpp longchar.cpp wctype_portable.cpp
+INCLUDE_DIRS
+ melder
)
diff --git a/praat/melder/CMakeLists.txt b/praat/melder/CMakeLists.txt
index d399b3d0..5346764e 100644
--- a/praat/melder/CMakeLists.txt
+++ b/praat/melder/CMakeLists.txt
@@ -1,4 +1,4 @@
-target_sources(praat PRIVATE
+add_praat_subdir(SOURCES
melder.cpp complex.cpp melder_alloc.cpp melder_str32.cpp melder_colour.cpp
melder_ftoa.cpp melder_console.cpp melder_textencoding.cpp melder_atof.cpp melder_files.cpp
melder_sort.cpp melder_debug.cpp MelderFile.cpp melder_strings.cpp
@@ -10,4 +10,6 @@ target_sources(praat PRIVATE
NUMmath.cpp
NUMspecfunc.cpp NUMear.cpp NUMinterpol.cpp NUMmetrics.cpp NUMrandom.cpp NUMfilter.cpp NUMlinprog.cpp
NUM.cpp STR.cpp VEC.cpp MAT.cpp STRVEC.cpp
+INCLUDE_DIRS
+ melder
)
diff --git a/praat/sensors/CMakeLists.txt b/praat/sensors/CMakeLists.txt
index 6527647e..3d7f8010 100644
--- a/praat/sensors/CMakeLists.txt
+++ b/praat/sensors/CMakeLists.txt
@@ -1,3 +1,5 @@
-target_sources(praat PRIVATE
+add_praat_subdir(SOURCES
Electroglottogram.cpp EMA.cpp EMArawData.cpp praat_sensors_init.cpp
+INCLUDE_DIRS
+ melder stat sys fon external/gsl external/clapack kar dwtools
)
diff --git a/praat/stat/CMakeLists.txt b/praat/stat/CMakeLists.txt
index 1c3a5038..a3ff4e8c 100644
--- a/praat/stat/CMakeLists.txt
+++ b/praat/stat/CMakeLists.txt
@@ -1,6 +1,8 @@
-target_sources(praat PRIVATE
+add_praat_subdir(SOURCES
Table.cpp TableEditor.cpp Regression.cpp manual_statistics.cpp
praat_TableOfReal.cpp praat_Stat.cpp
TableOfReal.cpp Distributions.cpp Distributions_and_Strings.cpp PairDistribution.cpp
LogisticRegression.cpp
+INCLUDE_DIRS
+ kar melder sys dwsys dwtools fon foned stat
)
diff --git a/praat/sys/CMakeLists.txt b/praat/sys/CMakeLists.txt
index c9a17632..5e38d51b 100644
--- a/praat/sys/CMakeLists.txt
+++ b/praat/sys/CMakeLists.txt
@@ -1,4 +1,4 @@
-target_sources(praat PRIVATE
+add_praat_subdir(SOURCES
Thing.cpp Data.cpp Simple.cpp Collection.cpp Strings.cpp
Graphics.cpp Graphics_linesAndAreas.cpp Graphics_text.cpp Graphics_colour.cpp
Graphics_image.cpp Graphics_record.cpp
@@ -17,4 +17,6 @@ target_sources(praat PRIVATE
GuiMenu.cpp GuiMenuItem.cpp GuiButton.cpp GuiLabel.cpp GuiCheckButton.cpp GuiRadioButton.cpp
GuiDialog.cpp GuiList.cpp GuiFileSelect.cpp GuiScale.cpp GuiScrollBar.cpp GuiScrolledWindow.cpp
GuiControl.cpp GuiForm.cpp GuiOptionMenu.cpp GuiProgressBar.cpp GuiShell.cpp GuiThing.cpp Gui_messages.cpp
+INCLUDE_DIRS
+ kar melder sys dwsys
)
diff --git a/res/etc/makefilelist.sh b/res/etc/makefilelist.sh
index e695b5f2..117c6eef 100755
--- a/res/etc/makefilelist.sh
+++ b/res/etc/makefilelist.sh
@@ -15,12 +15,14 @@
# You should have received a copy of the GNU General Public License
# along with Parselmouth. If not, see
+SCRIPT_PATH=$(realpath res/etc/praat_makefile_to_cmake.py)
+
for SUBDIR in $(find . -mindepth 3 -name 'Makefile' | xargs dirname)
do
if [ -f "$SUBDIR/CMakeLists.txt" ]
then
pushd "$SUBDIR" > /dev/null
- CONTENTS=$(egrep -o '([[:graph:]]+\.o *)+' Makefile | sed 's|$(CELT)|opus/celt/|g' | sed 's|$(SILK)|opus/silk/|g' | sed 's|$(SILKFLOAT)|opus/silk/float/|g' | sed -E 's/([[:graph:]]+)\.o/ls \1.c* | tr "\n" " " ;/ge' | sed '1!s/^/\t/g' | sed 's/ $//' | sed '1s/^/target_sources(praat PRIVATE\n\t/' | sed '$s/$/\n)/') && cmp -s CMakeLists.txt <<< "$CONTENTS" || meld CMakeLists.txt <(echo "$CONTENTS")
+ CONTENTS=$(python $SCRIPT_PATH Makefile) && cmp -s CMakeLists.txt <<< "$CONTENTS" || meld CMakeLists.txt <(echo "$CONTENTS")
popd > /dev/null
fi
done