I am using header file generated by configure_file() to specify a path to a json file which is parsed by my c++ application. In my CMakeLists.txt file I set a CMake variable equal to the path I want which is used in the the *.h.in file.
I would like to modify a CMake variable (the path) base on whether I’m just building (i.e. command line “make”), in which variable would point to somewhere in the build directory or building and installing (i.e. command line “make install”) in which case I’d set my variable to usr/local…
What can I use in a conditional to modify my CMake variable based on whether “install” was specified at the command line? I can’t find this.
Conditionally specifying the location of a non-compiled file based on whether the target is being installed seems like a common use case, is there a more standard way of doing this? generator expressions are related, but seem to be used specifically for specifying target properties.