Skip to content

Commit

Permalink
Some fixes for linking against lvr2::lvr2 target
Browse files Browse the repository at this point in the history
  • Loading branch information
JustusBraun committed Nov 8, 2024
1 parent 946db41 commit 52eedd0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ option(BUILD_TOOLS_EXPERIMENTAL "Build experimental tools" OFF)
option(WITH_DRACO "Build libraries with draco enabled" OFF)

## Compile as C++17
add_compile_options(-std=c++17)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# DEFAULT RELEASE
if (NOT EXISTS ${CMAKE_BINARY_DIR}/CMakeCache.txt)
Expand Down Expand Up @@ -583,6 +583,7 @@ endif()
###############################################################################

set(LVR2_LIB_DEPENDENCIES
${Boost_LIBRARIES}
${Boost_PROGRAM_OPTIONS_LIBRARY}
${Boost_SYSTEM_LIBRARY}
${Boost_THREAD_LIBRARY}
Expand Down
2 changes: 1 addition & 1 deletion LVR2Config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ if(@CGAL_FOUND@)
list(APPEND LVR2_INCLUDE_DIRS ${CGAL_INCLUDE_DIRS})
endif()

find_package(Boost REQUIRED)
find_package(Boost COMPONENTS @Boost_COMPONENTS@ REQUIRED)
list(APPEND LVR2_INCLUDE_DIRS ${Boost_INCLUDE_DIRS})
list(APPEND LVR2_DEFINITIONS ${Boost_LIB_DIAGNOSTIC_DEFINITIONS})

Expand Down
10 changes: 10 additions & 0 deletions src/liblvr2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,11 @@ target_link_libraries(
lvr2_static
${LVR2_INTERNAL_DEPENDENCIES_STATIC}
${LVR2_LIB_DEPENDENCIES})
target_compile_definitions(
lvr2_static
PUBLIC
${LVR2_DEFINITIONS}
)


#####################################################################################
Expand All @@ -178,6 +183,11 @@ if( NOT MSVC )
lvr2
${LVR2_INTERNAL_DEPENDENCIES_SHARED}
${LVR2_LIB_DEPENDENCIES})
target_compile_definitions(
lvr2
PUBLIC
${LVR2_DEFINITIONS}
)

install(TARGETS lvr2_static lvr2
EXPORT lvr2Targets
Expand Down

0 comments on commit 52eedd0

Please sign in to comment.