diff options
author | Přemysl Janouch <p.janouch@gmail.com> | 2014-10-14 22:53:53 +0200 |
---|---|---|
committer | Přemysl Janouch <p.janouch@gmail.com> | 2014-11-19 03:31:46 +0100 |
commit | b352a0fc8d49536322ffffa3b2d16d135d9a7996 (patch) | |
tree | 12cf01a52ebc99d860583a3415fd0e959c51f39b /CMakeLists.txt | |
parent | a3348d888b14d76da86a6f8dde8f4dc075ccf6b1 (diff) | |
download | tdv-b352a0fc8d49536322ffffa3b2d16d135d9a7996.tar.gz tdv-b352a0fc8d49536322ffffa3b2d16d135d9a7996.tar.xz tdv-b352a0fc8d49536322ffffa3b2d16d135d9a7996.zip |
Rewrite to use termo
Also get rid of some silliness that I'm only able to see now.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index b9fed6c..9612bfe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,6 +8,9 @@ if ("${CMAKE_C_COMPILER_ID}" MATCHES "GNU" OR CMAKE_COMPILER_IS_GNUC) "${CMAKE_C_FLAGS_DEBUG} -Wall -Wextra -Wno-missing-field-initializers") endif ("${CMAKE_C_COMPILER_ID}" MATCHES "GNU" OR CMAKE_COMPILER_IS_GNUC) +# Build options +option (USE_SYSTEM_TERMO "Don't compile our own termo, use the system one" OFF) + # Version set (project_VERSION_MAJOR "0") set (project_VERSION_MINOR "1") @@ -21,13 +24,27 @@ set (project_VERSION "${project_VERSION}.${project_VERSION_PATCH}") include (CheckFunctionExists) CHECK_FUNCTION_EXISTS ("wcwidth" HAVE_WCWIDTH) -# Dependecies +# Dependencies find_package (ZLIB REQUIRED) - find_package (PkgConfig REQUIRED) pkg_check_modules (dependencies REQUIRED ncursesw glib-2.0 gio-2.0 pango) -include_directories (${ZLIB_INCLUDE_DIRS} ${dependencies_INCLUDE_DIRS}) +if (USE_SYSTEM_TERMO) + find_package (Termo REQUIRED) +else (USE_SYSTEM_TERMO) + add_subdirectory (termo EXCLUDE_FROM_ALL) + # We don't have many good choices when we don't want to install it and want + # to support older versions of CMake; this is a relatively clean approach + # (other possibilities: setting a variable in the parent scope, using a + # cache variable, writing a special config file with build paths in it and + # including it here, or setting a custom property on the targets). + get_directory_property (Termo_INCLUDE_DIRS + DIRECTORY termo INCLUDE_DIRECTORIES) + set (Termo_LIBRARIES termo-static) +endif (USE_SYSTEM_TERMO) + +include_directories (${ZLIB_INCLUDE_DIRS} + ${dependencies_INCLUDE_DIRS} ${Termo_INCLUDE_DIRS}) # Localization find_package (Gettext REQUIRED) @@ -76,7 +93,8 @@ set (project_common_headers src/utils.h) # Project libraries -set (project_common_libraries ${ZLIB_LIBRARIES} ${dependencies_LIBRARIES}) +set (project_common_libraries + ${ZLIB_LIBRARIES} ${dependencies_LIBRARIES} termo-static) # Create a common project library so that source files are only compiled once if (${CMAKE_VERSION} VERSION_GREATER "2.8.7") |