FreeYourSoul / FSeam

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

Default install path differs from include of generated mock files #8

Closed jatozy closed 5 years ago

jatozy commented 5 years ago

Describe the bug After installation of FSeam and compiling the FSeam_Tutorial, the compilation of the tutorial crashes because of that the file FSeam/FSeam.hpp can not be included.

To Reproduce Steps to reproduce the behavior:

  1. Compile and install FSeam

    git clone https://github.com/FreeYourSoul/FSeam.git
    cd FSeam
    mkdir build
    cd build
    cmake ..
    cmake --build . 
    cmake --build . --target test
    sudo cmake --build . --target install

    Result of installation:

    -- Install configuration: ""
    -- Installing: /usr/local/share/include/FSeam.hpp
    -- Installing: /usr/local/share/include/Versioner.hh
    -- Installing: /usr/local/share/bin/FSeamerFile.py
    -- Installing: /usr/local/share/bin/CppHeaderParser.py
    -- Installing: /usr/local/bin/FSeamerFile.py
    -- Installing: /usr/local/bin/CppHeaderParser.py
    -- Installing: /usr/local/share/cmake/FSeam/FSeamTargets.cmake
    -- Installing: /usr/local/share/cmake/FSeam/FSeamConfig.cmake
    -- Installing: /usr/local/share/cmake/FSeam/FSeamConfigVersion.cmake
    -- Installing: /usr/local/share/cmake/FSeam/FSeamModule.cmake
  2. Create folder in which the Tutorial shall be compiled

    sudo mkdir /workspaces
    sudo chmod 777 /workspaces
  3. Download and compile the FSeam tutorial

    cd /workspaces
    git clone https://github.com/FreeYourSoul/FSeam_Tutorial
    cd FSeam_Tutorial
    mkdir build
    cd build
    cmake ..
    cmake --build .
    cmake --build . --target test
  4. See error

    [ 10%] Building CXX object CMakeFiles/testFSeam_2.dir/FreeFunction.fseam.cc.o
    In file included from /workspaces/FSeam_Tutorial/build/FreeFunction.fseam.cc:8:
    /workspaces/FSeam_Tutorial/build/FSeamMockData.hpp:13:10: fatal error: FSeam/FSeam.hpp: No such file or directory
    #include <FSeam/FSeam.hpp>
          ^~~~~~~~~~~~~~~~~
    compilation terminated.

    Expected behavior FSeam installs the header files in the location /usr/local/include/Fseam/ and not in /usr/local/share/include/. Because /usr/local/share is no default include path of gcc and clang.

Desktop (please complete the following information):

FreeYourSoul commented 5 years ago

A fix has been provided in the CMakelist.txt to install the header files into the FSeam folder properly. (headers were installed in the root folder which was not clean).

FreeYourSoul commented 5 years ago

Don't hesitate to re-open the ticket if the issue has not been solved