Skip to content

Commit c3617f0

Browse files
authored
Add install instructions (#135)
1 parent 4554f33 commit c3617f0

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

INSTALL_INSTRUCTIONS.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Install instructions for LibAPR.
2+
3+
The way to use it is configure it via some new APR_* variables (can be set to ON/OFF depending on needs) which describes what to build and if it should be installed through cmake commands:
4+
5+
APR_BUILD_STATIC_LIB=ON
6+
APR_BUILD_SHARED_LIB=OFF
7+
APR_INSTALL=ON
8+
(all other configuration possibilities are now in the top of CMakeLists.txt file)
9+
10+
so full command line would look like:
11+
12+
```
13+
mkdir build
14+
cd build
15+
cmake -DCMAKE_INSTALL_PREFIX=/tmp/APR -DAPR_INSTALL=ON -DAPR_BUILD_STATIC_LIB=ON -DAPR_BUILD_SHARED_LIB=OFF ..
16+
make
17+
make install
18+
```
19+
20+
To use APR the minimalistic CMakeLists.txt file would look like:
21+
22+
```
23+
cmake_minimum_required(VERSION 3.2)
24+
project(myAprProject)
25+
set(CMAKE_CXX_STANDARD 14)
26+
27+
#external libraries needed for APR
28+
find_package(HDF5 REQUIRED)
29+
find_package(TIFF REQUIRED)
30+
include_directories(${HDF5_INCLUDE_DIRS} ${TIFF_INCLUDE_DIR} )
31+
32+
find_package(APR REQUIRED)
33+
34+
add_executable(HelloAPR helloWorld.cpp)
35+
target_link_libraries(HelloAPR ${HDF5_LIBRARIES} ${TIFF_LIBRARIES} apr::staticLib)
36+
```
37+
38+
if shared version is preferred then apr::sharedLib should be used (and of course APR_BUILD_SHARED_LIB=ON during lib build step).
39+
40+
NOTICE: if APR is isntalled in not standard directory then some hint for cmake must be provided by adding install dir to CMAKE_PREFIX_PATH like for above example:
41+
42+
```
43+
export CMAKE_PREFIX_PATH=/tmp/APR:$CMAKE_PREFIX_PATH
44+
```

0 commit comments

Comments
 (0)