From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Enge Subject: bug#18926: cmake-build-system should set CMAKE_INSTALL_LIBDIR and CMAKE_PREFIX_PATH Date: Sun, 1 Mar 2015 10:58:47 +0100 Message-ID: <20150301095847.GA28759@debian> References: <877fzdu45q.fsf@gmail.com> <87d295i556.fsf@gnu.org> <87sii02yax.fsf@gmail.com> <874mugp6oj.fsf@gnu.org> <871tpjb0hk.fsf@gmail.com> <87wq52327h.fsf@gnu.org> <87vbjcp8xx.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58341) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YS0fR-0007ym-EQ for bug-guix@gnu.org; Sun, 01 Mar 2015 05:00:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YS0fL-0008Qh-Nx for bug-guix@gnu.org; Sun, 01 Mar 2015 05:00:09 -0500 Received: from debbugs.gnu.org ([140.186.70.43]:57520) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YS0fL-0008QF-LP for bug-guix@gnu.org; Sun, 01 Mar 2015 05:00:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YS0fK-0004Uc-Tj for bug-guix@gnu.org; Sun, 01 Mar 2015 05:00:03 -0500 Sender: "Debbugs-submit" Resent-Message-ID: Content-Disposition: inline In-Reply-To: <87vbjcp8xx.fsf@gnu.org> List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 18926@debbugs.gnu.org The patch does not work. I thought this was due to it returning the .cmake files themselves and not the directory containing them. Here, for instance, it contains /gnu/store/h30r6z3fc67h8557kd63vjjdlfpc58wj-libqtxdg-1.1.0/share/cmake/qt5xdg/qt5xdg-config.cmake Inside the build directory, I tried an export CMAKE_MODULE_PATH=/gnu/store/h30r6z3fc67h8557kd63vjjdlfpc58wj-libqtxdg-1.1.0/share/cmake/qt5xdg with the same error message. Then I followed the advice given on screen and set export CMAKE_PREFIX_PATH=/gnu/store/h30r6z3fc67h8557kd63vjjdlfpc58wj-libqtxdg-1.1.0 which worked. export Qt5Xdg_DIR=/gnu/store/h30r6z3fc67h8557kd63vjjdlfpc58wj-libqtxdg-1.1.0/share/cmake/qt5xdg worked as well. But I do not see how to implement this kind of package specific path in guix. The following explains why CMAKE_MODULE_PATH has no effect here: http://www.cmake.org/cmake/help/v3.0/command/find_package.html Apparently, there is a "module mode" and a "config mode". The first one uses CMAKE_MODULE_PATH and looks for files called FindPACKAGE.cmake. We are in the second case here, where a file PACKAGEConfig.cmake or package-config.cmake is looked for. Further below on that page, it is explained where these config files are looked for. On unix like systems, this is /(lib/|lib|share)/cmake/*/ /(lib/|lib|share)/*/ /(lib/|lib|share)/*/(cmake|CMake)/ The part can be set by CMAKE_PREFIX_PATH. What would be desirable is the following: In the definition of a search path, we need an additional transformation (if it is not already there). We need to look for the regular expression (.+)/(lib|lib64|share)/.+\.cmake$ or maybe (.+)/(lib|lib/[^/]+|share)/.+\.cmake$ and put \1 into CMAKE_PREFIX_PATH. I think that would also make the lines (setenv "CMAKE_LIBRARY_PATH" (getenv "LIBRARY_PATH")) (setenv "CMAKE_INCLUDE_PATH" (getenv "CPATH")) in guix/build/cmake-build-system obsolete. Concerning the "lib64" part, I still have doubts. The documentation speaks of "lib/"; yet, there are packages which install into "lib64" (like libqtxdg, needed for liblxqt, which triggered this discussion). So if the suggestion above does not work, we can in a second step try to play with CMAKE_INSTALL_LIBDIR. Andreas