How to get the external library (PDAL) running?

Hello,

having problems setting up a console program using the external library pdal (www.pdal.io)
What I did:

New Project, Hello-World main, which runs.

Adding pdal-includes like:
 
  #include <pdal/Reader.hpp> 


In CodeBlocks:
Added the header and source code files recursively from the pdal dir.
pdal/pdal
pdal/io
pdal/filters
pdal/kernal
pdal/plugins
pdal/vendor

Results building it:
1
2
/home/patrick/unifr/pdal/pdal/Stage.hpp|39|fatal error: pdal/Dimension.hpp: No 
such file or directory|


When I try it with cmake (according to the toturial on pdal.io/dev/cmake)
Added a CMakeLists.txt in the project root folder with:
1
2
3
4
5
6
7
8
9
10
11
12
cmake_minimum_required(VERSION 3.5)

project(PDAL VERSION 2.0.0 LANGUAGES CXX C)
string(TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWER)

include_directories(${PDAL_INCLUDE_DIRS})
link_directories(${PDAL_LIBRARY_DIRS})

add_definitions(${PDAL_DEFINITIONS})
set(CMAKE_CXX_FLAGS "-std=c++11")
add_executable(pdal_console main.cpp)
target_link_libraries(pdal_console PRIVATE ${PDAL_LIBRARIES})

(Added the line "include_directories(${/home/patrick/unifr/pdal/})")

which results in: (cmake ok), make:
1
2
/home/patrick/unifr/PDALConsole/main.cpp:3:10: fatal error: pdal/Reader.hpp: No such file or directory
 #include "pdal/Reader.hpp" 


I cloned the pdal source code from git.
My directories look as the following:

code root:
/home/patrick/unifr/


/home/patrick/unifr/PDALConsole/ <- my project with a main.cpp
/home/patrick/unifr/pdal/ <-pdal library header/source code

So what I am doing wrong? Problems seems to be connected in telling the compiler where the find the pdal files. I thought the line include_directories($PDAL..) should do the job, I even tried to add the absolute dir path (which didn't help either and should be done, no absolute paths).
I am not used to develop c++ with external source code. Did I do it correct with the pdal-source code .. is that how it is supposed to be done?
(I am in the field of developing quite a lot but not in C++)

My goal is to have an application which used the pdal library for reading and processing point clouds.

Used: ubuntu, CodeBlocks/cmake

Greetings,
Rick
PDAL_INCLUDE_DIRS

What is the value of that? Where is it written?
Thanks for the reply.

When I add:
message(status, ${PDAL_INCLUDE_DIRS})
Result is:
status,
Seems like it is empty, which explains why the files are not found.

When I check PDAL_FOUND, it is empty too.

According to the tutorial ( https://pdal.io/development/cmake.html ) I thought cmake fills in the variables, as the find_package requires pdal to be there.

So how can I add the dir to that variable, or even better, let it cmake do? The pdal package somehow needs to be known by cmake?
I'm no CMake expert, but what you're asking is something like "how do I set a Cmake variable"

If you put that into Google, you'll get a lot of pages purporting to explain it.
Ah, ja, I can do that, and I did, with the same result as in adding the library dir
include_directories(${/home/patrick/unifr/pdal/}):

1
2
3
4
5
6
7
8
9
10
11
12
In file included from /home/patrick/unifr/pdal/pdal/Reader.hpp:37:0,
                 from /home/patrick/unifr/PDALConsole/main.cpp:3:
/home/patrick/unifr/pdal/pdal/Stage.hpp:39:10: fatal error: pdal/Dimension.hpp: No such file or directory
 #include <pdal/Dimension.hpp>
          ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
CMakeFiles/pdal_console.dir/build.make:62: recipe for target 'CMakeFiles/pdal_console.dir/main.cpp.o' failed
make[2]: *** [CMakeFiles/pdal_console.dir/main.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/pdal_console.dir/all' failed
make[1]: *** [CMakeFiles/pdal_console.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2


The file Dimension.hpp cannot be found here or online at github.com/PDAL/PDAL.
Sounds like it is a problem I need to ask them directly. Will come back with further information, thanks for the help so far.
Topic archived. No new replies allowed.