From owner-freebsd-ports@freebsd.org Sat Jan 16 09:11:15 2021 Return-Path: Delivered-To: freebsd-ports@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B7A734D8ED7 for ; Sat, 16 Jan 2021 09:11:15 +0000 (UTC) (envelope-from 6yearold@gmail.com) Received: from mail-lj1-f180.google.com (mail-lj1-f180.google.com [209.85.208.180]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DHsjb4hRbz3L1P for ; Sat, 16 Jan 2021 09:11:15 +0000 (UTC) (envelope-from 6yearold@gmail.com) Received: by mail-lj1-f180.google.com with SMTP id m10so12972308lji.1 for ; Sat, 16 Jan 2021 01:11:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zfwRkCEqYMrjbmNDNVgi4ObzLhKXK20T7ogCqQDAUGM=; b=LnwwC+dMuKFTnjW2utTQ5tzHDX0SOeeQ1nVLpVtT60o2CAg7hagDN1/7Uo2HMiHr2e VrhibFa7ais91Aer9qlLEwytpDl17RvIS4JpZps5BpaNmKxXcYlhJnb33i5m+elfFTCM eEV5unw8uKYvFMGW2iIRti8cHYzEDzy0TGKtNFCSmU/tdaglcGMOUZ7PPxc/tVIwzoce kRMZXGoQhoiysgHhVBcfFz/ibYFUz2w2kSnfFSmLcgy0ddLM5lOlFNfJqZkcdAtNC+k7 BuVq4mKVg2XdHaIs2Y5gpAukisqjc8MKLbvEVo9mNgAL8LQOPeKu+om5lo4aG/xQK86y gIug== X-Gm-Message-State: AOAM533G36BY3EQY1KtCzsam0ufkRWOG0+y+qds3MOEL/pBciKOOIsyS kSS7jk7ERU7dZSjM9pK6D6ktaywBcuE02w== X-Google-Smtp-Source: ABdhPJzi1iB3CSdv8AIPXAqHkgDutZ/ouAG8WAI/4JixRd2f8EiVilWzYje9DrRgpTjaKDS/8WOn7Q== X-Received: by 2002:a2e:50c:: with SMTP id 12mr7031970ljf.226.1610788273839; Sat, 16 Jan 2021 01:11:13 -0800 (PST) Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com. [209.85.167.50]) by smtp.gmail.com with ESMTPSA id 68sm1033121ljj.23.2021.01.16.01.11.13 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 16 Jan 2021 01:11:13 -0800 (PST) Received: by mail-lf1-f50.google.com with SMTP id o10so16753445lfl.13 for ; Sat, 16 Jan 2021 01:11:13 -0800 (PST) X-Received: by 2002:ac2:5472:: with SMTP id e18mr7262695lfn.489.1610788273164; Sat, 16 Jan 2021 01:11:13 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Gleb Popov Date: Sat, 16 Jan 2021 13:10:44 +0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: CMAKE_PREFIX_PATH and /usr/local To: Tomasz CEDRO Cc: freebsd-ports X-Rspamd-Queue-Id: 4DHsjb4hRbz3L1P X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jan 2021 09:11:15 -0000 On Sat, Jan 16, 2021 at 12:17 AM Tomasz CEDRO wrote: > On Fri, Jan 15, 2021 at 10:05 AM Gleb Popov wrote: > > On Fri, Jan 15, 2021 at 12:50 AM Tomasz CEDRO wrote: > >> Hello world :-) > >> I am porting LimeSuite to FreeBSD. Local patch fixes missing > >> "/usr/local/" path in CMakeLists.txt so the package now builds fine on > >> FreeBSD. On Linux probably most of the libraries and includes are > >> located in /usr/ do problem does not exist. > >> Upstream has some objections to accept this patch and considers > >> "/usr/local" a non-standard path [1]. But they propose to use > >> CMAKE_PREFIX_PATH to add "/usr/local". This however does not seem to > >> be supported in Ports (yet?). > >> The question is how to tell CMake about "/usr/local/include" without > >> source code modification? :-) > >> Below is the proposed patch: > >> > @@ -171,6 +171,11 @@ if (ENABLE_NEW_GAIN_BEHAVIOUR) > >> add_definitions(-DNEW_GAIN_BEHAVIOUR) > >> endif() > >> +if (CMAKE_SYSTEM_NAME MATCHES "BSD") > >> + include_directories("/usr/local/include") > > > > This is most certainly a wrong thing to do. Instead of simply adding > -I/usr/local/include everywhere, you should fix problems for each > dependency that the software requires. > > > > What error do you get without your patch? > > Hello Gleb :-) This seems the LimeSuite CMake issue not to use > /usr/local/include where some GL includes are located. Without it > there is a build problem as GL.h (something like this) is not found. I > am not sure it this is the only occurrence of this symptom. Simply > adding /usr/local/include solves the problem. > The correct fix is to call find_package(OpenGL) and then use variables it sets.