1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-22 08:04:49 -05:00

Use PARENT_SCOPE for _DEPENDS variables so visible in other CMakeFiles

This commit is contained in:
Jon Beniston 2022-05-27 06:45:22 +01:00
parent c926711f89
commit 253e4b2c2f

View File

@ -209,6 +209,7 @@ else()
endif()
# We don't CACHE for _DEPENDS variable, as the external project is only added when NOT _FOUND
# Use PARENT_SCOPE so they can still be used in other CMakeFiles
if (NOT LIBUSB_FOUND AND NOT USE_PRECOMPILED_LIBS)
# Cloning git repo doesn't include configure, so we download the bz2 which does
@ -220,7 +221,7 @@ if (NOT LIBUSB_FOUND AND NOT USE_PRECOMPILED_LIBS)
TEST_COMMAND ""
)
ExternalProject_Get_Property(libusb install_dir)
set(LIBUSB_DEPENDS libusb)
set(LIBUSB_DEPENDS libusb PARENT_SCOPE)
set(LIBUSB_FOUND ON CACHE INTERNAL "")
set(LIBUSB_EXTERNAL ON CACHE INTERNAL "")
set(LIBUSB_INCLUDE_DIR "${install_dir}/include/libusb-1.0" CACHE INTERNAL "")
@ -242,7 +243,7 @@ if (NOT HIDAPI_FOUND AND NOT USE_PRECOMPILED_LIBS)
TEST_COMMAND ""
)
ExternalProject_Get_Property(hidapi install_dir)
set(HIDAPI_DEPENDS hidapi)
set(HIDAPI_DEPENDS hidapi PARENT_SCOPE)
set(HIDAPI_FOUND ON CACHE INTERNAL "")
set(HIDAPI_EXTERNAL ON CACHE INTERNAL "")
set(HIDAPI_ROOT_DIR "${install_dir}" CACHE INTERNAL "")
@ -262,7 +263,7 @@ if (NOT OPUS_FOUND AND NOT USE_PRECOMPILED_LIBS)
TEST_COMMAND ""
)
ExternalProject_Get_Property(opus install_dir)
set(OPUS_DEPENDS opus)
set(OPUS_DEPENDS opus PARENT_SCOPE)
set(OPUS_FOUND ON CACHE INTERNAL "")
set(OPUS_EXTERNAL ON CACHE INTERNAL "")
set(OPUS_INCLUDE_DIRS "${install_dir}/include" CACHE INTERNAL "")
@ -285,7 +286,7 @@ if (NOT ZLIB_FOUND AND NOT USE_PRECOMPILED_LIBS)
TEST_COMMAND ""
)
ExternalProject_Get_Property(zlib install_dir)
set(ZLIB_DEPENDS zlib)
set(ZLIB_DEPENDS zlib PARENT_SCOPE)
set(ZLIB_FOUND ON CACHE INTERNAL "")
set(ZLIB_EXTERNAL ON CACHE INTERNAL "")
set(ZLIB_INCLUDE_DIRS "${install_dir}/include" CACHE INTERNAL "")
@ -307,7 +308,7 @@ if (NOT FAAD_FOUND AND NOT USE_PRECOMPILED_LIBS)
TEST_COMMAND ""
)
ExternalProject_Get_Property(faad source_dir binary_dir install_dir)
set(FAAD_DEPENDS faad)
set(FAAD_DEPENDS faad PARENT_SCOPE)
set(FAAD_FOUND ON CACHE INTERNAL "")
set(FAAD_EXTERNAL ON CACHE INTERNAL "")
set(FAAD_INCLUDE_DIR "${install_dir}/include" CACHE INTERNAL "")
@ -331,7 +332,7 @@ if (NOT FFTW3F_FOUND AND NOT USE_PRECOMPILED_LIBS)
TEST_COMMAND ""
)
ExternalProject_Get_Property(fftw3f source_dir binary_dir)
set(FFTW3F_DEPENDS fftw3f)
set(FFTW3F_DEPENDS fftw3f PARENT_SCOPE)
set(FFTW3F_FOUND ON CACHE INTERNAL "")
set(FFTW3F_EXTERNAL ON CACHE INTERNAL "")
set(FFTW3F_INCLUDE_DIRS "${source_dir}/api" "${binary_dir}" CACHE INTERNAL "")
@ -414,7 +415,7 @@ if (NOT FFMEG_FOUND AND NOT USE_PRECOMPILED_LIBS)
TEST_COMMAND ""
)
ExternalProject_Get_Property(x264 install_dir)
set(X264_DEPENDS x264)
set(X264_DEPENDS x264 PARENT_SCOPE)
set(X264_PKG_CONFIG_DIR "${install_dir}/lib/pkgconfig")
set(X264_FOUND ON CACHE INTERNAL "")
set(X264_EXTERNAL ON CACHE INTERNAL "")
@ -432,7 +433,7 @@ if (NOT FFMEG_FOUND AND NOT USE_PRECOMPILED_LIBS)
TEST_COMMAND ""
)
ExternalProject_Get_Property(x265 install_dir)
set(X265_DEPENDS x265)
set(X265_DEPENDS x265 PARENT_SCOPE)
set(X265_PKG_CONFIG_DIR "${install_dir}/lib/pkgconfig")
set(X265_FOUND ON CACHE INTERNAL "")
set(X265_EXTERNAL ON CACHE INTERNAL "")
@ -449,7 +450,7 @@ if (NOT FFMEG_FOUND AND NOT USE_PRECOMPILED_LIBS)
TEST_COMMAND ""
)
ExternalProject_Get_Property(fdk_aac install_dir)
set(FDK_AAC_DEPENDS fdk_aac)
set(FDK_AAC_DEPENDS fdk_aac PARENT_SCOPE)
set(FDK_AAC_PKG_CONFIG_DIR "${install_dir}/lib/pkgconfig")
set(FDK_AAC_FOUND ON CACHE INTERNAL "")
set(FDK_AAC_EXTERNAL ON CACHE INTERNAL "")
@ -468,7 +469,7 @@ if (NOT FFMEG_FOUND AND NOT USE_PRECOMPILED_LIBS)
TEST_COMMAND ""
)
ExternalProject_Get_Property(mpg123 install_dir)
set(MPG123_DEPENDS mpg123)
set(MPG123_DEPENDS mpg123 PARENT_SCOPE)
set(MPG123_PKG_CONFIG_DIR "${install_dir}/lib/pkgconfig")
set(MPG123_FOUND ON CACHE INTERNAL "")
set(MPG123_EXTERNAL ON CACHE INTERNAL "")
@ -488,7 +489,7 @@ if (NOT FFMEG_FOUND AND NOT USE_PRECOMPILED_LIBS)
TEST_COMMAND ""
)
ExternalProject_Get_Property(lame install_dir)
set(LAME_DEPENDS lame)
set(LAME_DEPENDS lame PARENT_SCOPE)
# ffmpeg doesn't try to use pkg-config for lame, as it doesn't include a .pc file
#set(LAME_PKG_CONFIG_DIR "${install_dir}/lib/pkgconfig")
set(LAME_EXTRA_CFLAGS "-I${install_dir}/include")
@ -512,7 +513,7 @@ if (NOT FFMEG_FOUND AND NOT USE_PRECOMPILED_LIBS)
TEST_COMMAND ""
)
ExternalProject_Get_Property(ffmpeg install_dir)
set(FFMPEG_DEPENDS ffmpeg)
set(FFMPEG_DEPENDS ffmpeg PARENT_SCOPE)
set(FFMPEG_INSTALL_DIR "${install_dir}")
set(FFMPEG_FOUND ON CACHE INTERNAL "")
set(FFMPEG_EXTERNAL ON CACHE INTERNAL "")
@ -544,7 +545,7 @@ if (NOT OpenCV_FOUND AND NOT USE_PRECOMPILED_LIBS)
TEST_COMMAND ""
)
ExternalProject_Get_Property(opencv source_dir binary_dir)
set(OpenCV_DEPENDS opencv)
set(OpenCV_DEPENDS opencv PARENT_SCOPE)
set(OpenCV_FOUND ON CACHE INTERNAL "")
set(OpenCV_EXTERNAL ON CACHE INTERNAL "")
set(OpenCV_INCLUDE_DIRS
@ -599,7 +600,7 @@ if ((NOT CODEC2_FOUND OR CODEC2_EXTERNAL) AND NOT USE_PRECOMPILED_LIBS)
TEST_COMMAND ""
)
ExternalProject_Get_Property(codec2 source_dir binary_dir)
set(CODEC2_DEPENDS codec2)
set(CODEC2_DEPENDS codec2 PARENT_SCOPE)
set(CODEC2_FOUND ON CACHE INTERNAL "")
set(CODEC2_EXTERNAL ON CACHE INTERNAL "")
set(CODEC2_INCLUDE_DIR "${source_dir}/src" "${binary_dir}" CACHE INTERNAL "")
@ -640,7 +641,7 @@ if (NOT CM256CC_FOUND OR CM256CC_EXTERNAL)
TEST_COMMAND ""
)
ExternalProject_Get_Property(cm256cc source_dir binary_dir)
set(CM256CC_DEPENDS cm256cc)
set(CM256CC_DEPENDS cm256cc PARENT_SCOPE)
set(CM256CC_FOUND ON CACHE INTERNAL "")
set(CM256CC_EXTERNAL ON CACHE INTERNAL "")
# we need cm256cc/library.h
@ -673,7 +674,7 @@ if ((NOT LIBDSDCC_FOUND OR LIBDSDCC_EXTERNAL) AND (NOT LIBMBE_FOUND OR LIBMBE_EX
)
ExternalProject_Get_Property(mbelib source_dir binary_dir)
set(USE_MBELIB ON)
set(DSDCC_DEPENDS mbelib)
set(DSDCC_DEPENDS mbelib PARENT_SCOPE)
set(LIBMBE_FOUND ON CACHE INTERNAL "")
set(LIBMBE_EXTERNAL ON CACHE INTERNAL "")
set(LIBMBE_INCLUDE_DIR "${source_dir}" CACHE INTERNAL "")
@ -704,7 +705,7 @@ if (NOT LIBSERIALDV_FOUND OR LIBSERIALDV_EXTERNAL)
TEST_COMMAND ""
)
ExternalProject_Get_Property(serialdv source_dir binary_dir)
set(DSDCC_DEPENDS ${DSDCC_DEPENDS} serialdv)
set(DSDCC_DEPENDS ${DSDCC_DEPENDS} serialdv PARENT_SCOPE)
set(LIBSERIALDV_FOUND ON CACHE INTERNAL "")
set(LIBSERIALDV_EXTERNAL ON CACHE INTERNAL "")
set(LIBSERIALDV_INCLUDE_DIR "${source_dir}" CACHE INTERNAL "")
@ -836,7 +837,7 @@ if (WIN32)
TEST_COMMAND ""
)
ExternalProject_Get_Property(pthreads4w source_dir binary_dir)
set(PTHREADS4W_DEPENDS pthreads4w)
set(PTHREADS4W_DEPENDS pthreads4w PARENT_SCOPE)
set(PTHREADS4W_FOUND ON CACHE INTERNAL "")
set(PTHREADS4W_EXTERNAL ON CACHE INTERNAL "")
set(PTHREADS4W_INCLUDE_DIR "${source_dir}" CACHE INTERNAL "")
@ -893,7 +894,7 @@ if (ZLIB_FOUND AND FAAD_FOUND)
)
endif(WIN32)
ExternalProject_Get_Property(dab source_dir binary_dir)
set(DAB_DEPENDS dab CACHE INTERNAL "")
set(DAB_DEPENDS dab PARENT_SCOPE)
set(DAB_FOUND ON CACHE INTERNAL "")
set(DAB_EXTERNAL ON CACHE INTERNAL "")
set(DAB_INCLUDE_DIR "${EXTERNAL_BUILD_LIBRARIES}/dab/src/dab" CACHE INTERNAL "")
@ -1333,7 +1334,7 @@ if (WIN32 OR APPLE)
)
endif ()
ExternalProject_Get_Property(libxml2 source_dir binary_dir)
set(LIBXML2_DEPENDS libxml2)
set(LIBXML2_DEPENDS libxml2 PARENT_SCOPE)
set(LIBXML2_FOUND ON CACHE INTERNAL "")
set(LIBXML2_EXTERNAL ON CACHE INTERNAL "")
set(LIBXML2_INCLUDE_DIR "${source_dir}/include" CACHE INTERNAL "")