CMakeLists.txt 14.9 KB
Newer Older
1
CMAKE_MINIMUM_REQUIRED(VERSION 3.1.0)
2 3 4 5 6 7 8 9 10 11 12 13

# First, check is the compiler is new enough, most version of Clang are fine
# until problems arise, checking for GCC is enough
IF (CMAKE_COMPILER_IS_GNUCC)
   EXECUTE_PROCESS(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
   IF (GCC_VERSION VERSION_GREATER 4.8 OR GCC_VERSION VERSION_EQUAL 4.8)
      MESSAGE(STATUS "Found GCC version >= 4.8: " ${GCC_VERSION})
   ELSE()
      MESSAGE(FATAL_ERROR "Your version of GCC is too old, please install GCC 4.8 or later")
   ENDIF()
ENDIF()

14
set (CMAKE_CXX_STANDARD 14)
15

16
# set project name and version
17
PROJECT(jami-client-gnome)
18 19 20 21 22 23

IF(EXISTS "${PROJECT_SOURCE_DIR}/version.txt")
   FILE (STRINGS "version.txt" PROJECT_VERSION)
ELSE()
   SET (PROJECT_VERSION "development")
ENDIF()
24

25 26 27 28
# set build date
IF( NOT ("$ENV{SOURCE_DATE_EPOCH}" STREQUAL ""))
  EXECUTE_PROCESS(
    COMMAND date -u -d "1970-01-01 UTC $ENV{SOURCE_DATE_EPOCH} seconds" "+%Y-%m-%d %H:%M:%S UTC"
29
    OUTPUT_VARIABLE CLIENT_BUILD_DATE
30 31
    OUTPUT_STRIP_TRAILING_WHITESPACE
    )
32
ELSEIF( "${CLIENT_BUILD_DATE}" STREQUAL "")
33 34
  EXECUTE_PROCESS(
    COMMAND date -u "+%Y-%m-%d %H:%M:%S UTC"
35
    OUTPUT_VARIABLE CLIENT_BUILD_DATE
36 37 38 39
    OUTPUT_STRIP_TRAILING_WHITESPACE
    )
ENDIF()

40 41 42
# add the binary tree to the search path for include files
# so that we will find config.h
INCLUDE_DIRECTORIES("${PROJECT_BINARY_DIR}")
43

44 45
LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")

46
# include custom cmake modules
47
INCLUDE(${CMAKE_SOURCE_DIR}/cmake/GResources.cmake)
48
INCLUDE(${CMAKE_SOURCE_DIR}/cmake/GSettings.cmake)
49 50 51 52 53 54 55

# make sure we're using Qt5
SET(ENABLE_QT5 true)

# for now, set debug as default
SET(CMAKE_BUILD_TYPE Debug)

56
# during packaging the CMAKE_INSTALL_PREFIX is used to specify where to install the files, but it
57
# may not be the same as where the package will put them, use JAMI_INSTALL_PREFIX to let the client
58
# know at runtime where to expect installed files to be located
59
SET(JAMI_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}
60 61 62
  CACHE PATH "prefix where the package will be installed on the user's system (eg: /usr/local); defaults to the CMAKE_INSTALL_PREFIX"
)

63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
# Check if LRC's location is manually specified with -DLibRingClient_PROJECT_DIR
IF(LibRingClient_PROJECT_DIR)
   SET(LIB_RING_CLIENT_INCLUDE_DIR ${LibRingClient_PROJECT_DIR}/src)
   # TODO: maybe allow a way to specify a different build dir
   SET(LIB_RING_LIBRARY_INCLUDE_DIR ${LibRingClient_PROJECT_DIR}/build)

   # check for the existence of the directories;
   # if the dirs have missing or outdated files then we will just get build/link errors
   IF(EXISTS "${LIB_RING_CLIENT_INCLUDE_DIR}/")
      MESSAGE("will expect lrc headers in ${LIB_RING_CLIENT_INCLUDE_DIR}")
      IF(EXISTS "${LIB_RING_LIBRARY_INCLUDE_DIR}/")
         MESSAGE("will expect lrc libraries in " ${LIB_RING_LIBRARY_INCLUDE_DIR})
         SET(LibRingClient_FOUND true)
         SET(LIB_RING_CLIENT_LIBRARY ringclient)
      ELSE()
         MESSAGE( FATAL_ERROR "${LIB_RING_LIBRARY_INCLUDE_DIR} does not exist")
      ENDIF(EXISTS "${LIB_RING_LIBRARY_INCLUDE_DIR}/")
   ELSE()
      MESSAGE( FATAL_ERROR "${LIB_RING_CLIENT_INCLUDE_DIR} does not exist")
   ENDIF(EXISTS "${LIB_RING_CLIENT_INCLUDE_DIR}/")
ELSE(LibRingClient_PROJECT_DIR)
   FIND_PACKAGE(LibRingClient REQUIRED)
ENDIF(LibRingClient_PROJECT_DIR)

87 88 89
# find packages
FIND_PACKAGE(PkgConfig REQUIRED)
PKG_CHECK_MODULES(GTK3 REQUIRED gtk+-3.0>=3.10)
90
PKG_CHECK_MODULES(GLIB REQUIRED glib-2.0>=2.40)
91
FIND_PACKAGE(Qt5Core REQUIRED)
92 93
PKG_CHECK_MODULES(CLUTTER REQUIRED clutter-1.0)
PKG_CHECK_MODULES(CLUTTERGTK REQUIRED clutter-gtk-1.0)
94
PKG_CHECK_MODULES(LIBNOTIFY libnotify>=0.7.6) #optional
95 96 97
IF( LIBNOTIFY_FOUND )
    pkg_check_modules(CANBERRA REQUIRED libcanberra-gtk3>=0.25)
ENDIF()
98
FIND_PACKAGE(Gettext) #optional for translations
aviau's avatar
aviau committed
99
PKG_CHECK_MODULES(LIBQRENCODE libqrencode>=3.4)
Lubomir Rintel's avatar
Lubomir Rintel committed
100
PKG_CHECK_MODULES(LIBNM libnm>=1.0) #optional to detect changes in the network
aviau's avatar
aviau committed
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117

# Both appindicators are optional. ayatana-appindicator is better
# maintained and it works best across all desktop environments.
PKG_CHECK_MODULES(APPINDICATOR ayatana-appindicator3-0.1)
IF( APPINDICATOR_FOUND )
    SET(HAVE_AYATANAAPPINDICATOR 1)
    SET(HAVE_APPINDICATOR 1)
ELSE()
    PKG_CHECK_MODULES(APPINDICATOR appindicator3-0.1)
    IF( APPINDICATOR_FOUND )
        SET(HAVE_AYATANAAPPINDICATOR 0)
        SET(HAVE_APPINDICATOR 1)
    ELSE()
        SET(HAVE_AYATANAAPPINDICATOR 0)
        SET(HAVE_APPINDICATOR 0)
    ENDIF()
ENDIF()
aviau's avatar
aviau committed
118

aviau's avatar
aviau committed
119
PKG_CHECK_MODULES(WEBKIT webkit2gtk-4.0)
120
IF(NOT WEBKIT_FOUND)
aviau's avatar
aviau committed
121 122 123
    PKG_CHECK_MODULES(WEBKIT REQUIRED webkit2gtk-3.0)
ENDIF()

124 125 126
# include libs
INCLUDE_DIRECTORIES(${GTK3_INCLUDE_DIRS})
INCLUDE_DIRECTORIES(${LIB_RING_CLIENT_INCLUDE_DIR})
127
INCLUDE_DIRECTORIES(SYSTEM ${Qt5Core_INCLUDE_DIRS} )
128 129
INCLUDE_DIRECTORIES(${CLUTTER_INCLUDE_DIRS})
INCLUDE_DIRECTORIES(${CLUTTERGTK_INCLUDE_DIRS})
130
INCLUDE_DIRECTORIES(${LIBNOTIFY_INCLUDE_DIRS})
131
INCLUDE_DIRECTORIES(${APPINDICATOR_INCLUDE_DIRS})
132
INCLUDE_DIRECTORIES(${LIBNM_INCLUDE_DIRS})
aviau's avatar
aviau committed
133
INCLUDE_DIRECTORIES(${WEBKIT_INCLUDE_DIRS})
134
INCLUDE_DIRECTORIES(${CANBERRA_INCLUDE_DIRS})
135 136 137

# link libs
LINK_DIRECTORIES(${GTK3_LIBRARY_DIRS})
138 139 140 141
LINK_DIRECTORIES(${LIB_RING_LIBRARY_INCLUDE_DIR})
LINK_DIRECTORIES(${Qt5Core_LIBRARY_DIRS} )
LINK_DIRECTORIES(${CLUTTER_LIBRARY_DIRS})
LINK_DIRECTORIES(${CLUTTERGTK_LIBRARY_DIRS})
142
LINK_DIRECTORIES(${LIBNOTIFY_LIBRARY_DIRS})
143
LINK_DIRECTORIES(${APPINDICATOR_LIBRARY_DIRS})
144
LINK_DIRECTORIES(${LIBNM_LIBRARY_DIRS})
aviau's avatar
aviau committed
145
LINK_DIRECTORIES(${WEBKIT_LIBRARY_DIRS})
146
LINK_DIRECTORIES(${CANBERRA_LIBRARY_DIRS})
147

148 149
# lib compiler flags
ADD_DEFINITIONS(${GTK3_CFLAGS})
150
ADD_DEFINITIONS(${GTK3_CFLAGS_OTHER})
151 152 153 154
ADD_DEFINITIONS(${LIB_RING_LIBRARY_CFLAGS})
ADD_DEFINITIONS(${Qt5Core_CFLAGS})
ADD_DEFINITIONS(${CLUTTER_CFLAGS})
ADD_DEFINITIONS(${CLUTTERGTK_CFLAGS})
155
ADD_DEFINITIONS(${LIBNOTIFY_CFLAGS})
156
ADD_DEFINITIONS(${APPINDICATOR_CFLAGS})
157
ADD_DEFINITIONS(${LIBNM_CFLAGS})
aviau's avatar
aviau committed
158
ADD_DEFINITIONS(${WEBKIT_CFLAGS})
159
ADD_DEFINITIONS(${CANBERRA_CFLAGS})
160

161 162 163 164 165 166 167 168 169
IF(NOT ${ENABLE_STATIC} MATCHES false)
  SET(QT5_MODULE_PATH ${QT5_PATH}/lib/cmake)
  FIND_PACKAGE(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED Core DBus)
  FIND_PACKAGE(Qt5DBus REQUIRED)
  INCLUDE_DIRECTORIES(SYSTEM ${Qt5DBus_INCLUDE_DIRS} )
  LINK_DIRECTORIES(${Qt5DBus_LIBRARY_DIRS} )
  ADD_DEFINITIONS(${Qt5DBus_CFLAGS})
ENDIF()

170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228
# warnings
ADD_DEFINITIONS(
   -Wall
   -Wextra
   -Wno-cpp
   -Wmissing-noreturn
   -Wpointer-arith
   -Wcast-align
   -Wwrite-strings
   -Wformat-nonliteral
   -Wformat-security
   -Wswitch-enum
   -Winit-self
   -Wmissing-include-dirs
   -Wundef
   -Wmissing-format-attribute
   -Wno-reorder
   -Wunused
   -Wuninitialized
   -Woverloaded-virtual
   -Wsuggest-attribute=const
   -Wunused-value
   -Wdouble-promotion
   -Wnonnull
   -Wsequence-point
   -Wunused-but-set-parameter
   -Wsizeof-pointer-memaccess
   -Wvarargs
)

# more warnings
IF (CMAKE_COMPILER_IS_GNUCC)
   IF (GCC_VERSION VERSION_GREATER 4.9 OR GCC_VERSION VERSION_EQUAL 4.9)
      ADD_DEFINITIONS(
         -Wconditionally-supported
         -Wdate-time
         -Wdelete-incomplete
         -Wfloat-conversion
      )
   ENDIF()

   IF (GCC_VERSION VERSION_GREATER 5.0 OR GCC_VERSION VERSION_EQUAL 5.0)
      ADD_DEFINITIONS(
         -Wsuggest-override
         -Wsuggest-final-types
         -Wsuggest-final-methods
         -Wbool-compare
         -Wformat-signedness
         -Wlogical-not-parentheses
         -Wnormalized
         -Wshift-count-negative
         -Wshift-count-overflow
         -Wsized-deallocation
         -Wsizeof-array-argument
      )
   ENDIF()

ENDIF()

229 230 231 232 233 234 235 236 237
# get git version on every build
SET(GIT_REVISION_INPUT_FILE ${PROJECT_SOURCE_DIR}/src/revision.h.in)
SET(GIT_REVISION_OUTPUT_FILE ${PROJECT_BINARY_DIR}/revision.h)

ADD_CUSTOM_TARGET(
   git_revision ALL
   COMMAND ${CMAKE_COMMAND}
      -DGIT_REVISION_INPUT_FILE=${GIT_REVISION_INPUT_FILE}
      -DGIT_REVISION_OUTPUT_FILE=${GIT_REVISION_OUTPUT_FILE}
238
      -DCLIENT_BUILD_DATE=${CLIENT_BUILD_DATE}
239 240 241 242 243 244 245 246 247
      -P ${CMAKE_SOURCE_DIR}/cmake/GitRevision.cmake
   COMMENT "generating ${GIT_REVISION_OUTPUT_FILE}"
)

ADD_CUSTOM_COMMAND(
   OUTPUT ${GIT_REVISION_OUTPUT_FILE}
   DEPENDS git_revision
)

248 249 250
# source files to compile
SET( SRC_FILES
   src/main.cpp
251 252 253 254 255 256
   src/client.h
   src/client.cpp
   src/client_options.h
   src/client_options.c
   src/mainwindow.h
   src/mainwindow.cpp
257 258
   src/incomingcallview.h
   src/incomingcallview.cpp
259 260
   src/currentcallview.h
   src/currentcallview.cpp
261 262 263 264
   src/models/gtkaccessproxymodel.h
   src/models/gtkaccessproxymodel.cpp
   src/models/gtkqtreemodel.h
   src/models/gtkqtreemodel.cpp
265
   src/utils/drawing.h
266
   src/utils/drawing.cpp
267 268
   src/video/video_widget.h
   src/video/video_widget.cpp
aviau's avatar
aviau committed
269 270 271 272
   src/accountcreationwizard.h
   src/accountcreationwizard.cpp
   src/accountmigrationview.h
   src/accountmigrationview.cpp
273 274
   src/usernameregistrationbox.h
   src/usernameregistrationbox.cpp
275 276
   src/models/activeitemproxymodel.h
   src/models/activeitemproxymodel.cpp
277
   src/defines.h
278 279
   src/video/xrectsel.h
   src/video/xrectsel.c
280 281
   src/dialogs.h
   src/dialogs.c
282 283
   src/mediasettingsview.h
   src/mediasettingsview.cpp
284 285
   src/newaccountsettingsview.h
   src/newaccountsettingsview.cpp
286 287
   src/generalsettingsview.h
   src/generalsettingsview.cpp
288 289
   src/native/pixbufmanipulator.h
   src/native/pixbufmanipulator.cpp
290 291
   src/utils/models.h
   src/utils/models.cpp
292 293
   src/notifier.h
   src/notifier.cpp
294 295
   src/utils/files.h
   src/utils/files.cpp
296
   ${GIT_REVISION_OUTPUT_FILE}
297 298
   src/native/dbuserrorhandler.h
   src/native/dbuserrorhandler.cpp
299 300
   src/welcomeview.h
   src/welcomeview.cpp
aviau's avatar
aviau committed
301 302
   src/webkitchatcontainer.h
   src/webkitchatcontainer.cpp
303
   src/chatview.h
304 305
   src/messagingwidget.h
   src/messagingwidget.cpp
306
   src/chatview.cpp
307 308
   src/avatarmanipulation.h
   src/avatarmanipulation.cpp
309 310
   src/cc-crop-area.h
   src/cc-crop-area.c
311 312
   src/conversationsview.h
   src/conversationsview.cpp
313 314
   src/conversationpopupmenu.h
   src/conversationpopupmenu.cpp
315
   src/accountinfopointer.h
316 317
   src/profileview.h
   src/profileview.cpp
318 319 320
   # Generated marshals
   src/marshals.h
   src/marshals.cpp
321 322
)

323 324 325 326
# compile glib resource files to c code
GLIB_COMPILE_RESOURCES( GLIB_RESOURCES_RING
   SOURCE
      pixmaps/pixmaps.gresource.xml
327
      ui/ui.gresource.xml
aviau's avatar
aviau committed
328
      web/web.gresource.xml
329
      sounds/sounds.gresource.xml
330 331
)

332 333 334 335 336
# IF(${ENABLE_TEST} MATCHES true)
#    ADD_SUBDIRECTORY( src/test)
# ENDIF()

# for translations
337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360
IF (GETTEXT_FOUND)

  # get all translation files; they're expected to be named using the following convention:
  # '<lang code>[_<country code].po'
  # eg: fr_CA.po (the country code is optional)
  FILE(GLOB PO_FILES ${CMAKE_SOURCE_DIR}/po/*.po)

  # Install each of the translation files
  FOREACH(PO_FILE IN LISTS PO_FILES)
    # extract the language (and optional country code) from the filename
    GET_FILENAME_COMPONENT(LANG ${PO_FILE} NAME_WE)
    GETTEXT_PROCESS_PO_FILES(${LANG} ALL PO_FILES ${PO_FILE})

    SET(TRANSLATIONS_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/share/locale/${LANG}/LC_MESSAGES)

    # install to share/locale and rename each to ring-client-gnome.mo
    INSTALL(
      FILES ${PROJECT_BINARY_DIR}/${LANG}.gmo
      DESTINATION ${TRANSLATIONS_INSTALL_DIR}
      RENAME ${PROJECT_NAME}.mo
    )
  ENDFOREACH(PO_FILE)

ENDIF(GETTEXT_FOUND)
361

362
# install and compile glib gsettings schema
363
add_schema("net.jami.Jami.gschema.xml" GSCHEMA_RING)
364

365
ADD_EXECUTABLE(jami-gnome ${GLIB_RESOURCES_RING} ${GSCHEMA_RING} ${SRC_FILES})
366

367
IF(NOT ${ENABLE_STATIC} MATCHES false)
368
TARGET_LINK_LIBRARIES(jami-gnome
369 370
   ${LIB_RING_CLIENT_LIBRARY}
   ${GTK3_LIBRARIES}
371 372
   ${Qt5Core_LIBRARIES}
   ${Qt5DBus_LIBRARIES}
373
   ${CLUTTER_LIBRARIES}
374
   ${CLUTTERGTK_LIBRARIES}
375
   ${LIBNOTIFY_LIBRARIES}
376
   ${APPINDICATOR_LIBRARIES}
377
   ${LIBNM_LIBRARIES}
aviau's avatar
aviau committed
378
   ${WEBKIT_LIBRARIES}
379
   ${LIBQRENCODE_LIBRARIES}
380
   ${CANBERRA_LIBRARIES}
381 382 383 384
   -lpthread
   -lrt
   )
ELSE()
385
TARGET_LINK_LIBRARIES(jami-gnome
386 387 388 389 390
   ${LIB_RING_CLIENT_LIBRARY}
   ${GTK3_LIBRARIES}
   ${Qt5Core_LIBRARIES}
   ${CLUTTER_LIBRARIES}
   ${CLUTTERGTK_LIBRARIES}
391
   ${LIBNOTIFY_LIBRARIES}
392
   ${APPINDICATOR_LIBRARIES}
393
   ${LIBNM_LIBRARIES}
aviau's avatar
aviau committed
394
   ${WEBKIT_LIBRARIES}
395
   ${LIBQRENCODE_LIBRARIES}
396
   ${CANBERRA_LIBRARIES}
397 398
   )
ENDIF()
399

400 401 402
# configure libnotify variable for config.h file
IF( LIBNOTIFY_FOUND )
   SET(USE_LIBNOTIFY 1)
403
   SET(USE_CANBERRA 1)
404 405 406 407
ELSE()
   SET(USE_LIBNOTIFY 0)
ENDIF()

408 409 410 411 412 413 414
# configure libnm variable for config.h file
IF( LIBNM_FOUND )
   SET(USE_LIBNM 1)
ELSE()
   SET(USE_LIBNM 0)
ENDIF()

415 416 417 418 419 420 421
# configure libcanberra variable for config.h file
IF( CANBERRA_FOUND )
   SET(USE_CANBERRA 1)
ELSE()
   SET(USE_CANBERRA 0)
ENDIF()

422 423 424 425 426 427
# create config header file to pass cmake settings to source code
CONFIGURE_FILE (
   "${PROJECT_SOURCE_DIR}/src/config.h.in"
   "${PROJECT_BINARY_DIR}/config.h"
)

428
INSTALL(TARGETS jami-gnome
429 430
   RUNTIME DESTINATION bin
)
431

432
# install .desktop in XDG desktop dir so that it is recognized by the system
433
INSTALL(FILES ${PROJECT_SOURCE_DIR}/jami-gnome.desktop
434 435 436
    DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications
)

437 438
# install audio files
INSTALL(FILES ${PROJECT_SOURCE_DIR}/sounds/ringtone_notify.wav
439
    DESTINATION ${CMAKE_INSTALL_PREFIX}/share/sounds/jami-gnome
440 441
)

442
# install .desktop in the jami-gnome data dir, so that it can be copied to the
443
# autostart dir by the client
444
INSTALL(FILES ${PROJECT_SOURCE_DIR}/jami-gnome.desktop.autostart
445
   DESTINATION
446
      ${CMAKE_INSTALL_PREFIX}/share/jami-gnome
447 448 449 450 451
   PERMISSIONS
      WORLD_READ
      OWNER_WRITE
      OWNER_READ
      GROUP_READ
452
   RENAME
453
      jami-gnome.desktop
454 455
)

456
INSTALL(FILES pixmaps/jami.svg
457 458 459
    DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/scalable/apps
)

460
INSTALL(FILES jami-gnome.appdata.xml
461
    DESTINATION ${CMAKE_INSTALL_PREFIX}/share/metainfo/
462
)
463

464
# install shell script which will launch Jami
465 466
INSTALL(
   FILES
467
      "${PROJECT_SOURCE_DIR}/src/jami"
468 469 470 471 472 473 474 475 476 477
   DESTINATION
      ${CMAKE_INSTALL_PREFIX}/bin
   PERMISSIONS
      WORLD_READ
      OWNER_WRITE
      OWNER_READ
      GROUP_READ
      OWNER_EXECUTE
      GROUP_EXECUTE
      WORLD_EXECUTE
478 479
)

480 481 482 483 484
INSTALL(CODE "
    EXECUTE_PROCESS(COMMAND rm ${CMAKE_INSTALL_PREFIX}/bin/ring.cx -f)
    EXECUTE_PROCESS(COMMAND ln -s ${CMAKE_INSTALL_PREFIX}/bin/jami ${CMAKE_INSTALL_PREFIX}/bin/ring.cx)
    ")

485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501
# add a target to generate API documentation with Doxygen
FIND_PACKAGE(Doxygen)
IF(DOXYGEN_FOUND)
    CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/doc/Doxyfile.in ${CMAKE_CURRENT_SOURCE_DIR}/doc/Doxyfile @ONLY)
    ADD_CUSTOM_TARGET(doc
        COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/doc/Doxyfile
        WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/doc
        COMMENT "Generating API documentation with Doxygen" VERBATIM
    )

    # create doc/README.md symlink to README since Doxygen doesn't understand file with no extension
    ADD_CUSTOM_COMMAND(
        TARGET doc
        PRE_BUILD
        COMMAND ln -sf ${CMAKE_CURRENT_SOURCE_DIR}/README ${CMAKE_CURRENT_SOURCE_DIR}/doc/README.md
    )
ENDIF(DOXYGEN_FOUND)
502 503 504 505 506 507 508 509 510

# uninstall target
CONFIGURE_FILE(
    "${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
    "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
    IMMEDIATE @ONLY)

ADD_CUSTOM_TARGET(uninstall
    COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)