c++ - CMakelist - if(DEFINED) syntax -


i going through cmakelist.txt file has entry c++ project containing src , tests folder. need know following syntax means?

if(defined build_tests)     add_subdirectory(tests) endif(defined build_tests) 

thanks rg

you can check manual, though think it's clear here:

if(defined build_tests) 

checks if variable build_tests defined in environment. if so,:

add_subdirectory(tests) 

add_subdirectory built in function (cmake has those) adds directory called tests (surprise) list of stuff needed built/compiled.

build_tests cmake variable, , determine if 'tests' part of makefile. @tsyvarev pointing out.


Comments

Popular posts from this blog

inversion of control - Autofac named registration constructor injection -

verilog - Systemverilog dynamic casting issues -

ios - Change Storyboard View using Seague -