[Orxonox-commit 4805] r9474 - in code/branches/testing: cmake/tools src test/util

landauf at orxonox.net landauf at orxonox.net
Thu Nov 29 22:30:43 CET 2012


Author: landauf
Date: 2012-11-29 22:30:42 +0100 (Thu, 29 Nov 2012)
New Revision: 9474

Added:
   code/branches/testing/src/template.vcproj.user.in
   code/branches/testing/src/template.vcxproj.user.in
Removed:
   code/branches/testing/src/orxonox-main.vcproj.user.in
   code/branches/testing/src/orxonox-main.vcxproj.user.in
Modified:
   code/branches/testing/cmake/tools/TargetUtilities.cmake
   code/branches/testing/src/CMakeLists.txt
   code/branches/testing/test/util/CMakeLists.txt
Log:
moved settings for executables in visual studio to TargetUtilities to make them work for orxonox-main and test-executables
define test-executables with ORXONOX_ADD_EXECUTABLE

Modified: code/branches/testing/cmake/tools/TargetUtilities.cmake
===================================================================
--- code/branches/testing/cmake/tools/TargetUtilities.cmake	2012-11-29 16:49:02 UTC (rev 9473)
+++ code/branches/testing/cmake/tools/TargetUtilities.cmake	2012-11-29 21:30:42 UTC (rev 9474)
@@ -81,6 +81,28 @@
 
 MACRO(ORXONOX_ADD_EXECUTABLE _target_name)
   TU_ADD_TARGET(${_target_name} EXECUTABLE "WIN32" ${ARGN})
+  
+  # When using Visual Studio we want to use the output directory as working
+  # directory and we also want to specify where the external dlls
+  # (lua, ogre, etc.) are. The problem hereby is that these information cannot
+  # be specified in CMake because they are not stored in the actual project file.
+  # This workaround will create a configured *.vcproj.user file that holds the
+  # right values. When starting the solution for the first time,
+  # these get written to the *vcproj.yourPCname.yourname.user
+  IF(MSVC)
+    IF(CMAKE_CL_64)
+      SET(MSVC_PLATFORM "x64")
+    ELSE()
+      SET(MSVC_PLATFORM "Win32")
+    ENDIF()
+    IF(MSVC10)
+      CONFIGURE_FILE("${CMAKE_SOURCE_DIR}/src/template.vcxproj.user.in" "${CMAKE_CURRENT_BINARY_DIR}/${_target_name}.vcxproj.user")
+    ELSE()
+      STRING(REGEX REPLACE "^Visual Studio ([0-9][0-9]?).*$" "\\1"
+             VISUAL_STUDIO_VERSION_SIMPLE "${CMAKE_GENERATOR}")
+      CONFIGURE_FILE("${CMAKE_SOURCE_DIR}/src/template.vcproj.user.in" "${CMAKE_CURRENT_BINARY_DIR}/${_target_name}.vcproj.user")
+    ENDIF()
+  ENDIF(MSVC)
 ENDMACRO(ORXONOX_ADD_EXECUTABLE)
 
 

Modified: code/branches/testing/src/CMakeLists.txt
===================================================================
--- code/branches/testing/src/CMakeLists.txt	2012-11-29 16:49:02 UTC (rev 9473)
+++ code/branches/testing/src/CMakeLists.txt	2012-11-29 21:30:42 UTC (rev 9474)
@@ -77,26 +77,12 @@
 SET(ORXONOX_EXECUTABLE_NAME ${_exec_name} CACHE INTERNAL "")
 
 
-# When using Visual Studio we want to use the output directory as working
-# directory and we also want to specify where the external dlls
-# (lua, ogre, etc.) are. The problem hereby is that these information cannot
-# be specified in CMake because they are not stored in the actual project file.
-# This workaround will create a configured *.vcproj.user file that holds the
-# right values. When starting the solution for the first time,
-# these get written to the *vcproj.yourPCname.yourname.user
 IF(MSVC)
   IF(CMAKE_CL_64)
     SET(MSVC_PLATFORM "x64")
   ELSE()
     SET(MSVC_PLATFORM "Win32")
   ENDIF()
-  IF(MSVC10)
-    CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/orxonox-main.vcxproj.user.in" "${CMAKE_CURRENT_BINARY_DIR}/orxonox-main.vcxproj.user")
-  ELSE()
-    STRING(REGEX REPLACE "^Visual Studio ([0-9][0-9]?).*$" "\\1"
-           VISUAL_STUDIO_VERSION_SIMPLE "${CMAKE_GENERATOR}")
-    CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/orxonox-main.vcproj.user.in" "${CMAKE_CURRENT_BINARY_DIR}/orxonox-main.vcproj.user")
-  ENDIF()
 ENDIF(MSVC)
 
 # Apple Mac OS X specific build settings

Deleted: code/branches/testing/src/orxonox-main.vcproj.user.in
===================================================================
--- code/branches/testing/src/orxonox-main.vcproj.user.in	2012-11-29 16:49:02 UTC (rev 9473)
+++ code/branches/testing/src/orxonox-main.vcproj.user.in	2012-11-29 21:30:42 UTC (rev 9474)
@@ -1,54 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioUserFile
-	ProjectType="Visual C++"
-	Version="${VISUAL_STUDIO_VERSION_SIMPLE}.00"
-	ShowAllFiles="false"
-	>
-	<Configurations>
-		<Configuration
-			Name="Debug|${MSVC_PLATFORM}"
-			>
-			<DebugSettings
-				WorkingDirectory="${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$(OutDir)"
-				Environment="PATH=${RUNTIME_LIBRARY_DIRECTORY};%PATH%"
-				EnvironmentMerge="true"
-			/>
-		</Configuration>
-		<Configuration
-			Name="RelForDevs|${MSVC_PLATFORM}"
-			>
-			<DebugSettings
-				WorkingDirectory="${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$(OutDir)"
-				Environment="PATH=${RUNTIME_LIBRARY_DIRECTORY};%PATH%"
-				EnvironmentMerge="true"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|${MSVC_PLATFORM}"
-			>
-			<DebugSettings
-				WorkingDirectory="${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$(OutDir)"
-				Environment="PATH=${RUNTIME_LIBRARY_DIRECTORY};%PATH%"
-				EnvironmentMerge="true"
-			/>
-		</Configuration>
-		<Configuration
-			Name="MinSizeRel|${MSVC_PLATFORM}"
-			>
-			<DebugSettings
-				WorkingDirectory="${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$(OutDir)"
-				Environment="PATH=${RUNTIME_LIBRARY_DIRECTORY};%PATH%"
-				EnvironmentMerge="true"
-			/>
-		</Configuration>
-		<Configuration
-			Name="RelWithDebInfo|${MSVC_PLATFORM}"
-			>
-			<DebugSettings
-				WorkingDirectory="${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$(OutDir)"
-				Environment="PATH=${RUNTIME_LIBRARY_DIRECTORY};%PATH%"
-				EnvironmentMerge="true"
-			/>
-		</Configuration>
-	</Configurations>
-</VisualStudioUserFile>

Deleted: code/branches/testing/src/orxonox-main.vcxproj.user.in
===================================================================
--- code/branches/testing/src/orxonox-main.vcxproj.user.in	2012-11-29 16:49:02 UTC (rev 9473)
+++ code/branches/testing/src/orxonox-main.vcxproj.user.in	2012-11-29 21:30:42 UTC (rev 9474)
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|${MSVC_PLATFORM}'">
-    <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
-    <LocalDebuggerEnvironment>PATH=${RUNTIME_LIBRARY_DIRECTORY};%PATH%</LocalDebuggerEnvironment>
-    <LocalDebuggerWorkingDirectory>$(Outdir)</LocalDebuggerWorkingDirectory>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RelForDevs|${MSVC_PLATFORM}'">
-    <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
-    <LocalDebuggerEnvironment>PATH=${RUNTIME_LIBRARY_DIRECTORY};%PATH%</LocalDebuggerEnvironment>
-    <LocalDebuggerWorkingDirectory>$(Outdir)</LocalDebuggerWorkingDirectory>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|${MSVC_PLATFORM}'">
-    <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
-    <LocalDebuggerEnvironment>PATH=${RUNTIME_LIBRARY_DIRECTORY};%PATH%</LocalDebuggerEnvironment>
-    <LocalDebuggerWorkingDirectory>$(Outdir)</LocalDebuggerWorkingDirectory>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|${MSVC_PLATFORM}'">
-    <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
-    <LocalDebuggerEnvironment>PATH=${RUNTIME_LIBRARY_DIRECTORY};%PATH%</LocalDebuggerEnvironment>
-    <LocalDebuggerWorkingDirectory>$(Outdir)</LocalDebuggerWorkingDirectory>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|${MSVC_PLATFORM}'">
-    <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
-    <LocalDebuggerEnvironment>PATH=${RUNTIME_LIBRARY_DIRECTORY};%PATH%</LocalDebuggerEnvironment>
-    <LocalDebuggerWorkingDirectory>$(Outdir)</LocalDebuggerWorkingDirectory>
-  </PropertyGroup>
-</Project>

Copied: code/branches/testing/src/template.vcproj.user.in (from rev 9470, code/branches/testing/src/orxonox-main.vcproj.user.in)
===================================================================
--- code/branches/testing/src/template.vcproj.user.in	                        (rev 0)
+++ code/branches/testing/src/template.vcproj.user.in	2012-11-29 21:30:42 UTC (rev 9474)
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioUserFile
+	ProjectType="Visual C++"
+	Version="${VISUAL_STUDIO_VERSION_SIMPLE}.00"
+	ShowAllFiles="false"
+	>
+	<Configurations>
+		<Configuration
+			Name="Debug|${MSVC_PLATFORM}"
+			>
+			<DebugSettings
+				WorkingDirectory="${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$(OutDir)"
+				Environment="PATH=${RUNTIME_LIBRARY_DIRECTORY};%PATH%"
+				EnvironmentMerge="true"
+			/>
+		</Configuration>
+		<Configuration
+			Name="RelForDevs|${MSVC_PLATFORM}"
+			>
+			<DebugSettings
+				WorkingDirectory="${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$(OutDir)"
+				Environment="PATH=${RUNTIME_LIBRARY_DIRECTORY};%PATH%"
+				EnvironmentMerge="true"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|${MSVC_PLATFORM}"
+			>
+			<DebugSettings
+				WorkingDirectory="${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$(OutDir)"
+				Environment="PATH=${RUNTIME_LIBRARY_DIRECTORY};%PATH%"
+				EnvironmentMerge="true"
+			/>
+		</Configuration>
+		<Configuration
+			Name="MinSizeRel|${MSVC_PLATFORM}"
+			>
+			<DebugSettings
+				WorkingDirectory="${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$(OutDir)"
+				Environment="PATH=${RUNTIME_LIBRARY_DIRECTORY};%PATH%"
+				EnvironmentMerge="true"
+			/>
+		</Configuration>
+		<Configuration
+			Name="RelWithDebInfo|${MSVC_PLATFORM}"
+			>
+			<DebugSettings
+				WorkingDirectory="${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$(OutDir)"
+				Environment="PATH=${RUNTIME_LIBRARY_DIRECTORY};%PATH%"
+				EnvironmentMerge="true"
+			/>
+		</Configuration>
+	</Configurations>
+</VisualStudioUserFile>

Copied: code/branches/testing/src/template.vcxproj.user.in (from rev 9470, code/branches/testing/src/orxonox-main.vcxproj.user.in)
===================================================================
--- code/branches/testing/src/template.vcxproj.user.in	                        (rev 0)
+++ code/branches/testing/src/template.vcxproj.user.in	2012-11-29 21:30:42 UTC (rev 9474)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|${MSVC_PLATFORM}'">
+    <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+    <LocalDebuggerEnvironment>PATH=${RUNTIME_LIBRARY_DIRECTORY};%PATH%</LocalDebuggerEnvironment>
+    <LocalDebuggerWorkingDirectory>$(Outdir)</LocalDebuggerWorkingDirectory>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RelForDevs|${MSVC_PLATFORM}'">
+    <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+    <LocalDebuggerEnvironment>PATH=${RUNTIME_LIBRARY_DIRECTORY};%PATH%</LocalDebuggerEnvironment>
+    <LocalDebuggerWorkingDirectory>$(Outdir)</LocalDebuggerWorkingDirectory>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|${MSVC_PLATFORM}'">
+    <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+    <LocalDebuggerEnvironment>PATH=${RUNTIME_LIBRARY_DIRECTORY};%PATH%</LocalDebuggerEnvironment>
+    <LocalDebuggerWorkingDirectory>$(Outdir)</LocalDebuggerWorkingDirectory>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|${MSVC_PLATFORM}'">
+    <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+    <LocalDebuggerEnvironment>PATH=${RUNTIME_LIBRARY_DIRECTORY};%PATH%</LocalDebuggerEnvironment>
+    <LocalDebuggerWorkingDirectory>$(Outdir)</LocalDebuggerWorkingDirectory>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|${MSVC_PLATFORM}'">
+    <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+    <LocalDebuggerEnvironment>PATH=${RUNTIME_LIBRARY_DIRECTORY};%PATH%</LocalDebuggerEnvironment>
+    <LocalDebuggerWorkingDirectory>$(Outdir)</LocalDebuggerWorkingDirectory>
+  </PropertyGroup>
+</Project>

Modified: code/branches/testing/test/util/CMakeLists.txt
===================================================================
--- code/branches/testing/test/util/CMakeLists.txt	2012-11-29 16:49:02 UTC (rev 9473)
+++ code/branches/testing/test/util/CMakeLists.txt	2012-11-29 21:30:42 UTC (rev 9474)
@@ -1,6 +1,11 @@
-ADD_EXECUTABLE(
+ORXONOX_ADD_EXECUTABLE(
     util_test
     EXCLUDE_FROM_ALL
+	NO_INSTALL
+  LINK_LIBRARIES
+    util
+	gmock_orxonox
+  SOURCE_FILES
     ${GMOCK_MAIN}
     ConvertTest.cc
     MathTest.cc
@@ -14,24 +19,6 @@
     SubStringTest.cc
     VA_NARGSTest.cc
 )
-TARGET_LINK_LIBRARIES(util_test util gmock_orxonox)
 ADD_DEPENDENCIES(test util_test)
 
 ADD_TEST(util_test ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/util_test)
-
-#-----------------
-
-IF(MSVC)
-  IF(CMAKE_CL_64)
-    SET(MSVC_PLATFORM "x64")
-  ELSE()
-    SET(MSVC_PLATFORM "Win32")
-  ENDIF()
-  IF(MSVC10)
-    CONFIGURE_FILE("../../src/orxonox-main.vcxproj.user.in" "${CMAKE_CURRENT_BINARY_DIR}/util_test.vcxproj.user")
-  ELSE()
-    STRING(REGEX REPLACE "^Visual Studio ([0-9][0-9]?).*$" "\\1"
-           VISUAL_STUDIO_VERSION_SIMPLE "${CMAKE_GENERATOR}")
-    CONFIGURE_FILE("../../src/orxonox-main.vcproj.user.in" "${CMAKE_CURRENT_BINARY_DIR}/util_test.vcproj.user")
-  ENDIF()
-ENDIF(MSVC)




More information about the Orxonox-commit mailing list