Просмотр исходного кода

Fix build if build type is blank, move windows build into source controlled scripts and enable unit tests

Paul 11 лет назад
Родитель
Сommit
6c90ac91d5
3 измененных файлов с 69 добавлено и 2 удалено
  1. 33 0
      CIBuild/windows/build.bat
  2. 34 0
      CIBuild/windows/build64.bat
  3. 2 2
      CMakeLists.txt

+ 33 - 0
CIBuild/windows/build.bat

@@ -0,0 +1,33 @@
+git rev-parse HEAD>current_version.txt
+set /P CURRENT=<current_version.txt
+echo %CURRENT%
+
+mkdir build
+::if %errorlevel% neq 0 exit /b %errorlevel%
+
+cd build
+if %errorlevel% neq 0 exit /b %errorlevel%
+
+set QTDIR=C:\qt-everywhere-opensource-src-4.8.6_32
+set OGRE_HOME=C:\Ogre\Build\sdk
+call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\VsDevCmd.bat"
+
+cmake .. -T v120_xp -DZLIB_INCLUDE_DIR=C:/zlib-1.2.8 -DBOOST_ROOT=C:\boost_1_55_0_32 -DBOOST_LIBRARYDIR=C:\boost_1_55_0_32\lib32-msvc-12.0 -DOGRE_DIR=C:\Ogre\Build\sdk -DOIS_HOME=C:\Ogre\Dependencies\Build\ogredeps -DZLIB_LIBRARY=C:/zlib-1.2.8/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/zlibwapi.lib
+if %errorlevel% neq 0 exit /b %errorlevel%
+
+msbuild /m QGears.sln /p:Configuration=Release
+if %errorlevel% neq 0 exit /b %errorlevel%
+
+cpack -C "Release"
+if %errorlevel% neq 0 exit /b %errorlevel%
+
+cd ..
+cd ..
+mkdir %CURRENT%
+cd %CURRENT%
+mkdir windows
+cd .. 
+dir
+move q-gears\build\*.msi %CURRENT%\windows
+
+ctest --verbose

+ 34 - 0
CIBuild/windows/build64.bat

@@ -0,0 +1,34 @@
+git rev-parse HEAD>current_version.txt
+set /P CURRENT=<current_version.txt
+echo %CURRENT%
+
+mkdir build
+::if %errorlevel% neq 0 exit /b %errorlevel%
+
+cd build
+if %errorlevel% neq 0 exit /b %errorlevel%
+
+set QTDIR=C:\qt-everywhere-opensource-src-4.8.6_64
+set OGRE_HOME=C:\Ogre64\Build\sdk
+call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\VsDevCmd.bat"
+
+cmake .. -G"Visual Studio 12 2013 Win64" -T v120_xp -DZLIB_INCLUDE_DIR=C:/zlib-1.2.8 -DBOOST_ROOT=C:\boost_1_55_0_64 -DBOOST_LIBRARYDIR=C:\boost_1_55_0_64\lib64-msvc-12.0 -DOGRE_DIR=C:\Ogre64\Build\sdk -DOIS_HOME=C:\Ogre64\Dependencies\Build\ogredeps -DZLIB_LIBRARY=C:/zlib-1.2.8/contrib/vstudio/vc11/x64/ZlibDllReleaseWithoutAsm/zlibwapi.lib
+if %errorlevel% neq 0 exit /b %errorlevel%
+
+msbuild /m QGears.sln /p:Configuration=Release
+if %errorlevel% neq 0 exit /b %errorlevel%
+
+cpack -C "Release"
+if %errorlevel% neq 0 exit /b %errorlevel%
+
+cd ..
+cd ..
+mkdir %CURRENT%
+cd %CURRENT%
+mkdir windows
+cd .. 
+dir
+move q-gears\build\*.msi %CURRENT%\windows
+
+
+ctest --verbose

+ 2 - 2
CMakeLists.txt

@@ -9,8 +9,6 @@ set(QGears_VERSION_MAJOR 0)
 set(QGears_VERSION_MINOR 22)
 set(QGears_VERSION_PATCH 0)
 
-string(TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE)
-
 if ("${CMAKE_BUILD_TYPE}" STREQUAL "")
   # CMake defaults to leaving CMAKE_BUILD_TYPE empty. This screws up
   # differentiation between debug and release builds.
@@ -18,6 +16,8 @@ if ("${CMAKE_BUILD_TYPE}" STREQUAL "")
   message("CMAKE_BUILD_TYPE was empty defaulting to RELEASE")
 endif ()
 
+string(TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE)
+
 message("CMAKE_BUILD_TYPE is ${CMAKE_BUILD_TYPE} CMAKE_BINARY_DIR is ${CMAKE_BINARY_DIR}")
 
 set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/bin_release)