CMake build problem

140 views
Skip to first unread message

Rob McDonald

unread,
Sep 16, 2022, 2:09:44 PM9/16/22
to fltk.coredev
I tried building the tip of master today (166a5bf785). I use CMake to build. I got the following error...

-- Looking for POSIX compatible scandir
-- POSIX compatible scandir - found
-- Found Doxygen: /opt/homebrew/bin/doxygen (found version "1.9.5") found components: doxygen dot
-- Found LATEX: /Library/TeX/texbin/latex
fatal: not a git repository (or any of the parent directories): .git
CMake Error at documentation/CMakeLists.txt:52 (string):
string sub-command REPLACE requires at least four arguments.


As you know, CMake does out-of-tree builds.  Many people are set up like this...

project/.git       # Git repository with source files, etc.
project/build    # Build directory

In this situation, the build directory is still in the hierarchy of the git repository.  The object files are not dumped in the same place as the source files, but it really isn't out of tree.  Instead, I set up like this....

project/repo/.git       # Git repository with source files, etc.
project/build             # Build directory

Consequently, my CMAKE_BINARY_DIR is never descended from the git repository.  My build is truly 'out of tree'.

I think this difference in setup may be leading to the error I'm seeing.

I think the CMake scripts should be robust to either approach as they are both common practice.

Rob







Manolo

unread,
Sep 17, 2022, 4:01:55 AM9/17/22
to fltk.coredev
Le vendredi 16 septembre 2022 à 20:09:44 UTC+2, rob a écrit :
I tried building the tip of master today (166a5bf785). I use CMake to build. I got the following error...

-- Looking for POSIX compatible scandir
-- POSIX compatible scandir - found
-- Found Doxygen: /opt/homebrew/bin/doxygen (found version "1.9.5") found components: doxygen dot
-- Found LATEX: /Library/TeX/texbin/latex
fatal: not a git repository (or any of the parent directories): .git
CMake Error at documentation/CMakeLists.txt:52 (string):
string sub-command REPLACE requires at least four arguments.

That should be fixed in the git repo at 09334c5.

@Albrecht: what about turning off OPTION_HTML_BUILD_DOCUMENTATION if ${CMAKE_SOURCE_DIR}/.git
does not exist or is not a directory ?

Albrecht Schlosser

unread,
Sep 18, 2022, 6:06:30 AM9/18/22
to fltkc...@googlegroups.com
On 9/17/22 10:01 Manolo wrote:
Le vendredi 16 septembre 2022 à 20:09:44 UTC+2, rob a écrit :
I tried building the tip of master today (166a5bf785). I use CMake to build. I got the following error...

-- Looking for POSIX compatible scandir
-- POSIX compatible scandir - found
-- Found Doxygen: /opt/homebrew/bin/doxygen (found version "1.9.5") found components: doxygen dot
-- Found LATEX: /Library/TeX/texbin/latex
fatal: not a git repository (or any of the parent directories): .git
CMake Error at documentation/CMakeLists.txt:52 (string):
string sub-command REPLACE requires at least four arguments.

@Rob: thanks for reporting this. It's a known issue (#499) although your constellation is a new variation of the issue and I agree of course that the CMake build should support this configuration. Sorry for the inconveniencies.


That should be fixed in the git repo at 09334c5.

OK, this commit is a good first step, I agree that it should fix Rob's issue.


@Albrecht: what about turning off OPTION_HTML_BUILD_DOCUMENTATION if ${CMAKE_SOURCE_DIR}/.git
does not exist or is not a directory ?

No, this is not the correct solution.

Sorry, I don't have the time to explain this further right now. Please discuss other potential suggestions in the context of issue #499 so they don't get lost.
https://github.com/fltk/fltk/issues/499
Reply all
Reply to author
Forward
0 new messages