Skip to content

Commit

Permalink
move 'Building' section from from Readme.md to Install
Browse files Browse the repository at this point in the history
  • Loading branch information
zdenop committed Dec 8, 2024
1 parent f1edbd8 commit a837ef5
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 68 deletions.
70 changes: 55 additions & 15 deletions INSTALL
Original file line number Diff line number Diff line change
@@ -1,27 +1,67 @@
First, read the file PATENTS in the same directory as this file.
# Building

Fetch leptonica from its website (http://leptonica.com/) and build it.
For this you will also need the standard libtiff, libpng and libjpeg.
## Prerequisites

If you're running a Unix-like OS, such as Linux, BSD, Mac OS X or msys
just run:
* installed [Leptonica](http://www.leptonica.org/) including development parts
* installed [cmake](https://cmake.org/) or [autotools] (https://www.gnu.org/software/automake/manual/html_node/Autotools-Introduction.html)
* installed C++ compiller (gcc, clang, MSVC)
* installed [git](https://git-scm.com/)



## Unix-like OS

If you're running a Unix-like OS, such as Linux, BSD, Mac OS X or msys just run:

```
./autogen.sh
./configure
make
make install (or sudo make install)
```


## CMake

CMake requires CMake build installation of Leptonica


### Windows


*Note*: `cat`, `rm` and `dos2unix` tool are part of [git for windows](https://gitforwindows.org/). You can add them to your path with `set PATH=%PATH%;C:\Program Files\Git\usr\bin`. Adjust path `f:\win64` to your Leptonica installation.

```
"c:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat" x64
set INSTALL_DIR=f:\win64
set INCLUDE_DIR=f:\win64\include
set LIB_DIR=f:\win64\lib
set PATH=%PATH%;%INSTALL_DIR%\bin
```

### Configuration

```
git clone --depth 1 https://github.com/agl/jbig2enc
cmake -Bbuild -DCMAKE_INSTALL_PREFIX=%INSTALL_DIR% -DCMAKE_PREFIX_PATH=%INSTALL_DIR%
cmake --build build --config Release
```

### Install

```
cmake --build build --config Release --target install
```

### Uninstall

VC++ 2008 Notes
===============
```
cat build/install_manifest.txt | dos2unix | xargs rm

Download leptonica-1.68-win32-lib-include-dirs.zip from
http://leptonica.com/download.html and unpack it so 'include', 'lib' and
'jbig2enc' directories are at the same directory (or adjust include path
in VC++ project).
```

Download stdint.h for Microsoft Visual Studio (part of package
msinttypes-r26.zip from http://code.google.com/p/msinttypes/downloads/list)
and place it to 'include' directory.
### Clean

Them open vs2008/jbig2enc.sln in Visual C++ 2008 and build solution.
```
rm -r build/*
```
53 changes: 0 additions & 53 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,56 +46,3 @@ If you want to encode an image as jbig2 (can be view in [STDU Viewer](http://www
```
$ jbig2 -s images/feyn.tif >feyn.jb2
```


# Building

## Prerequisites

* installed [leptonica](http://www.leptonica.org/) including development parts
* installed [cmake](https://cmake.org/) or [autotools] (https://www.gnu.org/software/automake/manual/html_node/Autotools-Introduction.html)
* installed C++ compiller (gcc, clang, MSVC)
* installed [git](https://git-scm.com/)


## Cmake

### Windows


*Note*: `cat`, `rm` and `dos2unix` tool are part of [git for windows](https://gitforwindows.org/). You can add them to your path with `set PATH=%PATH%;C:\Program Files\Git\usr\bin`. Adjust path `f:\win64` to your leptonica installation.

```
"c:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat" x64
set INSTALL_DIR=f:\win64
set INCLUDE_DIR=f:\win64\include
set LIB_DIR=f:\win64\lib
set PATH=%PATH%;%INSTALL_DIR%\bin
```

### Configuration

```
git clone --depth 1 https://github.com/agl/jbig2enc
cmake -Bbuild -DCMAKE_INSTALL_PREFIX=%INSTALL_DIR% -DCMAKE_PREFIX_PATH=%INSTALL_DIR%
cmake --build build --config Release
```

### Install

```
cmake --build build --config Release --target install
```

### Uninstall

```
cat build/install_manifest.txt | dos2unix | xargs rm
```

### Clean

```
rm -r build/*
```

0 comments on commit a837ef5

Please sign in to comment.