forked from koreader/koreader-base
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[build] Unified CMake thirdparty/build dir
Just a passing thought, putting it up in a PR on GH for public archival/inspiration purposes or possibly to extend upon. This is a proof of concept of building in thirdparty/build/$(MACHINE) instead of thirdparty/build/$DEPENDENCY/$(MACHINE). That way instead of using the Makefile.third with a lot of complex variable passing to CMake etc. you'd keep the logic almost entirely in CMake (not implemented in this proof of concept), so you should be able to write things like `add_dependencies(mupdf zlib)`. Also the dist-clean command could be simplified to removing `THIRDPARTY_BUILD_DIR`. Or to put it another way, if you're using CMake you might as well actually use it, so that errors like koreader#865 can't occur.
- Loading branch information
Showing
5 changed files
with
33 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,4 +35,5 @@ build | |
|
||
kpvcrlib/build | ||
thirdparty/*/build | ||
thirdparty/build | ||
kodebug-* |
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
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,20 @@ | ||
PROJECT(koreader-base-thirdparty) | ||
cmake_minimum_required(VERSION 3.5.1) | ||
|
||
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_LIST_DIR}/cmake_modules") | ||
include("koreader_thirdparty_common") | ||
|
||
enable_language(C) | ||
|
||
assert_var_defined(CC) | ||
assert_var_defined(CFLAGS) | ||
assert_var_defined(LDFLAGS) | ||
|
||
message(STATUS "Thirdparty: zlib…") | ||
configure_file( | ||
${CMAKE_CURRENT_SOURCE_DIR}/zlib/CMakeLists.txt | ||
${CMAKE_BINARY_DIR}/zlib-src/CMakeLists.txt | ||
@ONLY) | ||
add_subdirectory("${CMAKE_BINARY_DIR}/zlib-src" | ||
"${CMAKE_BINARY_DIR}/zlib-build") | ||
message(STATUS "Thirdparty: zlib… DONE") |
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