Revision: 7627
http://playerstage.svn.sourceforge.net/playerstage/?rev=7627&view=rev
Author: natepak
Date: 2009-05-08 16:55:50 +0000 (Fri, 08 May 2009)
Log Message:
-----------
Added ability to build gazebo for release, debug, or profile
Modified Paths:
--------------
code/gazebo/trunk/CMakeLists.txt
code/gazebo/trunk/server/CMakeLists.txt
Modified: code/gazebo/trunk/CMakeLists.txt
===================================================================
--- code/gazebo/trunk/CMakeLists.txt 2009-05-08 00:23:57 UTC (rev 7626)
+++ code/gazebo/trunk/CMakeLists.txt 2009-05-08 16:55:50 UTC (rev 7627)
@@ -27,11 +27,42 @@
SET (gazebo_cmake_dir ${PROJECT_SOURCE_DIR}/cmake CACHE PATH
"Location of CMake scripts")
+# Build type cflags
+SET (CMAKE_C_FLAGS_RELEASE " -O3 -DNDEBUG -fPIC -Wall " CACHE INTERNAL "C
Flags for release" FORCE)
+SET (CMAKE_C_FLAGS_DEBUG " -ggdb -fPIC " CACHE INTERNAL "C Flags fro debug"
FORCE)
+SET (CMAKE_C_FLAGS_PROFILE " -ggdb -pg -fPIC " CACHE INTERNAL "C Flags for
profile" FORCE)
+
+# Build type link flags
+SET (CMAKE_LINK_FLAGS_RELEASE "" CACHE INTERNAL "Link flags fro release" FORCE)
+SET (CMAKE_LINK_FLAGS_DEBUG "" CACHE INTERNAL "Link flags for debug" FORCE)
+SET (CMAKE_LINK_FLAGS_PROFILE "" CACHE INTERNAL "Link flags for profile" FORCE)
+
+FIND_LIBRARY(PROFILER "profiler")
+IF (PROFILER)
+ SET (CMAKE_LINK_FLAGS_PROFILE "${CMAKE_LINK_FLAGS_PROFILE} -lprofiler"
+ CACHE INTERNAL "Link flags for profile" FORCE)
+ENDIF (PROFILER)
+
+FIND_LIBRARY(TCMALLOC "tcmalloc")
+IF (TCMALLOC)
+ SET (CMAKE_LINK_FLAGS_PROFILE "${CMAKE_LINK_FLAGS_PROFILE} -ltcmalloc"
+ CACHE INTERNAL "Link flags for profile" FORCE)
+ENDIF (TCMALLOC)
+
+IF (NOT CMAKE_BUILD_TYPE)
+ SET (CMAKE_BUILD_TYPE "release" CACHE STRING
+ "Choose the type of build, options are: debug release profile" FORCE)
+ENDIF (NOT CMAKE_BUILD_TYPE)
+
+STRING(TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE)
+
+MESSAGE (STATUS "Build Type: ${CMAKE_BUILD_TYPE}")
+
+
MESSAGE (STATUS "====== Finding 3rd Party Packages ======")
INCLUDE (${gazebo_cmake_dir}/SearchForStuff.cmake)
MESSAGE (STATUS "----------------------------------------")
-
ADD_SUBDIRECTORY(libgazebo)
ADD_SUBDIRECTORY(server)
ADD_SUBDIRECTORY(worlds)
Modified: code/gazebo/trunk/server/CMakeLists.txt
===================================================================
--- code/gazebo/trunk/server/CMakeLists.txt 2009-05-08 00:23:57 UTC (rev
7626)
+++ code/gazebo/trunk/server/CMakeLists.txt 2009-05-08 16:55:50 UTC (rev
7627)
@@ -91,7 +91,10 @@
APPEND_TO_CACHED_LIST(gazeboserver_cflags ${gazeboserver_cflags_desc}
"-fPIC;-Wall")
LIST_TO_STRING(GAZEBO_CFLAGS "${gazeboserver_cflags}")
-SET_SOURCE_FILES_PROPERTIES(${gazeboserver_sources} PROPERTIES COMPILE_FLAGS
${GAZEBO_CFLAGS})
+SET_SOURCE_FILES_PROPERTIES(${gazeboserver_sources} PROPERTIES COMPILE_FLAGS
"${GAZEBO_CFLAGS} ${CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE}}")
+
+SET_SOURCE_FILES_PROPERTIES(${gazeboserver_sources} PROPERTIES LINK_FLAGS
${CMAKE_LINK_FLAGS_${CMAKE_BUILD_TYPE}})
+
TARGET_LINK_LIBRARIES( gazebo gazeboshm ${gazeboserver_link_libs}
${FLTK_LIBRARIES} ${Boost_LIBRARIES})
INSTALL (TARGETS gazebo DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit