CMakeLists.txt: OSG_FIND_3RD_PARTY_DEPS option

Android-specific macros aren't needed in some cases, e.g. if the NDK is
setup with all the needed dependencies a much easier way to find
packages is to simply specify the correct `CMAKE_FIND_ROOT_PATH`.

The `ANDROID_3RD_PARTY` macro interferes with this.
Adds an option to disable it.

WIN32 build is in a similar situation, the new option affects it also.
This commit is contained in:
Gleb Mazovetskiy 2021-01-22 14:29:22 +00:00
parent df901fba7a
commit df0c312d99

View File

@ -753,7 +753,9 @@ OPTION(BUILD_OSG_PLUGINS "Build OSG Plugins - Disable for compile testing exampl
mark_as_advanced(BUILD_OSG_PLUGINS) mark_as_advanced(BUILD_OSG_PLUGINS)
################################################################################ ################################################################################
# 3rd Party Dependency Stuff # 3rd Party Dependency Stuff
IF(WIN32 AND NOT ANDROID) OPTION(OSG_FIND_3RD_PARTY_DEPS "Enable to search for Android or Windows dependencies in ./3rdparty" ON)
IF(WIN32 AND NOT ANDROID AND OSG_FIND_3RD_PARTY_DEPS)
INCLUDE(Find3rdPartyDependencies) INCLUDE(Find3rdPartyDependencies)
ENDIF() ENDIF()
@ -764,7 +766,7 @@ OPTION(OSG_USE_LOCAL_LUA_SOURCE "Enable to use local Lua source when building th
# you can use the following style of command line option when invoking Cmake (here illustrating ignoring PythonLibs) : # you can use the following style of command line option when invoking Cmake (here illustrating ignoring PythonLibs) :
# cmake -DCMAKE_DISABLE_FIND_PACKAGE_PythonLibs=1 . # cmake -DCMAKE_DISABLE_FIND_PACKAGE_PythonLibs=1 .
# #
IF(ANDROID) IF(ANDROID AND OSG_FIND_3RD_PARTY_DEPS)
ANDROID_3RD_PARTY() ANDROID_3RD_PARTY()
ELSE() ELSE()
# Common to all platforms except android: # Common to all platforms except android:
@ -840,7 +842,7 @@ ENDIF()
# Image readers/writers depend on 3rd party libraries except for OS X which # Image readers/writers depend on 3rd party libraries except for OS X which
# can use Quicktime. # can use Quicktime.
IF(NOT ANDROID) IF(NOT (ANDROID AND OSG_FIND_3RD_PARTY_DEPS))
IF(NOT APPLE) IF(NOT APPLE)
FIND_PACKAGE(GIFLIB) FIND_PACKAGE(GIFLIB)
FIND_PACKAGE(JPEG) FIND_PACKAGE(JPEG)