I have a project "A" that depends on another project "B".
- ProjectB installs some headers, for example B1.h, B2.h.
- ProjectA tries to create a Python wrapper of B1.h and B2.h, using SWIG.
ProjectA uses :
ExternalProject_Add(ProjectB ...)
to compile and install ProjectB somwhere into the binary dir.Swig_Add_Library(ProjectB ...)
to create the Python wrapper ; this command creates a target_ProjectB
.
I want to be sure that B1.h, B2.h are installed before SWIG runs, thus I added the following command :
add_dependencies(_ProjectB ProjectA)
On Windows, this works fine.
However on Linux, the add_dependencies
command is not taken into account, which gives :
.../ProjectA.i: 111: Error: Unable to find 'B1.h'
.../ProjectA.i: 112: Error: Unable to find 'B2.h'
I am sure that the include dir given to SWIG is correct: indeed, when I run make
for the second time, this works because ProjectB was successfully installed by the first call to make
.
I use CMake 3.13.5.
Any help would be great !