Skip to content

Commit

Permalink
Find libexecinfo if it exists.
Browse files Browse the repository at this point in the history
  • Loading branch information
abellgithub committed Feb 13, 2018
1 parent 124f18f commit 18bc9ca
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
5 changes: 5 additions & 0 deletions cmake/execinfo.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#
# See if we have an execinfo library.
#

find_library(EXECINFO_LIBRARY execinfo)
8 changes: 7 additions & 1 deletion dimbuilder/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ endif()

include(${ROOT_DIR}/cmake/common.cmake NO_POLICY_SCOPE)

include(${PDAL_CMAKE_DIR}/execinfo.cmake)

#
# We include Utils.cpp here rather than linking in the Utils library because
# some people building linux packages disable rpath, which means that
Expand All @@ -27,8 +29,12 @@ target_include_directories(dimbuilder PRIVATE
${PDAL_INCLUDE_DIR}
${PDAL_JSONCPP_INCLUDE_DIR})
PDAL_TARGET_COMPILE_SETTINGS(dimbuilder)
target_link_libraries(dimbuilder
PRIVATE
${EXECINFO_LIBRARY})
if (PDAL_HAVE_JSONCPP)
target_link_libraries(dimbuilder ${JSON_CPP_LINK_TYPE} ${PDAL_JSONCPP_LIB_NAME})
target_link_libraries(dimbuilder ${JSON_CPP_LINK_TYPE}
${PDAL_JSONCPP_LIB_NAME})
endif()
if (UNIX AND NOT APPLE)
target_link_libraries(dimbuilder PRIVATE ${CMAKE_DL_LIBS})
Expand Down
3 changes: 3 additions & 0 deletions pdal/util/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ if(EXISTS)
return()
endif()

include(${PDAL_CMAKE_DIR}/execinfo.cmake)

set(PDAL_UTIL_SOURCES
"${PDAL_UTIL_DIR}/Bounds.cpp"
"${PDAL_UTIL_DIR}/Charbuf.cpp"
Expand All @@ -17,6 +19,7 @@ set(PDAL_UTIL_SOURCES
PDAL_ADD_FREE_LIBRARY(${PDAL_UTIL_LIB_NAME} SHARED ${PDAL_UTIL_SOURCES})
target_link_libraries(${PDAL_UTIL_LIB_NAME}
PRIVATE
${EXECINFO_LIBRARY}
${PDAL_BOOST_LIB_NAME}
)
target_include_directories(${PDAL_UTIL_LIB_NAME} PRIVATE
Expand Down

0 comments on commit 18bc9ca

Please sign in to comment.