Makefile to depend on third-party libs with cmake -


all.

my main program uses third-party library a. main program uses autoconf , library uses cmakefile build. since converting 1 framework pain me, want keep 2 different build mechanism.

since main depends on liba, made main depend on liba , liba force-build target.

when change source file of main , make on main, liba gets cmake , keep intact since nothing on liba changed, main gets build.

when change source file in liba , make on main, liba gets build forcefuly. main's dependency liba computed before building new liba, linking not done. make twice each time main safely.

how can improve build? summarize:

  • main depends on liba (a)
  • when make after changing source file of liba, want build liba first , build main (b)
  • when make after changing source file of main, want build main original liba (c)
  • when make without doing anything, want build nothing. (d)

with current setup, cannot (b).

any helps appreciated.

what old shell script (or bat file, if happen on windows)? run cmake liba, run make main, profit!

you can use make batch engine, e.g.

all:         cmake liba         $(make) -f main.mk main 

Comments

Popular posts from this blog

gridview - Yii2 DataPorivider $totalSum for a column -

java - Suppress Jboss version details from HTTP error response -

Sass watch command compiles .scss files before full sftp upload -