Cmake coding style

Showing 1-9 of 9 messages
Cmake coding style Alexander Sokolov 7/17/12 10:06 AM
We have a crazy situation with the cmake files. All files have their own style of naming variables. Here is a variants of the variable names for .h files.
  • razor-appswitcher_HDRS
  • razor-policykit-agent_H
  • ${PROJECT_NAME} _HEADERS
  • H_FILES
  • HEADERS
  • razorqxt_PUBLIC_HDRS and razorqxt_PRIVATE_HDRS
  • QTXDG_PUBLIC_HDRS and QTXDG_PRIVATE_HDRS
  • HW_HEADERS

I suggest to choose one style and describe it in the wiki.

Do we need prefixes? Cmake documentation says: "Each new directory or function creates a new scope." Therefore, the two programs will be have independent variables, but I'm not sure about the nested directory, like:
razorqt-session
    CMakeLists.txt
    /config
        CMakeLists.txt

I like the style of H_FILES (or ${PROJECT_NAME} _H_FILES if prefix is needed)
This allows to have a single style for different files: TS_FILES, QM_FILES, MOC_FILES, QRC_FILES, and so on.

Any Ideas.
Re: Cmake coding style Kuzma Shapran 7/17/12 6:40 PM
+1 to your suggestion.

So for a dynamic library it can be:

${PROJECT_NAME}_H_FILES
${PROJECT_NAME}_PRIVATE_H_FILES 
${PROJECT_NAME}_PUBLIC_H_FILES 
Re: [razor-qt] Cmake coding style Christian Surlykke 7/18/12 12:52 AM


2012/7/17 Alexander Sokolov <sokol...@gmail.com>
I prefer no prefixes. TS_FILES, QM_FILES,.. as you suggest would be fine with me.

br. Chr. 

Re: [razor-qt] Cmake coding style Alexander Sokolov 7/18/12 1:50 AM
I made the test (diff in the attach). I added the variable with the same name to the razorqt-session/CMakeLists.txt and razorqt-session/config/CMakeLists.txt. Result:

-- @@@@@ VAR in the razorqt-session/config/CMakeLists.txt: razor-session;razor-sessioncfg                    
-- @@@@@ VAR in the razorqt-session/CMakeLists.txt:  razor-session 

As you can see in razorqt-session/config/CMakeLists.txt variable have cumulative value. This may create errors, which would be difficult to detect. So let's use ${PROJECT_NAME}_XXX_FILES

2012/7/18 chri...@surlykke.dk <chri...@surlykke.dk>

--
You received this message because you are subscribed to the Google
Groups "Razor-qt" group.
For more options, visit this group at
http://groups.google.com/group/razor-qt?hl=en



--
Best regards,
Alexander.
Re: [razor-qt] Cmake coding style PICCORO Lenz McKAY 7/18/12 6:50 AM


On Wed, Jul 18, 2012 at 4:20 AM, Александр Соколов <sokol...@gmail.com> wrote:
As you can see in razorqt-session/config/CMakeLists.txt variable have cumulative value. This may create errors, which would be difficult to detect. So let's use ${PROJECT_NAME}_XXX_FILES
This are better, thant
On Tue, Jul 17, 2012 at 9:10 PM, Kuzma Shapran <leaf.o...@gmail.com> wrote:
So for a dynamic library it can be:
${PROJECT_NAME}_H_FILES
${PROJECT_NAME}_PRIVATE_H_FILES 
${PROJECT_NAME}_PUBLIC_H_FILES
I dont think so that's necesary.. and i think "PROJECT_NAME" must be "MODULE_NAME" due i think the main proyect are RAZORQT, or so MAIN_PROJECT and SUBPROJECT could also.. but directly PROJECT_NAME may be confusing

2012/7/18 chri...@surlykke.dk <chri...@surlykke.dk>

I prefer no prefixes. TS_FILES, QM_FILES,.. as you suggest would be fine with me.
+1 to u, better no prefixes

--
Lenz McKAY Gerardo (PICCORO)
http://qgqlochekone.blogspot.com
Cofundador de Venenux;  debian based multimedia alike free only zealots users (oh well, i try but..too many free guidelines buahhh)
http://shutendouji.net
creador de massenkoh linux; debian enhanchements for better up to date support on stable brand, including non-free soft.

Re: Cmake coding style Petr Vanek 7/18/12 10:57 AM
prefixes are mandatory. That's what I said - variables are inherited ;)

Also (I think) it's much more readable to have FOO_HEADERS than ${PROJECT}_HEADERS.

That are my 2c...
Re: [razor-qt] Cmake coding style Alexander Sokolov 7/18/12 12:31 PM


2012/7/18 PICCORO McKAY Lenz <mckayg...@gmail.com>



On Wed, Jul 18, 2012 at 4:20 AM, Александр Соколов <sokol...@gmail.com> wrote:
As you can see in razorqt-session/config/CMakeLists.txt variable have cumulative value. This may create errors, which would be difficult to detect. So let's use ${PROJECT_NAME}_XXX_FILES
This are better, thant
On Tue, Jul 17, 2012 at 9:10 PM, Kuzma Shapran <leaf.o...@gmail.com> wrote:
So for a dynamic library it can be:
${PROJECT_NAME}_H_FILES
${PROJECT_NAME}_PRIVATE_H_FILES 
${PROJECT_NAME}_PUBLIC_H_FILES
I dont think so that's necesary.. and i think "PROJECT_NAME" must be "MODULE_NAME" due i think the main proyect are RAZORQT, or so MAIN_PROJECT and SUBPROJECT could also.. but directly PROJECT_NAME may be confusing
PROJECT_NAME is not normal variable, any cmake file should have the "project(razor-foo)" line. The PROJECT_NAME contains razor-foo in this case. IMHO we no need your own variable instead a standard, well known and the documented in the cmake docs.
 

2012/7/18 chri...@surlykke.dk <chri...@surlykke.dk>

I prefer no prefixes. TS_FILES, QM_FILES,.. as you suggest would be fine with me.
+1 to u, better no prefixes

--
Lenz McKAY Gerardo (PICCORO)
http://qgqlochekone.blogspot.com
Cofundador de Venenux;  debian based multimedia alike free only zealots users (oh well, i try but..too many free guidelines buahhh)
http://shutendouji.net
creador de massenkoh linux; debian enhanchements for better up to date support on stable brand, including non-free soft.

--
You received this message because you are subscribed to the Google
Groups "Razor-qt" group.
For more options, visit this group at
http://groups.google.com/group/razor-qt?hl=en



--
Best regards,
Alexander.
Re: [razor-qt] Re: Cmake coding style Alexander Sokolov 7/18/12 12:39 PM


2012/7/18 Petr Vanek <pe...@scribus.info>

prefixes are mandatory. That's what I said - variables are inherited ;)
OK we use prefixes. And what about postfixes? 
 
Also (I think) it's much more readable to have FOO_HEADERS than ${PROJECT}_HEADERS.
I can't find now, but I already fixed copy-past errors - one part of the file contains foo_HDRS but another part contains bar_HDRS. With ${PROJECT_NAME}  we can use copy-past without  risk.



That are my 2c...


On Tuesday, July 17, 2012 7:06:15 PM UTC+2, Alexander Sokolov wrote:
We have a crazy situation with the cmake files. All files have their own style of naming variables. Here is a variants of the variable names for .h files.
  • razor-appswitcher_HDRS
  • razor-policykit-agent_H
  • ${PROJECT_NAME} _HEADERS
  • H_FILES
  • HEADERS
  • razorqxt_PUBLIC_HDRS and razorqxt_PRIVATE_HDRS
  • QTXDG_PUBLIC_HDRS and QTXDG_PRIVATE_HDRS
  • HW_HEADERS

I suggest to choose one style and describe it in the wiki.

Do we need prefixes? Cmake documentation says: "Each new directory or function creates a new scope." Therefore, the two programs will be have independent variables, but I'm not sure about the nested directory, like:
razorqt-session
    CMakeLists.txt
    /config
        CMakeLists.txt

I like the style of H_FILES (or ${PROJECT_NAME} _H_FILES if prefix is needed)
This allows to have a single style for different files: TS_FILES, QM_FILES, MOC_FILES, QRC_FILES, and so on.

Any Ideas.

--
You received this message because you are subscribed to the Google
Groups "Razor-qt" group.
For more options, visit this group at
http://groups.google.com/group/razor-qt?hl=en



--
Best regards,
Alexander.
Re: [razor-qt] Re: Cmake coding style PICCORO Lenz McKAY 7/18/12 1:36 PM

umm ok more readable but relationshipt are less readable with razor modules.. 
On Wed, Jul 18, 2012 at 1:27 PM, Petr Vanek <pe...@scribus.info> wrote:
Also (I think) it's much more readable to have FOO_HEADERS than ${PROJECT}_HEADERS.

 
On Wed, Jul 18, 2012 at 3:01 PM, Александр Соколов <sokol...@gmail.com> wrote:

i revised cmake wiki documentation, damn PROJECT_NAME are mandatory for sub-compilation by modular policy, i was taking that razorqt are the PROYECT_NAME and modulesa subprojects, due does not cmake support subprojects! damn well ok