From cc079453dab4619baa2bb7e2d135f431e77e0742 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 17 Sep 2008 19:25:40 +0000 Subject: [PATCH] From Mattias Helsing, CMakeLists.txt changes: "I installed latest Cmake(2.6.1) on a new machine and got a CMP008 warning from cmake. This fix set up osg to use the old behaviour which have worked before. We might set this to NEW but I need to do more testing first. I'l be able to test this on winxp with msvc80/90 and ubuntu hardy with gcc-4.2. quote from cmake cvs log policy CMP0008 to decides how to treat full path libraries that do not appear to be valid library file names. Such libraries worked by accident in the VS IDE and Xcode generators with CMake 2.4 and below." OsgMarcroUtils.cmake changes: "On Philips suggestion truncated a redundant if/else construction in OsgMacroUtils to avoid developer warnings in cmake-2.6.1 concerning cmake policy CMP0008 which allows full paths to libraries only with valid library names " --- CMakeLists.txt | 6 ++++++ CMakeModules/OsgMacroUtils.cmake | 6 +----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a7a0219d9..496b2cbb7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,6 +19,12 @@ if(COMMAND cmake_policy) # Works around warnings about escaped quotes in ADD_DEFINITIONS # statements. cmake_policy(SET CMP0005 NEW) + + # cmake-2.6.1 introduces policy cmp0008 decide how to treat full path libraries that do not appear to be valid library file names + # quote from cvslog "Such libraries worked by accident in the VS IDE and Xcode generators in CMake 2.4 and below." + if(POLICY CMP0008) + cmake_policy(SET CMP0008 OLD) + endif(POLICY CMP0008) endif(COMMAND cmake_policy) PROJECT(OpenSceneGraph) diff --git a/CMakeModules/OsgMacroUtils.cmake b/CMakeModules/OsgMacroUtils.cmake index 51ae33eb5..95bb564ea 100644 --- a/CMakeModules/OsgMacroUtils.cmake +++ b/CMakeModules/OsgMacroUtils.cmake @@ -30,11 +30,7 @@ MACRO(LINK_INTERNAL TRGTNAME) #CMake 2.4.7, at least seem to use PREFIX instead of IMPORT_PREFIX for computing linkage info to use into projects, # so we full path name to specify linkage, this prevent automatic inferencing of dependencies, so we add explicit depemdencies #to library targets used - IF(NOT MSVC_IDE) - TARGET_LINK_LIBRARIES(${TRGTNAME} optimized "${OUTPUT_LIBDIR}/${LINKLIB}.lib" debug "${OUTPUT_LIBDIR}/${LINKLIB}${CMAKE_DEBUG_POSTFIX}.lib") - ELSE(NOT MSVC_IDE) - TARGET_LINK_LIBRARIES(${TRGTNAME} optimized "${OUTPUT_LIBDIR}/${LINKLIB}" debug "${OUTPUT_LIBDIR}/${LINKLIB}${CMAKE_DEBUG_POSTFIX}") - ENDIF(NOT MSVC_IDE) + TARGET_LINK_LIBRARIES(${TRGTNAME} optimized "${OUTPUT_LIBDIR}/${LINKLIB}.lib" debug "${OUTPUT_LIBDIR}/${LINKLIB}${CMAKE_DEBUG_POSTFIX}.lib") ADD_DEPENDENCIES(${TRGTNAME} ${LINKLIB}) ELSE(MSVC AND OSG_MSVC_VERSIONED_DLL) TARGET_LINK_LIBRARIES(${TRGTNAME} optimized "${LINKLIB}" debug "${LINKLIB}${CMAKE_DEBUG_POSTFIX}")