fix CMake build on Mac OSX

This commit is contained in:
Erwin Coumans 2014-04-28 11:11:45 -07:00
parent 55f045956e
commit 4996a64238
6 changed files with 39 additions and 19 deletions

View File

@ -41,9 +41,13 @@ IF (WIN32)
)
ADD_DEFINITIONS(-DGLEW_STATIC)
ELSE(WIN32)
IF(NOT APPLE)
IF(APPLE)
find_library(COCOA NAMES Cocoa)
MESSAGE(${COCOA})
link_libraries(${COCOA})
ELSE(APPLE)
LINK_LIBRARIES( GLEW)
ENDIF(NOT APPLE)
ENDIF(APPLE)
ENDIF(WIN32)
@ -61,4 +65,4 @@ IF (INTERNAL_ADD_POSTFIX_EXECUTABLE_NAMES)
SET_TARGET_PROPERTIES(App_AllBullet2Demos PROPERTIES DEBUG_POSTFIX "_Debug")
SET_TARGET_PROPERTIES(App_AllBullet2Demos PROPERTIES MINSIZEREL_POSTFIX "_MinsizeRel")
SET_TARGET_PROPERTIES(App_AllBullet2Demos PROPERTIES RELWITHDEBINFO_POSTFIX "_RelWithDebugInfo")
ENDIF(INTERNAL_ADD_POSTFIX_EXECUTABLE_NAMES)
ENDIF(INTERNAL_ADD_POSTFIX_EXECUTABLE_NAMES)

View File

@ -45,9 +45,13 @@ IF (WIN32)
)
ADD_DEFINITIONS(-DGLEW_STATIC)
ELSE(WIN32)
IF(NOT APPLE)
IF(APPLE)
find_library(COCOA NAMES Cocoa)
MESSAGE(${COCOA})
link_libraries(${COCOA})
ELSE(APPLE)
LINK_LIBRARIES( GLEW X11 dl)
ENDIF(NOT APPLE)
ENDIF(APPLE)
ENDIF(WIN32)
@ -60,4 +64,4 @@ IF (INTERNAL_ADD_POSTFIX_EXECUTABLE_NAMES)
SET_TARGET_PROPERTIES(App_Bullet3_OpenCL_Demos PROPERTIES DEBUG_POSTFIX "_Debug")
SET_TARGET_PROPERTIES(App_Bullet3_OpenCL_Demos PROPERTIES MINSIZEREL_POSTFIX "_MinsizeRel")
SET_TARGET_PROPERTIES(App_Bullet3_OpenCL_Demos PROPERTIES RELWITHDEBINFO_POSTFIX "_RelWithDebugInfo")
ENDIF(INTERNAL_ADD_POSTFIX_EXECUTABLE_NAMES)
ENDIF(INTERNAL_ADD_POSTFIX_EXECUTABLE_NAMES)

View File

@ -22,9 +22,13 @@ IF (WIN32)
)
ADD_DEFINITIONS(-DGLEW_STATIC)
ELSE(WIN32)
IF(NOT APPLE)
IF(APPLE)
find_library(COCOA NAMES Cocoa)
MESSAGE(${COCOA})
link_libraries(${COCOA})
ELSE(APPLE)
LINK_LIBRARIES( GLEW X11 dl Xext)
ENDIF(NOT APPLE)
ENDIF(APPLE)
ENDIF(WIN32)
@ -37,4 +41,4 @@ IF (INTERNAL_ADD_POSTFIX_EXECUTABLE_NAMES)
SET_TARGET_PROPERTIES(AppSimpleOpenGL3 PROPERTIES DEBUG_POSTFIX "_Debug")
SET_TARGET_PROPERTIES(AppSimpleOpenGL3 PROPERTIES MINSIZEREL_POSTFIX "_MinsizeRel")
SET_TARGET_PROPERTIES(AppSimpleOpenGL3 PROPERTIES RELWITHDEBINFO_POSTFIX "_RelWithDebugInfo")
ENDIF(INTERNAL_ADD_POSTFIX_EXECUTABLE_NAMES)
ENDIF(INTERNAL_ADD_POSTFIX_EXECUTABLE_NAMES)

View File

@ -32,7 +32,12 @@
trigger = "enet",
description = "Enable enet NAT punchthrough test"
}
newoption
{
trigger = "gtest",
description = "Enable unit tests using gtest"
}
configurations {"Release", "Debug"}
configuration "Release"
flags { "Optimize", "EnableSSE2","StaticRuntime", "NoMinimalRebuild", "FloatFast"}
@ -88,11 +93,13 @@
dofile ("findOpenGLGlewGlut.lua")
language "C++"
if _OPTIONS["gtest"] then
include "../test/gtest-1.7.0"
-- include "../test/hello_gtest"
include "../test/gtest-1.7.0"
-- include "../test/hello_gtest"
include "../test/TestBullet3OpenCL"
include "../test/TestBullet3OpenCL"
end
include "../Demos3/AllBullet2Demos"

View File

@ -42,7 +42,7 @@ long b3_maxdot_large( const float *vv, const float *vec, unsigned long count, fl
long b3_maxdot_large( const float *vv, const float *vec, unsigned long count, float *dotResult )
{
const float4 *vertices = (const float4*) vv;
static const unsigned char indexTable[16] = {-1, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0 };
static const unsigned char indexTable[16] = {(unsigned char)-1, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0 };
float4 dotMax = b3Assign128( -B3_INFINITY, -B3_INFINITY, -B3_INFINITY, -B3_INFINITY );
float4 vvec = _mm_loadu_ps( vec );
float4 vHi = b3CastiTo128f(_mm_shuffle_epi32( b3CastfTo128i( vvec), 0xaa )); /// zzzz
@ -427,7 +427,8 @@ long b3_mindot_large( const float *vv, const float *vec, unsigned long count, fl
long b3_mindot_large( const float *vv, const float *vec, unsigned long count, float *dotResult )
{
const float4 *vertices = (const float4*) vv;
static const unsigned char indexTable[16] = {-1, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0 };
static const unsigned char indexTable[16] = {(unsigned char)-1, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0 };
float4 dotmin = b3Assign128( B3_INFINITY, B3_INFINITY, B3_INFINITY, B3_INFINITY );
float4 vvec = _mm_loadu_ps( vec );
float4 vHi = b3CastiTo128f(_mm_shuffle_epi32( b3CastfTo128i( vvec), 0xaa )); /// zzzz

View File

@ -6,7 +6,7 @@
void myerrorprintf(const char* msg)
{
printf(msg);
printf("%s",msg);
}
static bool sVerboseWarning = true;
@ -16,7 +16,7 @@ void mywarningprintf(const char* msg)
if (sVerboseWarning)
{
//OutputDebugStringA(msg);
printf(msg);
printf("%s",msg);
}
}
@ -27,7 +27,7 @@ void myprintf(const char* msg)
if (sVerbosePrintf)
{
//OutputDebugStringA(msg);
printf(msg);
printf("%s",msg);
}
}