Hi all,

attached patch series makes some changes to the install rules:
if OSG_USE_SEPARATE_LIBDIRS is ON (default) libs will be installed to "configuration" specific directories, on windows these are:

lib${OSG_LIBDIR_SUFFIX}/${OSG_INSTALL_SUBDIR}/debug
lib${OSG_LIBDIR_SUFFIX}/${OSG_INSTALL_SUBDIR}/rel
lib${OSG_LIBDIR_SUFFIX}/${OSG_INSTALL_SUBDIR}/debugopt
lib${OSG_LIBDIR_SUFFIX}/${OSG_INSTALL_SUBDIR}/relnoopt

for other platforms:

lib${OSG_LIBDIR_SUFFIX}/${OSG_INSTALL_SUBDIR}/debug
lib${OSG_LIBDIR_SUFFIX}/${OSG_INSTALL_SUBDIR}/
lib${OSG_LIBDIR_SUFFIX}/${OSG_INSTALL_SUBDIR}/relwithdbg
lib${OSG_LIBDIR_SUFFIX}/${OSG_INSTALL_SUBDIR}/minsizerel
lib${OSG_LIBDIR_SUFFIX}/${OSG_INSTALL_SUBDIR}/debuggv

The rationale for not putting release libs into a subdir is that that allows setting CMAKE_INSTALL_PREFIX=/usr/local and leave OSG_INSTALL_SUBDIR empty (default) and end up with the release libs in a "standard" location. The second patch also brings osg2-config back to a semi usable state, ATM it is just broken since it does not deal with the imported targets. In order for osg2-config to be most useful it would probably need to be taught about different dependencies for different configurations and we'd need to make a distinction between libs that only get linked into OpenSG libs and those the user also has to link against when using (linking) and OpenSG lib...

[This part is mainly a reminder for myself, so I don't forget all this again ;)] I think i finally understood how cmake's CMAKE_CONFIGURATION_TYPES, CMAKE_BUILD_TYPE and stuff that builds on them is supposed to work: Generated build system basically fall into two categories, those that can handle multiple configs (VS IDE projects, XCode) and those that are limited to a single one (make). For the single config build systems the configuration is chosen at cmake time by setting CMAKE_BUILD_TYPE, for the others its done at build time. Annoyingly the INSTALL commands CONFIGURATIONS does not work for BUILD_TYPE build systems and we need two sets of install rules :(

Any comments?

        Cheers,
                Carsten
>From 1fa34c555e35d28d37c8c54142c5553057fc73a6 Mon Sep 17 00:00:00 2001
From: Neumann <[email protected]>
Date: Fri, 18 Dec 2009 10:31:29 -0600
Subject: [PATCH] changed: install libs to "per-configuration" dirs for build systems
          that use cmake configurations and those that use CMAKE_BUILD_TYPE

---
 CMake/BuildFunctions.cmake |  132 ++++++++++--------------------------------
 CMakeLists.txt             |  139 ++++++++++++++++++++++++++++++-------------
 2 files changed, 127 insertions(+), 144 deletions(-)

diff --git a/CMake/BuildFunctions.cmake b/CMake/BuildFunctions.cmake
index 532d2d6..b122bb8 100644
--- a/CMake/BuildFunctions.cmake
+++ b/CMake/BuildFunctions.cmake
@@ -804,118 +804,46 @@ FUNCTION(OSG_SETUP_LIBRARY_BUILD PROJ_DEFINE)
     ENDIF()
 
     # install rules
-    IF(WIN32)
-
-        IF(OSG_INSTALL_SUBDIR)
-            SET(_OSG_ISC "${OSG_INSTALL_SUBDIR}/")
-        ELSE(OSG_INSTALL_SUBDIR)
-            SET(_OSG_ISC "")
-        ENDIF(OSG_INSTALL_SUBDIR)
-        
-        IF(OSG_USE_SEPARATE_LIBDIRS)
-          SET(_OSG_TARGET_BINDIR_REL bin/${_OSG_ISC}rel)
-          SET(_OSG_TARGET_BINDIR_DBG bin/${_OSG_ISC}debug)
-          SET(_OSG_TARGET_BINDIR_RELNO bin/${_OSG_ISC}relnoopt)
-          SET(_OSG_TARGET_BINDIR_DBGO bin/${_OSG_ISC}debugopt)
-
-          SET(_OSG_TARGET_LIBDIR_REL lib/${_OSG_ISC}rel)
-          SET(_OSG_TARGET_LIBDIR_DBG lib/${_OSG_ISC}debug)
-          SET(_OSG_TARGET_LIBDIR_RELNO lib/${_OSG_ISC}relnoopt)
-          SET(_OSG_TARGET_LIBDIR_DBGO lib/${_OSG_ISC}debugopt)
-        ELSE(OSG_USE_SEPARATE_LIBDIRS)
-          SET(_OSG_TARGET_BINDIR_REL bin/${_OSG_ISC})
-          SET(_OSG_TARGET_BINDIR_DBG bin/${_OSG_ISC})
-          SET(_OSG_TARGET_BINDIR_RELNO bin/${_OSG_ISC})
-          SET(_OSG_TARGET_BINDIR_DBGO bin/${_OSG_ISC})
-
-          SET(_OSG_TARGET_LIBDIR_REL lib/${_OSG_ISC})
-          SET(_OSG_TARGET_LIBDIR_DBG lib/${_OSG_ISC})
-          SET(_OSG_TARGET_LIBDIR_RELNO lib/${_OSG_ISC})
-          SET(_OSG_TARGET_LIBDIR_DBGO lib/${_OSG_ISC})
-        ENDIF(OSG_USE_SEPARATE_LIBDIRS)
-
-        INSTALL(TARGETS ${PROJECT_NAME}
-                CONFIGURATIONS Release
-                RUNTIME DESTINATION ${_OSG_TARGET_BINDIR_REL}
-                LIBRARY DESTINATION ${_OSG_TARGET_LIBDIR_REL}
-                ARCHIVE DESTINATION ${_OSG_TARGET_LIBDIR_REL})
-
-        INSTALL(TARGETS ${PROJECT_NAME}
-                CONFIGURATIONS Debug 
-                RUNTIME DESTINATION ${_OSG_TARGET_BINDIR_DBG}
-                LIBRARY DESTINATION ${_OSG_TARGET_LIBDIR_DBG}
-                ARCHIVE DESTINATION ${_OSG_TARGET_LIBDIR_DBG})
-
-        INSTALL(TARGETS ${PROJECT_NAME}
-                CONFIGURATIONS ReleaseNoOpt
-                RUNTIME DESTINATION ${_OSG_TARGET_BINDIR_RELNO}
-                LIBRARY DESTINATION ${_OSG_TARGET_LIBDIR_RELNO}
-                ARCHIVE DESTINATION ${_OSG_TARGET_LIBDIR_RELNO})
-
-        INSTALL(TARGETS ${PROJECT_NAME}
-                CONFIGURATIONS DebugOpt
-                RUNTIME DESTINATION ${_OSG_TARGET_BINDIR_DBGO}
-                LIBRARY DESTINATION ${_OSG_TARGET_LIBDIR_DBGO}
-                ARCHIVE DESTINATION ${_OSG_TARGET_LIBDIR_DBGO})
-
-        
-        IF(OSG_INSTALL_PDB_FILES)
 
-          GET_TARGET_PROPERTY(_TMPVAL ${PROJECT_NAME} Release_LOCATION)
+    IF(CMAKE_CONFIGURATION_TYPES)
+        # if the build system supports configurations (VS IDE, XCode) set
+        # install destinations for all of them
 
-          STRING(REPLACE "dll" "pdb" _TMPVAL1 ${_TMPVAL})
+        FOREACH(CONF ${CMAKE_CONFIGURATION_TYPES})
+            STRING(TOUPPER ${CONF} UP_CONF)
 
-          INSTALL(FILES ${_TMPVAL1} 
-                  CONFIGURATIONS Release
-                  DESTINATION ${_OSG_TARGET_BINDIR_REL})
- 
- 
-          GET_TARGET_PROPERTY(_TMPVAL ${PROJECT_NAME} Debug_LOCATION)
+            INSTALL(TARGETS ${PROJECT_NAME}
+                RUNTIME DESTINATION ${OSG_INSTALL_BINDIR_${UP_CONF}} CONFIGURATIONS ${CONF}
+                LIBRARY DESTINATION ${OSG_INSTALL_LIBDIR_${UP_CONF}} CONFIGURATIONS ${CONF}
+                ARCHIVE DESTINATION ${OSG_INSTALL_LIBDIR_${UP_CONF}} CONFIGURATIONS ${CONF})
 
-          STRING(REPLACE "dll" "pdb" _TMPVAL1 ${_TMPVAL})
+            IF(WIN32 AND OSG_INSTALL_PDB_FILES)
+                GET_TARGET_PROPERTY(_TMPVAL ${PROJECT_NAME} LOCATION_${CONF})
+                STRING(REPLACE "dll" "pdb" _TMPVAL ${_TMPVAL})
 
-          INSTALL(FILES ${_TMPVAL1} 
-                  CONFIGURATIONS Debug
-                  DESTINATION ${_OSG_TARGET_BINDIR_DBG})
+                INSTALL(FILES ${_TMPVAL}
+                    DESTINATION ${OSG_INSTALL_BINDIR_${UP_CONF}} CONFIGURATIONS ${CONF})
+            ENDIF(WIN32 AND OSG_INSTALL_PDB_FILES)
 
+        ENDFOREACH(CONF)
+    ELSE(CMAKE_CONFIGURATION_TYPES)
+        # if the build system uses CMAKE_BUILD_TYPE instead, use that to
+        # determine the install destination
 
-          GET_TARGET_PROPERTY(_TMPVAL ${PROJECT_NAME} ReleaseNoOpt_LOCATION)
-
-          STRING(REPLACE "dll" "pdb" _TMPVAL1 ${_TMPVAL})
-
-          INSTALL(FILES ${_TMPVAL1} 
-                  CONFIGURATIONS ReleaseNoOpt
-                  DESTINATION ${_OSG_TARGET_BINDIR_RELNO})
-
-
-          GET_TARGET_PROPERTY(_TMPVAL ${PROJECT_NAME} DebugOpt_LOCATION)
-
-          STRING(REPLACE "dll" "pdb" _TMPVAL1 ${_TMPVAL})
-
-          INSTALL(FILES ${_TMPVAL1} 
-                  CONFIGURATIONS DebugOpt
-                  DESTINATION ${_OSG_TARGET_BINDIR_DBGO})
-
-        ENDIF(OSG_INSTALL_PDB_FILES)
-
+        STRING(TOUPPER ${CMAKE_BUILD_TYPE} UP_CONF)
 
         INSTALL(TARGETS ${PROJECT_NAME}
-                CONFIGURATIONS MinSizeRel
-                RUNTIME DESTINATION lib/minsizerel
-                LIBRARY DESTINATION lib/minsizerel
-                ARCHIVE DESTINATION lib/minsizerel)
+            RUNTIME DESTINATION ${OSG_INSTALL_BINDIR_${UP_CONF}}
+            LIBRARY DESTINATION ${OSG_INSTALL_LIBDIR_${UP_CONF}}
+            ARCHIVE DESTINATION ${OSG_INSTALL_LIBDIR_${UP_CONF}})
 
-        INSTALL(TARGETS ${PROJECT_NAME}
-                CONFIGURATIONS RelWithDebInfo
-                RUNTIME DESTINATION lib/relwithdbg
-                LIBRARY DESTINATION lib/relwithdbg
-                ARCHIVE DESTINATION lib/relwithdbg)
-    ELSE(WIN32)
-        INSTALL(TARGETS ${PROJECT_NAME}
-                RUNTIME DESTINATION lib${OSG_LIBDIR_SUFFIX}
-                LIBRARY DESTINATION lib${OSG_LIBDIR_SUFFIX}
-                ARCHIVE DESTINATION lib${OSG_LIBDIR_SUFFIX})
-    ENDIF(WIN32)
+        IF(WIN32 AND OSG_INSTALL_PDB_FILES)
+            GET_TARGET_PROPERTY(_TMPVAL ${PROJECT_NAME} LOCATION_${CMAKE_BUILD_TYPE})
+            STRING(REPLACE "dll" "pdb" _TMPVAL ${_TMPVAL})
+            
+            INSTALL(FILES ${_TMPVAL} DESTINATION ${OSG_INSTALL_BINDIR_${UP_CONF}})
+        ENDIF(WIN32 AND OSG_INSTALL_PDB_FILES)
+    ENDIF(CMAKE_CONFIGURATION_TYPES)
 
     INSTALL(FILES ${${PROJECT_NAME}_HDR}
             DESTINATION include/OpenSG
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 25bbeda..88f5cf8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -56,8 +56,8 @@ OSG_OPTION(OSG_ENABLE_OGL2_SHADERFUNCTIONS "" ON)
 OSG_SET_CACHE(OSG_SHADER_CACHE_MODE 5 STRING "")
 
 OSG_OPTION(OSG_ENABLE_FCD2CODE "" OFF)
-OSG_OPTION(OSG_FCD2CODE_WRITE_CLASS "Write class file during cmake run if only
-the fcd file is found" OFF)
+OSG_OPTION(OSG_FCD2CODE_WRITE_CLASS
+           "Write class file during cmake run if only the fcd file is found" OFF)
 OSG_OPTION(OSG_ENABLE_SCANPARSE_REGEN "" OFF)
 
 OSG_OPTION(OSG_ENABLE_GLDEFINE_MAPPER "" ON)
@@ -84,10 +84,13 @@ ENDIF()
 OPTION(OSG_ENABLE_AUTOINIT_THREADS "" OFF)
 
 IF(WIN32)
-  OSG_OPTION(OSG_USE_SEPARATE_LIBDIRS "" ON)
   OSG_OPTION(OSG_INSTALL_PDB_FILES "" OFF)
+  OSG_SET_CACHE(OSG_INSTALL_SUBDIR "" STRING "add subdir to installed libs")
 ENDIF(WIN32)
 
+OSG_OPTION(OSG_USE_SEPARATE_LIBDIRS
+           "Install libraries into per configuration subdirectories" ON)
+
 OSG_OPTION(OSGCOMPAT_ENABLE                  "" OFF)
 OSG_OPTION(OSGCOMPAT_ENABLE_DEPRECATED       "" OFF)
 OSG_OPTION(OSGCOMPAT_ENABLE_DEPRECATED_PROPS "" OFF)
@@ -209,31 +212,92 @@ ELSE()
     SET(OSG_PLATFORM_32 1)
 ENDIF()
 
-
 IF(${CMAKE_CXX_PLATFORM_ID} STREQUAL "Linux")
     SET(LINUX 1)
 ENDIF()
 
-IF(NOT WIN32 AND NOT CMAKE_BUILD_TYPE)
-  SET(CMAKE_BUILD_TYPE Debug CACHE STRING
-      "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
-      FORCE)
-ENDIF(NOT WIN32 AND NOT CMAKE_BUILD_TYPE)
+# cmake uses either configurations (from CMAKE_CONFIGURATION_TYPES) or
+# CMAKE_BUILD_TYPE to determine what is being built.
+# Project files (VS IDE, XCode) use configurations, cmd line build systems
+# use CMAKE_BUILD_TYPE
+
+# on windows we change the set of supported configurations to something that
+# makes it clear 
 
+IF(CMAKE_CONFIGURATION_TYPES AND WIN32)
+    SET(CMAKE_CONFIGURATION_TYPES "Debug" "Release" "DebugOpt" "ReleaseNoOpt")
+    SET_PROPERTY(GLOBAL PROPERTY DEBUG_CONFIGURATIONS "Debug;DebugOpt")
+ENDIF(CMAKE_CONFIGURATION_TYPES AND WIN32)
+
+IF(NOT CMAKE_CONFIGURATION_TYPES)
+    IF(NOT CMAKE_BUILD_TYPE)
+        SET(CMAKE_BUILD_TYPE "Debug")
+    ENDIF(NOT CMAKE_BUILD_TYPE)
+ENDIF(NOT CMAKE_CONFIGURATION_TYPES)
 
 IF(NOT OSG_COMPILER_DEFAULTS)
-   INCLUDE(CMake/SetupCompiler.cmake)
-   SET( OSG_COMPILER_DEFAULTS 1 CACHE INTERNAL "Defaults written" FORCE ) #INTERNAL
+    INCLUDE(CMake/SetupCompiler.cmake)
+    SET( OSG_COMPILER_DEFAULTS 1 CACHE INTERNAL "Defaults written" FORCE ) #INTERNAL
 ENDIF(NOT OSG_COMPILER_DEFAULTS)
 
 INCLUDE(CMake/UpdateCompiler.cmake)
 
-IF(CMAKE_BUILD_TYPE STREQUAL "Debug" OR
-   CMAKE_BUILD_TYPE STREQUAL "DebugGV")
-
-    SET(OSG_LIBDIR_SUFFIX "${OSG_LIBDIR_SUFFIX}/debug")
+# Installation directories
+IF(OSG_INSTALL_SUBDIR)
+    SET(_OSG_ISD "${OSG_INSTALL_SUBDIR}/")
+ELSE(OSG_INSTALL_SUBDIR)
+    SET(_OSG_ISD "")
+ENDIF(OSG_INSTALL_SUBDIR)
 
-ENDIF()
+IF(WIN32)
+    IF(OSG_USE_SEPARATE_LIBDIRS)
+        SET(OSG_INSTALL_BINDIR_DEBUG        "bin/${_OSG_ISD}debug")
+        SET(OSG_INSTALL_BINDIR_RELEASE      "bin/${_OSG_ISD}rel")
+        SET(OSG_INSTALL_BINDIR_DEBUGOPT     "bin/${_OSG_ISD}debugopt")
+        SET(OSG_INSTALL_BINDIR_RELEASENOOPT "bin/${_OSG_ISD}relnoopt")
+
+        SET(OSG_INSTALL_LIBDIR_DEBUG        "lib${OSG_LIBDIR_SUFFIX}/${_OSG_ISD}debug")
+        SET(OSG_INSTALL_LIBDIR_RELEASE      "lib${OSG_LIBDIR_SUFFIX}/${_OSG_ISD}rel")
+        SET(OSG_INSTALL_LIBDIR_DEBUGOPT     "lib${OSG_LIBDIR_SUFFIX}/${_OSG_ISD}debugopt")
+        SET(OSG_INSTALL_LIBDIR_RELEASENOOPT "lib${OSG_LIBDIR_SUFFIX}/${_OSG_ISD}relnoopt")
+    ELSE(OSG_USE_SEPARATE_LIBDIRS)
+        SET(OSG_INSTALL_BINDIR_DEBUG        "bin/${_OSG_ISD}")
+        SET(OSG_INSTALL_BINDIR_RELEASE      "bin/${_OSG_ISD}")
+        SET(OSG_INSTALL_BINDIR_DEBUGOPT     "bin/${_OSG_ISD}")
+        SET(OSG_INSTALL_BINDIR_RELEASENOOPT "bin/${_OSG_ISD}")
+
+        SET(OSG_INSTALL_LIBDIR_DEBUG        "lib${OSG_LIBDIR_SUFFIX}/${_OSG_ISD}")
+        SET(OSG_INSTALL_LIBDIR_RELEASE      "lib${OSG_LIBDIR_SUFFIX}/${_OSG_ISD}")
+        SET(OSG_INSTALL_LIBDIR_DEBUGOPT     "lib${OSG_LIBDIR_SUFFIX}/${_OSG_ISD}")
+        SET(OSG_INSTALL_LIBDIR_RELEASENOOPT "lib${OSG_LIBDIR_SUFFIX}/${_OSG_ISD}")
+    ENDIF(OSG_USE_SEPARATE_LIBDIRS)
+ELSE(WIN32)
+    IF(OSG_USE_SEPARATE_LIBDIRS)
+        SET(OSG_INSTALL_BINDIR_DEBUG          "lib${OSG_LIBDIR_SUFFIX}/${_OSG_ISD}debug")
+        SET(OSG_INSTALL_BINDIR_RELEASE        "lib${OSG_LIBDIR_SUFFIX}/${_OSG_ISD}")
+        SET(OSG_INSTALL_BINDIR_RELWITHDEBINFO "lib${OSG_LIBDIR_SUFFIX}/${_OSG_ISD}relwithdbg")
+        SET(OSG_INSTALL_BINDIR_MINSIZEREL     "lib${OSG_LIBDIR_SUFFIX}/${_OSG_ISD}minsizerel")
+        SET(OSG_INSTALL_BINDIR_DEBUGGV        "lib${OSG_LIBDIR_SUFFIX}/${_OSG_ISD}debuggv")
+
+        SET(OSG_INSTALL_LIBDIR_DEBUG          "lib${OSG_LIBDIR_SUFFIX}/${_OSG_ISD}debug")
+        SET(OSG_INSTALL_LIBDIR_RELEASE        "lib${OSG_LIBDIR_SUFFIX}/${_OSG_ISD}")
+        SET(OSG_INSTALL_LIBDIR_RELWITHDEBINFO "lib${OSG_LIBDIR_SUFFIX}/${_OSG_ISD}relwithdbg")
+        SET(OSG_INSTALL_LIBDIR_MINSIZEREL     "lib${OSG_LIBDIR_SUFFIX}/${_OSG_ISD}minsizerel")
+        SET(OSG_INSTALL_LIBDIR_DEBUGGV        "lib${OSG_LIBDIR_SUFFIX}/${_OSG_ISD}debuggv")
+    ELSE(OSG_USE_SEPARATE_LIBDIRS)
+        SET(OSG_INSTALL_BINDIR_DEBUG          "lib${OSG_LIBDIR_SUFFIX}/${_OSG_ISD}")
+        SET(OSG_INSTALL_BINDIR_RELEASE        "lib${OSG_LIBDIR_SUFFIX}/${_OSG_ISD}")
+        SET(OSG_INSTALL_BINDIR_RELWITHDEBINFO "lib${OSG_LIBDIR_SUFFIX}/${_OSG_ISD}")
+        SET(OSG_INSTALL_BINDIR_MINSIZEREL     "lib${OSG_LIBDIR_SUFFIX}/${_OSG_ISD}")
+        SET(OSG_INSTALL_BINDIR_DEBUGGV        "lib${OSG_LIBDIR_SUFFIX}/${_OSG_ISD}")
+
+        SET(OSG_INSTALL_LIBDIR_DEBUG          "lib${OSG_LIBDIR_SUFFIX}/${_OSG_ISD}")
+        SET(OSG_INSTALL_LIBDIR_RELEASE        "lib${OSG_LIBDIR_SUFFIX}/${_OSG_ISD}")
+        SET(OSG_INSTALL_LIBDIR_RELWITHDEBINFO "lib${OSG_LIBDIR_SUFFIX}/${_OSG_ISD}")
+        SET(OSG_INSTALL_LIBDIR_MINSIZEREL     "lib${OSG_LIBDIR_SUFFIX}/${_OSG_ISD}")
+        SET(OSG_INSTALL_LIBDIR_DEBUGGV        "lib${OSG_LIBDIR_SUFFIX}/${_OSG_ISD}")
+    ENDIF(OSG_USE_SEPARATE_LIBDIRS)
+ENDIF(WIN32)
 
 ADD_DEFINITIONS(-D OSG_BUILD_ACTIVE)
 
@@ -243,41 +307,37 @@ OSG_CHECK_INSTALL()
 # DEPENDENCIES
 ##############################################################################
 
-#IF(WIN32)
-  OSG_OPTION(OSG_USE_OSGSUPPORT_LIBS "" OFF)
-  OSG_OPTION(OSG_USE_STATIC_SUPPORT_LIBS "" OFF)
 
-  IF(OSG_USE_OSGSUPPORT_LIBS)
+OSG_OPTION(OSG_USE_OSGSUPPORT_LIBS "" OFF)
+OSG_OPTION(OSG_USE_STATIC_SUPPORT_LIBS "" OFF)
+
+IF(OSG_USE_OSGSUPPORT_LIBS)
     OSG_SET_CACHE(OSG_SUPPORT_ROOT "" PATH "")
-  ENDIF(OSG_USE_OSGSUPPORT_LIBS)
+ENDIF(OSG_USE_OSGSUPPORT_LIBS)
 
-  IF(EXISTS "${OSG_SUPPORT_ROOT}" AND 
-     EXISTS "${OSG_SUPPORT_ROOT}/include/OSGSupportConfig.cmake")
+IF(EXISTS "${OSG_SUPPORT_ROOT}" AND 
+   EXISTS "${OSG_SUPPORT_ROOT}/include/OSGSupportConfig.cmake")
 
     INCLUDE("${OSG_SUPPORT_ROOT}/include/OSGSupportConfig.cmake")  
 
     SET(_OSG_FATAL_DMS_COMBO FALSE)
 
     IF( NOT OSG_DISABLE_MICROSOFT_SECURE_CXXX AND     OSG_SUPPORT_DISABLE_MICROSOFT_SECURE_CXXX)
-      SET(_OSG_FATAL_DMS_COMBO TRUE)
+        SET(_OSG_FATAL_DMS_COMBO TRUE)
     ENDIF()
 
     IF(     OSG_DISABLE_MICROSOFT_SECURE_CXXX AND NOT OSG_SUPPORT_DISABLE_MICROSOFT_SECURE_CXXX)
-      SET(_OSG_FATAL_DMS_COMBO TRUE)
+        SET(_OSG_FATAL_DMS_COMBO TRUE)
     ENDIF()
 
     IF(_OSG_FATAL_DMS_COMBO)
 
-      MESSAGE(FATAL_ERROR "Conflicting DISABLE_MS_SECURE settings:\n"
-                          "  Support : ${OSG_SUPPORT_DISABLE_MICROSOFT_SECURE_CXXX}\n"
-                          "  OpenSG  : ${OSG_DISABLE_MICROSOFT_SECURE_CXXX}")
-
-    ENDIF()
-  ENDIF()
+        MESSAGE(FATAL_ERROR "Conflicting DISABLE_MS_SECURE settings:\n"
+                            "  Support : ${OSG_SUPPORT_DISABLE_MICROSOFT_SECURE_CXXX}\n"
+                            "  OpenSG  : ${OSG_DISABLE_MICROSOFT_SECURE_CXXX}")
+    ENDIF(_OSG_FATAL_DMS_COMBO)
+ENDIF()
 
-IF(WIN32)
-   SET(OSG_INSTALL_SUBDIR "" CACHE STRING "add subdir to installed libs")
-ENDIF(WIN32)
 
 IF(NOT OSG_BUILD_DEPENDEND)
 
@@ -844,9 +904,9 @@ FILE(WRITE  "${CMAKE_BINARY_DIR}/bin/osg2-config" "${OSG2_CONFIG_PART1_CONTENT}"
 FILE(APPEND "${CMAKE_BINARY_DIR}/bin/osg2-config" "${OSG2_CONFIG_PART2_CONTENT}")
 FILE(APPEND "${CMAKE_BINARY_DIR}/bin/osg2-config" "${OSG2_CONFIG_PART3_CONTENT}")
 
-FILE(REMOVE  "${CMAKE_BINARY_DIR}/bin/osg2-config.part1.tmp")
-FILE(REMOVE  "${CMAKE_BINARY_DIR}/bin/osg2-config.part2.tmp")
-FILE(REMOVE  "${CMAKE_BINARY_DIR}/bin/osg2-config.part3.tmp")
+#FILE(REMOVE  "${CMAKE_BINARY_DIR}/bin/osg2-config.part1.tmp")
+#FILE(REMOVE  "${CMAKE_BINARY_DIR}/bin/osg2-config.part2.tmp")
+#FILE(REMOVE  "${CMAKE_BINARY_DIR}/bin/osg2-config.part3.tmp")
 
 INSTALL(PROGRAMS "${CMAKE_BINARY_DIR}/bin/osg2-config"
         DESTINATION bin)
@@ -917,11 +977,6 @@ IF(OSGBUILD_ENABLE_PACKAGING)
 
 ENDIF(OSGBUILD_ENABLE_PACKAGING)
 
-IF(WIN32)
-SET(CMAKE_CONFIGURATION_TYPES "Debug;Release;DebugOpt;ReleaseNoOpt" 
-                              CACHE STRING "OpenSG Build Types" FORCE )
-ENDIF(WIN32)
-
 IF(OSG_WITH_CUDA)
   CUDA_BUILD_CLEAN_TARGET()
 ENDIF(OSG_WITH_CUDA)
-- 
1.6.0.6

>From 282cddbac5c6f259d0dd4c92575966d0abe204d1 Mon Sep 17 00:00:00 2001
From: Neumann <[email protected]>
Date: Fri, 18 Dec 2009 11:53:40 -0600
Subject: [PATCH] changed: handle imported library targets when writing osg2-config.part2.tmp

---
 CMake/BuildFunctions.cmake |   15 +++++++++-
 CMake/osg2-config.part3.in |   67 ++++++++++++++++++++++++++++---------------
 2 files changed, 57 insertions(+), 25 deletions(-)

diff --git a/CMake/BuildFunctions.cmake b/CMake/BuildFunctions.cmake
index b122bb8..6ef8614 100644
--- a/CMake/BuildFunctions.cmake
+++ b/CMake/BuildFunctions.cmake
@@ -326,7 +326,20 @@ FUNCTION(OSG_STORE_PROJECT_DEPENDENCIES)
     # External libraries this lib depends on
     # we build lists of libs, libdirs and incdirs then write them
     FOREACH(DEPLIB ${${PROJECT_NAME}_DEP_LIB})
-        OSG_EXTRACT_LIB_AND_LIBDIR("${${DEPLIB}}" LIBS LIBDIRS)
+        MESSAGE("DEPLIB = [${DEPLIB}] [${${DEPLIB}}]")
+        SET(LIBNAME)
+
+        FOREACH(LIB ${${DEPLIB}})
+            IF(TARGET ${LIB})
+                GET_TARGET_PROPERTY(_TMPVAL ${${DEPLIB}} LOCATION)
+                LIST(APPEND LIBNAME ${_TMPVAL})
+            ELSE(TARGET ${LIB})
+                LIST(APPEND LIBNAME ${LIB})
+            ENDIF(TARGET ${LIB})
+        ENDFOREACH(LIB)
+
+        MESSAGE("LIBNAME = [${LIBNAME}]")
+        OSG_EXTRACT_LIB_AND_LIBDIR("${LIBNAME}" LIBS LIBDIRS)
 
         LIST(APPEND DEPLIBS ${LIBS})
         LIST(APPEND DEPLIBDIRS ${LIBDIRS})
diff --git a/CMake/osg2-config.part3.in b/CMake/osg2-config.part3.in
index a1a268f..7a64ecf 100644
--- a/CMake/osg2-config.part3.in
+++ b/CMake/osg2-config.part3.in
@@ -59,16 +59,27 @@ def main():
                       help="Print the OpenSG version and exit.")
 
     parser.set_defaults(build_type=inst_build_type)
-    parser.add_option("--opt",             action="store_const", const="Release", dest="build_type",
-                      help = "Use library search path patterns for optimized OpenSG libraries " + \
-                             "(NOTE: This does not affect external dependencies, those always use the build time settings!).")
-    parser.add_option("--dbg",             action="store_const", const="Debug",   dest="build_type",
-                      help = "Use library search path patterns for debug OpenSG libraries " + \
-                             "(NOTE: This does not affect external dependencies, those always use the build time settings!).")
-    parser.add_option("--dbgrt",           action="store_const", const="DebugRT", dest="build_type",
-                      help = "Use library search path patterns for debug-runtime OpenSG libraries " + \
-                             "(NOTE: This does not affect external dependencies, those always use the build time settings!).")
 
+    if "win32" == sys.platform:
+        parser.add_option("--dbg",       action="store_const", const="Debug", dest="build_type",
+                          help="Use library search path patterns for Debug libraries")
+        parser.add_option("--dbg-opt",   action="store_const", const="DebugOpt", dest="build_type",
+                          help="Use library search path patterns for optimized Debug libraries")
+        parser.add_option("--rel",       action="store_const", const="Release", dest="build_type",
+                          help="Use library search path patterns for Release libraries")
+        parser.add_option("--rel-noopt", action="store_const", const="ReleaseNoOpt", dest="build_type",
+                          help="Use library search path patterns for unoptimized Release libraries")
+    else:
+        parser.add_option("--dbg",         action="store_const", const="Debug", dest="build_type",
+                          help="Use library search path patterns for Debug libraries")
+        parser.add_option("--dbg-gv",      action="store_const", const="DebugGV", dest="build_type",
+                          help="Use library search path patterns for maintainer Debug libraries")
+        parser.add_option("--rel",         action="store_const", const="Release", dest="build_type",
+                          help="Use library search path patterns for Release libraries")
+        parser.add_option("--rel-debinfo", action="store_const", const="RelWithDebInfo", dest="build_type",
+                          help="Use library search path patterns for Release libraries (with debug info)")
+        parser.add_option("--rel-minsize", action="store_const", const="MinSizeRel", dest="build_type",
+                          help="Use library search path patterns for Release libraries (optimized for size)")
 
     (options, pos_args) = parser.parse_args()
 
@@ -79,21 +90,29 @@ def main():
     elif inst_platform_64:
         lib_part = "lib64"
 
-    if options.build_type == "Release":
-        spez_lib_dir = pj(inst_prefix, lib_part)
-        spez_inc_dir = pj(inst_prefix, "include")
-    elif options.build_type == "Debug":
-        spez_lib_dir = pj(inst_prefix, lib_part, "debug")
-        spez_inc_dir = pj(inst_prefix, "include")
-    elif options.build_type == "DebugRT":
-        spez_lib_dir = pj(inst_prefix, lib_part, "debugrt")
-        spez_inc_dir = pj(inst_prefix, "include")
-        lib_suffix   = "_d"
-
-    # paths for different build type requested, overwrite defaults
-    if options.build_type != inst_build_type:
-        lib_dir = spez_lib_dir
-        inc_dir = spez_inc_dir
+    if "win32" == sys.platform:
+        if options.build_type == "Debug":
+            spez_lib_dir = pj(inst_prefix, lib_part, "debug")
+        elif options.build_type == "DebugOpt":
+            spez_lib_dir = pj(inst_prefix, lib_part, "debugopt")
+        elif options.build_type == "Release":
+            spez_lib_dir = pj(inst_prefix, lib_part, "rel")
+        elif options.build_type == "ReleaseNoOpt":
+            spez_lib_dir = pj(inst_prefix, lib_part, "relnoopt")
+    else:
+        if options.build_type == "Debug":
+            spez_lib_dir = pj(inst_prefix, lib_part, "debug")
+        elif options.build_type == "DebugGV":
+            spez_lib_dir = pj(inst_prefix, lib_part, "debuggv")
+        elif options.build_type == "Release":
+            spez_lib_dir = pj(inst_prefix, lib_part)
+        elif options.build_type == "RelWithDebInfo":
+            spez_lib_dir = pj(inst_prefix, lib_part, "relwithdbg")
+        elif options.build_type == "MinSizeRel":
+            spez_lib_dir = pj(inst_prefix, lib_part, "minsizerel")
+
+    lib_dir = spez_lib_dir
+    inc_dir = pj(inst_prefix, "include")
 
     # Process simple single options
     if options.prefix:
-- 
1.6.0.6

>From e2aee4a4d70674c84c6b22c3c241e67884f59ad6 Mon Sep 17 00:00:00 2001
From: Neumann <[email protected]>
Date: Fri, 18 Dec 2009 11:54:28 -0600
Subject: [PATCH] changed: minor cleanup

---
 CMake/ConfigurePackages.cmake     |   16 ++++++++--------
 CMake/ExternalProjectHelper.cmake |    1 -
 CMakeLists.txt                    |   13 ++++++-------
 3 files changed, 14 insertions(+), 16 deletions(-)

diff --git a/CMake/ConfigurePackages.cmake b/CMake/ConfigurePackages.cmake
index 96bb11d..12b7922 100644
--- a/CMake/ConfigurePackages.cmake
+++ b/CMake/ConfigurePackages.cmake
@@ -613,20 +613,20 @@ MACRO(OSG_CONFIGURE_LIBMINI)
 
 		IF(UNIX)
 
-          IF(EXISTS ${OSG_SUPPORT_ROOT}/lib${OSG_LIBDIR_BASE_SUFFIX}/opt/libosgmini.a)
-            SET(OSG_LIBMINI_LIBRARY_RELEASE ${OSG_SUPPORT_ROOT}/lib${OSG_LIBDIR_BASE_SUFFIX}/opt/libosgmini.a)
+          IF(EXISTS ${OSG_SUPPORT_ROOT}/lib${OSG_LIBDIR_SUFFIX}/opt/libosgmini.a)
+            SET(OSG_LIBMINI_LIBRARY_RELEASE ${OSG_SUPPORT_ROOT}/lib${OSG_LIBDIR_SUFFIX}/opt/libosgmini.a)
           ENDIF()
-          IF(EXISTS ${OSG_SUPPORT_ROOT}/lib${OSG_LIBDIR_BASE_SUFFIX}/debug/libosgmini.a)
-            SET(OSG_LIBMINI_LIBRARY_DEBUG ${OSG_SUPPORT_ROOT}/lib${OSG_LIBDIR_BASE_SUFFIX}/debug/libosgmini.a)
+          IF(EXISTS ${OSG_SUPPORT_ROOT}/lib${OSG_LIBDIR_SUFFIX}/debug/libosgmini.a)
+            SET(OSG_LIBMINI_LIBRARY_DEBUG ${OSG_SUPPORT_ROOT}/lib${OSG_LIBDIR_SUFFIX}/debug/libosgmini.a)
           ENDIF()
 
         ELSEIF(WIN32)
 
-          IF(EXISTS ${OSG_SUPPORT_ROOT}/lib${OSG_LIBDIR_BASE_SUFFIX}/libosgmini.lib)
-              SET(OSG_LIBMINI_LIBRARY_RELEASE ${OSG_SUPPORT_ROOT}/lib${OSG_LIBDIR_BASE_SUFFIX}/libosgmini.lib)
+          IF(EXISTS ${OSG_SUPPORT_ROOT}/lib${OSG_LIBDIR_SUFFIX}/libosgmini.lib)
+              SET(OSG_LIBMINI_LIBRARY_RELEASE ${OSG_SUPPORT_ROOT}/lib${OSG_LIBDIR_SUFFIX}/libosgmini.lib)
           ENDIF()
-          IF(EXISTS ${OSG_SUPPORT_ROOT}/lib${OSG_LIBDIR_BASE_SUFFIX}/libosgminiD.lib)
-              SET(OSG_LIBMINI_LIBRARY_DEBUG ${OSG_SUPPORT_ROOT}/lib${OSG_LIBDIR_BASE_SUFFIX}/libosgminiD.lib)
+          IF(EXISTS ${OSG_SUPPORT_ROOT}/lib${OSG_LIBDIR_SUFFIX}/libosgminiD.lib)
+              SET(OSG_LIBMINI_LIBRARY_DEBUG ${OSG_SUPPORT_ROOT}/lib${OSG_LIBDIR_SUFFIX}/libosgminiD.lib)
           ENDIF()
 
 		ENDIF()
diff --git a/CMake/ExternalProjectHelper.cmake b/CMake/ExternalProjectHelper.cmake
index d25e8eb..f7e88d0 100644
--- a/CMake/ExternalProjectHelper.cmake
+++ b/CMake/ExternalProjectHelper.cmake
@@ -22,7 +22,6 @@ MACRO(OSG_INIT)
   IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
     SET(OSG_PLATFORM_64 1)
     SET(OSG_LIBDIR_SUFFIX "64")
-    SET(OSG_LIBDIR_BASE_SUFFIX "64")
   ELSE()
     SET(OSG_PLATFORM_32 1)
   ENDIF()
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 88f5cf8..aa1dc73 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -10,8 +10,8 @@ INCLUDE(OpenSGVersion)
 ##############################################
 
 IF(NOT _OSGINITCACHELOADED AND EXISTS ${CMAKE_SOURCE_DIR}/CMakeCacheInitial.txt)
-  INCLUDE(${CMAKE_SOURCE_DIR}/CMakeCacheInitial.txt)
-  SET(_OSGINITCACHELOADED TRUE CACHE INTERNAL "")
+    INCLUDE(${CMAKE_SOURCE_DIR}/CMakeCacheInitial.txt)
+    SET(_OSGINITCACHELOADED TRUE CACHE INTERNAL "")
 ENDIF(NOT _OSGINITCACHELOADED AND EXISTS ${CMAKE_SOURCE_DIR}/CMakeCacheInitial.txt)
 
 
@@ -22,9 +22,9 @@ INCLUDE(BuildFunctions)
 ##########################
 
 IF("${OpenSG_SOURCE_DIR}"  STREQUAL "${OpenSG_BINARY_DIR}")
-  MESSAGE(FATAL_ERROR "OpenSG requires an out of source Build. \n"
-                      "Please create a separate binary directory and run "
-                      "CMake there.")
+    MESSAGE(FATAL_ERROR "OpenSG requires an out of source Build. \n"
+                        "Please create a separate binary directory and run "
+                        "CMake there.")
 ENDIF("${OpenSG_SOURCE_DIR}"  STREQUAL "${OpenSG_BINARY_DIR}")
 
 SET(OSG_BUILD_ACTIVE TRUE)
@@ -192,7 +192,7 @@ OSG_SET_CACHE(OSG_EXTRA_EXTERNAL_MODULES "" STRING
               "Extra modules that OpenSG will try to import.")
 
 OSG_SET_CACHE(OSG_IGNORE_INSTALL "" STRING 
-              "Extra modules that OpenSG will build but not installed.")
+              "Extra modules that OpenSG will build but not install.")
 
 OSG_OPTION(OSG_LINK_EXTERNAL_MODULES_TO_CSM "" FALSE)
 
@@ -207,7 +207,6 @@ SET(OSG_LIBDIR_SUFFIX "")
 IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
     SET(OSG_PLATFORM_64 1)
     SET(OSG_LIBDIR_SUFFIX "64")
-    SET(OSG_LIBDIR_BASE_SUFFIX "64")
 ELSE()
     SET(OSG_PLATFORM_32 1)
 ENDIF()
-- 
1.6.0.6

>From 18e0607beea42a4eea034bd61b861a651e1293b7 Mon Sep 17 00:00:00 2001
From: Neumann <[email protected]>
Date: Fri, 18 Dec 2009 11:54:51 -0600
Subject: [PATCH] fixed: link with OSGImageFileIO to match standalone version

---
 Examples/Simple/CMakeLists.fromosg.txt |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/Examples/Simple/CMakeLists.fromosg.txt b/Examples/Simple/CMakeLists.fromosg.txt
index 0b06b32..6482a12 100644
--- a/Examples/Simple/CMakeLists.fromosg.txt
+++ b/Examples/Simple/CMakeLists.fromosg.txt
@@ -17,8 +17,17 @@ LIST(REMOVE_ITEM SRCFILES "${PROJECT_SOURCE_DIR}/shader.cpp")
 #############################################################################
 # get dependencies
 
-SET(OSG_COMPONENTS OSGBase OSGCluster OSGDrawable OSGFileIO OSGGroup OSGState
-                   OSGSystem OSGUtil OSGWindow OSGWindowGLUT)
+SET(OSG_COMPONENTS OSGBase
+                   OSGCluster
+                   OSGDrawable
+                   OSGFileIO
+                   OSGGroup
+                   OSGImageFileIO
+                   OSGState
+                   OSGSystem
+                   OSGUtil
+                   OSGWindow
+                   OSGWindowGLUT)
 
 IF(UNIX)
     IF(APPLE)
-- 
1.6.0.6

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Opensg-core mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-core

Reply via email to