Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CMake] Provide a way to customise the install directories #504

Merged
merged 1 commit into from
Mar 10, 2016

Conversation

delcypher
Copy link
Contributor

[CMake] Provide a way to customise the install directories used for
executables, include files and libraries. We use
GNUInstallDirs.cmake which ships with CMake to do the difficult work
of setting a sensible default and setting up CMake cache variables.
These can be overriden when running CMake by setting the
CMAKE_INSTALL_BINDIR, CMAKE_INSTALL_INCLUDEDIR and
CMAKE_INSTALL_LIBDIR cache variables.

@jirislaby Could you please test this? For the use case you mentioned to me in #461 you can do cmake -DCMAKE_INSTALL_LIBDIR=lib64 /path/to/z3/root if you really need to force the library installation directory it but I think GNUInstallDirs.cmake should pick lib64 by default.

@wintersteiger Could you hold off merging this until @jirislaby reports everything is okay?

executables, include files and libraries. We use
``GNUInstallDirs.cmake`` which ships with CMake to do the difficult work
of setting a sensible default and setting up CMake cache variables.
These can be overriden when running CMake by setting the
``CMAKE_INSTALL_BINDIR``, ``CMAKE_INSTALL_INCLUDEDIR`` and
``CMAKE_INSTALL_LIBDIR`` cache variables.
@jirislaby
Copy link

On 03/09/2016, 03:23 PM, Dan Liew wrote:

@jirislaby https://github.com/jirislaby Could you please test this?
For the use case you mentioned to me in #461
#461 you can do |cmake
-DCMAKE_INSTALL_LIBDIR=lib64 /path/to/z3/root| if you really need to
force the library installation directory it but I think
|GNUInstallDirs.cmake| should pick |lib64| by default.

It does not work automatically, neither with -DCMAKE_INSTALL_LIBDIR:

cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib64
-DBUILD_LIBZ3_SHARED=true -DUSE_LIB_GMP=true
-DBUILD_PYTHON_BINDINGS=true -DINSTALL_PYTHON_BINDINGS=true
...
CMake Warning:
Manually-specified variables were not used by the project:

 CMAKE_INSTALL_LIBDIR

I see:
/dev/shm/xxx//home/abuild/rpmbuild/BUILDROOT/z3-20160309-0.x86_64/usr/lib/libz3.so.4.4.2.0

thanks,

js

@delcypher
Copy link
Contributor Author

@jirislaby Did you remember to wipe your source tree of the old CMakeLists.txt files and then repopulate with the latest CMakeLists.txt files before running CMake? i.e. run

contrib/cmake/bootstrap remove
contribute/cmake/boostrap create

I keep forgetting to do that myself which can result in very confusing behaviour. That's the only way the warning you show would make sense because CMAKE_INSTALL_LIBDIR is definitely used in this PR.

@jirislaby
Copy link

Yep, I always use a clean tree.

But I didn't actually apply the patch in the proper tree. Now it works automatically, indeed:
[ 27s] -- CMAKE_INSTALL_LIBDIR: "lib64"
[ 27s] -- CMAKE_INSTALL_BINDIR: "bin"
[ 27s] -- CMAKE_INSTALL_INCLUDEDIR: "include"

Thanks.

@delcypher
Copy link
Contributor Author

@jirislaby Great. Thanks for testing.

@wintersteiger This PR is ready to go :)

wintersteiger added a commit that referenced this pull request Mar 10, 2016
[CMake] Provide a way to customise the install directories
@wintersteiger wintersteiger merged commit 9095d7d into Z3Prover:master Mar 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants