Skip to content

Commit

Permalink
fix install dirs for lvr2 targets
Browse files Browse the repository at this point in the history
  • Loading branch information
spuetz committed Dec 3, 2020
1 parent e7e3c71 commit 286898b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
12 changes: 6 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -633,16 +633,16 @@ endif()
# CMAKE FILES
###############################################################################

install(EXPORT lvr2Targets
FILE lvr2Targets.cmake
NAMESPACE lvr2::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/lvr2)

include(CMakePackageConfigHelpers)
set(INCLUDE_INSTALL_DIR include/)
set(LIB_INSTALL_DIR lib/)
set(SYSCONFIG_INSTALL_DIR etc/lvr2/)

install(EXPORT lvr2Targets
FILE lvr2Targets.cmake
NAMESPACE lvr2::
DESTINATION ${LIB_INSTALL_DIR}/cmake/lvr2)

configure_package_config_file(LVR2Config.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/LVR2Config.cmake
INSTALL_DESTINATION ${LIB_INSTALL_DIR}/cmake/lvr2
Expand All @@ -669,7 +669,7 @@ install(FILES
CMakeModules/FindOpenNI2.cmake
CMakeModules/FindQVTK.cmake
CMakeModules/FindSTANN.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/lvr2/Modules)
DESTINATION ${LIB_INSTALL_DIR}/cmake/lvr2/Modules)


###############################################################################
Expand Down
9 changes: 7 additions & 2 deletions LVR2Config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
# - LVR2_INCLUDE_DIRS
# - LVR2_DEFINITIONS
# - LVR2_LIBRARIES
# - LVR2_LIBRARY
#
# Do not forget to add_defintions(${LVR2_DEFINITIONS}) as they
# describe the build configuration of liblvr.
Expand All @@ -24,11 +25,15 @@ cmake_policy(SET CMP0012 NEW)
set(LVR2_INCLUDE_DIRS @LVR2_INSTALL_INCLUDE_DIRS@)
set(LVR2_DEFINITIONS @LVR2_DEFINITIONS@)

find_package(PkgConfig REQUIRED)

option(LVR2_USE_STATIC_LIBS OFF)
if(LVR2_USE_STATIC_LIBS)
set(LVR2_LIBRARIES lvr2_static)
find_library(LVR2_LIBRARY NAMES lvr2_static)
set(LVR2_LIBRARIES ${LVR2_LIBRARY})
else()
set(LVR2_LIBRARIES lvr2)
find_library(LVR2_LIBRARY NAMES lvr2)
set(LVR2_LIBRARIES ${LVR2_LIBRARY})
endif()

find_package(OpenCV REQUIRED)
Expand Down

0 comments on commit 286898b

Please sign in to comment.