[Bro-Commits] [git/broctl] master: Changing some installation paths. (90ddc4d)

Robin,

- The CMake install does no longer recreate some of the
top-level directories when they already exist. That makes it
possible to now symlink them somewhere else after the first
install.

The new code probably isn't doing as you intended. The OPTIONAL flag seems unrelated to the existence of the destination directory, it's checking the existence of the named directory as a source directory (part of the build) and won't complain if it doesn't exist, but it also won't create the destination directory in that case, which is a problem. In other words, for a fresh install, the spool and logs directories don't get created for me.

I would re-code it to script the creation of those directories at `make install` time, but I'm finding that CPack will only bundle things up into the binary package if they've been installed w/ the install() macro and that's not callable at `make install` time.

So my idea is that I'll re-code for the general case to script the directory creation at `make install` time, but also add a configure option that a packager can set to explicitly use the install() macro instead.

Are you able to give the platform and CMake version that produced the bad behavior of the installation of directories overwriting/recreating existing ones? I don't see the same problem (using the original code) on OS X 10.6 + CMake 2.8.3, so I'd like to document it.

case, which is a problem. In other words, for a fresh install, the
spool and logs directories don't get created for me.

Hmm, just tried it, and they do get created for me with current
master. (Though I indeed might have misunderstood OPTIONS, from a
quick try I don't see a difference without).

So, not sure what's different over here. Here's what I need: I have
a setup where I link spool and logs to somewhere else. I do that
manually after the first "make install", and then need later "make
installs" to not delete those links, but jsut follow them as
necessary. I thought that the "NOT EXISTS" would do the trick?

Are you able to give the platform and CMake version that produced

FreeBSD and cmake 2.8.2

Robin

> case, which is a problem. In other words, for a fresh install, the
> spool and logs directories don't get created for me.

Hmm, just tried it, and they do get created for me with current
master. (Though I indeed might have misunderstood OPTIONS, from a
quick try I don't see a difference without).

Yeah, after thinking about it again, the OPTIONAL flag shouldn't cause different behavior in the case of not supplying a src dir and probably actually doesn't (though, I think it still doesn't help accomplish what you need). I think I figured out what was actually happening to me...

So, not sure what's different over here. Here's what I need: I have
a setup where I link spool and logs to somewhere else. I do that
manually after the first "make install", and then need later "make
installs" to not delete those links, but jsut follow them as
necessary. I thought that the "NOT EXISTS" would do the trick?

That check will happen at the configure time. So the problem I ran into was I had a previous installation at /usr/local/bro, then I did:

./configure
cd build
make
# at this point I realize that I have an existing installation that I want to get rid of to test a clean install
rm -rf /usr/local/bro
make install

So /usr/local/bro/spool/* and /usr/local/bro/logs didn't get created because they existed at configure time.

> Are you able to give the platform and CMake version that produced

FreeBSD and cmake 2.8.2

So the question I have now is, does CMake code like the following:

   install(DIRECTORY DESTINATION spool)

actually overwrite your symlinks on FreeBSD while doing `make install`?

I don't see that happening on OS X 10.6 (w/ CMake 2.8.3) or Fedora 14 (w/ CMake 2.8.2).

Well, that's funny because now that I'm trying this, it doesn't
overwrite the links. However, I'm pretty sure it did it when I was
using that earlier ... Let me try a bit more, if everything works
fine, I'll revert the change.

Robin