Skip to content

Commit

Permalink
Replace ${CMAKE_SOURCE_DIR} with ${PROJECT_SOURCE_DIR}
Browse files Browse the repository at this point in the history
Enables embedding octomap into other source structures, for instance through add_subdirectory() (OctoMap#157)
  • Loading branch information
cehberlin authored and ahornung committed Feb 24, 2017
1 parent 6ac4c9c commit 817af60
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions dynamicEDT3D/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ INCLUDE(CompilerSettings)


# Set output directories for libraries and executables
SET( BASE_DIR ${CMAKE_SOURCE_DIR} )
SET( BASE_DIR ${PROJECT_SOURCE_DIR} )
SET( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${BASE_DIR}/lib )
SET( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${BASE_DIR}/lib )
SET( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${BASE_DIR}/bin )
Expand All @@ -51,8 +51,8 @@ set(INSTALL_TARGETS_DEFAULT_ARGS
)

find_package(octomap REQUIRED
HINTS ${CMAKE_SOURCE_DIR}/lib/cmake/octomap
${CMAKE_SOURCE_DIR}/../octomap/lib/cmake/octomap
PATHS ${PROJECT_SOURCE_DIR}/../octomap/lib/cmake/octomap
NO_DEFAULT_PATH
)
MESSAGE(STATUS "Found octomap version: " ${octomap_VERSION})
MESSAGE(STATUS "octomap libraries: ${OCTOMAP_LIBRARIES}")
Expand Down
2 changes: 1 addition & 1 deletion octomap/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ IF(OCTOMAP_OMP)
ENDIF(OCTOMAP_OMP)

# Set output directories for libraries and executables
SET( BASE_DIR ${CMAKE_SOURCE_DIR} )
SET( BASE_DIR ${PROJECT_SOURCE_DIR} )
SET( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${BASE_DIR}/lib )
SET( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${BASE_DIR}/lib )
SET( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${BASE_DIR}/bin )
Expand Down
6 changes: 3 additions & 3 deletions octovis/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ SET (CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/CMakeModules")
INCLUDE(CompilerSettings)

# Set output directories for libraries and executables
SET( BASE_DIR ${CMAKE_SOURCE_DIR} )
SET( BASE_DIR ${PROJECT_SOURCE_DIR} )
SET( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${BASE_DIR}/lib )
SET( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${BASE_DIR}/lib )
SET( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${BASE_DIR}/bin )
Expand All @@ -43,8 +43,8 @@ endforeach( OUTPUTCONFIG CMAKE_CONFIGURATION_TYPES )
# Otherwise you need to export octomap_DIR to the directory containing
# the file octomap-config.cmake
find_package(octomap ${OCTOVIS_MAJOR_VERSION}.${OCTOVIS_MINOR_VERSION} REQUIRED
HINTS ${CMAKE_SOURCE_DIR}/lib/cmake/octomap
${CMAKE_SOURCE_DIR}/../octomap/lib/cmake/octomap
PATHS ${PROJECT_SOURCE_DIR}/../octomap/lib/cmake/octomap
NO_DEFAULT_PATH
)
MESSAGE(STATUS "Found octomap version: " ${octomap_VERSION})

Expand Down

0 comments on commit 817af60

Please sign in to comment.