1 # CMAKE_CXX_STANDARD requires at least CMake 3.1.
2 cmake_minimum_required(VERSION 3.1)
7 set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
9 # C++ code requires C++11.
10 set(CMAKE_CXX_STANDARD 11)
11 set(CMAKE_CXX_EXTENSIONS false)
12 set(CMAKE_CXX_STANDARD_REQUIRED true)
14 # Libtermkey requires C99.
15 set(CMAKE_C_STANDARD 99)
16 set(CMAKE_C_EXTENSIONS false)
17 set(CMAKE_C_STANDARD_REQUIRED true)
19 # Find required libraries.
20 find_package(PkgConfig)
21 pkg_check_modules(PURPLE REQUIRED "purple >= 2.9.0")
22 pkg_check_modules(GLIB2 REQUIRED "glib-2.0 >= 2.32.0")
23 pkg_check_modules(SIGC REQUIRED "sigc++-2.0 >= 2.2.0")
24 pkg_check_modules(NCURSESW REQUIRED "ncursesw >= 5.8")
26 # Populate common include directories.
28 "${CMAKE_CURRENT_BINARY_DIR}"
29 "${CMAKE_CURRENT_SOURCE_DIR}")
31 # Handle localization.
34 message(SEND_ERROR "Iconv not found")
39 mark_as_advanced(GETTEXT_MSGFMT_EXECUTABLE)
40 mark_as_advanced(GETTEXT_MSGMERGE_EXECUTABLE)
42 if(Intl_FOUND AND GETTEXT_FOUND)
43 set(centerim5_LOCALEDIR "${CMAKE_INSTALL_PREFIX}/share/locale")
46 if(NOT Intl_FOUND AND NOT GETTEXT_FOUND)
47 set(missing_package "Intl and Gettext")
48 elseif(NOT Intl_FOUND)
49 set(missing_package "Intl")
51 set(missing_package "Gettext")
53 message(SEND_ERROR "${missing_package} not found, localization not possible")
57 # Produce documentation.
61 "Doxygen was not found, generating documentation for CppConsUI will not be "
64 if(NOT DOXYGEN_DOT_FOUND)
66 "Dot was not found, generating documentation for CppConsUI will not be "
70 # Checks for tools needed by the termex test framework. Only warn about these
71 # missing dependencies.
72 find_program(TIC_EXECUTABLE tic DOC "Path to a program.")
73 mark_as_advanced(TIC_EXECUTABLE)
74 find_package_handle_standard_args(Tic
75 REQUIRED_VARS TIC_EXECUTABLE)
76 if(NOT TIC_EXECUTABLE)
77 message(WARNING "Tic was not found, running tests will not be possible")
80 find_package(PythonInterp 3.5)
81 if(NOT PYTHONINTERP_FOUND)
83 "Suitable Python interpreter was not found, running tests will not be "
87 if(TIC_EXECUTABLE AND PYTHONINTERP_FOUND)
88 set(TERMEX_TESTS true)
90 set(TERMEX_TESTS false)
93 # Generate the config file.
94 set(centerim5_PKGLIBDIR "${CMAKE_INSTALL_PREFIX}/lib/centerim5")
95 execute_process(COMMAND misc/git-version-gen .tarball-version
96 WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
97 OUTPUT_VARIABLE centerim5_VERSION)
98 configure_file(config.h.cmake config.h)
100 install(FILES centerim5.1 DESTINATION share/man/man1)
102 add_subdirectory(cppconsui)
103 add_subdirectory(src)
104 add_subdirectory(tests EXCLUDE_FROM_ALL)
105 add_subdirectory(plugins)
107 add_subdirectory(doc)