Revision: 40595
          http://brlcad.svn.sourceforge.net/brlcad/?rev=40595&view=rev
Author:   starseeker
Date:     2010-09-17 04:59:34 +0000 (Fri, 17 Sep 2010)

Log Message:
-----------
Hopefully this will do it - there appears to be some (fairly legitimate) 
confusion from the build system when we don an enable-all build, have libpng, 
libz, etc. in the build lib directory, and then turn on the system versions of 
the libs on top of the built enable-all build.  The answer appears to be to 
remove the built libraries when the third party options are switched - entails 
a fair bit of rebuilding, but with any luck the vast slew of error messages in 
that case is gone now.  May also want to nuke the static outputs, have to think 
about that.

Modified Paths:
--------------
    brlcad/branches/cmake/misc/CMake/ThirdParty.cmake

Modified: brlcad/branches/cmake/misc/CMake/ThirdParty.cmake
===================================================================
--- brlcad/branches/cmake/misc/CMake/ThirdParty.cmake   2010-09-17 03:58:44 UTC 
(rev 40594)
+++ brlcad/branches/cmake/misc/CMake/ThirdParty.cmake   2010-09-17 04:59:34 UTC 
(rev 40595)
@@ -21,6 +21,23 @@
                                SET(${CMAKE_PROJECT_NAME}_BUILD_LOCAL_${upper} 
ON CACHE BOOL "Build the local ${upper} library." FORCE)
                                SET(${upper}_LIBRARY "${lower}" CACHE STRING 
"set by THIRD_PARTY macro" FORCE)
                        ENDIF(NOT 
${CMAKE_PROJECT_NAME}-ENABLE_SYSTEM_LIBS_ONLY) 
+      ELSE(NOT ${upper}_FOUND)
+               # We have to remove any previously built output from enabled 
local copies of the
+               # library in question, or the linker will get confused - a 
system lib was found and
+               # system libraries are to be preferred with current options.  
This is unfortunate in
+               # that it may introduce extra build work just from trying 
configure options, but appears
+               # to be essential to ensuring that the build "just works" each 
time.
+               STRING(REGEX REPLACE "lib" "" rootname "${lower}")
+               FILE(GLOB STALE_FILES 
"${LIBRARY_OUTPUT_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}${rootname}*${CMAKE_SHARED_LIBRARY_SUFFIX}*")
+               MESSAGE("STALE_FILES: ${STALE_FILES}")
+               FOREACH(stale_file ${STALE_FILES})
+                  EXEC_PROGRAM(
+                          ${CMAKE_COMMAND} ARGS -E remove ${stale_file}
+                                        OUTPUT_VARIABLE rm_out
+                                        RETURN_VALUE rm_retval
+                                )
+               ENDFOREACH(stale_file ${STALE_FILES})
+
                ENDIF(NOT ${upper}_FOUND)
        ELSE(NOT ${CMAKE_PROJECT_NAME}_BUILD_LOCAL_${upper} OR 
${CMAKE_PROJECT_NAME}-ENABLE_SYSTEM_LIBS_ONLY)
                SET(${upper}_LIBRARY "${lower}" CACHE STRING "set by 
THIRD_PARTY macro" FORCE)


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to