How to build a program with 2 different values of a variable in CMake

后端 未结 2 1348
挽巷
挽巷 2021-02-06 05:03

I\'ve recently ported my Qt project from qmake to CMake. My main program contains a value which depends on a #define directiv

2条回答
  •  长情又很酷
    2021-02-06 06:02

    Another way could be:

    mkdir two directory
    buildflavor1
    buildflavor2
    

    In the first sub directory run:

    cmake -DFLAVOR=OPTION1 ..
    

    in the second run:

    run cmake -DFLAVOR=OPTION2 ..
    

    So two executable with same name with different compilation flag with is own feature .o and so on.

提交回复
热议问题