floooh / oryol

A small, portable and extensible C++ 3D coding framework
MIT License
2k stars 200 forks source link

running and compiling with clion #304

Closed neshume closed 6 years ago

neshume commented 6 years ago

when trying to compile and run with clion, get strange cmake messages :

/usr/bin/python: can't open file '///**/oryol/cmake-build-debug/fips-gen.py': [Errno 2] No such file or directory

the ** are user specific paths so i removed them ..

it seems the build system tries to find fips-gen.py on the wrong path .. looks like a current directory issue.

cheers,

Neshume

floooh commented 6 years ago

The fips-gen.py file should be generated when running "./fips gen", and the location should be ../fips-build/[proj-name]/[config-name]/fips-gen.py relative to the project directory (but converted to an absolute path).

Does the fips-gen.py file exist there? Does a ./fips build from the command line work with the same config?

neshume commented 6 years ago

Yes it does. Xcode also works. Could be an issue with clion but works with prev versions of fips. I need to check when it broke down. 🤓

floooh commented 6 years ago

It could be related by this change:

https://github.com/floooh/fips/commit/9c2744aefe6c5ac2b1200adca31fd487c9fd3805

This adds a -j parameter to cmake --build and this is handed to the underlying tool (and if the tool doesn't know this parameter the build stops with an error). I saw the same problem in an oryol build config together with Xcode:

https://github.com/floooh/oryol/commit/dbce7bc63288703b84d3cd734aabe87506f49e08

If Clion has the same problem, I think a solution would be to add a check before the cmake --build is invoked whether it will run make, ninja, or something else under the hoow.

Can you check whether it was caused by this commit?

neshume commented 6 years ago

of course , I am checking this commit .

Will update ASAP.

cheers,

neshume

neshume commented 6 years ago

from what i see it is not caused by this commit.

it seems the file fips-gen.py is not generated and copied into the config directory [cmake-build-debug]

when I copy the file manually from osx-xcode-debug configuration .. all builds just fine in clion.

floooh commented 6 years ago

ok I can reproduce the problem ob Mac, it's looking for fips-gen.py in the wrong place. I'll move the bug over to fips, since it doesn't seem to be Oryol specific, and close this one here.

floooh commented 6 years ago

...the problem is actually that CLion creates its own build directory inside the project directory (called cmake-build-debug), instead of using the directory hierarchy under fips-deploy... hmm, I'm not sure if this is worth fixing, since a lot of other things might depend on the proper build file location... I'll tinker around with it for a bit.

floooh commented 6 years ago

OK, I got it working without changes, you just need to import the project differently:

image

neshume commented 6 years ago

floooh you are indeed the king!!

thx

neshume