These are chat archives for symengine/symengine

9th
Dec 2015
Ondřej Čertík
@certik
Dec 09 2015 15:23
@isuruf I asked about the cmake yesterday. The SymEngineConfig.cmake and similar should work for "binary" packages as well, i.e. if somebody installs them elsewhere. There wasn't time to discuss specifics, but we should simply ask on the cmake users or devel list.
I also asked about our package discovery macros, and Bill Hoffman said that cmake should be general enough to do this itself, and if not, we should try to submit our improvements to cmake itself, using the cmake devel list.
Isuru Fernando
@isuruf
Dec 09 2015 15:27
Maybe a follow up on the previous thread about the macros?
Ondřej Čertík
@certik
Dec 09 2015 15:41
We should do a follow up on that thread, but I am testing the CMAKE_PREFIX_PATH approach now.

Instead of

        PATH_SUFFIXES
            lib
            lib64

we should just use CMAKE_LIBRARY_ARCHITECTURE

Isuru Fernando
@isuruf
Dec 09 2015 15:49
Then, if we had GMP_DIR as /home/isuru/.local/ would it search /home/isuru/.local/lib ?
Ondřej Čertík
@certik
Dec 09 2015 15:50
You don't set GMP_DIR, you set CMAKE_PREFIX_PATH.
So if you put /home/isuru/.local/ into CMAKE_PREFIX_PATH, then it will search /home/isuru/.local/lib
We thought that just like in autotools, you set per package where to find them.
But in cmake, you put all the search prefix paths into CMAKE_PREFIX_PATH.
See #675.
@isuruf so the CMAKE_PREFIX_PATH takes care of 90% of my usage, since I always have the libraries installed in some kind of a prefix. One just has to put all the paths in there in the order I want them to be searched.
Ondřej Čertík
@certik
Dec 09 2015 15:58
If this somehow doesn't work, then I can still set per library paths, i.e. the cache variable that find_library and find_path sets. This is not as nice as we currently have, since cmake will not test it, it will not run find_path if I set the cache variable. But it still allows the user to do what he needs. And CMAKE_PREFIX_PATH seems to cover most of my use cases.
As to the lib64 thing, there is CMAKE_LIBRARY_ARCHITECTURE and FIND_LIBRARY_USE_LIB64_PATHS, so these two variables should cover that issue.