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

Jonathan Siwek jsiwek at ncsa.illinois.edu
Mon Jan 10 11:53:54 PST 2011


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.

> diff --git a/CMakeLists.txt b/CMakeLists.txt
> index 5056886..a098852 100644
> --- a/CMakeLists.txt
> +++ b/CMakeLists.txt
> @@ -184,14 +184,25 @@ else ()
> RENAME networks.cfg.example)
> endif ()
> 
> -install(DIRECTORY DESTINATION spool)
> -install(DIRECTORY DESTINATION spool/tmp)
> -install(DIRECTORY DESTINATION logs)
> -
> -# The dynamic state will be updated on first `broctl install`
> -file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/broctl.dat)
> -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/broctl.dat
> - DESTINATION spool)
> +if (NOT EXISTS ${PREFIX}/spool)
> + install(DIRECTORY DESTINATION spool OPTIONAL)
> +endif ()
> +
> +if (NOT EXISTS ${PREFIX}/spool/policy)
> + install(DIRECTORY DESTINATION spool/policy OPTIONAL)
> +endif ()
> +
> +if (NOT EXISTS ${PREFIX}/spool/tmp)
> + install(DIRECTORY DESTINATION spool/tmp OPTIONAL)
> +endif ()
> +
> +if (NOT EXISTS ${PREFIX}/logs)
> + install(DIRECTORY DESTINATION logs OPTIONAL)
> +endif ()


More information about the bro-dev mailing list