[Attn. MAINTAINER]: cmake-4.2.1
Carlo B.
carlo.bramini@gmail.com
Mon Sep 7 08:22:30 GMT 2026
Hello,
perhaps I have not understood something, but it is not clear to me the
reason of this patch.
For example: if you configure a project with "-G Ninja" as generator,
then a message like this one will be printed on screen if you execute
"ninja test":
CMakeFiles/test.dir/utility.sh: line 4: ARGS: command not found
However, this is expected to happen if you are calling directly the
build tool for running the tests, just because this is not the right
way to run them.
Tests are expected to be executed with ctest utility.
I wrote a very tiny test program with a CMakeLists.txt file and I
attached them to this email.
Save these two files somewhere and try to execute the following instructions.
First, create a build directory, not strictly required but always useful:
> mkdir build && cd build
Configure the project, here I'm using Ninja:
> $ cmake .. -G Ninja
> -- The CXX compiler identification is GNU 14.4.0
> -- Detecting CXX compiler ABI info
> -- Detecting CXX compiler ABI info - done
> -- Check for working CXX compiler: /usr/bin/c++.exe - skipped
> -- Detecting CXX compile features
> -- Detecting CXX compile features - done
> -- Configuring done (1.5s)
> -- Generating done (0.1s)
> -- Build files have been written to: /home/carlo/a/build
Build it:
> $ cmake --build .
> [2/2] Linking CXX executable my_test.exe
Run the tests by calling Ninja directly:
> $ ninja test
> [0/1] Running tests...
> CMakeFiles/test.dir/utility.sh: line 4: ARGS: command not found
> Test project /home/carlo/a/build
> Start 1: TestExample
> 1/1 Test #1: TestExample ...................... Passed 0.03 sec
>
> 100% tests passed, 0 tests failed out of 1
>
> Total Test time (real) = 0.04 sec
Now, run the tests with ctest:
> $ ctest
> Test project /home/carlo/a/build
> Start 1: TestExample
> 1/1 Test #1: TestExample ...................... Passed 0.03 sec
>
> 100% tests passed, 0 tests failed out of 1
>
> Total Test time (real) = 0.04 sec
And as you can see, here the message on undefined $(ARGS) is gone and
it's working as expected.
I hope that you will find this information useful.
Sincerely,
Carlo Bramini.
Il giorno lun 7 set 2026 alle ore 02:07 Marco Atzeri via Cygwin-apps
<cygwin-apps@cygwin.com> ha scritto:
>
> On 06/09/2026 22:06, ASSI via Cygwin-apps wrote:
> >
> > There's anancient bug in cmake when generating for anything but make: it
> > will emit a "$(ARGS)" unconditinally that makes no sense at all unless
> > you are a) targeting make and b) something sets ARGS=… on the invocation
> > of make.
> >
> > The fallout is usually:
> >
> > CMakeFiles/test.dir/utility.sh: 4: ARGS: not found
> >
>
> >
> > CMake projects using Ninja work correctly now, I've not yet tried what
> > happens for a make based one. CMake tests are still running, I'll
> > cancel them and restart later.
> >
> > Regards,
> > Achim.
>
> Thanks for the patch.
>
> I will put cmake up on TOTO list
>
> Regards
> Marco
>
-------------- next part --------------
#include <iostream>
int main() {
std::cout << "Test in progress..." << std::endl;
// The test program returns 0 if it's correct.
return 0;
}
-------------- next part --------------
cmake_minimum_required(VERSION 3.10)
project(ExampleCTest LANGUAGES CXX)
# 1. enable support for CTest
enable_testing()
# 2. Create executable for testing
add_executable(my_test test.cpp)
# 3. Define the test executed by CTest
add_test(NAME TestExample COMMAND my_test)
More information about the Cygwin-apps
mailing list