diff --git a/Gems/EMotionFX/Code/CMakeLists.txt b/Gems/EMotionFX/Code/CMakeLists.txt index d46c67fafb..b90902a948 100644 --- a/Gems/EMotionFX/Code/CMakeLists.txt +++ b/Gems/EMotionFX/Code/CMakeLists.txt @@ -68,12 +68,6 @@ ly_add_target( ) if (PAL_TRAIT_BUILD_HOST_TOOLS) - - find_package(OpenGL QUIET REQUIRED) - # Imported targets (like OpenGL::GL) are scoped to a directory. Add a - # a global scope - add_library(3rdParty::OpenGLInterface INTERFACE IMPORTED GLOBAL) - target_link_libraries(3rdParty::OpenGLInterface INTERFACE OpenGL::GL) ly_add_target( NAME EMotionFX.Editor.Static STATIC diff --git a/Gems/EMotionFX/Code/Editor/Platform/Mac/platform_mac.cmake b/Gems/EMotionFX/Code/Editor/Platform/Mac/platform_mac.cmake index 821e7d1f25..95df062a93 100644 --- a/Gems/EMotionFX/Code/Editor/Platform/Mac/platform_mac.cmake +++ b/Gems/EMotionFX/Code/Editor/Platform/Mac/platform_mac.cmake @@ -13,10 +13,4 @@ # based on the active platform # NOTE: functions in cmake are global, therefore adding functions to this file # is being avoided to prevent overriding functions declared in other targets platfrom -# specific cmake files - -target_compile_definitions(3rdParty::OpenGLInterface - INTERFACE - # MacOS 10.14 deprecates OpenGL. This silences the warnings for now. - GL_SILENCE_DEPRECATION -) \ No newline at end of file +# specific cmake files \ No newline at end of file diff --git a/cmake/3rdParty.cmake b/cmake/3rdParty.cmake index 4cd3ab2917..8d0c030302 100644 --- a/cmake/3rdParty.cmake +++ b/cmake/3rdParty.cmake @@ -116,10 +116,6 @@ function(ly_add_external_target) # Setting BASE_PATH variable in the parent scope to allow for the Find<3rdParty>.cmake scripts to use them set(BASE_PATH ${BASE_PATH} PARENT_SCOPE) - if(NOT EXISTS ${BASE_PATH}) - message(FATAL_ERROR "Cannot find 3rdParty library ${ly_add_external_target_NAME} on path ${BASE_PATH}") - endif() - add_library(3rdParty::${NAME_WITH_NAMESPACE} INTERFACE IMPORTED GLOBAL) if(ly_add_external_target_INCLUDE_DIRECTORIES) diff --git a/cmake/3rdParty/FindOpenGLInterface.cmake b/cmake/3rdParty/FindOpenGLInterface.cmake new file mode 100644 index 0000000000..1e4992290f --- /dev/null +++ b/cmake/3rdParty/FindOpenGLInterface.cmake @@ -0,0 +1,19 @@ +# +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# + +find_package(OpenGL) + +ly_add_external_target( + NAME OpenGLInterface + VERSION "" + BUILD_DEPENDENCIES + OpenGL::GL +) \ No newline at end of file diff --git a/cmake/3rdParty/Platform/Mac/OpenGLInterface_mac.cmake b/cmake/3rdParty/Platform/Mac/OpenGLInterface_mac.cmake new file mode 100644 index 0000000000..7d0d47740f --- /dev/null +++ b/cmake/3rdParty/Platform/Mac/OpenGLInterface_mac.cmake @@ -0,0 +1,13 @@ +# +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# + +# MacOS 10.14 deprecates OpenGL. This silences the warnings for now. +set(OPENGLINTERFACE_COMPILE_DEFINITIONS GL_SILENCE_DEPRECATION) \ No newline at end of file diff --git a/cmake/3rdParty/Platform/Mac/cmake_mac_files.cmake b/cmake/3rdParty/Platform/Mac/cmake_mac_files.cmake index f786f80cf7..0e3cc53262 100644 --- a/cmake/3rdParty/Platform/Mac/cmake_mac_files.cmake +++ b/cmake/3rdParty/Platform/Mac/cmake_mac_files.cmake @@ -15,6 +15,7 @@ set(FILES Clang_mac.cmake DirectXShaderCompiler_mac.cmake FbxSdk_mac.cmake + OpenGLInterface_mac.cmake OpenSSL_mac.cmake Wwise_mac.cmake ) diff --git a/cmake/3rdParty/cmake_files.cmake b/cmake/3rdParty/cmake_files.cmake index 3fe15bc0ce..46b612df42 100644 --- a/cmake/3rdParty/cmake_files.cmake +++ b/cmake/3rdParty/cmake_files.cmake @@ -18,6 +18,7 @@ set(FILES Finddyad.cmake FindFbxSdk.cmake Findlibav.cmake + FindOpenGLInterface.cmake FindOpenSSL.cmake FindRadTelemetry.cmake FindVkValidation.cmake