Skip to content

Commit

Permalink
Merge pull request #150 from wgoadri/cmake-enable-exportation
Browse files Browse the repository at this point in the history
Enable targets exportation during build
  • Loading branch information
nmellado authored Sep 6, 2024
2 parents 576dd57 + 8611d67 commit 045d6c2
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ Ponca changelog
--------------------------------------------------------------------------------
Current head (v.1.4 RC)

- Cmake
- [build] Enable exportation of projects linking to Ponca targets (#150)
- [install] Change output directory to `lib/cmake/Ponca` (#150)

--------------------------------------------------------------------------------
v.1.3
This release introduces several improvements around the KdTre API, as well as bug fixes, new features and doc
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ endmacro()
################################################################################
set(Ponca_EXPORT_TARGET_DIR \${CMAKE_CURRENT_LIST_DIR})

set(config_install_dir "${CMAKE_INSTALL_PREFIX}/lib/cmake/")
set(config_install_dir "${CMAKE_INSTALL_PREFIX}/lib/cmake/Ponca")
set(include_install_dir "${CMAKE_INSTALL_PREFIX}/include")
set(generated_dir "${CMAKE_CURRENT_BINARY_DIR}/generated")

Expand Down
1 change: 1 addition & 0 deletions cmake/Config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ find_dependency(Eigen3 REQUIRED)

include("@Ponca_EXPORT_TARGET_DIR@/PoncaTargets-Fitting.cmake")
include("@Ponca_EXPORT_TARGET_DIR@/PoncaTargets-Common.cmake")
include("@Ponca_EXPORT_TARGET_DIR@/PoncaTargets-SpatialPartitioning.cmake")


# Compute paths
Expand Down
6 changes: 5 additions & 1 deletion cmake/PoncaConfigureCommon.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,14 @@ install(TARGETS Common
install(EXPORT CommonTargets
FILE PoncaTargets-Common.cmake
NAMESPACE Ponca::
DESTINATION lib/cmake
DESTINATION lib/cmake/Ponca
)

add_library(Ponca::Common ALIAS Common)
export(EXPORT CommonTargets
FILE ${CMAKE_CURRENT_BINARY_DIR}/PoncaTargets-Common.cmake
NAMESPACE Ponca::
)

#############################################
# HACK: have the files showing in the IDE, under the name 'ponca-src'
Expand Down
6 changes: 5 additions & 1 deletion cmake/PoncaConfigureFitting.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,15 @@ install(TARGETS Fitting
install(EXPORT FittingTargets
FILE PoncaTargets-Fitting.cmake
NAMESPACE Ponca::
DESTINATION lib/cmake
DESTINATION lib/cmake/Ponca
COMPONENT Common
)

add_library(Ponca::Fitting ALIAS Fitting)
export(EXPORT FittingTargets
FILE ${CMAKE_CURRENT_BINARY_DIR}/PoncaTargets-Fitting.cmake
NAMESPACE Ponca::
)

#############################################
# HACK: have the files showing in the IDE, under the name 'ponca-src'
Expand Down
6 changes: 5 additions & 1 deletion cmake/PoncaConfigureSpatialPartitioning.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,15 @@ install(TARGETS SpatialPartitioning
install(EXPORT SpatialPartitioningTargets
FILE PoncaTargets-SpatialPartitioning.cmake
NAMESPACE Ponca::
DESTINATION lib/cmake
DESTINATION lib/cmake/Ponca
COMPONENT Common
)

add_library(Ponca::SpatialPartitioning ALIAS SpatialPartitioning)
export(EXPORT SpatialPartitioningTargets
FILE ${CMAKE_CURRENT_BINARY_DIR}/PoncaTargets-SpatialPartitioning.cmake
NAMESPACE Ponca::
)

#############################################
# HACK: have the files showing in the IDE, under the name 'ponca-src'
Expand Down

0 comments on commit 045d6c2

Please sign in to comment.