3 # CMAKE_CXX_STANDARD requires at least CMake 3.1.
4 cmake_minimum_required(VERSION 3.1)
6 # C++ code requires C++11.
7 set(CMAKE_CXX_STANDARD 11)
8 set(CMAKE_CXX_EXTENSIONS false)
9 set(CMAKE_CXX_STANDARD_REQUIRED true)
11 # Libtermkey requires C99.
12 set(CMAKE_C_STANDARD 99)
13 set(CMAKE_C_EXTENSIONS false)
14 set(CMAKE_C_STANDARD_REQUIRED true)
16 # Find required libraries.
17 find_package(PkgConfig)
18 pkg_check_modules(PURPLE REQUIRED "purple >= 2.9.0")
19 pkg_check_modules(GLIB2 REQUIRED "glib-2.0 >= 2.32.0")
20 pkg_check_modules(SIGC REQUIRED "sigc++-2.0 >= 2.2.0")
21 pkg_check_modules(NCURSESW REQUIRED "ncursesw >= 5.8")
23 # Populate common include directories.
25 "${centerim5_BINARY_DIR}"
26 "${centerim5_SOURCE_DIR}")
28 # Handle translations.
30 mark_as_advanced(GETTEXT_MSGFMT_EXECUTABLE)
31 mark_as_advanced(GETTEXT_MSGMERGE_EXECUTABLE)
34 set(centerim5_LOCALEDIR "${CMAKE_INSTALL_PREFIX}/share/locale")
37 message(SEND_ERROR "Gettext not found, translation not possible")
41 # Produce documentation.
44 # Checks for tools needed by the termex test framework. Only warn about these
45 # missing dependencies.
46 find_program(TIC_EXECUTABLE tic DOC "Path to a program.")
47 mark_as_advanced(TIC_EXECUTABLE)
49 message(STATUS "Found tic: ${TIC_EXECUTABLE}")
51 message(WARNING "tic was not found, running tests will not be possible")
54 find_package(PythonInterp 3.5 QUIET)
55 if(PYTHONINTERP_FOUND)
57 "Found Python 3: ${PYTHON_EXECUTABLE} (found version \"${PYTHON_VERSION_STRING}\")")
60 "python >= 3.5 was not found, running tests will not be possible")
63 if(TIC_EXECUTABLE AND PYTHONINTERP_FOUND)
64 set(TERMEX_TESTS true)
66 set(TERMEX_TESTS false)
69 # Generate the config file.
70 set(centerim5_PKGLIBDIR "${CMAKE_INSTALL_PREFIX}/lib/centerim5")
71 execute_process(COMMAND misc/git-version-gen .tarball-version
72 WORKING_DIRECTORY "${centerim5_SOURCE_DIR}" OUTPUT_VARIABLE centerim5_VERSION)
73 configure_file(config.h.cmake config.h)
75 install(FILES centerim5.1 DESTINATION share/man/man1)
77 add_subdirectory(cppconsui)
79 add_subdirectory(tests EXCLUDE_FROM_ALL)
80 add_subdirectory(plugins)