kiwi: resource.c missing for successful Cmake?

This is probably more due to my lack of cmake understanding but I can’t get it to generate successfully.

CMake Error at src/CMakeLists.txt:51 (add_library):
  Cannot find source file:

    resources.c

  Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp
  .hxx .in .txx


CMake Error: CMake can not determine linker language for target: KiWi
CMake Error in src/CMakeLists.txt:
  Exporting the target "KiWi" is not allowed since its linker language cannot
  be determined

Any info on what is happening here? Is it just me? Can you provide a successful cmake configuration as an example, pretty please? 😃

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 1
  • Comments: 36 (20 by maintainers)

Commits related to this issue

Most upvoted comments

@krystcich well I have tested it with Android previously and it worked. It wasn’t through CMake though. There is an Android.mk makefile on KiWi’s source root that I used to build it in the past but I’ll admit that I havent tested it nowadays. It builds a static library as well (and statically links to SDL), you can use it to link to your main .so, depending on your project’s root Android.mk. SDL2 sources has an android example that I used as a base and edited to build one of the examples and link with KiWi. I’d say thats the path to go. Let me know if you succeed and how (I’d only ask you to open another issue regarding this).

Building a shared library out of KiWi seems to not hurt anyone so I’ll make it happen.

That is good to know. I’ll boot Windows today and I’ll try to provide a proper fix.

Hello! Here’s what worked for me:

  1. comment line 6 in KiWi-master/resources/kiwires.cmake
  2. compile only file2c.c by hand (gcc file2c.c -o file2c.exe) and move file2c.exe file to KiWi-master/build
  3. link libraries for CMake in correct order mingw32;SDL2main;SDL2;SDL2_image;SDL2_ttf (make sure other SDL2 related stuff is pointing the right include directories and .a files for libs)
  4. Configure, Generate (CMake: 3.11.0-rc3 on Windows with MinGW Makefile option) now goes fine
  5. change utf8.c line 21 to: #elif !defined(OpenBSD)
  6. go to KiWi-master/build/examples/drag, run cmd, make
  7. copy libKiWi.dll from KiWi-master/build/src to KiWi-build/examples/drag/
  8. add all usual SDL2 dll files (SDL2.dll, SDL2_image.dll, SDL2_ttf.dll, libpng16-16.dll, libfreetype-6.dll, zlib1.dll)
  9. run drag.exe

Hope that helps somehow!