Closed fcomida closed 5 years ago
Are you sure about this? The install prefix is /usr/
and in my /usr/
directory there isn't even any lib64 directory.
I am on Fedora 29, my install prefix is "/usr/local" (where I put locally built software) and with my change librtprocess.so got intalled in "/usr/local/lib64/librtprocess.so". In Fedora 64 bits libraries are under "/usr/lib64" and "/lib64" is a symlink to "/usr/lib64". There is also "/usr/lib" and "/usr/local/lib" and symlinks as above for multilib (i686) packages.
Also note I've updated cmakelists.txt to include a mac part. I tested the merge on mac and this pr obliterates the change, installing into lib64, etc. If possible please sync with master again before merging it. Perhaps also make the UNIX parts you add conditional to be not APPLE so as to not apply on macOS.
Also, why not use the -DCMAKE_INSTALL_PREFIX or something to be more universal for those unixes?
I also think INSTALL_PREFIX is somehow wrong. One should use CMAKE_INSTALL_PREFIX and there's no need to write it, for instance in the "install" directive DESTINATION is relative to CMAKE_INSTALL_PREFIX.
get_property(LIB64 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS) should take care of finding out where libraries must be installed on each system.
@fcomida
I also think INSTALL_PREFIX is somehow wrong. One should use CMAKE_INSTALL_PREFIX and there's no need to write it, for instance in the "install" directive DESTINATION is relative to CMAKE_INSTALL_PREFIX.
I wrote that part to get it somehow working on Linux and msys2. Me being a complete cmake noob, @fcomida @CarVac feel free to change it to the best.
Unfortunately I know even less about cmake so I can only defer to those who know better...
I'm sorry but this is the wrong way to do it. Please use the GNUInstallDirs module provided by cmake:
See: https://git.cryptomilk.org/projects/cmocka.git/tree/CMakeLists.txt#n34 and https://git.cryptomilk.org/projects/cmocka.git/tree/src/CMakeLists.txt#n75
I started #27, I'm too stupid to associate "fix installation on Linux" with the install target...
Here is the GNU standard directory policy: https://www.gnu.org/prep/standards/html_node/Directory-Variables.html
I think it's important to respect this policy especially, well, as of my last investigation of the subject, cmake doesn't include 'uninstall' targets in its Makefiles...
That's why cmake offers a GNUInstallDir module ...
I attempted to make it use GNUInstallDirs but now Filmulator can't find the .so file (it does compile though).
Things installed:
/usr/local/lib/librtprocess.so
/usr/local/lib/pkgconfig/rtprocess.pc
/usr/local/include/rtprocess/rtprocess.h
Here's my current CMakeLists.txt.
Any advice?
You need to add /user/local/lib to the library search path. On Ubuntu, I:
# libc default configuration
/usr/local/lib
And then:
$ sudo ldconfig
How strange that libc.conf has been there since... 2009 according to the filesystem, yet I needed to run ldconfig to get it to recognize that?
In any case, I've pushed my attempt to the dev branch so I'd appreciate it if people could try it.
My file was there, but empty. I had to put /usr/local/lib line in and run ldconfig
@CarVac this doesn't point to cmake changes.
@CarVac
Here's my current CMakeLists.txt. Any advice?
Don't use file(GLOB_RECURSE SOURCES "src/*.cc")
. The reason is in the CMake docs:
Note: We do not recommend using GLOB to collect a list of source files from your source tree. If no CMakeLists.txt file changes when a source is added or removed then the generated build system cannot know when to ask CMake to regenerate.
Best, Flössie
@Floessie
Don't use file(GLOB_RECURSE SOURCES "src/*.cc")
It was me who used that, not knowing anything about cmake
I'm travelling this week and attend devconf. I can take a look and improve cmake next week.
@heckflosse
It was me who used that, not knowing anything about cmake
It just caught my eye. Sometimes it's more important to get started quickly. But I'm really curious what Andreas will come up with...
Best, Flössie
See PR #37
on 64 bits system libraries go to ${INSTALL_PREFIX}lib64