How to configure cmake to get an executable not by default
问题 I have a small project with cmake. I build a lib and an executable. on the development machine I want also an executable that cannot be build on other machines/environments. e.g.: <my-lib> | -- CMakeLists.txt | + -- src/ -> build the lib/archive | |-- lib.c | |-- lib.h | |-- CMakeLists.txt | + -- tool -> build the tool | |-- tool.c | |-- CMakeLists.txt | + -- tests -> build the unit tests | |-- tests.c | |-- CMakeLists.txt I added CMakeLists.txt to all directories. Also an add_executable to