FLTK logo

Re: [fltk.coredev] CMake: add 'examples' to build [was: Something in progress? (table examples broken on Linux)]

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.coredev  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: CMake: add 'examples' to build [was: Something in progress? (table examples broken on Linux)] Greg Ercolano Aug 14, 2020  
 
On 2020-08-14 04:00, Albrecht Schlosser wrote:

>> 		fltk/<build>/test/		<-- test executables
>> 		fltk/<build>/examples/		<-- examples executables
>>
> I'd rule out this concept because CMake uses these dirs for their own 
> files created by the CMake configure + build phase. Please take a look 
> at these dirs and you'll see. This has been one of the reasons to put 
> them in an extra bin/ directory (originally: bin/examples/ as you 
> certainly know).

	That's too bad, as I think the contents of those dirs will
	confuse folks used to FLTK's old autoconf results and following
	old docs.

	So just curious: couldn't we target those dirs for the binaries
	anyway? Or would that complicate the 'make clean' target?

	Just checking to make sure there isn't a way out, as it just
	seems like the obvious place for stuff to go.

	My thinking of the optimal layout would be:

		<build>/bin      <-- fluid (wrapper on OSX) and fltk-config would go here
		<build>/examples <-- example execs (mixed with some cmake cruft might be OK)
		<build>/test     <-- test execs (mixed with some cmake cruft might be OK)

	But if there might be crosstalk between cmake's needs
	and our stuff, perhaps that's bad.

>> 	But if things really need to be in <build>/bin for some reason,
>> 	then I'd next hope for:
>>
>> 		<build>/bin/test/		<-- test executables
>> 		<build>/bin/examples/		<-- examples executables
> 
> I wanted to get rid of the subdirs and put the test/* executables in the 
> bin/ dir where previously only fluid was generated to be able to use a 
> well-known structure for test/demo so we could run fluid and all the 
> test programs from the same directory w/o adding lots of directory 
> handling stuff (in test/demo.cxx).

	I'm sure you've researched carefully, but I think if we don't
	do the above, we'll have to be more specific in our docs,
	as the autoconf/make vs cmake/make results will differ as
	to where to find stuff. Old docs will be wrong.

> Therefore I'd *really* like to keep the created fluid and test/*.cxx 
> executables all together in one directory. Otherwise we'd need to 
> revisit test/demo.cxx to sort that out again.
> 
> Please consider that test/demo.cxx must be able to execute the test 
> programs from the fltk/test folder for autoconf/make builds and from 
> build/bin/something folder(s) for CMake builds and for all different 
> variants of Xcode, VS, make, ninja, ...
> 
> It was hard work to get this going, I wouldn't like to change this again.
> 
>> 	..and I guess my last choice would be:
>>
>> 		<build>/bin/                    <-- test executables
>> 		<build>/bin/examples/           <-- examples executables
> 
> This is as it is done now in my test branch. It works and it's the 
> easiest way to go.

	OK, but if we go this route, I'd /highly/ recommend a small banner
	at the end of the build process saying where stuff is:

--- COMPLETED
    To build examples, run 'make examples'.
        LIBS: ./lib
        BINS: ./bin  (fltk-config, fluid..)
        TEST PROGRAMS: ./bin    (e.g. demo, hello, etc)
     EXAMPLE PROGRAMS: ./bin    (e.g. tree-simple, etc)

>> You can pull from my branch to test:
>> https://github.com/Albrecht-S/fltk/tree/feature-examples
>> [..]
>> Another question regarding macOS only: I'm not sure where the wrapper 
>> scripts get installed (now). Are they installed in bin/examples or are 
>> they all installed in bin/ ? Can anybody please test and tell me?

    I did the following on 10.10.3:

git clone git@github.com:Albrecht-S/fltk.git fltk-albrecht-fork
cd fltk-albrecht-fork
git checkout feature-examples
mkdir build
cd build
cmake -D OPTION_USE_SYSTEM_LIBPNG=off -D OPTION_USE_SYSTEM_ZLIB=off ..
make -j 4

    ..and it looks like both wrappers and .apps are in the ./bin directory.

    Question: I'm not sure I know how to build the 'examples' -- what should
    I use to test that? I tried the things that seemed obvious to me:

$ pwd
/net/tmp/fltk-albrecht-fork/build

$ make examples
make: *** No rule to make target `examples'.  Stop.    <-- nope

$ cd ../examples; make                                 <-- nope
make: ../fltk-config: Command not found
make: ../fltk-config: Command not found
*** Compile browser-simple.cxx...
make: I..: No such file or directory
make: ../fltk-config: Command not found
make: ../fltk-config: Command not found
make: ../fltk-config: Command not found
*** Linking browser-simple...
make: browser-simple.o: No such file or directory
make: *** [browser-simple] Error 1

    I think you mentioned the examples were enabled by default in this branch,
    but I couldn't find e.g. 'tree-simple' in the build dir:

$ pwd
/net/tmp/fltk-albrecht-fork/build

$ find . | grep tree-simple

$

    ..so I assumed I need to run a follow up make command to build it, but maybe
    that's not ready yet.

-- 
You received this message because you are subscribed to the Google Groups "fltk.coredev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkcoredev+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkcoredev/b9539af5-8174-6e85-f826-299a593c391f%40seriss.com.
Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.