From 00e00f4e002bfa8a520aad4ac4246113645ace4a Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 7 Sep 2007 10:15:39 +0000 Subject: [PATCH] From Guillaume Millet, "Please find in attachment a small improvement to the pfb plugin CmakeLists.txt and to the FindPerformer.cmake module. Under Windows libs are: libpf.lib (we need to add the lib prefix) and libpfdu-util.lib (libpfdu and libpfutil are compiled into one lib) We need to add PFROOT to the search path for libs and includes (default environment variable for Performer path) And at last we need to put PFROOT/include and PFROOT/include/Performer as include dir for compiling." --- CMakeModules/FindPerformer.cmake | 66 ++++++++++++++++++++++--------- src/osgPlugins/pfb/CMakeLists.txt | 14 +++++-- 2 files changed, 57 insertions(+), 23 deletions(-) diff --git a/CMakeModules/FindPerformer.cmake b/CMakeModules/FindPerformer.cmake index ea6ab83bd..c960934ad 100644 --- a/CMakeModules/FindPerformer.cmake +++ b/CMakeModules/FindPerformer.cmake @@ -10,6 +10,8 @@ # Created by Robert Osfield. FIND_PATH(PERFORMER_INCLUDE_DIR Performer/pfdu.h + $ENV{PFROOT}/include + $ENV{PFROOT} $ENV{PERFORMER_DIR}/include $ENV{PERFORMER_DIR} $ENV{OSGDIR}/include @@ -27,25 +29,51 @@ FIND_PATH(PERFORMER_INCLUDE_DIR Performer/pfdu.h /usr/freeware/include ) -FIND_LIBRARY(PERFORMER_LIBRARY - NAMES pf - PATHS - $ENV{PERFORMER_DIR}/lib - $ENV{PERFORMER_DIR} - $ENV{OSGDIR}/lib - $ENV{OSGDIR} - $ENV{OSG_ROOT}/lib - ~/Library/Frameworks - /Library/Frameworks - /usr/local/lib - /usr/lib - /sw/lib - /opt/local/lib - /opt/csw/lib - /opt/lib - [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/lib - /usr/freeware/lib64 -) +IF(MSVC) + FIND_LIBRARY(PERFORMER_LIBRARY + NAMES libpf + PATHS + $ENV{PFROOT}/lib + $ENV{PFROOT} + $ENV{PERFORMER_DIR}/lib + $ENV{PERFORMER_DIR} + $ENV{OSGDIR}/lib + $ENV{OSGDIR} + $ENV{OSG_ROOT}/lib + ~/Library/Frameworks + /Library/Frameworks + /usr/local/lib + /usr/lib + /sw/lib + /opt/local/lib + /opt/csw/lib + /opt/lib + [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/lib + /usr/freeware/lib64 + ) +ELSE(MSVC) + FIND_LIBRARY(PERFORMER_LIBRARY + NAMES pf + PATHS + $ENV{PFROOT}/lib + $ENV{PFROOT} + $ENV{PERFORMER_DIR}/lib + $ENV{PERFORMER_DIR} + $ENV{OSGDIR}/lib + $ENV{OSGDIR} + $ENV{OSG_ROOT}/lib + ~/Library/Frameworks + /Library/Frameworks + /usr/local/lib + /usr/lib + /sw/lib + /opt/local/lib + /opt/csw/lib + /opt/lib + [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/lib + /usr/freeware/lib64 + ) +ENDIF(MSVC) SET(PERFORMER_FOUND "NO") IF(PERFORMER_LIBRARY AND PERFORMER_INCLUDE_DIR) diff --git a/src/osgPlugins/pfb/CMakeLists.txt b/src/osgPlugins/pfb/CMakeLists.txt index ab80e81d4..afe2807bf 100644 --- a/src/osgPlugins/pfb/CMakeLists.txt +++ b/src/osgPlugins/pfb/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES( ${PERFORMER_INCLUDE_DIR} ) +INCLUDE_DIRECTORIES( ${PERFORMER_INCLUDE_DIR} ${PERFORMER_INCLUDE_DIR}/Performer ) SET(TARGET_SRC ReaderWriterPFB.cpp @@ -9,9 +9,15 @@ SET(TARGET_H ConvertFromPerformer.h ) -SET(TARGET_EXTERNAL_LIBRARIES - pfdu pfutil -) +IF(MSVC) + SET(TARGET_EXTERNAL_LIBRARIES + libpfdu-util + ) +ELSE(MSVC) + SET(TARGET_EXTERNAL_LIBRARIES + pfdu pfutil + ) +ENDIF(MSVC) SET(TARGET_LIBRARIES_VARS PERFORMER_LIBRARY )