cmake install: how to remove subdir prefix -


i have library liba. structure following:

liba + cmakelists.txt + mysrc/headera.h + mysrc/headerb.h + mysrc/modulea/moda.h + mysrc/moduleb/modb.h 

my lib compiles fine , afterwards want install using cmake code:

set(source_dir mysrc) set(lib_name liba)  ... install(targets ${lib_name} destination /usr/local/lib) install(directory ${source_dir}  destination /usr/local/include/liba files_matching pattern "*.h") 

result:

liba.a ends in

/usr/local/lib/liba.a (which fine) 

headers end in

/usr/local/include/liba/mysrc/* /usr/local/include/liba/mysrc/modulea /usr/local/include/liba/mysrc/moduleb 

what not wanted. i want remove "mysrc":

/usr/local/include/liba/* /usr/local/include/liba/modulea /usr/local/include/liba/moduleb 

how can remove mysrc path?

as cmake documentation says, can prevent cmake appending directory name following trailing slash:

install(directory ${source_dir}/   destination /usr/local/include/liba   files_matching pattern "*.h") 

Comments

Popular posts from this blog

matlab - "Contour not rendered for non-finite ZData" -

delphi - Indy UDP Read Contents of Adata -

javascript - Any ideas when Firefox is likely to implement lengthAdjust and textLength? -