-D must be entered each time cmake is run unless it is run from a
script. This must be done for each project run from a local machine.
This is intended, because you can’t predict where any given user will
have his libraries installed. Some people may keep them in their home
directory (say /home/foo/mylibs), others in /opt (say
/opt/mylibs). Thus, it is the duty of the user building the software to
instruct CMake properly.
I can't really add CMAKE_INCLUDE_PATH to any given
file, since other people who work with code will not have the same
include locations (or operating system).
These variables are not intended to be set inside CMakeLists.txt for the
reason I gave above.
I'd be interested in configuring include files / libraries for
projects on my machine. For find_path it says for step 2 in the
process, "Search paths specified in cmake-specific environment
variables. These are intended to be set in the user’s shell
configuration.". find_library has the same sort of thing. I assume I
could either set environment variables in Windows or do the same in
Linux to set this once and for all and not do this for each project.
This is the proper way to do it. I assume you can just set an
environment variable like CMAKE_INCLUDE_PATH instead of specifying it
with -D, and cmake will pick it up. Try it out and see.
I will reject HTML emails. | Ich akzeptiere keine HTML-Nachrichten.
Use GnuPG for mail encryption: | GnuPG für Mail-Verschlüsselung:
My key fingerprint: | Mein Schlüsselabdruck:
B1FE 958E D5E8 468E AA20 | B1FE 958E D5E8 468E AA20
8F4B F1D8 799F BCC8 BC4F | 8F4B F1D8 799F BCC8 BC4F