c++ - Makefile : How to install a project with a file pkg-config -


i trying make clean install of c++ project :

  • exports .h inside include/ dir
  • compile .dylib (macos) or .so (ubuntu) inside lib/ dir

now question : how write/export pkg-config .pc file, makefile, correspond project. in mac os , linux, can call

ldflags=$(shell pkg-config --libs my_project)  cppflags=$(shell pkg-config --cflags my_project) 

in other makefiles, flags include.

this done far (macos):

install : $(objs)   mkdir -p $(install_lib_dir)   $(cxx) -dynamiclib $^ $(cppflags) $(ldflags) -o $(install_lib_dir)/lib$(engine_lib_name).dylib   mkdir -p include   cp src/*.h include/   cp src/*.tpp include/   mv include $(install_dir)   rm -rf include   rm -rf lib  uninstall:   @echo "removing dir " $(install_dir)   rm -r $(install_dir) 

thank much. if can't done, doing cmake instead...


Comments

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -

Kivy: Swiping (Carousel & ScreenManager) -