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 # The extaction plugin 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")
25 pkg_check_modules(TERMKEY REQUIRED "termkey >= 0.18")
27 # Populate common include directories.
29 "${CMAKE_CURRENT_BINARY_DIR}"
30 "${CMAKE_CURRENT_SOURCE_DIR}")
32 # Handle localization.
35 message(SEND_ERROR "Iconv not found")
40 mark_as_advanced(GETTEXT_MSGFMT_EXECUTABLE)
41 mark_as_advanced(GETTEXT_MSGMERGE_EXECUTABLE)
43 if(Intl_FOUND AND GETTEXT_FOUND)
44 set(centerim5_LOCALEDIR "${CMAKE_INSTALL_PREFIX}/share/locale")
47 if(NOT Intl_FOUND AND NOT GETTEXT_FOUND)
48 set(missing_package "Intl and Gettext")
49 elseif(NOT Intl_FOUND)
50 set(missing_package "Intl")
52 set(missing_package "Gettext")
54 message(SEND_ERROR "${missing_package} not found, localization not possible")
58 # Produce documentation.
62 "Doxygen was not found, generating documentation for CppConsUI will not be "
65 if(NOT DOXYGEN_DOT_FOUND)
67 "Dot was not found, generating documentation for CppConsUI will not be "
71 # Checks for tools needed by the termex test framework. Only warn about these
72 # missing dependencies.
73 find_program(TIC_EXECUTABLE tic DOC "Path to a program.")
74 mark_as_advanced(TIC_EXECUTABLE)
75 find_package_handle_standard_args(Tic
76 REQUIRED_VARS TIC_EXECUTABLE)
77 if(NOT TIC_EXECUTABLE)
78 message(WARNING "Tic was not found, running tests will not be possible")
81 find_package(PythonInterp 3.5)
82 if(NOT PYTHONINTERP_FOUND)
84 "Suitable Python interpreter was not found, running tests will not be "
88 if(TIC_EXECUTABLE AND PYTHONINTERP_FOUND)
89 set(TERMEX_TESTS true)
91 set(TERMEX_TESTS false)
94 # Generate the config file.
95 set(centerim5_PKGLIBDIR "${CMAKE_INSTALL_PREFIX}/lib/centerim5")
96 execute_process(COMMAND misc/git-version-gen .tarball-version
97 WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
98 OUTPUT_VARIABLE centerim5_VERSION)
99 configure_file(config.h.cmake config.h)
101 install(FILES centerim5.1 DESTINATION share/man/man1)
103 add_subdirectory(cppconsui)
104 add_subdirectory(src)
105 add_subdirectory(tests EXCLUDE_FROM_ALL)
106 add_subdirectory(plugins)
108 add_subdirectory(doc)