Skip to content

Commit

Permalink
Standalone plugin builds (PDAL#4177)
Browse files Browse the repository at this point in the history
* use PROJECT_SOURCE_DIR for building -DSTANDALONE

* try CMAKE_CURRENT_LIST_DIR

* CMAKE_CURRENT_LIST_DIR

* CMAKE_CURRENT_SOURCE_DIR for standalone.cmake

* more standalone

* condition test building with STANDALONE

* move PDAL-finding to bottom of STANDALONE ops
  • Loading branch information
hobu authored Sep 18, 2023
1 parent 702ca29 commit 810b876
Show file tree
Hide file tree
Showing 16 changed files with 381 additions and 35 deletions.
2 changes: 1 addition & 1 deletion cmake/standalone.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(ROOT_DIR "${CMAKE_SOURCE_DIR}/../..")
set(ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../..")

get_filename_component(ROOT_DIR "${ROOT_DIR}" ABSOLUTE)

Expand Down
10 changes: 5 additions & 5 deletions plugins/draco/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ cmake_minimum_required(VERSION 3.13)

if (STANDALONE)
project(pdal-draco)
find_package(PDAL REQUIRED)
include("${CMAKE_SOURCE_DIR}/../../cmake/standalone.cmake" )

include("${CMAKE_CURRENT_LIST_DIR}/../../cmake/standalone.cmake" )
include(${PDAL_CMAKE_DIR}/arbiter.cmake)
include(${PDAL_CMAKE_DIR}/nlohmann.cmake)
add_subdirectory("${CMAKE_SOURCE_DIR}/../../vendor/arbiter" "vendor/arbiter")

add_subdirectory("${PROJECT_SOURCE_DIR}/../../vendor/arbiter" "vendor/arbiter")
find_package(PDAL REQUIRED)
endif(STANDALONE)


Expand Down Expand Up @@ -73,7 +73,7 @@ if (UNIX)
endif()


if (WITH_TESTS)
if (WITH_TESTS AND NOT STANDALONE)

PDAL_ADD_TEST(pdal_io_draco_writer_test
FILES
Expand Down
330 changes: 330 additions & 0 deletions plugins/draco/build/build.ninja

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion plugins/e57/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
cmake_minimum_required(VERSION 3.13)

if (STANDALONE)
include(../../cmake/standalone.cmake NO_POLICY_SCOPE)
find_package(PDAL REQUIRED)
include("${PROJECT_SOURCE_DIR}/../../cmake/standalone.cmake" )
endif(STANDALONE)


Expand Down
8 changes: 4 additions & 4 deletions plugins/hdf/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ cmake_minimum_required(VERSION 3.13)

if (STANDALONE)
project(pdal-hdf)
find_package(PDAL REQUIRED)
include("${CMAKE_SOURCE_DIR}/../../cmake/standalone.cmake" )
include("${CMAKE_CURRENT_LIST_DIR}/../../cmake/standalone.cmake" )
include(${PDAL_CMAKE_DIR}/arbiter.cmake)
include(${PDAL_CMAKE_DIR}/nlohmann.cmake)
include(${PDAL_CMAKE_DIR}/libxml2.cmake)
add_subdirectory("${CMAKE_SOURCE_DIR}/../../vendor/arbiter" "vendor/arbiter")
add_subdirectory("${PROJECT_SOURCE_DIR}/../../vendor/arbiter" "vendor/arbiter")
find_package(PDAL REQUIRED)
endif(STANDALONE)

#
Expand All @@ -33,7 +33,7 @@ PDAL_ADD_PLUGIN(libname reader hdf
${NLOHMANN_INCLUDE_DIR}
)

if (WITH_TESTS)
if (WITH_TESTS AND NOT STANDALONE)
PDAL_ADD_TEST(pdal_io_hdf_reader_test
FILES test/HdfReadertest.cpp
LINK_WITH ${libname}
Expand Down
7 changes: 3 additions & 4 deletions plugins/icebridge/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ cmake_minimum_required(VERSION 3.13)

if (STANDALONE)
project(pdal-icebridge)
find_package(PDAL REQUIRED)
include("${CMAKE_SOURCE_DIR}/../../cmake/standalone.cmake" )
include("${CMAKE_CURRENT_LIST_DIR}/../../cmake/standalone.cmake" )
include(${PDAL_CMAKE_DIR}/arbiter.cmake)
include(${PDAL_CMAKE_DIR}/nlohmann.cmake)
include(${PDAL_CMAKE_DIR}/libxml2.cmake)
add_subdirectory("${CMAKE_SOURCE_DIR}/../../vendor/arbiter" "vendor/arbiter")

add_subdirectory("${PROJECT_SOURCE_DIR}/../../vendor/arbiter" "vendor/arbiter")
find_package(PDAL REQUIRED)
endif(STANDALONE)

#
Expand Down
9 changes: 4 additions & 5 deletions plugins/nitf/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ cmake_minimum_required(VERSION 3.13)

if (STANDALONE)
project(pdal-nitf)
find_package(PDAL REQUIRED)
include("${CMAKE_SOURCE_DIR}/../../cmake/standalone.cmake" )
include("${CMAKE_CURRENT_LIST_DIR}/../../cmake/standalone.cmake" )
include(${PDAL_CMAKE_DIR}/arbiter.cmake)
include(${PDAL_CMAKE_DIR}/nlohmann.cmake)
add_subdirectory("${CMAKE_SOURCE_DIR}/../../vendor/arbiter" "vendor/arbiter")

add_subdirectory("${PROJECT_SOURCE_DIR}/../../vendor/arbiter" "vendor/arbiter")
find_package(PDAL REQUIRED)
endif(STANDALONE)

#
Expand Down Expand Up @@ -65,7 +64,7 @@ if (WIN32)
)
endif()

if (WITH_TESTS)
if (WITH_TESTS AND NOT STANDALONE)
PDAL_ADD_TEST(pdal_io_nitf_writer_test
FILES
test/NitfWriterTest.cpp
Expand Down
3 changes: 2 additions & 1 deletion plugins/openscenegraph/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ cmake_minimum_required(VERSION 3.13)

if (STANDALONE)
project(pdal-openscenegraph)
include(../../cmake/standalone.cmake NO_POLICY_SCOPE)
include("${CMAKE_CURRENT_LIST_DIR}/../../cmake/standalone.cmake" )
find_package(PDAL REQUIRED)
endif(STANDALONE)

#
Expand Down
7 changes: 3 additions & 4 deletions plugins/pgpointcloud/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ cmake_minimum_required(VERSION 3.13)

if (STANDALONE)
project(pdal-pgpointcloud)
find_package(PDAL REQUIRED)
include("${CMAKE_SOURCE_DIR}/../../cmake/standalone.cmake" )
include("${CMAKE_CURRENT_LIST_DIR}/../../cmake/standalone.cmake" )
include(${PDAL_CMAKE_DIR}/arbiter.cmake)
include(${PDAL_CMAKE_DIR}/nlohmann.cmake)
include(${PDAL_CMAKE_DIR}/libxml2.cmake)
add_subdirectory("${CMAKE_SOURCE_DIR}/../../vendor/arbiter" "vendor/arbiter")

add_subdirectory("${PROJECT_SOURCE_DIR}/../../vendor/arbiter" "vendor/arbiter")
find_package(PDAL REQUIRED)
endif(STANDALONE)

#
Expand Down
2 changes: 1 addition & 1 deletion plugins/rdb/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ cmake_minimum_required(VERSION 3.13)

if (STANDALONE)
project(pdal-rdb)
include("${CMAKE_CURRENT_LIST_DIR}/../../cmake/standalone.cmake" )
find_package(PDAL REQUIRED)
include("${CMAKE_SOURCE_DIR}/../../cmake/standalone.cmake" )
endif(STANDALONE)

find_package(rdb COMPONENTS REQUIRED)
Expand Down
4 changes: 2 additions & 2 deletions plugins/rxp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ cmake_minimum_required(VERSION 3.13)

if (STANDALONE)
project(pdal-rxp)
find_package(PDAL REQUIRED)
include("${CMAKE_SOURCE_DIR}/../../cmake/standalone.cmake" )
include("${CMAKE_CURRENT_LIST_DIR}/../../cmake/standalone.cmake" )
find_package(PDAL REQUIRED)
endif(STANDALONE)

set(RXP_TEST_NAME rxptest)
Expand Down
2 changes: 1 addition & 1 deletion plugins/teaser/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
cmake_minimum_required(VERSION 3.13)

if (STANDALONE)
find_package(PDAL REQUIRED)
include(../../cmake/standalone.cmake NO_POLICY_SCOPE)
find_package(PDAL REQUIRED)
endif(STANDALONE)

find_package(OpenMP QUIET REQUIRED)
Expand Down
6 changes: 3 additions & 3 deletions plugins/tiledb/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ cmake_minimum_required(VERSION 3.13)

if (STANDALONE)
project(pdal-tiledb)
find_package(PDAL REQUIRED)
include("${CMAKE_SOURCE_DIR}/../../cmake/standalone.cmake" )
include("${CMAKE_CURRENT_LIST_DIR}/../../cmake/standalone.cmake" )
include(${PDAL_CMAKE_DIR}/nlohmann.cmake)
find_package(PDAL REQUIRED)
endif(STANDALONE)

#
Expand Down Expand Up @@ -49,7 +49,7 @@ PDAL_ADD_PLUGIN(writer_libname writer tiledb
${NLOHMANN_INCLUDE_DIR}
)

if (WITH_TESTS)
if (WITH_TESTS AND NOT STANDALONE)

PDAL_ADD_TEST(pdal_io_tiledb_utils_test
FILES
Expand Down
4 changes: 2 additions & 2 deletions plugins/trajectory/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ cmake_minimum_required(VERSION 3.13)

if (STANDALONE)
project(pdal-trajectory)
find_package(PDAL REQUIRED)
include(../../cmake/standalone.cmake NO_POLICY_SCOPE)
include("${CMAKE_CURRENT_LIST_DIR}/../../cmake/standalone.cmake" NO_POLICY_SCOPE)
find_package(PDAL REQUIRED)
endif(STANDALONE)


Expand Down
17 changes: 17 additions & 0 deletions scripts/conda/standalone.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

mkdir build
cd build
echo "conda prefix" %CONDA_PREFIX%


cmake .. ^
-DSTANDALONE=ON ^
-DCMAKE_INSTALL_PREFIX="%CONDA_PREFIX%" ^
-DCMAKE_BUILD_TYPE=Release ^
-DPDAL_DIR="%CONDA_PREFIX%" ^
-DBUILD_PLUGIN_DRACO=ON ^
-G Ninja
REM ninja
REM ninja install


2 changes: 1 addition & 1 deletion vendor/utfcpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 3.0.2)
cmake_minimum_required(VERSION 3.13)
project (utf8cpp VERSION 3.2.2 LANGUAGES CXX)

if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
Expand Down

0 comments on commit 810b876

Please sign in to comment.