FreeYourSoul / FSeam

Cpp header only library to manage compile time mock class generated via Python script
MIT License
86 stars 8 forks source link

Can't build Fseam, FILE_FSEAMER_PY-NOTFOUND #37

Open eduardoaugustojulio opened 3 years ago

eduardoaugustojulio commented 3 years ago

Describe the bug I cant build Fseam using CMake, it could found FILE_FSEAMER_PY.

To Reproduce Steps to reproduce the behavior:

git clone Fseam
cd FSeam && mkdir build && cd build
cmake  -DFSEAM_USE_GTEST=ON -DFSEAM_USE_CATCH2=OFF -DBUILD_TESTING=OFF ..
-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- 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
-- FSeam v1.0.1
-- Found GTest: /usr/lib/x86_64-linux-gnu/libgtest.a
-- Found Python3: /usr/bin/python3.8 (found version "3.8.5") found components: Interpreter
-- Fseam Generator command : /usr/bin/python3.8;FILE_FSEAMER_PY-NOTFOUND
-- add custom command for testFSeam with fileToMock /home/user/FSeam/test/src/EmptyClassTest.hh
with command : /usr/bin/python3.8 FILE_FSEAMER_PY-NOTFOUND /home/user/FSeam/test/src/EmptyClassTest.hh /home/user/FSeam/build/test
-- add custom command for testFSeam with fileToMock /home/user/FSeam/test/src/ClassWithConstructor.hh
with command : /usr/bin/python3.8 FILE_FSEAMER_PY-NOTFOUND /home/user/FSeam/test/src/ClassWithConstructor.hh /home/user/FSeam/build/test
-- add custom command for testFSeam with fileToMock /home/user/FSeam/test/src/AbstractClass.hh
with command : /usr/bin/python3.8 FILE_FSEAMER_PY-NOTFOUND /home/user/FSeam/test/src/AbstractClass.hh /home/user/FSeam/build/test
-- add custom command for testFSeam with fileToMock /home/user/FSeam/test/src/DependencyNonGettable.hh
with command : /usr/bin/python3.8 FILE_FSEAMER_PY-NOTFOUND /home/user/FSeam/test/src/DependencyNonGettable.hh /home/user/FSeam/build/test
-- add custom command for testFSeam with fileToMock /home/user/FSeam/test/src/DependencyGettable.hh
with command : /usr/bin/python3.8 FILE_FSEAMER_PY-NOTFOUND /home/user/FSeam/test/src/DependencyGettable.hh /home/user/FSeam/build/test
-- add custom command for testFSeamFreeFunction with fileToMock /home/user/FSeam/test/src/FreeFunctionClass.hh
with command : /usr/bin/python3.8 FILE_FSEAMER_PY-NOTFOUND /home/user/FSeam/test/src/FreeFunctionClass.hh /home/user/FSeam/build/test
-- Configuring done
-- Generating done
-- Build files have been written to: /home/user/FSeam/build
make
/usr/bin/cmake -S/home/user/FSeam -B/home/user/FSeam/build --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start /home/user/FSeam/build/CMakeFiles /home/user/FSeam/build/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory '/home/user/FSeam/build'
make -f test/CMakeFiles/testFSeamAbstractClassRun.dir/build.make test/CMakeFiles/testFSeamAbstractClassRun.dir/depend
make[2]: Entering directory '/home/user/FSeam/build'
cd /home/user/FSeam/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/user/FSeam /home/user/FSeam/test /home/user/FSeam/build /home/user/FSeam/build/test /home/user/FSeam/build/test/CMakeFiles/testFSeamAbstractClassRun.dir/DependInfo.cmake --color=
Scanning dependencies of target testFSeamAbstractClassRun
make[2]: Leaving directory '/home/user/FSeam/build'
make -f test/CMakeFiles/testFSeamAbstractClassRun.dir/build.make test/CMakeFiles/testFSeamAbstractClassRun.dir/build
make[2]: Entering directory '/home/user/FSeam/build'
[  2%] Generating FSEAM code for /home/user/FSeam/test/src/AbstractClass.hh
cd /home/user/FSeam/build/test && /usr/bin/python3.8 FILE_FSEAMER_PY-NOTFOUND /home/user/FSeam/test/src/AbstractClass.hh /home/user/FSeam/build/test
/usr/bin/python3.8: can't open file 'FILE_FSEAMER_PY-NOTFOUND': [Errno 2] No such file or directory
make[2]: *** [test/CMakeFiles/testFSeamAbstractClassRun.dir/build.make:64: test/AbstractClass.fseam.cc] Error 2
make[2]: Leaving directory '/home/user/FSeam/build'
make[1]: *** [CMakeFiles/Makefile2:113: test/CMakeFiles/testFSeamAbstractClassRun.dir/all] Error 2
make[1]: Leaving directory '/home/user/FSeam/build'
make: *** [Makefile:144: all] Error 2

Expected behavior Well, it should build and install FSeam without errors.

Desktop (please complete the following information):

Joshuaoneheart commented 2 years ago

encounter the same problem when make, could please someone answer this issue?

Joshuaoneheart commented 2 years ago

I solve this problem by myself, it may be a version issue with cmake. You can change line 22 in cmake/FSeamModule.cmake from find_file(FILE_FSEAMER_PY FSeamerFile.py) to find_file(FILE_FSEAMER_PY FSeamerFile.py ${CMAKE_CURRENT_SOURCE_DIR}/../Generator) to solve this problem.

kchantrell-codan commented 2 years ago

Encountering the same problem in Ubuntu 20.04.3 LTS. The fix by @Joshuaoneheart works to complete the CMake configuration.