Skip to content

Commit ba23c23

Browse files
committed
Add cmake scripts, update documents
1 parent 16322cf commit ba23c23

File tree

5 files changed

+58
-10
lines changed

5 files changed

+58
-10
lines changed

CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
cmake_minimum_required(VERSION 3.5)
2+
3+
project(ftn2xml VERSION 0.1.0)
4+
5+
find_package(podofo REQUIRED)
6+
7+
option(VERSION "Project version" ${CMAKE_PROJECT_VERSION})
8+
9+
add_subdirectory(src)

Fountain_Syntax.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ The official description of standard Fountain is available at [Fountain.io](http
2121
* Characters are in all upper case.
2222
- They may be forced with `@`
2323
- There may be a same-line parenthetical.
24+
- Trailing `^` indicates simultaneous or dual dialog.
2425
* Dialog speech follows Character or Parenthetical.
2526
* Parentheticals follow Character or Speech. They are surrounded with `(` and `)`.
2627
* Bold text is indicated with `**`

Readme.md

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Fountain Screenplay Processor
1+
# Fountain Screenplay Processor (`ftn2xml`)
22

33
This library converts Fountain screenplay documents into XML-style documents with tags that can be converted to other markup languages, like HTML or FDX. Some command-line utilities are provided to demonstrate use, including PDF conversion using PoDoFo.
44

@@ -19,21 +19,18 @@ A detailed description of standard Fountain is available at [Fountain.io](https:
1919

2020
## Usage (command line)
2121

22-
Basic command line utilities are provided:
22+
Some basic command line utilities are provided:
2323

2424
* `ftn2xml` – Convert to native XML-style format.
2525
* `ftn2html` – Convert to native HTML-style format.
2626
* `ftn2pdf` – Export to PDF using PoDoFo library.
2727
* `ftn2fdx` – Convert into Final Draft document.
2828

29-
To use:
29+
Use the binary or symlink that corresponds to the desired conversion.
3030

31-
1. Build by running `make` from within the `src` directory.
32-
2. Move the binary and symlinks into your `PATH`.
33-
3. Use the binary or symlink that corresponds to the desired conversion.
34-
* First argument is the fountain input file.
35-
* Second argument, if present, is the output file. Required for PDF output.
36-
* If only one argument is given, output is to `stdout`.
31+
* First argument is the fountain input file.
32+
* Second argument, if present, is the output file. Required for PDF output.
33+
* If only one argument is given, output is to `stdout`.
3734

3835
## Usage (source code)
3936

@@ -52,9 +49,19 @@ To use:
5249

5350
* Compiler that supports C++17 standard. Both `clang++` and `g++` seem to work.
5451
* [PoDoFo](https://github.com/podofo/podofo) for PDF export.
55-
- PoDoFo 0.9.x - use commit tagged [0.0.2](https://github.com/xiota/fountain-screenplay-processor/releases/tag/v0.0.2).
52+
- PoDoFo 0.9.x - use commit tagged [0.0.2](releases/tag/v0.0.2).
5653
- PoDoFo 0.10.x - requires [Courier Prime](https://quoteunquoteapps.com/courierprime/) to work around some font issues.
5754

55+
## Building
56+
57+
```bash
58+
git clone https://github.com/xiota/ftn2xml
59+
cmake -B build -S ftn2xml -DCMAKE_INSTALL_PREFIX=/usr
60+
cmake --build build
61+
DESTDIR=output cmake --install
62+
```
63+
64+
5865
## License
5966

6067
This software is licensed under the GPL-3.0-or-later.

src/CMakeLists.txt

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
add_executable(ftn2xml ftn2xml.cc)
2+
3+
configure_file(ftn2xml.h.in ftn2xml.h)
4+
5+
add_library(fountain fountain.cc auxiliary.cc)
6+
7+
target_link_libraries(ftn2xml fountain podofo)
8+
9+
target_include_directories(
10+
ftn2xml PUBLIC
11+
"${PROJECT_BINARY_DIR}"
12+
)
13+
14+
install(
15+
TARGETS ftn2xml
16+
DESTINATION "${CMAKE_INSTALL_PREFIX}/bin"
17+
)
18+
19+
file(CREATE_LINK ftn2xml "${CMAKE_CURRENT_BINARY_DIR}/ftn2fdx" SYMBOLIC)
20+
file(CREATE_LINK ftn2xml "${CMAKE_CURRENT_BINARY_DIR}/ftn2html" SYMBOLIC)
21+
file(CREATE_LINK ftn2xml "${CMAKE_CURRENT_BINARY_DIR}/ftn2pdf" SYMBOLIC)
22+
23+
install(
24+
FILES
25+
"${CMAKE_CURRENT_BINARY_DIR}/ftn2fdx"
26+
"${CMAKE_CURRENT_BINARY_DIR}/ftn2html"
27+
"${CMAKE_CURRENT_BINARY_DIR}/ftn2pdf"
28+
DESTINATION "${CMAKE_INSTALL_PREFIX}/bin"
29+
)

src/ftn2xml.h.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
#define FTN2XML_VERSION @VERSION@

0 commit comments

Comments
 (0)