McMartin/FRUT

Issue with "Header Search Paths" and "Extra Library Search Paths" in exporter

kauwua opened this issue · 2 comments

Hi,

First of all, thanks for maintaining this project ! Here is my issue :

The project I'm working on uses relative paths for the "Header Search Paths" and "Extra Library Search Paths" in the exporter settings of Projucer. Switching to FRUT, the headers added using the "Header Search Paths" were unfound.

The reason seems to be the following

  1. Jucer2CMake converts the relative paths of "Header Search Paths" and "Extra Library Search Paths" from relative to the target project directory, to relative to the .jucer directory.
    With this folder structure

root/
├─ MyProject/
│ ├─ Builds/
│ │ ├─ TargetFolder/
│ ├─ MyProject.jucer

Accessing a file in root would look like "../../../myfile.h", but Jucer2CMake transforms it to "../myfile.h" (relative to the .jucer)

  1. Reprojucer.cmake uses the _FRUT_abs_path_based_on_jucer_target_project_folder function, which fails to give the correct path because it is now relative to the .jucer directory
    This does not happen with "Extra Library Search Paths" because Reprojucer.cmake uses the _FRUT_abs_path_based_on_jucer_project_dir function.

To fix this, I switched both "Header Search Paths" and "Extra Library Search Paths" to fully use paths relative to the target project directory, which will make the .jucer and CMakeLists.txt match to avoid confusion. You can find my changes here https://github.com/Riuzakiii/FRUT/commit/ed2db9052778a616f598f09246b5d147e10de625.

Do you think this would be a good fix ?

Hi @Riuzakiii,

Thanks a lot for reporting this bug!

In #687, I tried to fix the issues related to settings that contain paths relative to the target project directory, but it seems that I missed these...

I left a few comments on your changes: they go in the right direction, but would need a bit of polish to be merged. Feel free to open a pull request though! (I would recommend using another branch than main in your repository)

Thanks, I made changes based on your comments and switched to using a develop branch instead of main. Here's the pull request : #727