Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions dynamicEDT3D/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ IF(WIN32)
set(DYNAMICEDT3D_LIBRARY
"${CMAKE_IMPORT_LIBRARY_PREFIX}dynamicedt3d${CMAKE_IMPORT_LIBRARY_SUFFIX}"
)
set(DYNAMICEDT3D_LIBRARY_DEBUG
"${CMAKE_IMPORT_LIBRARY_PREFIX}dynamicedt3dd${CMAKE_IMPORT_LIBRARY_SUFFIX}"
)
ELSE()
set(DYNAMICEDT3D_LIBRARY
"${CMAKE_SHARED_LIBRARY_PREFIX}dynamicedt3d${CMAKE_SHARED_LIBRARY_SUFFIX}"
Expand Down
12 changes: 12 additions & 0 deletions dynamicEDT3D/dynamicEDT3DConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,18 @@ set(DYNAMICEDT3D_VERSION "@DYNAMICEDT3D_VERSION@")
set_and_check(DYNAMICEDT3D_INCLUDE_DIRS "@PACKAGE_DYNAMICEDT3D_INCLUDE_DIRS@")
set_and_check(DYNAMICEDT3D_LIBRARY_DIRS "@PACKAGE_DYNAMICEDT3D_LIB_DIR@")

if(WIN32)
set(DYNAMICEDT3D_LIBRARIES
optimized "@DYNAMICEDT3D_LIB_DIR@/@DYNAMICEDT3D_LIBRARY@"
debug "@DYNAMICEDT3D_LIB_DIR@/@DYNAMICEDT3D_LIBRARY_DEBUG@"
)
set(DYNAMICEDT3D_LIBRARIES
optimized "@PACKAGE_DYNAMICEDT3D_LIB_DIR@/@DYNAMICEDT3D_LIBRARY@"
debug"@PACKAGE_DYNAMICEDT3D_LIB_DIR@/@DYNAMICEDT3D_LIBRARY_DEBUG@"
)
else(WIN32)
set(DYNAMICEDT3D_LIBRARIES "@PACKAGE_DYNAMICEDT3D_LIB_DIR@/@DYNAMICEDT3D_LIBRARY@")
endif(WIN32)
set(DYNAMICEDT3D_LIBRARIES "@PACKAGE_DYNAMICEDT3D_LIB_DIR@/@DYNAMICEDT3D_LIBRARY@")

@DYNAMICEDT3D_INCLUDE_TARGETS@
32 changes: 23 additions & 9 deletions dynamicEDT3D/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,49 @@ SET( dynamicEDT3D_SRCS
dynamicEDT3D.cpp
)

add_library(dynamicedt3d SHARED ${dynamicEDT3D_SRCS})
set_target_properties(dynamicedt3d PROPERTIES
VERSION ${DYNAMICEDT3D_VERSION}
SOVERSION ${DYNAMICEDT3D_SOVERSION}
)
target_link_libraries(dynamicedt3d ${OCTOMAP_LIBRARIES})
# Source code not set up for shared symbol export under Windows. Skip shared build.
IF(WIN32)
set(SKIP_SHARED YES)
ENDIF(WIN32)

IF(NOT SKIP_SHARED)
add_library(dynamicedt3d SHARED ${dynamicEDT3D_SRCS})
set_target_properties(dynamicedt3d PROPERTIES
VERSION ${DYNAMICEDT3D_VERSION}
SOVERSION ${DYNAMICEDT3D_SOVERSION}
)
target_link_libraries(dynamicedt3d ${OCTOMAP_LIBRARIES})

set(DYNAMICEDT3D_TARGETS dynamicedt3d dynamicedt3d-static)
ELSE(NOT SKIP_SHARED)
set(DYNAMICEDT3D_TARGETS dynamicedt3d-static)
ENDIF(NOT SKIP_SHARED)

add_library(dynamicedt3d-static STATIC ${dynamicEDT3D_SRCS})
target_link_libraries(dynamicedt3d-static ${OCTOMAP_LIBRARIES})

SET_TARGET_PROPERTIES(dynamicedt3d-static PROPERTIES OUTPUT_NAME "dynamicedt3d")
SET_TARGET_PROPERTIES(dynamicedt3d-static PROPERTIES OUTPUT_NAME_DEBUG "dynamicedt3dd")

if(NOT EXISTS "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/dynamicEDT3D")
file(MAKE_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/dynamicEDT3D")
endif()

export(TARGETS dynamicedt3d dynamicedt3d-static
export(TARGETS ${DYNAMICEDT3D_TARGETS}
FILE "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/dynamicEDT3D/dynamicEDT3DTargets.cmake")

# directly depend on the octomap library target when building the
# complete distribution, so it it recompiled as needed
if (CMAKE_PROJECT_NAME STREQUAL "octomap-distribution")
ADD_DEPENDENCIES(dynamicedt3d-static octomap-static)
ADD_DEPENDENCIES(dynamicedt3d octomap)
IF(NOT SKIP_SHARED)
ADD_DEPENDENCIES(dynamicedt3d octomap)
endif(NOT SKIP_SHARED)
endif()

ADD_SUBDIRECTORY(examples)

install(TARGETS dynamicedt3d dynamicedt3d-static
install(TARGETS ${DYNAMICEDT3D_TARGETS}
EXPORT dynamicEDT3DTargets
INCLUDES DESTINATION include
${INSTALL_TARGETS_DEFAULT_ARGS}
Expand Down
12 changes: 9 additions & 3 deletions dynamicEDT3D/src/examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
set(DYNAMICEDT3D_LINK dynamicedt3d)
IF(WIN32)
# Windows build not setup for dynamic library export. Use static library.
set(DYNAMICEDT3D_LINK dynamicedt3d-static)
ENDIF(WIN32)

add_executable(exampleEDT3D exampleEDT3D.cpp)
target_link_libraries(exampleEDT3D dynamicedt3d)
target_link_libraries(exampleEDT3D ${DYNAMICEDT3D_LINK})

add_executable(exampleEDTOctomap exampleEDTOctomap.cpp)
target_link_libraries(exampleEDTOctomap dynamicedt3d)
target_link_libraries(exampleEDTOctomap ${DYNAMICEDT3D_LINK})

add_executable(exampleEDTOctomapStamped exampleEDTOctomapStamped.cpp)
target_link_libraries(exampleEDTOctomapStamped dynamicedt3d)
target_link_libraries(exampleEDTOctomapStamped ${DYNAMICEDT3D_LINK})
6 changes: 6 additions & 0 deletions octomap/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ IF(WIN32)
set(OCTOMATH_LIBRARY
"${CMAKE_IMPORT_LIBRARY_PREFIX}octomath${CMAKE_IMPORT_LIBRARY_SUFFIX}"
)
set(OCTOMAP_LIBRARY_DEBUG
"${CMAKE_IMPORT_LIBRARY_PREFIX}octomapd${CMAKE_IMPORT_LIBRARY_SUFFIX}"
)
set(OCTOMATH_LIBRARY_DEBUG
"${CMAKE_IMPORT_LIBRARY_PREFIX}octomathd${CMAKE_IMPORT_LIBRARY_SUFFIX}"
)
ELSE()
set(OCTOMAP_LIBRARY
"${CMAKE_SHARED_LIBRARY_PREFIX}octomap${CMAKE_SHARED_LIBRARY_SUFFIX}"
Expand Down
17 changes: 13 additions & 4 deletions octomap/octomap-config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,18 @@ set_and_check(OCTOMAP_INCLUDE_DIRS "@PACKAGE_OCTOMAP_INCLUDE_DIRS@")
set_and_check(OCTOMAP_LIBRARY_DIRS "@PACKAGE_OCTOMAP_LIB_DIR@")

# Set library names
set(OCTOMAP_LIBRARIES
"@PACKAGE_OCTOMAP_LIB_DIR@/@OCTOMAP_LIBRARY@"
"@PACKAGE_OCTOMAP_LIB_DIR@/@OCTOMATH_LIBRARY@"
)
if(WIN32)
set(OCTOMAP_LIBRARIES
optimized "@PACKAGE_OCTOMAP_LIB_DIR@/@OCTOMAP_LIBRARY@"
optimized "@PACKAGE_OCTOMAP_LIB_DIR@/@OCTOMATH_LIBRARY@"
debug "@PACKAGE_OCTOMAP_LIB_DIR@/@OCTOMAP_LIBRARY_DEBUG@"
debug "@PACKAGE_OCTOMAP_LIB_DIR@/@OCTOMATH_LIBRARY_DEBUG@"
)
elseif(WIN32)
set(OCTOMAP_LIBRARIES
"@PACKAGE_OCTOMAP_LIB_DIR@/@OCTOMAP_LIBRARY@"
"@PACKAGE_OCTOMAP_LIB_DIR@/@OCTOMATH_LIBRARY@"
)
endif(WIN32)

@OCTOMAP_INCLUDE_TARGETS@
58 changes: 36 additions & 22 deletions octomap/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,63 +10,77 @@ SET (octomap_SRCS
ColorOcTree.cpp
)

# Source code not set up for shared symbol export under Windows. Skip shared build.
set(OCTOMAP_LINK octomap octomath)
IF(WIN32)
set(SKIP_SHARED YES)
set(OCTOMAP_LINK octomap-static octomath-static)
ENDIF(WIN32)

# dynamic and static libs, see CMake FAQ:
ADD_LIBRARY( octomap SHARED ${octomap_SRCS})
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")
IF(NOT SKIP_SHARED)
ADD_LIBRARY( octomap SHARED ${octomap_SRCS})
set_target_properties( octomap PROPERTIES
VERSION ${OCTOMAP_VERSION}
SOVERSION ${OCTOMAP_SOVERSION}
)

TARGET_LINK_LIBRARIES(octomap octomath)

TARGET_LINK_LIBRARIES(octomap octomath)
set(OCTOMAP_TARGETS octomap octomap-static)
ELSE(NOT SKIP_SHARED)
set(OCTOMAP_TARGETS octomap-static)
ENDIF(NOT SKIP_SHARED)
ADD_LIBRARY( octomap-static STATIC ${octomap_SRCS})
SET_TARGET_PROPERTIES(octomap-static PROPERTIES OUTPUT_NAME "octomap")
SET_TARGET_PROPERTIES(octomap-static PROPERTIES OUTPUT_NAME_DEBUG "octomapd")

if(NOT EXISTS "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/octomap")
file(MAKE_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/octomap")
endif()

export(TARGETS octomap octomap-static
export(TARGETS ${OCTOMAP_TARGETS}
APPEND FILE "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/octomap/octomap-targets.cmake")

ADD_SUBDIRECTORY( testing )

ADD_EXECUTABLE(graph2tree graph2tree.cpp)
TARGET_LINK_LIBRARIES(graph2tree octomap)
TARGET_LINK_LIBRARIES(graph2tree ${OCTOMAP_LINK})

ADD_EXECUTABLE(log2graph log2graph.cpp)
TARGET_LINK_LIBRARIES(log2graph octomap)
TARGET_LINK_LIBRARIES(log2graph ${OCTOMAP_LINK})

ADD_EXECUTABLE(binvox2bt binvox2bt.cpp)
TARGET_LINK_LIBRARIES(binvox2bt octomap)
TARGET_LINK_LIBRARIES(binvox2bt ${OCTOMAP_LINK})

ADD_EXECUTABLE(bt2vrml bt2vrml.cpp)
TARGET_LINK_LIBRARIES(bt2vrml octomap)
TARGET_LINK_LIBRARIES(bt2vrml ${OCTOMAP_LINK})

ADD_EXECUTABLE(edit_octree edit_octree.cpp)
TARGET_LINK_LIBRARIES(edit_octree octomap)
TARGET_LINK_LIBRARIES(edit_octree ${OCTOMAP_LINK})

ADD_EXECUTABLE(convert_octree convert_octree.cpp)
TARGET_LINK_LIBRARIES(convert_octree octomap)
TARGET_LINK_LIBRARIES(convert_octree ${OCTOMAP_LINK})

ADD_EXECUTABLE(eval_octree_accuracy eval_octree_accuracy.cpp)
TARGET_LINK_LIBRARIES(eval_octree_accuracy octomap)
TARGET_LINK_LIBRARIES(eval_octree_accuracy ${OCTOMAP_LINK})

ADD_EXECUTABLE(compare_octrees compare_octrees.cpp)
TARGET_LINK_LIBRARIES(compare_octrees octomap)
TARGET_LINK_LIBRARIES(compare_octrees ${OCTOMAP_LINK})

ADD_EXECUTABLE(simple_example simple_example.cpp)
TARGET_LINK_LIBRARIES(simple_example octomap)
TARGET_LINK_LIBRARIES(simple_example ${OCTOMAP_LINK})

ADD_EXECUTABLE(normals_example normals_example.cpp)
TARGET_LINK_LIBRARIES(normals_example octomap)
TARGET_LINK_LIBRARIES(normals_example ${OCTOMAP_LINK})

ADD_EXECUTABLE(intersection_example intersection_example.cpp)
TARGET_LINK_LIBRARIES(intersection_example octomap)
TARGET_LINK_LIBRARIES(intersection_example ${OCTOMAP_LINK})

ADD_EXECUTABLE(octree2pointcloud octree2pointcloud.cpp)
TARGET_LINK_LIBRARIES(octree2pointcloud octomap)
TARGET_LINK_LIBRARIES(octree2pointcloud ${OCTOMAP_LINK})

install(TARGETS octomap octomap-static
install(TARGETS ${OCTOMAP_TARGETS}
EXPORT octomap-targets
INCLUDES DESTINATION include
${INSTALL_TARGETS_DEFAULT_ARGS}
Expand Down
30 changes: 21 additions & 9 deletions octomap/src/math/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,38 @@ SET (octomath_SRCS
)


ADD_LIBRARY( octomath SHARED ${octomath_SRCS})
# Source code not set up for shared symbol export under Windows. Skip shared build.
IF(WIN32)
set(SKIP_SHARED YES)
ENDIF(WIN32)

SET_TARGET_PROPERTIES( octomath PROPERTIES
VERSION ${OCTOMAP_VERSION}
SOVERSION ${OCTOMAP_SOVERSION}
INSTALL_NAME_DIR ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} # this seems to be necessary for MacOS X
)
# INSTALL_NAME_DIR seems to be necessary for MacOS X
IF(NOT SKIP_SHARED)
ADD_LIBRARY( octomath SHARED ${octomath_SRCS})

SET_TARGET_PROPERTIES( octomath PROPERTIES
VERSION ${OCTOMAP_VERSION}
SOVERSION ${OCTOMAP_SOVERSION}
INSTALL_NAME_DIR ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} # this seems to be necessary for MacOS X
)
# INSTALL_NAME_DIR seems to be necessary for MacOS X

set(OCTOMATH_TARGETS octomath octomath-static)
ELSE(NOT SKIP_SHARED)
set(OCTOMATH_TARGETS octomath-static)
ENDIF(NOT SKIP_SHARED)

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

if(NOT EXISTS "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/octomap")
file(MAKE_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/octomap")
endif()

export(TARGETS octomath octomath-static
export(TARGETS ${OCTOMATH_TARGETS}
APPEND FILE "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/octomap/octomap-targets.cmake")

install(TARGETS octomath octomath-static
install(TARGETS ${OCTOMATH_TARGETS}
EXPORT octomap-targets
INCLUDES DESTINATION include
${INSTALL_TARGETS_DEFAULT_ARGS}
Expand Down
23 changes: 13 additions & 10 deletions octomap/src/testing/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,36 +1,39 @@
IF(NOT DEFINED OCTOMAP_LINK)
set(OCTOMAP_LINK octomap octomath)
ENDIF(NOT DEFINED OCTOMAP_LINK)
if(BUILD_TESTING)
ADD_EXECUTABLE(test_raycasting test_raycasting.cpp)
TARGET_LINK_LIBRARIES(test_raycasting octomap)
TARGET_LINK_LIBRARIES(test_raycasting ${OCTOMAP_LINK})

ADD_EXECUTABLE(test_iterators test_iterators.cpp)
TARGET_LINK_LIBRARIES(test_iterators octomap)
TARGET_LINK_LIBRARIES(test_iterators ${OCTOMAP_LINK})

ADD_EXECUTABLE(test_io test_io.cpp)
TARGET_LINK_LIBRARIES(test_io octomap)
TARGET_LINK_LIBRARIES(test_io ${OCTOMAP_LINK})

ADD_EXECUTABLE(test_changedkeys test_changedkeys.cpp)
TARGET_LINK_LIBRARIES(test_changedkeys octomap)
TARGET_LINK_LIBRARIES(test_changedkeys ${OCTOMAP_LINK})

ADD_EXECUTABLE(test_scans test_scans.cpp)
TARGET_LINK_LIBRARIES(test_scans octomap)
TARGET_LINK_LIBRARIES(test_scans ${OCTOMAP_LINK})

ADD_EXECUTABLE(test_color_tree test_color_tree.cpp)
TARGET_LINK_LIBRARIES(test_color_tree octomap)
TARGET_LINK_LIBRARIES(test_color_tree ${OCTOMAP_LINK})

ADD_EXECUTABLE(color_tree_histogram color_tree_histogram.cpp)
TARGET_LINK_LIBRARIES(color_tree_histogram octomap)
TARGET_LINK_LIBRARIES(color_tree_histogram ${OCTOMAP_LINK})

ADD_EXECUTABLE(test_mapcollection test_mapcollection.cpp)
TARGET_LINK_LIBRARIES(test_mapcollection octomap octomath)
TARGET_LINK_LIBRARIES(test_mapcollection ${OCTOMAP_LINK})

ADD_EXECUTABLE(test_pruning test_pruning.cpp)
TARGET_LINK_LIBRARIES(test_pruning octomap octomath)
TARGET_LINK_LIBRARIES(test_pruning ${OCTOMAP_LINK})


# CTest tests below

ADD_EXECUTABLE(unit_tests unit_tests.cpp)
TARGET_LINK_LIBRARIES(unit_tests octomap)
TARGET_LINK_LIBRARIES(unit_tests ${OCTOMAP_LINK})

ADD_TEST (NAME MathVector COMMAND unit_tests MathVector )
ADD_TEST (NAME MathPose COMMAND unit_tests MathPose )
Expand Down
3 changes: 3 additions & 0 deletions octovis/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ IF(BUILD_VIEWER)
set(OCTOVIS_LIBRARY
"${CMAKE_IMPORT_LIBRARY_PREFIX}octovis${CMAKE_IMPORT_LIBRARY_SUFFIX}"
)
set(OCTOVIS_LIBRARY_DEBUG
"${CMAKE_IMPORT_LIBRARY_PREFIX}octovisd${CMAKE_IMPORT_LIBRARY_SUFFIX}"
)
ELSE()
set(OCTOVIS_LIBRARY
"${CMAKE_SHARED_LIBRARY_PREFIX}octovis${CMAKE_SHARED_LIBRARY_SUFFIX}"
Expand Down
Loading