On 28.11.2016 at 17:32 Daniele Lugli wrote:
> Hi Albrecht,
>
> thank you for your exceptionally prompt reply! It is really a good first
> impact with the fltk community!
Welcome. We're not always that fast, but we try to help as good as we can.
> Of course I will trust your suggestion and go with fltk-1.3.4, but first
> I would like to try and complete the build of 1.4
> I am reluctant to switch to VS Community 2015 as I already have some
> code working well with 2013 and a new version of the compiler/IDE can be
> a jump in the dark, but of course I will switch if I find that 2013
> gives problems with fltk.
That's all fine. And it's always good to have two versions to test. I
only wrote about VS 2015 for completeness, because I use it for testing
and I know it works. I do also have VS 2008 and VS 2010 on another PC,
and they all work. It's good to read that VS 2013 Community works as
well, thanks for your feedback.
> So I changed "Where is the source code" to the _parent_ of the src
> directory (not really intuitive :) but I understand this is a
> cmake-related, not fltk-related detail).
The src/ directory is only one of potentially many more source
subdirectories in the FLTK source folder. There is also fluid, test, and
there are image and zip library folders. From CMake's point of view the
"source code directory" should always be the top level directory unless
you read anything else in the build instructions. CMake looks for the
file CMakeLists.txt, and it _should_ find the top-level one, not one in
the subdirectories (note: there is and must be one in the src/ directory
as well). CMakeLists.txt is for CMake what Makefiles are for
conventional configure/make build systems.
> Configure now completes, but complains missing HAVE_GL_GL_H,
> HAVE_GL_GLU_H, HAVE_LOCALE_H and suggests to re-run cmake-gui from a
> Visual Studio developer.
> Done so, it finds the three headers somewhere in the guts of the system, OK.
This is a known (CMake) issue, and the warning is generated by FLTK's
CMake script intentionally. However it would likely also work if you
just opened the solution and started to build...
> Changed all /MD flags to /MT in the CMAKE group.
There should be a better way to do this, but I can't help directly
because I don't use VS for my development. You could try to set /MT in
OPTION_OPTIM, but I don't know if this would work. See below for more...
> Changed CMAKE_INSTALL_PREFIX from C:/Program Files/FLTK to C:/Program
> Files/FLTK-1.4 (anticipating the parallel installation of the 1.3
> version too).
> Click Generate.
> Opened the solution in VS, changed Debug to Release, ALL_BUILD
> Some warnings, eg conversion from double to float or from float to int,
> deprecated strdup and similar -- no error though.
Perfect. There are options to suppress these warnings, and I know that
you can set _these_ options in OPTION_OPTIM because I did this to see
*real* warnings and errors. You may try to set these options in CMake's
OPTION_OPTIM:
/wd4244 /wd4267 /wd4305 /wd4996 /wd4312 /wd4334 /wd4838
Fixing (some/most of) these warnings is on my to-do-list for FLTK 1.4.
There's also an STR with a patch, so this is likely to happen soon...
> Tried a handful of exe from build\bin\examples\Release, all working --
> and impressive.
Great!
> Found nothing under C:/Program Files/FLTK-1.4. I see that INSTALL has
> not been built (maybe it is not included in ALL_BUILD?)
Yes, it is intentionally not included. If you want to install then only
after you tested a new version and you really want to do it, so it's a
separate build step.
> Try to build INSTALL separately -- cannot create the directory.
> Relaunch VS as administrator and retry -- OK.
> Wonderful !
:-)
> By the way, is it really necessary to install FLTK or could I also keep
> it in my private tree? In this way I could carry it with my stuff:
> sometimes I work on different machines and it would be nice not to have
> to reinstall it every time.
You don't need to "install" it, particularly not in a system folder
where you need admin privileges. The interesting point comes when you
build your own applications that use the FLTK library. You can use the
FLTK library and include files directly from the FLTK build directory,
and that's what the FLTK team usually recommends. There are two points
though that make an installation step "interesting" (helpful):
Point 1: the build directory layout WRT header and library files can
differ from a real install directory, so the setup of your own projects
may have to be different as well.
Point 2: There are at least two files created in CMake's build
directory, i.e. in a subdirectory of your build/ folder:
config.h and FL/abi-version.h .
config.h should only be visible to the FLTK library build and will not
be installed in your install directory. FL/abi-version.h however must be
seen by the compiler when you compile your project. You must set your
"additional include directories" (or similar) in your own project to:
(1) /path/to/fltk
(2) /path/to/fltk/build
if you *don't* install FLTK (and, BTW, you can accidentally include
config.h in your application if you do so).
OTOH, if you "install" FLTK in one of your personal directories, say
/path/to/my/projects/fltk-1.3 then you need only one additional include
directory:
(1) /path/to/my/projects/fltk-1.3
The file FL/abi-version.h will be installed in the correct place, and
config.h won't be accessible to your own project's build process.
So I think it is better to do this additional installation step if you
use Visual Studio and it has the additional advantage that you can do it
after testing a new FLTK snapshot or release w/o disturbing your
previously installed version while still testing. YMMV.
See also Michael Surette's post. What he says is that you can easily use
FLTK from the build directory if you setup your own build with CMake as
well which I't generally recommend. But this can be different if you use
your own Visual Studio projects generated manually, and I assume that's
what you have.
> Now I am going to do the same with 1.3 as suggested.
Good luck, and have fun!
> Even if I find no problem, I would like to document the steps here, if
> it does not clutter too much. It could be useful for somebody else, or a
> good reminder for myself.
Feel free to do that. Note that we also have our "articles". If you
think that you can help others an article would be a good choice.
Articles can be updated when you see that your instructions are outdated
or need some polishing, whereas mailing list contents can't be changed.
PS: Please don't top-post here. For better reading you should trim the
message you're replying to and interleave citations and your new text.
Thanks.