Skip to content

Commit

Permalink
Merge pull request #78 from wjwwood/remaining_ros_patches_from_4.1.1
Browse files Browse the repository at this point in the history
Remaining ros patches from 4.1.1
  • Loading branch information
rtv authored Apr 27, 2017
2 parents ce76f95 + 695a4a5 commit 214e9e6
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 24 deletions.
25 changes: 21 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,8 @@ ENDFOREACH(INC ${PC_INCLUDE_DIRS})
CONFIGURE_FILE (${CMAKE_CURRENT_SOURCE_DIR}/stage.pc.in ${CMAKE_CURRENT_BINARY_DIR}/stage.pc @ONLY)
INSTALL (FILES ${CMAKE_CURRENT_BINARY_DIR}/stage.pc DESTINATION ${PROJECT_LIB_DIR}/pkgconfig/)

# Create the CMake module files
CONFIGURE_FILE (${CMAKE_CURRENT_SOURCE_DIR}/stage-config.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/stage-config.cmake @ONLY)
CONFIGURE_FILE (${CMAKE_CURRENT_SOURCE_DIR}/stage-config-version.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/stage-config-version.cmake @ONLY)
INSTALL (FILES ${CMAKE_CURRENT_BINARY_DIR}/stage-config.cmake ${CMAKE_CURRENT_BINARY_DIR}/stage-config-version.cmake DESTINATION ${PROJECT_LIB_DIR}/cmake/${PROJECT_NAME})
# Install catkin package.xml
install(FILES package.xml DESTINATION share/stage)

MESSAGE( STATUS "Installation path CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}" )

Expand Down Expand Up @@ -179,6 +177,25 @@ IF ( BUILD_PLAYER_PLUGIN )
ENDIF ( PLAYER_FOUND )
ENDIF ( BUILD_PLAYER_PLUGIN )

# Create the CMake module files (needs to be run after the stage target was created)
if (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION} GREATER 2.8.11)
# Use a generator expression if the version of cmake allows it.
set(STAGE_TARGET_NAME "$<TARGET_FILE_NAME:stage>")
else()
# Otherwise use the LOCATION property of the target (this will produce a warning on newer versions of cmake)
get_property(location_ TARGET stage PROPERTY LOCATION)
get_filename_component(STAGE_TARGET_NAME "${location_}" NAME)
unset(location_)
endif()
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/stage-config.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/stage-config.cmake @ONLY)
if (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION} GREATER 2.8.11)
# Also run it through file(GENERATE ...) to expand generator expressions (if the version of cmake supports it).
FILE (GENERATE
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/stage-config.cmake
INPUT ${CMAKE_CURRENT_BINARY_DIR}/stage-config.cmake)
endif()
CONFIGURE_FILE (${CMAKE_CURRENT_SOURCE_DIR}/stage-config-version.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/stage-config-version.cmake @ONLY)
INSTALL (FILES ${CMAKE_CURRENT_BINARY_DIR}/stage-config.cmake ${CMAKE_CURRENT_BINARY_DIR}/stage-config-version.cmake DESTINATION ${PROJECT_LIB_DIR}/cmake/${PROJECT_NAME})

# generate a cpack config file used to create packaged tarballs
IF ( CPACK_CFG )
Expand Down
36 changes: 18 additions & 18 deletions cmake/internal/FindOS.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -45,28 +45,28 @@ ELSE (PROJECT_OS_LINUX)
ENDIF (PROJECT_OS_LINUX)

# 32 or 64 bit Linux
IF (PROJECT_OS_LINUX)
# Set the library directory suffix accordingly
IF (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64")
SET (PROJECT_PROC_64BIT TRUE BOOL INTERNAL)
MESSAGE (STATUS "Linux x86_64 Detected")
ELSEIF (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "ppc64")
MESSAGE (STATUS "Linux ppc64 Detected")
SET (PROJECT_PROC_64BIT TRUE BOOL INTERNAL)
ELSEIF ($CMAKE_SYSTEM_PROCESSOR} STREQUAL "s390x")
MESSAGE (STATEUS "Linux s390x Detected")
SET (PROJECT_PROC_64BIT TRUE BOOL INTERNAL)
ENDIF (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64")
ENDIF (PROJECT_OS_LINUX)
# IF (PROJECT_OS_LINUX)
# # Set the library directory suffix accordingly
# IF (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64")
# SET (PROJECT_PROC_64BIT TRUE BOOL INTERNAL)
# MESSAGE (STATUS "Linux x86_64 Detected")
# ELSEIF (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "ppc64")
# MESSAGE (STATUS "Linux ppc64 Detected")
# SET (PROJECT_PROC_64BIT TRUE BOOL INTERNAL)
# ELSEIF ($CMAKE_SYSTEM_PROCESSOR} STREQUAL "s390x")
# MESSAGE (STATEUS "Linux s390x Detected")
# SET (PROJECT_PROC_64BIT TRUE BOOL INTERNAL)
# ENDIF (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64")
# ENDIF (PROJECT_OS_LINUX)

IF(PROJECT_PROC_64BIT)
# IF(PROJECT_PROC_64BIT)
# Set the install path to lib64
SET(PROJECT_LIB_DIR "lib64")
SET(PROJECT_PLUGIN_DIR "lib64/${PROJECT_NAME}-${APIVERSION}")
ELSE (PROJECT_PROC_64BIT)
# SET(PROJECT_LIB_DIR "lib64")
# SET(PROJECT_PLUGIN_DIR "lib64/${PROJECT_NAME}-${APIVERSION}")
# ELSE (PROJECT_PROC_64BIT)
SET(PROJECT_LIB_DIR "lib")
SET(PROJECT_PLUGIN_DIR "lib/${PROJECT_NAME}-${APIVERSION}")
ENDIF (PROJECT_PROC_64BIT)
# ENDIF (PROJECT_PROC_64BIT)

MESSAGE(STATUS "Installing Libraries to ${CMAKE_INSTALL_PREFIX}/${PROJECT_LIB_DIR}")
MESSAGE(STATUS "Installing Plugins to ${CMAKE_INSTALL_PREFIX}/${PROJECT_PLUGIN_DIR}")
3 changes: 3 additions & 0 deletions libstage/world.cc
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@
#include <cmath>
using std::abs;

#include <cstdlib>

#include <stdlib.h>
#include <assert.h>
#include <libgen.h> // for dirname(3)
#include <limits.h>
Expand Down
2 changes: 1 addition & 1 deletion stage-config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ set(STAGE_INCLUDE_DIRS "@CMAKE_INSTALL_PREFIX@/include/@PROJECT_NAME@-@APIVERSIO
"@OPENGL_INCLUDE_DIR@")
list(REMOVE_DUPLICATES STAGE_INCLUDE_DIRS)
set(STAGE_LIBRARIES
"@CMAKE_INSTALL_PREFIX@/@PROJECT_LIB_DIR@/libstage.so"
"${stage_DIR}/../../../@PROJECT_LIB_DIR@/@STAGE_TARGET_NAME@"
"@FLTK_LIBRARIES@"
"@OPENGL_gl_LIBRARIES@")

2 changes: 1 addition & 1 deletion stage.pc.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
prefix=@CMAKE_INSTALL_PREFIX@
prefix="@CMAKE_INSTALL_PREFIX@"

Name: stage
Description: Stage robot simulation program, C++ library and Player plugin - part of the Player Project (http://playerstage.org)
Expand Down

0 comments on commit 214e9e6

Please sign in to comment.