From 55d5a4d28a83bddbc4a2c73498c974317b6245ed Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 2 Oct 2007 21:26:22 +0000 Subject: [PATCH] Introduced a OSG_PLUGIN_PREFIX variable into CMake build system with it set to "" for all platforms except Cygwin where its set to "cygwin_" and Mingw where it is set to "mingw_". Updated osgDB::Registry to look for these for the plugins. Updated the osgintrospection example to search for these names as well. --- CMakeLists.txt | 14 ++++++++++++++ examples/osgintrospection/osgintrospection.cpp | 4 ++-- src/osgDB/Registry.cpp | 4 ++-- src/osgPlugins/CMakeLists.txt | 6 ++---- src/osgWrappers/CMakeLists.txt | 4 +--- 5 files changed, 21 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 28c480a08..4b80823f6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,6 +23,17 @@ SET(OPENSCENEGRAPH_VERSION ${OPENSCENEGRAPH_MAJOR_VERSION}.${OPENSCENEGRAPH_MINO SET(OSG_PLUGINS osgPlugins-${OPENSCENEGRAPH_VERSION}) +SET(OSG_PLUGIN_PREFIX "") + +IF (CYGWIN) + SET(OSG_PLUGIN_PREFIX "cygwin_") +ENDIF(CYGWIN) + +IF(MINGW) + SET(OSG_PLUGIN_PREFIX "mingw_") +ENDIF(MINGW) + + # We want to build SONAMES shared librariess SET(OPENSCENEGRAPH_SONAMES TRUE) SET(OPENTHREADS_SONAMES TRUE) @@ -87,6 +98,9 @@ INCLUDE_DIRECTORIES( #ADD_DEFINITIONS(-D) # Platform specific definitions + + + IF(WIN32) ADD_DEFINITIONS(-D_SCL_SECURE_NO_WARNINGS) ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE) diff --git a/examples/osgintrospection/osgintrospection.cpp b/examples/osgintrospection/osgintrospection.cpp index 65a6a022e..1e4a5525a 100644 --- a/examples/osgintrospection/osgintrospection.cpp +++ b/examples/osgintrospection/osgintrospection.cpp @@ -38,9 +38,9 @@ std::string createLibraryNameForWrapper(const std::string& ext) #if defined(WIN32) // !! recheck evolving Cygwin DLL extension naming protocols !! NHV #ifdef __CYGWIN__ - return "cygosgwrapper_"+ext+".dll"; + return "cygwin_osgwrapper_"+ext+".dll"; #elif defined(__MINGW32__) - return "libosgwrapper_"+ext+".dll"; + return "mingw_osgwrapper_"+ext+".dll"; #else #ifdef _DEBUG return "osgwrapper_"+ext+"d.dll"; diff --git a/src/osgDB/Registry.cpp b/src/osgDB/Registry.cpp index 1d0b0a668..3a7f42252 100644 --- a/src/osgDB/Registry.cpp +++ b/src/osgDB/Registry.cpp @@ -585,9 +585,9 @@ std::string Registry::createLibraryNameForExtension(const std::string& ext) #if defined(WIN32) // !! recheck evolving Cygwin DLL extension naming protocols !! NHV #ifdef __CYGWIN__ - return prepend+"cyg"+"osgdb_"+lowercase_ext+".dll"; + return prepend+"cygwin_"+"osgdb_"+lowercase_ext+".dll"; #elif defined(__MINGW32__) - return prepend+"lib"+"osgdb_"+lowercase_ext+".dll"; + return prepend+"mingw_"+"osgdb_"+lowercase_ext+".dll"; #else #ifdef _DEBUG return prepend+"osgdb_"+lowercase_ext+"d.dll"; diff --git a/src/osgPlugins/CMakeLists.txt b/src/osgPlugins/CMakeLists.txt index 5f61c9aa9..cd585d344 100644 --- a/src/osgPlugins/CMakeLists.txt +++ b/src/osgPlugins/CMakeLists.txt @@ -11,15 +11,13 @@ IF(NOT MSVC) SET(LIBRARY_OUTPUT_PATH "${LIBRARY_OUTPUT_PATH}/${OSG_PLUGINS}") ENDIF(NOT MSVC) -IF(NOT MINGW) - SET(CMAKE_SHARED_MODULE_PREFIX "") -ENDIF(NOT MINGW) +SET(CMAKE_SHARED_MODULE_PREFIX ${OSG_PLUGIN_PREFIX}) SET(TARGET_DEFAULT_PREFIX "osgdb_") SET(TARGET_DEFAULT_LABEL_PREFIX "Plugins") SET(TARGET_COMMON_LIBRARIES - OpenThreads + OpenThreads osg osgDB osgUtil diff --git a/src/osgWrappers/CMakeLists.txt b/src/osgWrappers/CMakeLists.txt index 87f9dbb66..a280f8040 100644 --- a/src/osgWrappers/CMakeLists.txt +++ b/src/osgWrappers/CMakeLists.txt @@ -2,9 +2,7 @@ PROJECT(OSG_WRAPPERS) SET(LIBRARY_OUTPUT_PATH "${LIBRARY_OUTPUT_PATH}/${OSG_PLUGINS}") -IF(NOT MINGW) - SET(CMAKE_SHARED_MODULE_PREFIX "") -ENDIF(NOT MINGW) +SET(CMAKE_SHARED_MODULE_PREFIX ${OSG_PLUGIN_PREFIX}) MACRO(ADD_WRAPPER_LIB SUBDIR EXPORTDEF)