From 16be0770e79613db17fb9269946aba08a6f4292e Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 5 Nov 2018 17:54:45 -0700 Subject: [PATCH] CMake: Fix libCgGL linkage in FindCg.cmake This involves both fixing the capitalization of "CgGL" and only adding libraries to CG_LIBRARIES when they're found. --- cmake/modules/FindCg.cmake | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/cmake/modules/FindCg.cmake b/cmake/modules/FindCg.cmake index a6636a67a1..b48904b2ba 100644 --- a/cmake/modules/FindCg.cmake +++ b/cmake/modules/FindCg.cmake @@ -42,7 +42,7 @@ macro(find_cggl) # Find the library directory find_library(CGGL_LIBRARY - NAMES "cgGL" "libCgGL" + NAMES "CgGL" "libCgGL" PATHS "C:/Program Files/Cg" "C:/Program Files/NVIDIA Corporation/Cg" "/usr" @@ -87,7 +87,7 @@ macro(find_cgd3d9) # Find the library directory find_library(CGD3D9_LIBRARY - NAMES "cgD3D9" "libCgD3D9" + NAMES "CgD3D9" "libCgD3D9" PATHS "C:/Program Files/Cg" "C:/Program Files/NVIDIA Corporation/Cg" "/usr" @@ -184,6 +184,11 @@ if(CG_INCLUDE_DIR AND CG_LIBRARY_DIR) find_cggl() find_cgd3d9() - set(CG_LIBRARIES ${CG_LIBRARY} ${CGGL_LIBRARY} ${CGD3D9_LIBRARY}) - mark_as_advanced(CG_LIBRARIES) + set(CG_LIBRARIES ${CG_LIBRARY}) + if(CGGL_LIBRARY) + list(APPEND CG_LIBRARIES "${CGGL_LIBRARY}") + endif() + if(CGD3D9_LIBRARY) + list(APPEND CG_LIBRARIES "${CGD3D9_LIBRARY}") + endif() endif()