Skip to content
This repository has been archived by the owner on Feb 25, 2023. It is now read-only.

Build in one step #3

Merged
merged 1 commit into from
Jun 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,23 @@
cmake_minimum_required(VERSION 3.5)
project(zero-epwing)
include_directories(eb)
link_directories(eb/eb/.libs jansson/lib)

include(ExternalProject)
ExternalProject_Add(
eb
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/eb
CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/eb/configure --disable-shared --disable-ebnet --disable-nls
PREFIX ${CMAKE_CURRENT_SOURCE_DIR}/eb
BUILD_COMMAND make
BUILD_IN_SOURCE 1
)
include_directories(eb ${CMAKE_BINARY_DIR})
option(JANSSON_EXAMPLES "" OFF)
option(JANSSON_BUILD_DOCS "" OFF)
option(JANSSON_WITHOUT_TESTS "" ON)
add_subdirectory(jansson)
link_directories(eb/eb/.libs ${CMAKE_BINARY_DIR}/jansson/lib)
add_executable(zero-epwing main.c book.c convert.c hooks.c)
add_dependencies(zero-epwing eb jansson)
target_link_libraries(zero-epwing libeb.a libz.a libjansson.a)
if (WIN32 OR APPLE)
target_link_libraries(zero-epwing libiconv.a)
Expand Down
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,15 @@ Prepare your development environment by making sure the following tools are set

Once your system is configured, follow the steps below to create builds:

1. Clone the repository by executing `git clone https://github.com/FooSoft/zero-epwing`.
2. Initialize the git submodules by executing `git submodule init`.
3. Pull down the submodule data by executing `git submodule update`.
4. Switch to the `eb` directory and execute `./configure --disable-shared --disable-ebnet --disable-nls`.
5. While still in the `eb` directory, build the modified library by executing `make`.
6. Switch to the `jansson` directory then execute `cmake .` and `make`.
7. From the project root directory, execute `cmake .` and `make`.
1. Clone the repository by executing
```
git clone --recurse-submodules https://github.com/FooSoft/zero-epwing
```
2. Prepare the project. From the project root directory, execute
```
cmake . -Bbuild && cmake --build build --
```
3. Find the executable in the `build` directory.

## Usage ##

Expand Down Expand Up @@ -108,4 +110,3 @@ GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.