FreeYourSoul / FSeam

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

Executing CMake results in a Catch2 Error #5

Closed jatozy closed 5 years ago

jatozy commented 5 years ago

Hi,

I try to use FSeam, but currently it fails at CMake.

My Environment: Inside a Docker container Ubuntu 19.04 cmake Version 3.7.2 gcc Version 9.1.0 Python Version 2.7.3 ply is installed via pip Catch2 Version 2.7.0 -> Compiled and installed via: git clone https://github.com/catchorg/Catch2.git && cd Catch2 && git checkout -b v2.7.0 && mkdir build && cd build && cmake .. -DBUILD_TESTING=OFF && make install

For FSeam I tried the following: git clone https://github.com/FreeYourSoul/FSeam.git cd FSeam mkdir build cd build cmake ..

Currently I am compiling it as root because it is inside a docker container and just for the first tests :)

The result of cmake .. is:

-- The C compiler identification is GNU 9.1.0 -- The CXX compiler identification is GNU 9.1.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/local/bin/c++ -- Check for working CXX compiler: /usr/local/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 -- add custom command for testFSeam with fileToMock /root/FSeam/test/src/DependencyNonGettable.hh with command : python;/root/FSeam/test/../Generator/FSeamerFile.py /root/FSeam/test/src/DependencyNonGettable.hh /root/FSeam/build/test -- add custom command for testFSeam with fileToMock /root/FSeam/test/src/DependencyGettable.hh with command : python;/root/FSeam/test/../Generator/FSeamerFile.py /root/FSeam/test/src/DependencyGettable.hh /root/FSeam/build/test -- add custom command for testFSeamFreeFunction with fileToMock /root/FSeam/test/src/FreeFunctionClass.hh with command : python;/root/FSeam/test/../Generator/FSeamerFile.py /root/FSeam/test/src/FreeFunctionClass.hh /root/FSeam/build/test CMake Error at /usr/local/lib/cmake/Catch2/Catch.cmake:163 (message): Cannot set more than one TEST_INCLUDE_FILE Call Stack (most recent call first): cmake/FSeamModule.cmake:117 (catch_discover_tests) test/CMakeLists.txt:45 (addFSeamTests)

FreeYourSoul commented 5 years ago

Hello, we had the same issue when compiling on Travis with a CMake version inferior to the 3.10.0. Can you try with a more up to date CMake version ?

jatozy commented 5 years ago

Thanks for your response. Yes this was the problem. I have uninstalled the via aptitude shipped cmake version and have installed version 3.14.5 and now it works.

Edit: My fault. Cmake 3.7.x is not the default version from Ubuntu 19.04. I have used a docker container with an older version.

FreeYourSoul commented 5 years ago

I will update the documentation to explicit that a version above CMake 3.10 is required