-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update examples CMakeList configuration to allow for standalone build
- Loading branch information
1 parent
00488a8
commit 7ae9fbc
Showing
4 changed files
with
130 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
# Distributed under the OSI-approved BSD 3-Clause License. See LICENSE | ||
# file accompanying BAG source for details. | ||
|
||
#[=======================================================================[.rst: | ||
FindBAG | ||
------- | ||
Finds the BAG library. | ||
Imported Targets | ||
^^^^^^^^^^^^^^^^ | ||
This module provides the following imported targets, if found: | ||
The baglib library | ||
Result Variables | ||
^^^^^^^^^^^^^^^^ | ||
This will define the following variables: | ||
``BAG_FOUND`` | ||
True if the system has the BAG library. | ||
``BAG_VERSION`` | ||
The version of the BAG library which was found. | ||
``BAG_INCLUDE_DIRS`` | ||
Include directories needed to use BAG. | ||
``BAG_LIBRARIES`` | ||
Libraries needed to link to BAG. | ||
Cache Variables | ||
^^^^^^^^^^^^^^^ | ||
The following cache variables may also be set: | ||
``BAG_INCLUDE_DIR`` | ||
The directory containing ``bag_dataset.h``. | ||
``BAG_LIBRARY`` | ||
The path to the BAG library. | ||
#]=======================================================================] | ||
|
||
find_package(PkgConfig) | ||
pkg_check_modules(PC_BAG QUIET BAG) | ||
|
||
find_path(BAG_INCLUDE_DIR | ||
NAMES bag_dataset.h | ||
PATHS ${PC_BAG_INCLUDE_DIRS} | ||
PATH_SUFFIXES | ||
include | ||
include/bag | ||
include/BAG | ||
include/baglib | ||
) | ||
find_library(BAG_LIBRARY | ||
NAMES baglib | ||
PATHS ${PC_BAG_LIBRARY_DIRS} | ||
) | ||
|
||
set(BAG_VERSION ${PC_BAG_VERSION}) | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(BAG | ||
FOUND_VAR BAG_FOUND | ||
REQUIRED_VARS | ||
BAG_LIBRARY | ||
BAG_INCLUDE_DIR | ||
VERSION_VAR BAG_VERSION | ||
) | ||
|
||
if(BAG_FOUND) | ||
set(BAG_LIBRARIES ${BAG_LIBRARY}) | ||
set(BAG_INCLUDE_DIRS ${BAG_INCLUDE_DIR}) | ||
set(BAG_DEFINITIONS ${PC_BAG_CFLAGS_OTHER}) | ||
endif() | ||
|
||
mark_as_advanced( | ||
BAG_INCLUDE_DIR | ||
BAG_LIBRARY | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# BAG C++ Sample Programs | ||
|
||
## Building standalone | ||
First install libbaglib from the | ||
[conda-forge](https://anaconda.org/conda-forge/libbaglib). | ||
|
||
Then install the following additional conda-forge packages: | ||
```shell | ||
conda install -c conda-forge ninja gcc gxx | ||
``` | ||
|
||
Finally, build BAG examples (make sure you are in the `examples` sub-directory | ||
when running these commands: | ||
```shell | ||
export CC=gcc # Windows: set CC=gcc | ||
export CXX=g++ # Windows: set GXX=g++ | ||
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -B build -S . | ||
cmake --build build | ||
``` | ||
|
||
## sample-data | ||
Contains a sample XML file and a prebuild BAG file as trivial | ||
examples. | ||
|
||
## bag_read | ||
A sample reading of a Bag file. See the readme.txt file inside | ||
the sample-data directory for more information to test this | ||
program. | ||
|
||
## bag_create | ||
Creates a sample 10x10 row/column BAG file. See the readme.txt | ||
file inside the sample-data directory for more information on | ||
how to test this program. | ||
|
||
## bag_compoundlayer | ||
Creates and reads a GeorefMetadataLayer. | ||
|
||
## bag_vr_create | ||
Creates a variable resolution BAG. | ||
|
||
## bag_vr_read | ||
Reads a variable resolution BAG. |
This file was deleted.
Oops, something went wrong.