Revision: 68960
http://sourceforge.net/p/brlcad/code/68960
Author: brlcad
Date: 2016-10-01 03:06:58 +0000 (Sat, 01 Oct 2016)
Log Message:
-----------
if we have the lib, conduct a different test that doesn't rely on searching for
the library (since CHECK_LIBRARY_EXISTS doesn't respect required library
flags). check for the function in the library specified via
check_function_exists()
Modified Paths:
--------------
brlcad/trunk/misc/CMake/BRLCAD_CheckFunctions.cmake
Modified: brlcad/trunk/misc/CMake/BRLCAD_CheckFunctions.cmake
===================================================================
--- brlcad/trunk/misc/CMake/BRLCAD_CheckFunctions.cmake 2016-10-01 03:05:41 UTC
(rev 68959)
+++ brlcad/trunk/misc/CMake/BRLCAD_CheckFunctions.cmake 2016-10-01 03:06:58 UTC
(rev 68960)
@@ -256,12 +256,20 @@
macro(BRLCAD_CHECK_LIBRARY targetname lname func)
set(CMAKE_C_FLAGS_TMP "${CMAKE_C_FLAGS}")
set(CMAKE_C_FLAGS "")
+
if(NOT ${targetname}_LIBRARY)
CHECK_LIBRARY_EXISTS(${lname} ${func} "" HAVE_${targetname}_${lname})
- if(HAVE_${targetname}_${lname})
- set(${targetname}_LIBRARY "${lname}")
- endif(HAVE_${targetname}_${lname})
+ else(NOT ${targetname}_LIBRARY)
+ set(CMAKE_REQUIRED_LIBRARIES_TMP ${CMAKE_REQUIRED_LIBRARIES})
+ set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}
${${targetname}_LIBRARY})
+ CHECK_FUNCTION_EXISTS(${func} HAVE_${targetname}_${lname})
+ set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES_TMP})
endif(NOT ${targetname}_LIBRARY)
+
+ if(HAVE_${targetname}_${lname})
+ set(${targetname}_LIBRARY "${lname}")
+ endif(HAVE_${targetname}_${lname})
+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS_TMP}")
endmacro(BRLCAD_CHECK_LIBRARY lname func)
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits