From bb29d15058fda9a4fd735b3b14a0194e5bac453d Mon Sep 17 00:00:00 2001 From: "erwin.coumans" Date: Fri, 16 Sep 2011 01:28:34 +0000 Subject: [PATCH] create premake4 solutions for the various OpenCL configurations (AMD, NVIDIA, Intel OpenCL SDKs for Windows) primarily to distribute project files that work. CMake is still better supported in general (not all demos/libs have been ported) Revert a recent change about warnings: %zu doesn't work in printf, %d does --- Demos/OpenCLClothDemo/AMD/premake4.lua | 65 +++++++++++++++ Demos/OpenCLClothDemo/Intel/premake4.lua | 65 +++++++++++++++ Demos/OpenCLClothDemo/NVidia/premake4.lua | 65 +++++++++++++++ Demos/OpenCLClothDemo/cl_cloth_demo.cpp | 12 +-- Demos/OpenCLClothDemo/cloth.h | 8 +- Demos/SharedOpenCL/btOclUtils.cpp | 16 ++-- Demos/premake4.lua | 2 +- msvc/premake4.lua | 52 +++++++++++- msvc/vs2008_dx11.bat | 1 + msvc/vs_all.bat | 36 ++++++++ .../OpenCL/AMD/CMakeLists.txt | 19 ----- .../OpenCL/AMD/premake4.lua | 27 ++++++ .../OpenCL/Intel/CMakeLists.txt | 82 +++++++++++++++++++ .../OpenCL/Intel/premake4.lua | 27 ++++++ .../OpenCL/NVidia/premake4.lua | 27 ++++++ 15 files changed, 467 insertions(+), 37 deletions(-) create mode 100644 Demos/OpenCLClothDemo/AMD/premake4.lua create mode 100644 Demos/OpenCLClothDemo/Intel/premake4.lua create mode 100644 Demos/OpenCLClothDemo/NVidia/premake4.lua create mode 100644 msvc/vs_all.bat create mode 100644 src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/AMD/premake4.lua create mode 100644 src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/Intel/CMakeLists.txt create mode 100644 src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/Intel/premake4.lua create mode 100644 src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/NVidia/premake4.lua diff --git a/Demos/OpenCLClothDemo/AMD/premake4.lua b/Demos/OpenCLClothDemo/AMD/premake4.lua new file mode 100644 index 000000000..2f59b49e5 --- /dev/null +++ b/Demos/OpenCLClothDemo/AMD/premake4.lua @@ -0,0 +1,65 @@ + + hasCL = findOpenCL_AMD() + + if (hasCL) then + + project "AppOpenCLClothDemo_AMD" + + defines { "USE_AMD_OPENCL","CL_PLATFORM_AMD"} + + initOpenCL_AMD() + + language "C++" + + kind "ConsoleApp" + targetdir "../../.." + + libdirs {"../../../Glut"} + + links { + "LinearMath", + "BulletCollision", + "BulletDynamics", + "BulletSoftBody", + "BulletSoftBodySolvers_OpenCL_AMD", + "opengl32" + } + + configuration "x64" + links { + "glut64", + "glew64" + } + configuration "x32" + links { + "glut32", + "glew32" + } + + configuration{} + + + includedirs { + "../../../src", + "../../../Glut", + "../../SharedOpenCL", + "../../OpenGL" + } + + files { + "../cl_cloth_demo.cpp", + "../../SharedOpenCL/btOclUtils.h", + "../../SharedOpenCL/btOclCommon.h", + "../../SharedOpenCL/btOclUtils.cpp", + "../../SharedOpenCL/btOclCommon.cpp", + "../../OpenGL/GLDebugDrawer.cpp", + "../../OpenGL/stb_image.cpp", + "../../OpenGL/stb_image.h", + "../gl_win.cpp", + "../clstuff.cpp", + "../clstuff.h", + "../gl_win.h", + "../cloth.h" + } + + end \ No newline at end of file diff --git a/Demos/OpenCLClothDemo/Intel/premake4.lua b/Demos/OpenCLClothDemo/Intel/premake4.lua new file mode 100644 index 000000000..9adc7ffdd --- /dev/null +++ b/Demos/OpenCLClothDemo/Intel/premake4.lua @@ -0,0 +1,65 @@ + + hasCL = findOpenCL_Intel() + + if (hasCL) then + + project "AppOpenCLClothDemo_Intel" + + defines { "USE_INTEL_OPENCL","CL_PLATFORM_INTEL"} + + initOpenCL_Intel() + + language "C++" + + kind "ConsoleApp" + targetdir "../../.." + + libdirs {"../../../Glut"} + + links { + "LinearMath", + "BulletCollision", + "BulletDynamics", + "BulletSoftBody", + "BulletSoftBodySolvers_OpenCL_Intel", + "opengl32" + } + + configuration "x64" + links { + "glut64", + "glew64" + } + configuration "x32" + links { + "glut32", + "glew32" + } + + configuration{} + + + includedirs { + "../../../src", + "../../../Glut", + "../../SharedOpenCL", + "../../OpenGL" + } + + files { + "../cl_cloth_demo.cpp", + "../../SharedOpenCL/btOclUtils.h", + "../../SharedOpenCL/btOclCommon.h", + "../../SharedOpenCL/btOclUtils.cpp", + "../../SharedOpenCL/btOclCommon.cpp", + "../../OpenGL/GLDebugDrawer.cpp", + "../../OpenGL/stb_image.cpp", + "../../OpenGL/stb_image.h", + "../gl_win.cpp", + "../clstuff.cpp", + "../clstuff.h", + "../gl_win.h", + "../cloth.h" + } + + end \ No newline at end of file diff --git a/Demos/OpenCLClothDemo/NVidia/premake4.lua b/Demos/OpenCLClothDemo/NVidia/premake4.lua new file mode 100644 index 000000000..8747f30b9 --- /dev/null +++ b/Demos/OpenCLClothDemo/NVidia/premake4.lua @@ -0,0 +1,65 @@ + + hasCL = findOpenCL_NVIDIA() + + if (hasCL) then + + project "AppOpenCLClothDemo_NVIDIA" + + defines { "USE_NVIDIA_OPENCL","CL_PLATFORM_NVIDIA"} + + initOpenCL_NVIDIA() + + language "C++" + + kind "ConsoleApp" + targetdir "../../.." + + libdirs {"../../../Glut"} + + links { + "LinearMath", + "BulletCollision", + "BulletDynamics", + "BulletSoftBody", + "BulletSoftBodySolvers_OpenCL_NVIDIA", + "opengl32" + } + + configuration "x64" + links { + "glut64", + "glew64" + } + configuration "x32" + links { + "glut32", + "glew32" + } + + configuration{} + + + includedirs { + "../../../src", + "../../../Glut", + "../../SharedOpenCL", + "../../OpenGL" + } + + files { + "../cl_cloth_demo.cpp", + "../../SharedOpenCL/btOclUtils.h", + "../../SharedOpenCL/btOclCommon.h", + "../../SharedOpenCL/btOclUtils.cpp", + "../../SharedOpenCL/btOclCommon.cpp", + "../../OpenGL/GLDebugDrawer.cpp", + "../../OpenGL/stb_image.cpp", + "../../OpenGL/stb_image.h", + "../gl_win.cpp", + "../clstuff.cpp", + "../clstuff.h", + "../gl_win.h", + "../cloth.h" + } + + end \ No newline at end of file diff --git a/Demos/OpenCLClothDemo/cl_cloth_demo.cpp b/Demos/OpenCLClothDemo/cl_cloth_demo.cpp index 70aaa2338..71e913c4c 100644 --- a/Demos/OpenCLClothDemo/cl_cloth_demo.cpp +++ b/Demos/OpenCLClothDemo/cl_cloth_demo.cpp @@ -528,12 +528,12 @@ void doFlags() { m_dynamicsWorld->stepSimulation(1./60.,0); - btDefaultSerializer* serializer = new btDefaultSerializer(); - m_dynamicsWorld->serialize(serializer); - - FILE* file = fopen("testFile.bullet","wb"); - fwrite(serializer->getBufferPointer(),serializer->getCurrentBufferSize(),1, file); - fclose(file); + // Option to save a .bullet file + // btDefaultSerializer* serializer = new btDefaultSerializer(); + // m_dynamicsWorld->serialize(serializer); + // FILE* file = fopen("testFile.bullet","wb"); + // fwrite(serializer->getBufferPointer(),serializer->getCurrentBufferSize(),1, file); + // fclose(file); CProfileManager::dumpAll(); } diff --git a/Demos/OpenCLClothDemo/cloth.h b/Demos/OpenCLClothDemo/cloth.h index 89d7e8d05..e3a0216a0 100644 --- a/Demos/OpenCLClothDemo/cloth.h +++ b/Demos/OpenCLClothDemo/cloth.h @@ -137,8 +137,12 @@ class piece_of_cloth { int width,height,n; unsigned char *data = stbi_load(filename.c_str(), &width, &height, &n, 0); - - + if (!data) + { + //premake project happens to be 2 levels above the root of Bullet, so try this instead: + std::string newname = "../../"+filename; + data = stbi_load(newname.c_str(), &width, &height, &n, 0); + } GLubyte* image=new GLubyte[512*256*4]; for(int y=0;y<256;++y) diff --git a/Demos/SharedOpenCL/btOclUtils.cpp b/Demos/SharedOpenCL/btOclUtils.cpp index c4962f037..f8a22f502 100644 --- a/Demos/SharedOpenCL/btOclUtils.cpp +++ b/Demos/SharedOpenCL/btOclUtils.cpp @@ -255,17 +255,17 @@ void btOclPrintDevInfo(cl_device_id device) // CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS size_t workitem_dims; clGetDeviceInfo(device, CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS, sizeof(workitem_dims), &workitem_dims, NULL); - printf(" CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS:\t%zu\n", workitem_dims); + printf(" CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS:\t%d\n", workitem_dims); // CL_DEVICE_MAX_WORK_ITEM_SIZES size_t workitem_size[3]; clGetDeviceInfo(device, CL_DEVICE_MAX_WORK_ITEM_SIZES, sizeof(workitem_size), &workitem_size, NULL); - printf(" CL_DEVICE_MAX_WORK_ITEM_SIZES:\t%zu / %zu / %zu \n", workitem_size[0], workitem_size[1], workitem_size[2]); + printf(" CL_DEVICE_MAX_WORK_ITEM_SIZES:\t%d / %d / %d \n", workitem_size[0], workitem_size[1], workitem_size[2]); // CL_DEVICE_MAX_WORK_GROUP_SIZE size_t workgroup_size; clGetDeviceInfo(device, CL_DEVICE_MAX_WORK_GROUP_SIZE, sizeof(workgroup_size), &workgroup_size, NULL); - printf(" CL_DEVICE_MAX_WORK_GROUP_SIZE:\t%zu\n", workgroup_size); + printf(" CL_DEVICE_MAX_WORK_GROUP_SIZE:\t%d\n", workgroup_size); // CL_DEVICE_MAX_CLOCK_FREQUENCY cl_uint clock_frequency; @@ -332,15 +332,15 @@ void btOclPrintDevInfo(cl_device_id device) size_t szMaxDims[5]; printf("\n CL_DEVICE_IMAGE "); clGetDeviceInfo(device, CL_DEVICE_IMAGE2D_MAX_WIDTH, sizeof(size_t), &szMaxDims[0], NULL); - printf("\t\t\t2D_MAX_WIDTH\t %zu\n", szMaxDims[0]); + printf("\t\t\t2D_MAX_WIDTH\t %d\n", szMaxDims[0]); clGetDeviceInfo(device, CL_DEVICE_IMAGE2D_MAX_HEIGHT, sizeof(size_t), &szMaxDims[1], NULL); - printf("\t\t\t\t\t2D_MAX_HEIGHT\t %zu\n", szMaxDims[1]); + printf("\t\t\t\t\t2D_MAX_HEIGHT\t %d\n", szMaxDims[1]); clGetDeviceInfo(device, CL_DEVICE_IMAGE3D_MAX_WIDTH, sizeof(size_t), &szMaxDims[2], NULL); - printf("\t\t\t\t\t3D_MAX_WIDTH\t %zu\n", szMaxDims[2]); + printf("\t\t\t\t\t3D_MAX_WIDTH\t %d\n", szMaxDims[2]); clGetDeviceInfo(device, CL_DEVICE_IMAGE3D_MAX_HEIGHT, sizeof(size_t), &szMaxDims[3], NULL); - printf("\t\t\t\t\t3D_MAX_HEIGHT\t %zu\n", szMaxDims[3]); + printf("\t\t\t\t\t3D_MAX_HEIGHT\t %d\n", szMaxDims[3]); clGetDeviceInfo(device, CL_DEVICE_IMAGE3D_MAX_DEPTH, sizeof(size_t), &szMaxDims[4], NULL); - printf("\t\t\t\t\t3D_MAX_DEPTH\t %zu\n", szMaxDims[4]); + printf("\t\t\t\t\t3D_MAX_DEPTH\t %d\n", szMaxDims[4]); // CL_DEVICE_EXTENSIONS: get device extensions, and if any then parse & log the string onto separate lines clGetDeviceInfo(device, CL_DEVICE_EXTENSIONS, sizeof(device_string), &device_string, NULL); diff --git a/Demos/premake4.lua b/Demos/premake4.lua index d05e4d361..5ecdf0e0e 100644 --- a/Demos/premake4.lua +++ b/Demos/premake4.lua @@ -18,7 +18,7 @@ function createDemos( demos, incdirs, linknames) files { "../msvc/bullet.rc" } configuration {"MaxOSX"} - print "hello" + --print "hello" linkoptions { "-framework Carbon -framework OpenGL -framework AGL -framework Glut" } configuration {"not Windows", "not MacOSX"} diff --git a/msvc/premake4.lua b/msvc/premake4.lua index a4ff2b956..c26cbea7b 100644 --- a/msvc/premake4.lua +++ b/msvc/premake4.lua @@ -1,4 +1,5 @@ --add the 0 so the solution comes first in the directory (when sorted on name) +--print "uncomment this hello premake4 world for debugging the script" solution "0BulletSolution" @@ -17,6 +18,25 @@ solution "0BulletSolution" description = "Enable DirectX11 build" } + newoption { + trigger = "with-opencl", + description = "Enable OpenCL builds (various SDKs)" + } + + newoption { + trigger = "with-opencl-amd", + description = "Enable OpenCL builds (AMD SDK)" + } + + newoption { + trigger = "with-opencl-intel", + description = "Enable OpenCL builds (Intel SDK)" + } + newoption { + trigger = "with-opencl-nvidia", + description = "Enable OpenCL builds (NVIDIA SDK)" + } + configurations {"Release", "Debug"} configuration "Release" @@ -63,9 +83,39 @@ end include "../src/BulletMultiThreaded/GpuSoftBodySolvers/DX11" end +--choose any OpenCL sdk that is installed on the system + if _OPTIONS["with-opencl"] then + include "../Demos/OpenCLClothDemo/AMD" + include "../src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/AMD" + include "../Demos/OpenCLClothDemo/NVidia" + include "../src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/NVidia" + include "../Demos/OpenCLClothDemo/Intel" + include "../src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/Intel" + end +--choose a particular OpenCL sdk, this is useful for distributing project files that just work for one OpenCL SDK + if _OPTIONS["with-opencl-amd"] then + include "../Demos/OpenCLClothDemo/AMD" + include "../src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/AMD" + end - if not _OPTIONS["with-dx11"] and not _OPTIONS["with-nacl"] then + if _OPTIONS["with-opencl-intel"] then + include "../Demos/OpenCLClothDemo/Intel" + include "../src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/Intel" + end + + if _OPTIONS["with-opencl-nvidia"] then + include "../Demos/OpenCLClothDemo/NVidia" + include "../src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/NVidia" + end + + if not _OPTIONS["with-opencl-amd"] and + not _OPTIONS["with-opencl-nvidia"] and + not _OPTIONS["with-opencl-intel"] and + not _OPTIONS["with-opencl"] and + not _OPTIONS["with-dx11"] and + not _OPTIONS["with-nacl"] then + include "../Demos" include "../Extras" end diff --git a/msvc/vs2008_dx11.bat b/msvc/vs2008_dx11.bat index 0e6ff1a2c..6f3705663 100644 --- a/msvc/vs2008_dx11.bat +++ b/msvc/vs2008_dx11.bat @@ -1,4 +1,5 @@ premake4 --with-dx11 vs2008 +rename vs2008 vs2008_dx11 pause \ No newline at end of file diff --git a/msvc/vs_all.bat b/msvc/vs_all.bat new file mode 100644 index 000000000..60bf79bf3 --- /dev/null +++ b/msvc/vs_all.bat @@ -0,0 +1,36 @@ +rem this script is mainly to create distributable visual studio project file + + +premake4 --with-opencl-nvidia vs2008 +rename vs2008 vs2008_opencl_nvidia + +premake4 --with-opencl-intel vs2008 +rename vs2008 vs2008_opencl_intel + +premake4 --with-opencl-amd vs2008 +rename vs2008 vs2008_opencl_amd + +premake4 --with-opencl-nvidia vs2010 +rename vs2010 vs2010_opencl_nvidia + +premake4 --with-opencl-intel vs2010 +rename vs2010 vs2010_opencl_intel + +premake4 --with-opencl-amd vs2010 +rename vs2010 vs2010_opencl_amd + +premake4 --with-dx11 vs2008 +rename vs2008 vs2008_dx11 + +premake4 --with-dx11 vs2010 +rename vs2010 vs2010_dx11 + +premake4 --with-dx11 vs2005 +rename vs2005 vs2005_dx11 + +premake4 vs2005 +premake4 vs2008 +premake4 vs2010 + + +pause \ No newline at end of file diff --git a/src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/AMD/CMakeLists.txt b/src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/AMD/CMakeLists.txt index 38e5a6620..cdb825a79 100644 --- a/src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/AMD/CMakeLists.txt +++ b/src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/AMD/CMakeLists.txt @@ -28,25 +28,6 @@ SET(BulletSoftBodyOpenCLSolvers_HDRS ../btSoftBodySolverOutputCLtoGL.h ) -# OpenCL and HLSL Shaders. -# Build rules generated to stringify these into headers -# which are needed by some of the sources -SET(BulletSoftBodyOpenCLSolvers_Shaders -# OutputToVertexArray - UpdateNormals - Integrate - UpdatePositions - UpdateNodes - SolvePositions - UpdatePositionsFromVelocities - ApplyForces - PrepareLinks - VSolveLinks -) - -foreach(f ${BulletSoftBodyOpenCLSolvers_Shaders}) - LIST(APPEND BulletSoftBodyOpenCLSolvers_OpenCLC "../OpenCLC/${f}.cl") -endforeach(f) diff --git a/src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/AMD/premake4.lua b/src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/AMD/premake4.lua new file mode 100644 index 000000000..05a929037 --- /dev/null +++ b/src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/AMD/premake4.lua @@ -0,0 +1,27 @@ + +hasCL = findOpenCL_AMD() + +if (hasCL) then + + project "BulletSoftBodySolvers_OpenCL_AMD" + + defines { "USE_AMD_OPENCL","CL_PLATFORM_AMD"} + + initOpenCL_AMD() + + kind "StaticLib" + + targetdir "../../../../../lib" + + includedirs { + ".", + "../../../..", + "../../../../../Glut" + } + files { + "../btSoftBodySolver_OpenCL.cpp", + "../btSoftBodySolver_OpenCLSIMDAware.cpp", + "../btSoftBodySolverOutputCLtoGL.cpp" + } + +end diff --git a/src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/Intel/CMakeLists.txt b/src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/Intel/CMakeLists.txt new file mode 100644 index 000000000..a6426dcab --- /dev/null +++ b/src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/Intel/CMakeLists.txt @@ -0,0 +1,82 @@ + +INCLUDE_DIRECTORIES( + ${BULLET_PHYSICS_SOURCE_DIR}/src + ${INTEL_OPENCL_INCLUDES} +) + +ADD_DEFINITIONS(-DUSE_INTEL_OPENCL) +ADD_DEFINITIONS(-DCL_PLATFORM_INTEL) + + + +SET(BulletSoftBodyOpenCLSolvers_SRCS + ../btSoftBodySolver_OpenCL.cpp + ../btSoftBodySolver_OpenCLSIMDAware.cpp + ../btSoftBodySolverOutputCLtoGL.cpp +) + +SET(BulletSoftBodyOpenCLSolvers_HDRS + ../btSoftBodySolver_OpenCL.h + ../btSoftBodySolver_OpenCLSIMDAware.h + ../../CPU/btSoftBodySolverData.h + ../btSoftBodySolverVertexData_OpenCL.h + ../btSoftBodySolverTriangleData_OpenCL.h + ../btSoftBodySolverLinkData_OpenCL.h + ../btSoftBodySolverLinkData_OpenCLSIMDAware.h + ../btSoftBodySolverBuffer_OpenCL.h + ../btSoftBodySolverVertexBuffer_OpenGL.h + ../btSoftBodySolverOutputCLtoGL.h +) + +# OpenCL and HLSL Shaders. +# Build rules generated to stringify these into headers +# which are needed by some of the sources +SET(BulletSoftBodyOpenCLSolvers_Shaders +# OutputToVertexArray + UpdateNormals + Integrate + UpdatePositions + UpdateNodes + SolvePositions + UpdatePositionsFromVelocities + ApplyForces + PrepareLinks + VSolveLinks +) + +foreach(f ${BulletSoftBodyOpenCLSolvers_Shaders}) + LIST(APPEND BulletSoftBodyOpenCLSolvers_OpenCLC "../OpenCLC/${f}.cl") +endforeach(f) + + + +ADD_LIBRARY(BulletSoftBodySolvers_OpenCL_Intel + ${BulletSoftBodyOpenCLSolvers_SRCS} + ${BulletSoftBodyOpenCLSolvers_HDRS} + ${BulletSoftBodyOpenCLSolvers_OpenCLC} +) + +SET_TARGET_PROPERTIES(BulletSoftBodySolvers_OpenCL_Intel PROPERTIES VERSION ${BULLET_VERSION}) +SET_TARGET_PROPERTIES(BulletSoftBodySolvers_OpenCL_Intel PROPERTIES SOVERSION ${BULLET_VERSION}) +IF (BUILD_SHARED_LIBS) + TARGET_LINK_LIBRARIES(BulletSoftBodySolvers_OpenCL_Intel BulletSoftBody) +ENDIF (BUILD_SHARED_LIBS) + + +IF (INSTALL_LIBS) + IF (NOT INTERNAL_CREATE_DISTRIBUTABLE_MSVC_PROJECTFILES) + IF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.5) + IF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK) + INSTALL(TARGETS BulletSoftBodySolvers_OpenCL_Intel DESTINATION .) + ELSE (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK) + INSTALL(TARGETS BulletSoftBodySolvers_OpenCL_Intel DESTINATION lib${LIB_SUFFIX}) +#headers are already installed by BulletMultiThreaded library + ENDIF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK) + ENDIF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.5) + + IF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK) + SET_TARGET_PROPERTIES(BulletSoftBodySolvers_OpenCL_Intel PROPERTIES FRAMEWORK true) + SET_TARGET_PROPERTIES(BulletSoftBodySolvers_OpenCL_Intel PROPERTIES PUBLIC_HEADER "${BulletSoftBodyOpenCLSolvers_HDRS}") + ENDIF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK) + ENDIF (NOT INTERNAL_CREATE_DISTRIBUTABLE_MSVC_PROJECTFILES) +ENDIF (INSTALL_LIBS) diff --git a/src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/Intel/premake4.lua b/src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/Intel/premake4.lua new file mode 100644 index 000000000..7d8877611 --- /dev/null +++ b/src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/Intel/premake4.lua @@ -0,0 +1,27 @@ + +hasCL = findOpenCL_Intel() + +if (hasCL) then + + project "BulletSoftBodySolvers_OpenCL_Intel" + + defines { "USE_INTEL_OPENCL","CL_PLATFORM_INTEL"} + + initOpenCL_Intel() + + kind "StaticLib" + + targetdir "../../../../../lib" + + includedirs { + ".", + "../../../..", + "../../../../../Glut" + } + files { + "../btSoftBodySolver_OpenCL.cpp", + "../btSoftBodySolver_OpenCLSIMDAware.cpp", + "../btSoftBodySolverOutputCLtoGL.cpp" + } + +end diff --git a/src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/NVidia/premake4.lua b/src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/NVidia/premake4.lua new file mode 100644 index 000000000..6e645473d --- /dev/null +++ b/src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/NVidia/premake4.lua @@ -0,0 +1,27 @@ + +hasCL = findOpenCL_NVIDIA() + +if (hasCL) then + + project "BulletSoftBodySolvers_OpenCL_NVIDIA" + + defines { "USE_NVIDIA_OPENCL","CL_PLATFORM_NVIDIA"} + + initOpenCL_NVIDIA() + + kind "StaticLib" + + targetdir "../../../../../lib" + + includedirs { + ".", + "../../../..", + "../../../../../Glut" + } + files { + "../btSoftBodySolver_OpenCL.cpp", + "../btSoftBodySolver_OpenCLSIMDAware.cpp", + "../btSoftBodySolverOutputCLtoGL.cpp" + } + +end