add preliminary premake4 support (next to cmake) mainly to auto-generate Visual Studio projectfiles that can be redistributed (with no dependency on cmake, premake)

This commit is contained in:
erwin.coumans
2011-09-02 22:24:08 +00:00
parent ed02816e68
commit 82234e6f33
23 changed files with 452 additions and 10 deletions

18
Demos/OpenGL/premake4.lua Normal file
View File

@@ -0,0 +1,18 @@
project "OpenGLSupport"
kind "StaticLib"
targetdir "../../lib"
includedirs {
".",
"../../src"
}
configuration {"Windows"}
includedirs {
"../../Glut"
}
configuration{}
files {
"**.cpp",
"**.h"
}

88
Demos/premake4.lua Normal file
View File

@@ -0,0 +1,88 @@
function createDemos( demos, incdirs, linknames)
for _, name in ipairs(demos) do
project ( "App_" .. name )
kind "ConsoleApp"
targetdir ".."
includedirs {incdirs}
configuration { "Windows" }
links { "glut32","glew32","opengl32" }
includedirs{ "../Glut" }
libdirs {"../Glut"}
files { "../msvc/bullet.rc" }
configuration {"MaxOSX"}
linkoptions { "-framework Carbon -framework OpenGL -framework AGL -framework Glut" }
configuration {"not Windows", "not MacOSX"}
links {"GL","GLU","glut"}
configuration{}
links {
linknames
}
files {
"./" .. name .. "/*.cpp" ,
"./" .. name .. "/*.h"
}
end
end
-- "CharacterDemo", fixme: it includes BspDemo files
local localdemos = {
"BasicDemo",
"Box2dDemo",
"BspDemo",
"CcdPhysicsDemo",
"CollisionDemo",
"CollisionInterfaceDemo",
"ConcaveConvexcastDemo",
"ConcaveDemo",
"ConcaveRaycastDemo",
"ConstraintDemo",
"ContinuousConvexCollision",
"ConvexHullDistance",
"DynamicControlDemo",
"EPAPenDepthDemo",
"ForkLiftDemo",
"FractureDemo",
"GenericJointDemo",
"GimpactTestDemo",
"GjkConvexCastDemo",
"HelloWorld",
"InternalEdgeDemo",
"MovingConcaveDemo",
"MultiMaterialDemo",
"RagdollDemo",
"Raytracer",
"SimplexDemo",
"SliderConstraintDemo",
"TerrainDemo",
"UserCollisionAlgorithm",
"VehicleDemo"
}
-- the following demos require custom include or link settings
createDemos(localdemos,{"../src","OpenGL"},{"OpenGLSupport","LinearMath","BulletCollision","BulletDynamics"})
createDemos({"ConvexDecompositionDemo"},{"../Extras/HACD","../src","OpenGL"},{"OpenGLSupport","LinearMath","BulletCollision","BulletDynamics", "HACD"})
createDemos({"SoftDemo"},{"../src","OpenGL"}, {"OpenGLSupport","LinearMath","BulletCollision","BulletDynamics", "BulletSoftBody"})
createDemos({"SerializeDemo"},{"../Extras/Serialize/BulletFileLoader","../Extras/Serialize/BulletWorldImporter","../src","OpenGL"},{"OpenGLSupport","LinearMath","BulletCollision","BulletDynamics", "BulletSoftBody", "BulletFileLoader","BulletWorldImporter"})
include "OpenGL"

View File

@@ -12,7 +12,10 @@
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_WARNINGS #define _CRT_SECURE_NO_WARNINGS
#endif //_CRT_SECURE_NO_WARNINGS
#include <sstream> #include <sstream>
#include <hacdGraph.h> #include <hacdGraph.h>
#include <hacdHACD.h> #include <hacdHACD.h>

9
Extras/HACD/premake4.lua Normal file
View File

@@ -0,0 +1,9 @@
project "HACD"
kind "StaticLib"
targetdir "../../lib"
includedirs {"."}
files {
"**.cpp",
"**.h"
}

View File

@@ -0,0 +1,12 @@
project "BulletFileLoader"
kind "StaticLib"
targetdir "../../lib"
includedirs {
"../../../src"
}
files {
"**.cpp",
"**.h"
}

View File

@@ -0,0 +1,13 @@
project "BulletWorldImporter"
kind "StaticLib"
targetdir "../../lib"
includedirs {
"../BulletFileLoader",
"../../../src"
}
files {
"**.cpp",
"**.h"
}

5
Extras/premake4.lua Normal file
View File

@@ -0,0 +1,5 @@
include "HACD"
include "Serialize/BulletFileLoader"
include "Serialize/BulletWorldImporter"

View File

@@ -1,13 +1,13 @@
At the moment there are no binary packages from Bullet library. At the moment there are no binary packages from Bullet library.
Once this is done, 3 libraries will be placed here: Once this is done, the libraries will be placed here
bulletmath.a LinearMath
bulletcollision.a BulletCollision
bulletdynamics.a BulletDynamics
The C-API will be available in the include folder. The C-API will be available in the include folder.
For now, there is only C++ files, see src/btBulletCollisionCommon.h and src/btBulletDynamicsCommon.h For now, there is only C++ files, see src/btBulletCollisionCommon.h and src/btBulletDynamicsCommon.h
http://bullet.sf.net http://bullet.googlecode.com
Erwin Coumans Erwin Coumans

View File

@@ -1,8 +1,8 @@
// This file is generated automatically. // This file is generated automatically.
1 VERSIONINFO 1 VERSIONINFO
FILEVERSION 2, 76, 0, 0 FILEVERSION 2, 79, 0, 0
PRODUCTVERSION 2, 76, 0, 0 PRODUCTVERSION 2, 79, 0, 0
#ifdef CS_DEBUG #ifdef CS_DEBUG
FILEFLAGS 0x1 FILEFLAGS 0x1
#else #else
@@ -14,9 +14,9 @@ FILEFLAGS 0x0
BLOCK "040904E4" BLOCK "040904E4"
{ {
VALUE "ProductName", "Bullet Continuous Collision Detection and Physics Library" VALUE "ProductName", "Bullet Continuous Collision Detection and Physics Library"
VALUE "ProductVersion", "2.76" VALUE "ProductVersion", "2.79"
VALUE "FileVersion", "2.76" VALUE "FileVersion", "2.79"
VALUE "LegalCopyright", "Copyright (c) 2005-2010 Erwin Coumans" VALUE "LegalCopyright", "Copyright (c) 2005-2011 Erwin Coumans"
#ifdef CS_DEBUG #ifdef CS_DEBUG
VALUE "Comments", "Debug build" VALUE "Comments", "Debug build"
#else #else

36
msvc/findDirectX11.lua Normal file
View File

@@ -0,0 +1,36 @@
function findDirectX11()
local dx11path = os.getenv("DXSDK_DIR")
if (dx11path) then
local filepath = string.format("%s%s",dx11path,"Include/D3D11.h")
headerdx11 = io.open(filepath, "r")
if (headerdx11) then
printf("Found DX11: '%s'", filepath)
return true
end
end
return false
end
function initDirectX11()
configuration {}
local dx11path = os.getenv("DXSDK_DIR")
defines { "ADL_ENABLE_DX11"}
includedirs {"$(DXSDK_DIR)/include"}
configuration "x32"
libdirs {"$(DXSDK_DIR)/Lib/x86"}
configuration "x64"
libdirs {"$(DXSDK_DIR)/Lib/x64"}
configuration {}
links {"d3dcompiler",
"dxerr",
"dxguid",
"d3dx9",
"d3d9",
"winmm",
"comctl32",
"d3dx11"
}
return true
end

84
msvc/findOpenCL.lua Normal file
View File

@@ -0,0 +1,84 @@
-- todo: add Apple OpenCL environment vars
function findOpenCL_AMD()
local amdopenclpath = os.getenv("AMDAPPSDKROOT")
if (amdopenclpath) then
return true
end
return false
end
function findOpenCL_NVIDIA()
local nvidiaopenclpath = os.getenv("CUDA_PATH")
if (nvidiaopenclpath) then
return true
end
return false
end
function findOpenCL_Intel()
local intelopenclpath = os.getenv("INTELOCLSDKROOT")
if (intelopenclpath) then
return true
end
return false
end
function initOpenCL_AMD()
configuration {}
local amdopenclpath = os.getenv("AMDAPPSDKROOT")
if (amdopenclpath) then
defines { "ADL_ENABLE_CL" , "CL_PLATFORM_AMD"}
includedirs {
"$(AMDAPPSDKROOT)/include"
}
configuration "x32"
libdirs {"$(AMDAPPSDKROOT)/lib/x86"}
configuration "x64"
libdirs {"$(AMDAPPSDKROOT)/lib/x86_64"}
configuration {}
links {"OpenCL"}
return true
end
return false
end
function initOpenCL_NVIDIA()
configuration {}
local nvidiaopenclpath = os.getenv("CUDA_PATH")
if (nvidiaopenclpath) then
defines { "ADL_ENABLE_CL" , "CL_PLATFORM_NVIDIA"}
includedirs {
"$(CUDA_PATH)/include"
}
configuration "x32"
libdirs {"$(CUDA_PATH)/lib/Win32"}
configuration "x64"
libdirs {"$(CUDA_PATH)/lib/x64"}
configuration {}
links {"OpenCL"}
return true
end
return false
end
function initOpenCL_Intel()
configuration {}
local intelopenclpath = os.getenv("INTELOCLSDKROOT")
if (intelopenclpath) then
defines { "ADL_ENABLE_CL" , "CL_PLATFORM_INTEL"}
includedirs {
"$(INTELOCLSDKROOT)/include"
}
configuration "x32"
libdirs {"$(INTELOCLSDKROOT)/lib/x86"}
configuration "x64"
libdirs {"$(INTELOCLSDKROOT)/lib/x64"}
configuration {}
links {"OpenCL"}
return true
end
return false
end

BIN
msvc/premake4.exe Normal file

Binary file not shown.

77
msvc/premake4.lua Normal file
View File

@@ -0,0 +1,77 @@
--add the 0 so the solution comes first in the directory (when sorted on name)
solution "0BulletSolution"
-- Multithreaded compiling
if _ACTION == "vs2010" or _ACTION=="vs2008" then
buildoptions { "/MP" }
end
newoption {
trigger = "with-nacl",
description = "Enable Native Client build"
}
newoption {
trigger = "with-dx11",
description = "Enable DirectX11 build"
}
configurations {"Release", "Debug"}
configuration "Release"
flags { "Optimize", "StaticRuntime", "NoMinimalRebuild", "FloatFast"}
configuration "Debug"
flags { "Symbols", "StaticRuntime" , "NoMinimalRebuild", "NoEditAndContinue" ,"FloatFast"}
platforms {"x32", "x64"}
configuration "x64"
targetsuffix "_64"
configuration {"x64", "debug"}
targetsuffix "_x64_debug"
configuration {"x64", "release"}
targetsuffix "_x64"
configuration {"x32", "debug"}
targetsuffix "_debug"
configuration {"Windows"}
defines { "_CRT_SECURE_NO_WARNINGS","_CRT_SECURE_NO_DEPRECATE"}
configuration{}
if not _OPTIONS["with-nacl"] then
flags { "NoRTTI", "NoExceptions"}
defines { "_HAS_EXCEPTIONS=0" }
targetdir "../bin"
else
targetdir "../bin_html"
end
dofile ("findOpenCL.lua")
dofile ("findDirectX11.lua")
language "C++"
location("./" .. _ACTION)
if _OPTIONS["with-dx11"] then
include "../Demos/DX11ClothDemo"
include "../src/BulletMultiThreaded/GpuSoftBodySolvers/DX11"
end
if not _OPTIONS["with-dx11"] and not _OPTIONS["with-nacl"] then
include "../Demos"
include "../Extras"
end
include "../src/LinearMath"
include "../src/BulletCollision"
include "../src/BulletDynamics"
include "../src/BulletSoftBody"

4
msvc/vs2005.bat Normal file
View File

@@ -0,0 +1,4 @@
premake4 vs2005
pause

10
msvc/vs2008.bat Normal file
View File

@@ -0,0 +1,10 @@
rem premake4 --no-pelibs vs2008
rem premake4 --no-pedemos vs2008
rem premake4 --no-bulletlibs --no-pelibs vs2008
rem premake4 --with-nacl vs2008
premake4 vs2008
pause

4
msvc/vs2008_dx11.bat Normal file
View File

@@ -0,0 +1,4 @@
premake4 --with-dx11 vs2008
pause

8
msvc/vs2008_nacl.bat Normal file
View File

@@ -0,0 +1,8 @@
rem premake4 --no-pelibs vs2008
rem premake4 --no-pedemos vs2008
rem premake4 --no-bulletlibs --no-pelibs vs2008
premake4 --with-nacl vs2008
pause

4
msvc/vs2010.bat Normal file
View File

@@ -0,0 +1,4 @@
premake4 vs2010
pause

View File

@@ -0,0 +1,11 @@
project "BulletCollision"
kind "StaticLib"
targetdir "../../lib"
includedirs {
"..",
}
files {
"**.cpp",
"**.h"
}

View File

@@ -0,0 +1,11 @@
project "BulletDynamics"
kind "StaticLib"
targetdir "../../lib"
includedirs {
"..",
}
files {
"**.cpp",
"**.h"
}

View File

@@ -0,0 +1,23 @@
hasDX11 = findDirectX11()
if (hasDX11) then
project "BulletSoftBodyDX11Solvers"
initDirectX11()
kind "StaticLib"
targetdir "../../../../lib"
includedirs {
".",
"../../.."
}
files {
"**.cpp",
"**.h"
}
end

View File

@@ -0,0 +1,11 @@
project "BulletSoftBody"
kind "StaticLib"
targetdir "../../lib"
includedirs {
"..",
}
files {
"**.cpp",
"**.h"
}

View File

@@ -0,0 +1,11 @@
project "LinearMath"
kind "StaticLib"
targetdir "../../lib"
includedirs {
"..",
}
files {
"**.cpp",
"**.h"
}