c++ - CMake, QtCreator and header files -


this not compilation related problem, more visual issue ...

i have project, set cmake (this not qt project). when open project qtcreator nicely finds related files, , files in project browser in alphabetical order like:

project  + abc.cpp  + abc.h  + def.cpp  + def.h 

however, if work qtcreator , qmake based project, headers , sources nicely separated like:

project  + headers  |  + abc.h  |  + def.h  + sources      + abc.cpp     + def.cpp 

question: how achieve separation of headers , sources qt creator? have tried source_group("headers" files abc.h def.h) , although works (to extent) visual studio, not work qt creator. other tips?

specifically cmake, like:

add_custom_command(output     ${cmake_binary_dir}/include/res.h ${cmake_binary_dir}/sources/abc.cpp     command ${cmake_command} -e touch ${cmake_binary_dir}/headers/abc.h depends ${cmake_source_dir}/resources/res.gen) 

for further options , details:

of course can still use qt creator if editing files. in qt creator @ main control panel, in upper left menu need select:

file > new file or project > files , classes > c++ : 

then have 3 options:

  • c++ class: option generate both sub-folders source file , header file, automatically including header , source file respective folders.
  • c++ source file: create , add source file respective sub-folder project.
  • c++ header file: create , add header file respective sub-folder project.

select 1 need , under project folder organized in way want it.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -