Re: [CMake] conditions and included subprojects

2018-06-11 Thread Andreas Naumann
: "Cornelis Bockemühl" An: "Andreas Naumann" , cmake@cmake.org Betreff: Re: [CMake] conditions and included subprojects Thanks for your proposals!   Actually my problem is basically that I want to keep up with some minimum good practice, but I am seeing myself throwing it o

Re: [CMake] conditions and included subprojects

2018-06-11 Thread Johannes Zarl-Zierl
Hello Cornelis, I'm not sure if I get your use-case completely, but somtimes I also have the need for three-state variables. What I usually do: set(MY_OPTION "AUTO" CACHE STRING "Documentation for my option") set_property(CACHE MY_OPTION STRINGS "ON:OFF:AUTO") if("${MY_OPTION}" STREQUAL AUTO)

Re: [CMake] conditions and included subprojects

2018-06-11 Thread Cornelis Bockemühl
Thanks for your proposals! Actually my problem is basically that I want to keep up with some minimum good practice, but I am seeing myself throwing it over board constantly if I do not find a logical solution after one or two hours of struggling... Your second option is close to what I am

Re: [CMake] conditions and included subprojects

2018-06-11 Thread Andreas Naumann
Dear Cornelis,   your description looks to me like having a three valued option: ON, OFF, UNDEFINED. But an option in cmake language has only two values: ON or OFF.  To solve your problem with the connection between your sub-project and the main project, you should forget about the main