Advertisement
Guest User

CMakelist.txt

a guest
Jun 5th, 2013
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.25 KB | None | 0 0
  1. # project name
  2. project (ShowDesktop)
  3.  
  4. # the oldest stable cmake version we support
  5. cmake_minimum_required (VERSION 2.8)
  6.  
  7. # tell cmake where its modules can be found in our project directory
  8. list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
  9.  
  10. # where we install data directory (if we have any)
  11. set (DATADIR "${CMAKE_INSTALL_PREFIX}/share")
  12.  
  13. # what to call that directory where we install data too
  14. set (PKGDATADIR "${DATADIR}/show-desktop")
  15.  
  16. set (EXEC_NAME "show-desktop")
  17. set (RELEASE_NAME "Show Desktop")
  18. set (VERSION "0.1")
  19. set (VERSION_INFO "Development version")
  20.  
  21. # install our .desktop file so the Applications menu will see it
  22. install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/show-desktop.desktop DESTINATION ${DATADIR}/applications/)
  23.  
  24. #
  25. # *_PACKAGES are used with the vala compiler (not versioned.)
  26. # *_PKG are used with PKG-Config and for linking, etc. (They can contain versions.)
  27. #
  28. # Both should contain *the same packages*, except for those whose VAPI file has
  29. # a different name. In such case, *_PACKAGES would use the name of the VAPI while
  30. # *_PKG would use the name of the package known by pkg-config.
  31. #
  32.  
  33. set(DEPS_PACKAGES
  34. glib-2.0
  35. granite
  36. libwnck-3.0
  37. )
  38.  
  39. set(DEPS_PKG
  40. granite
  41. )
  42.  
  43.  
  44. set(GLOBAL_VALAC_OPTIONS
  45. -X -DWNCK_I_KNOW_THIS_IS_UNSTABLE
  46. )
  47.  
  48. # we're about to use pkgconfig to make sure dependencies are installed so let's find pkgconfig first
  49. find_package(PkgConfig)
  50.  
  51. # now let's actually check for the required dependencies
  52. pkg_check_modules(DEPS REQUIRED ${DEPS_PKG})
  53.  
  54.  
  55.  
  56.  
  57.  
  58. # make sure we have vala
  59. find_package(Vala REQUIRED)
  60.  
  61. # make sure we use vala
  62. include(ValaVersion)
  63.  
  64. # make sure it's the desired version of vala
  65. ensure_vala_version("0.16.0" MINIMUM)
  66.  
  67. # files we want to compile
  68. include(ValaPrecompile)
  69. vala_precompile(VALA_C ${EXEC_NAME}
  70. src/show-desktop.vala
  71.  
  72. # tell what libraries to use when compiling
  73. PACKAGES
  74. ${DEPS_PACKAGES}
  75. OPTIONS
  76. ${GLOBAL_VALAC_OPTIONS}
  77. )
  78.  
  79. add_definitions(${DEPS_CFLAGS})
  80. link_libraries(${DEPS_LIBRARIES})
  81. link_directories(${DEPS_LIBRARY_DIRS})
  82.  
  83. # tell cmake what to call the executable we just made
  84. add_executable(${EXEC_NAME} ${VALA_C})
  85.  
  86. # install the binaries we just made
  87. install (TARGETS ${EXEC_NAME} RUNTIME DESTINATION bin)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement