Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # project name
- project (ShowDesktop)
- # the oldest stable cmake version we support
- cmake_minimum_required (VERSION 2.8)
- # tell cmake where its modules can be found in our project directory
- list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
- # where we install data directory (if we have any)
- set (DATADIR "${CMAKE_INSTALL_PREFIX}/share")
- # what to call that directory where we install data too
- set (PKGDATADIR "${DATADIR}/show-desktop")
- set (EXEC_NAME "show-desktop")
- set (RELEASE_NAME "Show Desktop")
- set (VERSION "0.1")
- set (VERSION_INFO "Development version")
- # install our .desktop file so the Applications menu will see it
- install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/show-desktop.desktop DESTINATION ${DATADIR}/applications/)
- #
- # *_PACKAGES are used with the vala compiler (not versioned.)
- # *_PKG are used with PKG-Config and for linking, etc. (They can contain versions.)
- #
- # Both should contain *the same packages*, except for those whose VAPI file has
- # a different name. In such case, *_PACKAGES would use the name of the VAPI while
- # *_PKG would use the name of the package known by pkg-config.
- #
- set(DEPS_PACKAGES
- glib-2.0
- granite
- libwnck-3.0
- )
- set(DEPS_PKG
- granite
- )
- set(GLOBAL_VALAC_OPTIONS
- -X -DWNCK_I_KNOW_THIS_IS_UNSTABLE
- )
- # we're about to use pkgconfig to make sure dependencies are installed so let's find pkgconfig first
- find_package(PkgConfig)
- # now let's actually check for the required dependencies
- pkg_check_modules(DEPS REQUIRED ${DEPS_PKG})
- # make sure we have vala
- find_package(Vala REQUIRED)
- # make sure we use vala
- include(ValaVersion)
- # make sure it's the desired version of vala
- ensure_vala_version("0.16.0" MINIMUM)
- # files we want to compile
- include(ValaPrecompile)
- vala_precompile(VALA_C ${EXEC_NAME}
- src/show-desktop.vala
- # tell what libraries to use when compiling
- PACKAGES
- ${DEPS_PACKAGES}
- OPTIONS
- ${GLOBAL_VALAC_OPTIONS}
- )
- add_definitions(${DEPS_CFLAGS})
- link_libraries(${DEPS_LIBRARIES})
- link_directories(${DEPS_LIBRARY_DIRS})
- # tell cmake what to call the executable we just made
- add_executable(${EXEC_NAME} ${VALA_C})
- # install the binaries we just made
- install (TARGETS ${EXEC_NAME} RUNTIME DESTINATION bin)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement