On 17/07/2021 14:20, Ichthyostega wrote:
> Am 15.07.21 um 18:51 schrieb Kristian Amlie:
>> I tried to
>> clone and build it myself, but got a message that "The source directory
>> ".../yoshimi-test/yoshimi-testrunner/build" does not appear to contain
>> CMakeLists.txt.". I guess you're still in the middle of setting it up.
> 
> 
> Hi Kristian,
> 
> the following works for me:
> 
>>(hiv)~/devel-$ git clone
> https://github.com/Ichthyostega/yoshimi-test.git yote
>>(hiv)~/devel-$ cd yote
>>(hiv)~/devel/yote-$ cmake -S yoshimi-testrunner -B
> yoshimi-testrunner/build
>>
>>>-- The CXX compiler identification is GNU 8.3.0
>>>-- Check for working CXX compiler: /usr/bin/c++
>>>-- Check for working CXX compiler: /usr/bin/c++ -- works
>>>-- Detecting CXX compiler ABI info
>>>-- Detecting CXX compiler ABI info - done
>>>-- Detecting CXX compile features
>>>-- Detecting CXX compile features - done
>>>-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29")
>>>-- Checking for module 'sox>=14'
>>>--   Found sox, version 14.4.2
>>>-- Configuring done
>>>-- Generating done
>>>-- Build files have been written to:
> /home/hiv/devel/yote/yoshimi-testrunner/build
>>
>>(hiv)~/devel/yote-$ cmake --build yoshimi-testrunner/build
>>
>>>Scanning dependencies of target testrunner
>>>[ 20%] Building CXX object CMakeFiles/testrunner.dir/src/Config.cpp.o
>>>[ 40%] Building CXX object CMakeFiles/testrunner.dir/src/Main.cpp.o
>>>[ 60%] Building CXX object CMakeFiles/testrunner.dir/src/Stage.cpp.o
>>>[ 80%] Building CXX object CMakeFiles/testrunner.dir/src/Suite.cpp.o
>>>[100%] Linking CXX executable testrunner
>>>[100%] Built target testrunner
>>
>>(hiv)~/devel/yote-$ ./run-tests
>>>Yoshimi-Testsuite failed: Misconfig: 'suitePath' not defined by config
> or commandline.

Looks like this is an issue on my system with cmake being too old. With
simpler arguments, it gives this:

  CMake Error at CMakeLists.txt:9 (cmake_minimum_required):
    CMake 3.12 or higher is required.  You are running version 3.10.2

  -- Configuring incomplete, errors occurred!

Then I tried in a Docker container with a more recent Ubuntu, and it worked.

[1] https://linux.die.net/man/1/cmake

> ...which brings up the interesting question about project tree layout. It
> is always a bit tricky to setup a new project, even more so when it is a
> bit
> "special". In this case, I made the assumption that the Yoshimi-test
> project
> is /not/ a source code project in itself, rather it /contains/ a source
> code
> project in the subdirectory yoshimi-testrunner
> 
> root
> +---yoshimi-testrunner
> |   + CMakeLists.txt
> |   + src/
> |   + build/
> |
> +---testsuite
>     ...
> 
> This implies, for building we need either to step into the
> yoshimi-testrunner
> dir, or alternatively tell cmake where the source is "-S
> yoshimi-testrunner"
> 
> Maybe this is too much surprising? Since most git projects you'll encounter
> are source code projects and have the buildsystem in the root directory?
>
> Btw, I also considered to make CMake the overall frontend for everything,
> i.e. also for running the tests. But in the end I am not convinced this is
> a good approach, since CMake would be just yet another gratuitous
> intermediary,
> and moreover, CMake tends to get messy soon (in that respect, as a
> "modern build
> system", CMake is a major disappointment)

Trust me, in my experience, *all* build systems are major
disappointments! :-D

But yeah, I think I agree, using cmake for everything is probably more
trouble than it's worth. Better to use it as a piece in the puzzle,
rather than as the puzzle solver.

> 
> 
> Obviously, another alternative directory layout would be to lift the
> source code
> project into the root, i.e. the root would hold both the "source code
> project"
> and the "testsuite project"
> 
> root
> + CMakeLists.txt
> +-yoshimi-testrunner/
> + build/
> +-testsuite
>   ...
> 
> For my taste, the central piece, the testsuite, would then be somewhat
> buried
> under the artefacts of the build system (and I expect the testrunner to
> become
> stable soon, so typically you'd build it once and then forget about it).

I think both proposals are good, but I would tend to agree that it is
common to have build files at the top of the project. Some projects
solve it by having this file simply recurse into sub directories, and
the top level file is then very short, leaving the real build files in
deeper folders. Not sure if this is convenient in cmake.

I think all in all I have a slight preference for your second proposal,
but as I said, both are good, really.

-- 
Kristian


_______________________________________________
Yoshimi-devel mailing list
Yoshimi-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/yoshimi-devel

Reply via email to