view contrib/CMakeLists.txt @ 513:928a40398dec

CMake: split options and conditions, closes #716 As described in the issue, the CMake process force off a cache variable when a condition is not met. If the user installs the requirements and re-run CMake it must also set the variable to on which is inconvenient. The new process is to add a secondary variable and do not touch user defined options.
author David Demelier <markand@malikania.fr>
date Mon, 23 Oct 2017 21:30:17 +0200
parents 7b671bd1ff43
children 27587ff92a64
line wrap: on
line source

#
# CMakeLists.txt -- CMake build system for irccd
#
# Copyright (c) 2013-2017 David Demelier <markand@malikania.fr>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#

project(contrib)

if (WITH_SYSTEMD)
    set(PATH "${CMAKE_INSTALL_PREFIX}/${WITH_BINDIR}/irccd")

    configure_file(
        ${CMAKE_CURRENT_SOURCE_DIR}/irccd.service
        ${CMAKE_CURRENT_BINARY_DIR}/irccd.service
    )

    install(
        FILES ${CMAKE_CURRENT_BINARY_DIR}/irccd.service
        DESTINATION ${WITH_SYSTEMDDIR}
    )
endif()