[{"id":24478,"web_url":"https://patchwork.libcamera.org/comment/24478/","msgid":"<YvJo/K7+Ospne0xW@pendragon.ideasonboard.com>","date":"2022-08-09T14:02:36","subject":"Re: [libcamera-devel] [SimpleCam PATCH v2] cmake: Provide a sample\n\tCMakeLists.txt","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Kieran,\n\nThank you for the patch.\n\nOn Tue, Aug 09, 2022 at 02:44:23PM +0100, Kieran Bingham via libcamera-devel wrote:\n> While libcamera uses meson as its build infrastructure, applications are\n> free to use other make systems. CMake is widely used, so add an example\n> CMakeLists.txt to support building simple-cam and linking against\n> libcamera using cmake.\n> \n> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> ---\n> v2:\n>  - Add compiler flags\n>  - Fix 'it's'\n>  - Remove stray leftovers\n>  - Remove version number\n> \n>  CMakeLists.txt | 32 ++++++++++++++++++++++++++++++++\n>  1 file changed, 32 insertions(+)\n>  create mode 100644 CMakeLists.txt\n> \n> diff --git a/CMakeLists.txt b/CMakeLists.txt\n> new file mode 100644\n> index 000000000000..2a86b55ebeea\n> --- /dev/null\n> +++ b/CMakeLists.txt\n> @@ -0,0 +1,32 @@\n> +cmake_minimum_required(VERSION 3.6)\n> +\n> +project(SimpleCam\n> +\tDESCRIPTION \"A small and documented example application for libcamera\"\n> +\tLANGUAGES CXX)\n> +\n> +set (CMAKE_CXX_STANDARD 17)\n> +\n> +set (CMAKE_CXX_FLAGS \"-Wall -Winvalid-pch -Wnon-virtual-dtor -Wextra -Werror -Wno-unused-parameter\")\n> +\n> +find_package(PkgConfig)\n> +\n> +pkg_check_modules(LIBCAMERA REQUIRED IMPORTED_TARGET libcamera)\n> +message(STATUS \"libcamera library found:\")\n> +message(STATUS \"    version: ${LIBCAMERA_VERSION}\")\n> +message(STATUS \"    libraries: ${LIBCAMERA_LINK_LIBRARIES}\")\n> +message(STATUS \"    include path: ${LIBCAMERA_INCLUDE_DIRS}\")\n> +\n> +# libevent is used specifically by simple-cam as its event loop.\n> +# Applications may use a different event handling implementation.\n> +pkg_check_modules(LIBEVENT REQUIRED IMPORTED_TARGET libevent_pthreads)\n> +message(STATUS \"libevent_pthreads library found:\")\n> +message(STATUS \"    version: ${LIBEVENT_VERSION}\")\n> +message(STATUS \"    libraries: ${LIBEVENT_LINK_LIBRARIES}\")\n> +message(STATUS \"    include path: ${LIBEVENT_INCLUDE_DIRS}\")\n> +\n> +include_directories(${CMAKE_SOURCE_DIR} ${LIBCAMERA_INCLUDE_DIRS} ${LIBEVENT_INCLUDE_DIRS})\n> +\n> +add_executable(simple-cam simple-cam.cpp event_loop.cpp)\n> +\n> +target_link_libraries(simple-cam PkgConfig::LIBEVENT)\n> +target_link_libraries(simple-cam PkgConfig::LIBCAMERA)","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 6E81FBE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  9 Aug 2022 14:02:50 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id CFB5063326;\n\tTue,  9 Aug 2022 16:02:49 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9F33061FAA\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  9 Aug 2022 16:02:48 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 25509481;\n\tTue,  9 Aug 2022 16:02:48 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1660053769;\n\tbh=fJ+ZFY4cqfvIht+bwJ2gqcnmsxveAN5fWGu/9voX9fM=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=TTihOrwzF7d7KozEjImCbWzr7ef1IL7Fz93escFfLxHIEQ1WqQE7zmaYIYSSAP+JI\n\tTc135Pj7NkG2luHZ97au+06ReV8kpuIaymEmjOrgXquPKiS14v5RLRX3Vvc/M7N8o5\n\tSOZVwJttNy2uSqApu78w6Q2F9/tSF+4JDA5jrR1/YrGbka85WB4vYpurwrKMSFzNuU\n\t7Rcw/ztO/kKyW+bjkIdXUa1CFURXOsgN1/no1tv1FscRc3pmYjia0yH3zyy8okcLGm\n\tFbq3/sWOYj5Kc8nwzAdXkoYatvTUJ+4z4jVzKjfFdMfTfZZ5wV2sa0biqjSBkX3ld5\n\t9bmu1OgKDC6VA==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1660053768;\n\tbh=fJ+ZFY4cqfvIht+bwJ2gqcnmsxveAN5fWGu/9voX9fM=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=AVLSgJfcN9DN/YhJQEmcS4HK4j3ZJ6YNh89M/YXQrkfO0UY8EA+bQom6owQKTIzVx\n\tODbvtglHYv24JvsFQaGpus9hjJUYA352fGr34gxpNtj6ShbbddIywy6rLSsdj9skYe\n\tkosNfh2KH/3Dq2O6c5b16sjGtj6otZUMkbM+3TYg="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"AVLSgJfc\"; dkim-atps=neutral","Date":"Tue, 9 Aug 2022 17:02:36 +0300","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Message-ID":"<YvJo/K7+Ospne0xW@pendragon.ideasonboard.com>","References":"<20220809134423.2092524-1-kieran.bingham@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20220809134423.2092524-1-kieran.bingham@ideasonboard.com>","Subject":"Re: [libcamera-devel] [SimpleCam PATCH v2] cmake: Provide a sample\n\tCMakeLists.txt","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]