diff options
author | Alexis Hildebrandt <afh@surryhill.net> | 2015-01-11 12:10:00 +0100 |
---|---|---|
committer | Alexis Hildebrandt <afh@surryhill.net> | 2015-01-12 10:50:44 +0100 |
commit | 1d7dd3e082be8a046f21d4a2d51026ac3c1f7c14 (patch) | |
tree | 0e9dd4165ac65d7b7c8fec8fa0ceb23bd57ee9e1 /CMakeLists.txt | |
parent | cc0b32d9bc26f9345de3d89b540841bc2b8ad593 (diff) | |
download | fork-ledger-1d7dd3e082be8a046f21d4a2d51026ac3c1f7c14.tar.gz fork-ledger-1d7dd3e082be8a046f21d4a2d51026ac3c1f7c14.tar.bz2 fork-ledger-1d7dd3e082be8a046f21d4a2d51026ac3c1f7c14.zip |
[cmake] Add FindUtfcpp.cmake
it will look for utfcpp in the standard system paths, UTFCPP_PATH,
and lib/utfcpp/v2_0/source.
This allows the use of utfcpp in:
* standard locations such as /usr/include on distributions shipping
utfcpp
* custom locations for users via UTFCPP_PATH
* the source tree using the default location of the utfcpp
git submodule, .i.e lib/utfcpp/v2_0
Signed-off-by: Alexis Hildebrandt <afh@surryhill.net>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 285b7b6b..538a26c6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,6 +11,9 @@ set(Ledger_VERSION_MINOR 1) set(Ledger_VERSION_PATCH 0) set(Ledger_VERSION_DATE 20141005) +# Point CMake at any custom modules we may ship +list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake") + enable_testing() add_definitions(-std=c++11) @@ -236,13 +239,20 @@ endmacro(add_ledger_library_dependencies _target) ######################################################################## +include(FindUtfcpp) +if (UTFCPP_FOUND) + include_directories("${UTFCPP_INCLUDE_DIR}") +else() + message(FATAL_ERROR "Missing required header file: utf8.h\n" + "Define UTFCPP_PATH or install utfcpp locally into the source tree below lib/utfcpp/." + ) +endif() + set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}) # add the binary tree to the search path for include files so that we will -# find TutorialConfig.h -include_directories("${PROJECT_SOURCE_DIR}/lib") -include_directories("${PROJECT_SOURCE_DIR}/lib/utfcpp/v2_0/source") +# find system.hh include_directories("${PROJECT_BINARY_DIR}") configure_file( |