Permalink
Browse files

stage: added a CMake option to build CPack scripts (off by default), …

…fixed some warnings
  • Loading branch information...
1 parent 7843b88 commit e9e576be01f8b28dfc39ad1764f35ceecaad8536 jeremy_asher committed Jul 30, 2008
Showing with 20 additions and 17 deletions.
  1. +14 −11 CMakeLists.txt
  2. +2 −2 libstage/canvas.cc
  3. +2 −2 libstage/world.cc
  4. +2 −2 libstageplugin/p_laser.cc
View
25 CMakeLists.txt
@@ -12,6 +12,7 @@ SET( MIN_PLAYER 2.1.0 )
OPTION (BUILD_PLAYER_PLUGIN "Build Player plugin" ON)
OPTION (BUILD_LSPTEST "Build Player plugin tests" OFF)
+OPTION (CPACK_CFG "[release building] generate CPack configuration files" OFF)
cmake_minimum_required( VERSION 2.4 FATAL_ERROR )
@@ -130,14 +131,16 @@ ENDIF ( BUILD_PLAYER_PLUGIN AND PLAYER_FOUND )
# generate a cpack config file used to create packaged tarballs
-INCLUDE(InstallRequiredSystemLibraries)
-SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${PROJECT_NAME}: A Multiple Robot Simulator")
-SET(CPACK_PACKAGE_VENDOR "The Player Project")
-#SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/DESCRIPTION.txt")
-#SET(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README.txt")
-#SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING.txt")
-SET(CPACK_PACKAGE_VERSION_MAJOR "${V_MAJOR}")
-SET(CPACK_PACKAGE_VERSION_MINOR "${V_MINOR}")
-SET(CPACK_PACKAGE_VERSION_PATCH "${V_BUGFIX}")
-SET(CPACK_PACKAGE_INSTALL_DIRECTORY "${PROJECT_NAME}-${V_MAJOR}.${V_MINOR}")
-INCLUDE(CPack)
+IF ( CPACK_CFG )
+ INCLUDE(InstallRequiredSystemLibraries)
+ SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${PROJECT_NAME}: A Multiple Robot Simulator")
+ SET(CPACK_PACKAGE_VENDOR "The Player Project")
+ #SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/DESCRIPTION.txt")
+ #SET(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README.txt")
+ #SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING.txt")
+ SET(CPACK_PACKAGE_VERSION_MAJOR "${V_MAJOR}")
+ SET(CPACK_PACKAGE_VERSION_MINOR "${V_MINOR}")
+ SET(CPACK_PACKAGE_VERSION_PATCH "${V_BUGFIX}")
+ SET(CPACK_PACKAGE_INSTALL_DIRECTORY "${PROJECT_NAME}-${V_MAJOR}.${V_MINOR}")
+ INCLUDE(CPack)
+ENDIF ( CPACK_CFG )
View
4 libstage/canvas.cc
@@ -741,8 +741,8 @@ void StgCanvas::renderFrame()
clockstr.append( " [ FOLLOW MODE ]" );
int margin = 3;
- int width = gl_width( clockstr.c_str() ) + 2 * margin;
- int height = gl_height() + 2 * margin;
+ float width = gl_width( clockstr.c_str() ) + 2 * margin;
+ float height = gl_height() + 2 * margin;
colorstack.Push( 0.8,0.8,1.0 ); // pale blue
glRectf( 0, 0, width, height );
View
4 libstage/world.cc
@@ -227,8 +227,8 @@ void StgWorld::Load( const char* worldfile_path )
(int)(this->interval_sim/thousand) );
if( wf->PropertyExists( entity, "quit_time" ) ) {
- this->quit_time = (stg_usec_t)million *
- wf->ReadFloat( entity, "quit_time", 0 );
+ this->quit_time = (stg_usec_t) ( million *
+ wf->ReadFloat( entity, "quit_time", 0 ) );
}
if( wf->PropertyExists( entity, "resolution" ) )
View
4 libstageplugin/p_laser.cc
@@ -114,10 +114,10 @@ int InterfaceLaser::ProcessMessage(QueuePointer & resp_queue,
cfg.resolution, cfg.fov, cfg.interval );
cfg.fov = plc->max_angle - plc->min_angle;
- cfg.resolution = cfg.fov / ( cfg.sample_count * plc->resolution );
+ cfg.resolution = (uint32_t) ( cfg.fov / ( cfg.sample_count * plc->resolution ) );
if ( cfg.resolution < 1 )
cfg.resolution = 1;
- cfg.interval = 1.0E6 / plc->scanning_frequency;
+ cfg.interval = (stg_usec_t) ( 1.0E6 / plc->scanning_frequency );
PRINT_DEBUG3( "setting laser config: resolution %d, fov %.6f, interval %d\n",
cfg.resolution, cfg.fov, cfg.interval );

0 comments on commit e9e576b

Please sign in to comment.