Re: [CMake] Syntax to document cmake files, functions and macros

2019-01-31 Thread Marc Herbert
> > On 24 Dec 2018, at 03:32, Oleksii Vilchanskyi gmail.com> wrote: > > On 12/24/18 12:01 PM, Olivier Croquette wrote: >> I have quite a few .cmake files that I want to document. They define >> functions, macros, and variables, and I was wondering if there is any >> standard or tooling to help.

Re: [CMake] Syntax to document cmake files, functions and macros

2019-02-11 Thread Marc Herbert
Le jeu. 31 janv. 2019 à 23:09, Torsten Robitzki a écrit : > > We are working on a larger CMake project and we use Sphinx. We use > sphinxcontrib.moderncmakedomain as extension, which adds CMake syntax > highlighting and sphinx.ext.intersphinx to allow us, to refer to the > original CMake document

Re: [CMake] Automatically updating Doxygen documentation and making it readily available to users with CMake

2019-02-22 Thread Marc Herbert
Le jeu. 21 févr. 2019 à 06:19, Timothy Wrona a écrit : > > Either way having it as an "index.html" file somewhere on the hard-disk is > not very intuitive. It would make much more sense for it to be on a web > server where you can access it with a sensible URL. > Unless it's linked from some fro

[CMake] Better way than: SET(CMAKE_C_ARCHIVE_CREATE " my_flags ... ?

2019-02-25 Thread Marc Herbert
Hi, 1. I found the hack below in the list's archive. However it seems... hackish. Among others it can't _append_ a flag, it can only replace all flags. Any newer and better way to append some extra flags? 2. Bonus question: how would you query "ar" and append some extra flags *only* when ar/ranl

Re: [CMake] FindPkgConfig and using -m32 on Linux

2019-02-27 Thread Marc Herbert
> On 17 Jan 2019, at 04:57, Jan Wielemaker wrote: > > I got very far using > >set(CMAKE_C_FLAGS -m32) Maybe not going to solve your main issue but worth changing anyway to: set(CMAKE_C_FLAGS "-m32 ${CMAKE_C_FLAGS}") With your previous and simpler code, passing any cmake -D

Re: [CMake] Remove compilation flags for a given target

2019-04-05 Thread Marc Herbert
> > > in our code base we would like to add a warning compilation flags. > Nevertheless, this flag prevents us from compiling a few targets so we > would like to remove this flag for the given targets. > > Since I don't want to *add* a compilation flags but remove one, I would > like to retrieve th

Re: [CMake] Better way than: SET(CMAKE_C_ARCHIVE_CREATE " my_flags ... ?

2019-04-05 Thread Marc Herbert
Le lun. 25 févr. 2019 à 11:41, Marc Herbert a écrit : > Hi, > > 1. I found the hack below in the list's archive. However it seems... > hackish. Among others it can't _append_ a flag, it can only replace all > flags. Any newer and better way to append some extra flags? &g

[CMake] cmake rewrites part of -S argument depending on the current directory!

2019-05-30 Thread Marc Herbert
Hi, I discovered a very unexpected -S behaviour and I'd like to know whether it's a bug or a feature. IF the current directory is a parent of the -S argument AND one component of the current directory is a symbolic link THEN the leading part of the -S argument is overridden using that symbolic li

Re: [CMake] cmake rewrites part of -S argument depending on the current directory!

2019-05-30 Thread Marc Herbert
and everything fails - at least a big "AVOID SYMLINKS [FOR NOW]" warning somewhere in the documentation. Fair enough? Sorry if I missed that. Thanks! Marc Le jeu. 30 mai 2019 à 07:15, Brad King a écrit : > On 5/30/19 3:22 AM, Marc Herbert wrote: > > IF the current director

[CMake] In add_subdirectory( binary_dir), binary_dir/ is just a decoy when there's no sub-target

2019-06-04 Thread Marc Herbert
tl;dr: should there be at least one target per CMakeLists.txt? https://cmake.org/cmake/help/v3.14/command/add_subdirectory.html > add_subdirectory(source_dir [binary_dir] ) > "The binary_dir specifies the directory in which to place the output files. [...] If binary_dir is not specified, the value

Re: [CMake] Question about getting git branch name.

2019-06-13 Thread Marc Herbert
Try: git describe --all or git describe --all --dirty --long git help describe PS: a git branch is effectively a *moving* tag so for a BUILD_VERSION it seems wrong to rely on branches (--all) instead of tags. I think you mean BUILD_BRANCH instead of BUILD_VERSION. Le sam. 8 juin 2019 à 15:25, Ste

Re: [CMake] In add_subdirectory( binary_dir), binary_dir/ is just a decoy when there's no sub-target

2019-06-13 Thread Marc Herbert
Ping? I'd like to file a bug but I don't know what is the intended behavior: 1. Should binary_dir work even when no target? 2. Should CMake warn/error that binary_dir is not supported unless targets are used? Marc Le mar. 4 juin 2019 à 12:05, Marc Herbert a écrit : > tl;dr: shoul

Re: [CMake] In add_subdirectory( binary_dir), binary_dir/ is just a decoy when there's no sub-target

2019-07-13 Thread Marc Herbert
Filed new bug https://gitlab.kitware.com/cmake/cmake/issues/19475 Le jeu. 13 juin 2019 à 11:06, Marc Herbert a écrit : > Ping? > > I'd like to file a bug but I don't know what is the intended behavior: > 1. Should binary_dir work even when no target? > 2. Should CMake w

Re: [CMake] Better way than: SET(CMAKE_C_ARCHIVE_CREATE " my_flags ... ?

2019-07-13 Thread Marc Herbert
3 and 3.14.0. > > > Le lun. 25 févr. 2019 à 11:41, Marc Herbert a > écrit : > >> Hi, >> >> 1. I found the hack below in the list's archive. However it seems... >> hackish. Among others it can't _append_ a flag, it can only replace all >> flags. An

Re: [CMake] how to set current source directory relative to external project

2019-07-13 Thread Marc Herbert
Le mar. 9 juil. 2019 à 13:24, hex a écrit : > Now that I look at it it seems very obvious. I still have doubts, though: > > I guess I am seeing the contents of a build directory as somewhat > volatile. For most files I want that, to either clean the project or > override the files. > > But what a

Re: [CMake] How to support separate debug and release build directories?

2019-07-13 Thread Marc Herbert
Le ven. 21 juin 2019 à 11:40, Michael Jackson a écrit : > > cd Foo > >mkdir Debug && cd Debug > >cmake -DCMAKE_BUILD_TYPE=Debug ../ > >make -j > > > > We have just created a Debug build in the Debug Directory. Now, the same > is analogous for the Release build. > > > > Cd Foo > > Mk

Re: [CMake] How to support separate debug and release build directories?

2019-07-13 Thread Marc Herbert
> > >> I am not finding it easy to find 'patterns' for these sort of issues. I >> would have thought that configuring a project with separate debug and >> release directories would be quite typical. But it's hard to find the >> recommended way of doing such things. >> > > It is typical: > https://

Re: [CMake] cmake - two targets that depends on single static library that should be compiled based on the target that is being built

2019-07-17 Thread Marc Herbert
> > > I have a static library and two target executables, let's call them > **libA**, **EXE1**, **EXE2**. > > If I am building EXE2, I need to disabled the macros in libA and don't > link to another library. > [...] > I don't want to create two targets with same source files. > I'm curious why you