[Orxonox-commit 926] r5649 - in code/branches/libraries: cmake src/core src/orxonox

rgrieder at orxonox.net rgrieder at orxonox.net
Sun Aug 16 16:21:01 CEST 2009


Author: rgrieder
Date: 2009-08-16 16:21:01 +0200 (Sun, 16 Aug 2009)
New Revision: 5649

Modified:
   code/branches/libraries/cmake/TargetUtilities.cmake
   code/branches/libraries/src/core/Core.cc
   code/branches/libraries/src/orxonox/CMakeLists.txt
Log:
Fixed msvc build: I had to link the plugins as SHARED instead of MODULE because CMake doesn't allow modules to be linked against another module.
The reason why it did work after all was because the quest library was built before overlays causing CMake to link against whatever it found under the name "overlays" in the end (which was of course the output file instead of the CMake representation of a library). Since msvc never links against dlls but rather against the corresponding *.lib file things got completely busted.

Also added the proposed fix for the PATH variable (successfully tested under Windows by deleting the overlays.plugin file).

Modified: code/branches/libraries/cmake/TargetUtilities.cmake
===================================================================
--- code/branches/libraries/cmake/TargetUtilities.cmake	2009-08-14 01:07:59 UTC (rev 5648)
+++ code/branches/libraries/cmake/TargetUtilities.cmake	2009-08-16 14:21:01 UTC (rev 5649)
@@ -147,9 +147,9 @@
     ENDIF()
   ENDIF()
 
-  # PLUGIN A
+  # PLUGIN A, always create shared libraries
   IF(_arg_PLUGIN)
-    SET(_arg_SHARED MODULE)
+    SET(_arg_SHARED SHARED)
     SET(_arg_STATIC)
   ENDIF()
 
@@ -164,7 +164,10 @@
 
   # PLUGIN B
   IF (_arg_PLUGIN)
-    SET_TARGET_PROPERTIES(${_target_name} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_PLUGIN_OUTPUT_DIRECTORY})
+    SET_TARGET_PROPERTIES(${_target_name} PROPERTIES
+      RUNTIME_OUTPUT_DIRECTORY ${CMAKE_PLUGIN_OUTPUT_DIRECTORY} # Windows
+      LIBRARY_OUTPUT_DIRECTORY ${CMAKE_PLUGIN_OUTPUT_DIRECTORY} # Unix
+    )
     ADD_PLUGIN(${_target_name})
   ENDIF()
 
@@ -196,15 +199,17 @@
   ENDIF()
 
   IF(NOT _arg_STATIC AND NOT _arg_NO_INSTALL)
-    SET(_library_destination ${ORXONOX_LIBRARY_INSTALL_PATH})
-    IF (_arg_PLUGIN)
-      SET(_library_destination ${ORXONOX_PLUGIN_INSTALL_PATH})
+    IF(_arg_PLUGIN)
+      INSTALL(TARGETS ${_target_name}
+        RUNTIME DESTINATION ${ORXONOX_PLUGIN_INSTALL_PATH}
+        LIBRARY DESTINATION ${ORXONOX_PLUGIN_INSTALL_PATH}
+      )
+    ELSE()
+      INSTALL(TARGETS ${_target_name}
+        RUNTIME DESTINATION ${ORXONOX_RUNTIME_INSTALL_PATH}
+        LIBRARY DESTINATION ${ORXONOX_LIBRARY_INSTALL_PATH}
+      )
     ENDIF()
-
-    INSTALL(TARGETS ${_target_name}
-      RUNTIME DESTINATION ${ORXONOX_RUNTIME_INSTALL_PATH}
-      LIBRARY DESTINATION ${_library_destination}
-    )
   ENDIF()
 
 ENDFUNCTION(TU_ADD_TARGET)

Modified: code/branches/libraries/src/core/Core.cc
===================================================================
--- code/branches/libraries/src/core/Core.cc	2009-08-14 01:07:59 UTC (rev 5648)
+++ code/branches/libraries/src/core/Core.cc	2009-08-16 14:21:01 UTC (rev 5649)
@@ -281,6 +281,10 @@
             // Search in the directory of our executable
             boost::filesystem::path searchpath = this->configuration_->pluginPath_;
 
+            // Add that path to the PATH variable in case a plugin depends on another one
+            std::string pathVariable = getenv("PATH");
+            putenv(("PATH=" + pathVariable + ";" + configuration_->pluginPath_.string()).c_str());
+
             boost::filesystem::directory_iterator file(searchpath);
             boost::filesystem::directory_iterator end;
 

Modified: code/branches/libraries/src/orxonox/CMakeLists.txt
===================================================================
--- code/branches/libraries/src/orxonox/CMakeLists.txt	2009-08-14 01:07:59 UTC (rev 5648)
+++ code/branches/libraries/src/orxonox/CMakeLists.txt	2009-08-16 14:21:01 UTC (rev 5649)
@@ -30,8 +30,8 @@
 )
 ADD_SUBDIRECTORY(gamestates)
 ADD_SUBDIRECTORY(interfaces)
+ADD_SUBDIRECTORY(overlays)
 ADD_SUBDIRECTORY(objects)
-ADD_SUBDIRECTORY(overlays)
 ADD_SUBDIRECTORY(sound)
 ADD_SUBDIRECTORY(tools)
 




More information about the Orxonox-commit mailing list