cmake: Support make uninstall.
[vlc.git] / extras / buildsystem / cmake / CMakeLists / root_CMakeLists.txt
1 PROJECT(vlc)
2
3 ENABLE_TESTING()
4
5 # Set the module path
6 set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
7
8 # Our own include
9 include( vlc_module_funcs )
10
11 # Our config
12 include( config )
13
14 # Global definitions
15 add_definitions(-DHAVE_CONFIG_H)
16 add_definitions(-D__LIBVLC__)
17 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99")
18 set(CMAKE_INCLUDE_CURRENT_DIR ON)
19
20 # Needed for glibc:
21 add_definitions(-D_GNU_SOURCE)
22
23 # Our main include directories
24 include_directories(${CMAKE_SOURCE_DIR}/include ${CMAKE_BINARY_DIR}/include)
25
26 # our sources:
27 add_subdirectory(src)
28 add_subdirectory(modules)
29 add_subdirectory(po)
30
31 # Enable uninstall
32 configure_file(
33   "${CMAKE_CURRENT_SOURCE_DIR}/extras/buildsystem/cmake/cmake_uninstall.cmake.in"
34   "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
35   IMMEDIATE @ONLY)
36
37 add_custom_target(uninstall
38   "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
39
40 # Enable CPack: Automatic package creation
41
42 set(README "${CMAKE_CURRENT_SOURCE_DIR}/README")
43 set(LICENCE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING")
44
45 if(APPLE)
46 set(README "${CMAKE_CURRENT_SOURCE_DIR}/extras/package/macosx/README.MacOSX.rtf")
47 set(LICENCE "") # FIXME: Mac OS X's Package Maker doesn't allow non .*
48 endif(APPLE)
49
50 set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "VLC Media Player")
51 set(CPACK_PACKAGE_VENDOR "VideoLAN Team")
52 set(CPACK_PACKAGE_DESCRIPTION_FILE ${README})
53 set(CPACK_RESOURCE_FILE_LICENSE ${LICENCE})
54 set(CPACK_PACKAGE_VERSION_MAJOR "${VLC_VERSION_MAJOR}")
55 set(CPACK_PACKAGE_VERSION_MINOR "${VLC_VERSION_MINOR}")
56 set(CPACK_PACKAGE_VERSION_PATCH "${VLC_VERSION_PATCH}${VLC_VERSION_EXTRA}")
57
58 include(CPack)