itk-wasm icon indicating copy to clipboard operation
itk-wasm copied to clipboard

Hello world Cmake error. The source directory "/work" does not appear to contain CMakeLists.txt.

Open cvisl opened this issue 5 months ago • 6 comments

Following the instructions of the hello-world tutorial. I get the following error:

Not searching for unused variables given on the command line.
CMake Error: The source directory "/work" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
ninja: fatal: invalid -j parameter

😵  undefined

My system:

  • Fedora 42
  • Docker 4.37.1
  • npm 10.9.2

I am not aware what happens in the Docker images but it doesn't seem to copy the CMakeLists.txt into the docker image?

My directory contains when I run the instructions (setup and build):

-rw-r--r--. 1   89 Jul 30 11:49 CMakeLists.txt
-rw-r--r--. 1   96 Jul 30 11:56 hello.cxx

cvisl avatar Jul 30 '25 10:07 cvisl

Hi @cvisl thanks for the report.

Major updates to the hello-world tutorial is a WIP here: https://github.com/InsightSoftwareConsortium/ITK-Wasm/pull/1433

thewtex avatar Jul 30 '25 12:07 thewtex

Hey @thewtex thanks for the swift reply!

I tried the create-itk-wasm method but this one also trips over an error, a different one:

/home/****/test/itk-wasm-test/native/ITK/Modules/ThirdParty/MINC/src/libminc/libcommon/ParseArgv.c:330:18: error: too many arguments to function ‘handlerProc’; expected 0, have 4
  330 |          argc = (*handlerProc)(infoPtr->dst, infoPtr->key,
      |                 ~^~~~~~~~~~~~~ ~~~~~~~~~~~~

Is that something you came across before? Might be a system dependency which is of a different version?

cvisl avatar Jul 30 '25 12:07 cvisl

@cvisl sorry for the delayed reply. I will look into this over the coming days.

thewtex avatar Aug 04 '25 20:08 thewtex

I tested it on a Ubuntu system as well and I got a bit further but I got the following error there:

CMake Error at test/CMakeLists.txt:1 (add_executable):
  The target name "test" is reserved when CTest testing is enabled.

On the configure-native task. This might be related to the cmake version I am using, 3.28.3.

cvisl avatar Aug 06 '25 09:08 cvisl

The "old way" (aka the current documentation) seems to work on a Ubuntu system.

cvisl avatar Aug 06 '25 10:08 cvisl

@cvisl I just released a new version of create-itk-wasm. Do you still get errors with this new version?

thewtex avatar Aug 13 '25 22:08 thewtex