cmake with 2 examples (HelloWorld, BasicDemo)

This commit is contained in:
erwincoumans
2015-04-16 18:11:22 -07:00
parent 9e2eff9a1e
commit c99ac6cfa1
4 changed files with 38 additions and 43 deletions

View File

@@ -0,0 +1,31 @@
# App_BasicExample is a minimal sample creating, stepping and deleting a Bullet dynamics world
INCLUDE_DIRECTORIES(
${BULLET_PHYSICS_SOURCE_DIR}/src
)
LINK_LIBRARIES(
BulletDynamics BulletCollision LinearMath
)
IF (WIN32)
ADD_EXECUTABLE(App_BasicExample
BasicExample.cpp
main.cpp
${BULLET_PHYSICS_SOURCE_DIR}/build3/bullet.rc
)
ELSE()
ADD_EXECUTABLE(App_BasicExample
BasicExample.cpp
main.cpp
)
ENDIF()
IF (INTERNAL_ADD_POSTFIX_EXECUTABLE_NAMES)
SET_TARGET_PROPERTIES(App_BasicExample PROPERTIES DEBUG_POSTFIX "_Debug")
SET_TARGET_PROPERTIES(App_BasicExample PROPERTIES MINSIZEREL_POSTFIX "_MinsizeRel")
SET_TARGET_PROPERTIES(App_BasicExample PROPERTIES RELWITHDEBINFO_POSTFIX "_RelWithDebugInfo")
ENDIF(INTERNAL_ADD_POSTFIX_EXECUTABLE_NAMES)

1
examples/CMakeLists.txt Normal file
View File

@@ -0,0 +1 @@
SUBDIRS( HelloWorld BasicDemo )

View File

@@ -76,12 +76,12 @@ struct CommonGraphicsApp
void defaultMouseButtonCallback( int button, int state, float x, float y)
{
if (button==0)
m_leftMouseButton=state;
m_leftMouseButton= (state==1);
if (button==1)
m_middleMouseButton=state;
m_middleMouseButton= (state==1);
if (button==2)
m_rightMouseButton=state;
m_rightMouseButton= (state==1);
m_mouseXpos = x;
m_mouseYpos = y;