I have a C++ library that is using cmake. The structure of my library looks like this:
src/module1/class1.h
src/module1/class1.cpp
src/module1/class2.h
src/module1/class2.cpp
src/module2/class3.h
src/module2/class3.cpp
etc..
I want to make install rule for my project using INSTALL command. First, i need to retrieve all my headers files:
FILE (GLOB_RECURSE ALL_HEADERS "*.h")
Next i’m trying to install them to C:\temp:
INSTALL(FILES {$ALL_HEADER} DESTINATION "C:\\temp")
It works, but resulting directory is following:
temp/class1.h
temp/class2.h
temp/class3.h
but not is:
temp/module1/class1.h
temp/module1/class2.h
temp/module2/class3.h
As you see CMake doesn’t “remember” folder paths. How can I deal with it?
One of options is using
install(DIRECTORY ...syntax: