Skip to content

Commit

Permalink
try another fix for octomap
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfv committed Sep 28, 2020
1 parent ee79715 commit 6ffbbd8
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 62 deletions.
94 changes: 35 additions & 59 deletions patch/ros-noetic-octomap.win.patch
Original file line number Diff line number Diff line change
@@ -1,50 +1,30 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6a3827a..625fa63 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,16 @@
CMAKE_MINIMUM_REQUIRED(VERSION 3.0.2)
PROJECT( octomap )

+if(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY)
+ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin")
+endif()
+if(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)
+ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib")
+endif()
+if(NOT CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
+ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib")
+endif()
+
set(CMAKE_INSTALL_LIBDIR "lib")

include(CTest)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 45b384f..6dc0293 100644
index 45b384f..7a47f77 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -8,17 +8,14 @@ SET (octomap_SRCS
OcTreeNode.cpp
OcTreeStamped.cpp
ColorOcTree.cpp
- )
+)
@@ -11,14 +11,13 @@ SET (octomap_SRCS
)

-# dynamic and static libs, see CMake FAQ:
# dynamic and static libs, see CMake FAQ:
-ADD_LIBRARY( octomap SHARED ${octomap_SRCS})
+ADD_LIBRARY( octomap ${octomap_SRCS})
set_target_properties( octomap PROPERTIES
VERSION ${OCTOMAP_VERSION}
SOVERSION ${OCTOMAP_SOVERSION}
+ OUTPUT_NAME "octomap"
)
-set_target_properties( octomap PROPERTIES
- VERSION ${OCTOMAP_VERSION}
- SOVERSION ${OCTOMAP_SOVERSION}
-)
-ADD_LIBRARY( octomap-static STATIC ${octomap_SRCS})
-SET_TARGET_PROPERTIES(octomap-static PROPERTIES OUTPUT_NAME "octomap")
-add_dependencies(octomap-static octomath-static)
+# ADD_LIBRARY( octomap SHARED ${octomap_SRCS})
+# set_target_properties( octomap PROPERTIES
+# VERSION ${OCTOMAP_VERSION}
+# SOVERSION ${OCTOMAP_SOVERSION}
+# )
+ADD_LIBRARY( octomap STATIC ${octomap_SRCS})
+SET_TARGET_PROPERTIES(octomap PROPERTIES OUTPUT_NAME "octomap")

TARGET_LINK_LIBRARIES(octomap octomath)

@@ -26,7 +23,7 @@ if(NOT EXISTS "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/octomap")
@@ -26,7 +25,7 @@ if(NOT EXISTS "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/octomap")
file(MAKE_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/octomap")
endif()

Expand All @@ -53,40 +33,40 @@ index 45b384f..6dc0293 100644
APPEND FILE "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/octomap/octomap-targets.cmake")

ADD_SUBDIRECTORY( testing )
@@ -67,10 +64,11 @@ TARGET_LINK_LIBRARIES(intersection_example octomap)
@@ -67,7 +66,7 @@ TARGET_LINK_LIBRARIES(intersection_example octomap)
ADD_EXECUTABLE(octree2pointcloud octree2pointcloud.cpp)
TARGET_LINK_LIBRARIES(octree2pointcloud octomap)

-install(TARGETS octomap octomap-static
+install(TARGETS octomap
EXPORT octomap-targets
- INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
- ${INSTALL_TARGETS_DEFAULT_ARGS}
+ INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
install(EXPORT octomap-targets DESTINATION "${CMAKE_INSTALL_DATADIR}/octomap")

INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
${INSTALL_TARGETS_DEFAULT_ARGS}
diff --git a/src/math/CMakeLists.txt b/src/math/CMakeLists.txt
index 3b47ec4..af8b3fa 100644
index 3b47ec4..e163ba0 100644
--- a/src/math/CMakeLists.txt
+++ b/src/math/CMakeLists.txt
@@ -5,25 +5,23 @@ SET (octomath_SRCS
@@ -5,24 +5,24 @@ SET (octomath_SRCS
)


-ADD_LIBRARY( octomath SHARED ${octomath_SRCS})
+ADD_LIBRARY( octomath ${octomath_SRCS})
+# ADD_LIBRARY( octomath SHARED ${octomath_SRCS})

SET_TARGET_PROPERTIES( octomath PROPERTIES
VERSION ${OCTOMAP_VERSION}
SOVERSION ${OCTOMAP_SOVERSION}
)
-SET_TARGET_PROPERTIES( octomath PROPERTIES
- VERSION ${OCTOMAP_VERSION}
- SOVERSION ${OCTOMAP_SOVERSION}
-)
+# SET_TARGET_PROPERTIES( octomath PROPERTIES
+# VERSION ${OCTOMAP_VERSION}
+# SOVERSION ${OCTOMAP_SOVERSION}
+# )

-ADD_LIBRARY( octomath-static STATIC ${octomath_SRCS})
-SET_TARGET_PROPERTIES(octomath-static PROPERTIES OUTPUT_NAME "octomath")
-
+ADD_LIBRARY( octomath STATIC ${octomath_SRCS})
+SET_TARGET_PROPERTIES(octomath PROPERTIES OUTPUT_NAME "octomath")

if(NOT EXISTS "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/octomap")
file(MAKE_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/octomap")
endif()
Expand All @@ -98,9 +78,5 @@ index 3b47ec4..af8b3fa 100644
-install(TARGETS octomath octomath-static
+install(TARGETS octomath
EXPORT octomap-targets
- INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
- ${INSTALL_TARGETS_DEFAULT_ARGS}
+ INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
${INSTALL_TARGETS_DEFAULT_ARGS}
7 changes: 4 additions & 3 deletions win.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ packages_select_by_deps:
# - velodyne_driver # probably too tricky to build
# - velodyne_pointcloud # depends on velodyne_driver
# - plotjuggler # fails with weird template initialization error
- franka_hw
- libfranka # for now has tests disabled
- franka_visualization

# - franka_hw
# - libfranka # for now has tests disabled
# - franka_visualization
# - teb_local_planner # cannot find cs.h from suitesparse

##
Expand Down

0 comments on commit 6ffbbd8

Please sign in to comment.