CMake Error at CMakeLists.txt:22 (install):
install TARGETS given no ARCHIVE DESTINATION for static library target
"rtnl_static".
-- Configuring incomplete, errors occurred!
При замене ${LIBINSTALL_DIR} на, например, /usr/lib ошибка пропадает.
Основной вопрос - как правильно описать процедуру установки собранного, в данном случае интересует установка библиотеки, в CMake?
Связанный с первый - как указать директорию для установки, bindir, libdir и компания из autotools, что-то в документации найти не удалось?
Спасибо.
[daedalus@icarus ~]$ wget http://cutecom.sourceforge.net/cutecom-0.22.0.tar.gz
--2012-10-06 23:31:56-- http://cutecom.sourceforge.net/cutecom-0.22.0.tar.gz
Распознаётся cutecom.sourceforge.net... 216.34.181.96
Подключение к cutecom.sourceforge.net|216.34.181.96|:80... соединение установлено.
HTTP-запрос отправлен. Ожидание ответа... 200 OK
Длина: 23208 (23K) [application/x-gzip]
Сохранение в: «cutecom-0.22.0.tar.gz»
100%[====================================================>] 23 208 58,7KB/s за 0,4s
2012-10-06 23:31:57 (58,7 KB/s) - «cutecom-0.22.0.tar.gz» сохранён [23208/23208]
[daedalus@icarus ~]$ ls
121360-Matrix-Flux.tar.gz client_state.xml System-Shock-1-0LJ09H3X64-1024x768.jpg
3LLx_9ImR7M.jpg cutecom-0.22.0.tar.gz time_stats_log
8e0fa1a71cd8.jpg daily_xfer_history.xml Видео
8ZBNpkdUAHY.jpg Desktop Документы
all_projects_list.xml gui_rpc_auth.cfg Загрузки
av-75954.jpeg lockfile Изображения
bf2.sh merida_rockshox.jpg Музыка
BlackGold.tar notices Общедоступные
client_state_prev.xml P4018258.JPG_small.jpg Шаблоны
[daedalus@icarus ~]$ tar -xvzf cutecom-0.22.0.tar.gz
cutecom-0.22.0/
cutecom-0.22.0/CMakeLists.txt
cutecom-0.22.0/COPYING
cutecom-0.22.0/Changelog
cutecom-0.22.0/README
cutecom-0.22.0/TODO
cutecom-0.22.0/configure
cutecom-0.22.0/cutecom.1
cutecom-0.22.0/cutecom.desktop
cutecom-0.22.0/cutecommdlg.ui
cutecom-0.22.0/main.cpp
cutecom-0.22.0/qcppdialogimpl.cpp
cutecom-0.22.0/qcppdialogimpl.h
[daedalus@icarus ~]$ cd cutecom-0.22.0
[daedalus@icarus cutecom-0.22.0]$ sudo ./configure
CuteCom uses the CMake build system, at least version 2.4.3 is required.
If there is no package for your distribution, you can
get it from http://www.cmake.org/HTML/Download.html
So instead of running ./configure, you need to run cmake:
$ cmake .
[daedalus@icarus cutecom-0.22.0]$ cmake
bash: cmake: команда не найдена
[daedalus@icarus cutecom-0.22.0]$ sudo pacman -S cmake
разрешение зависимостей...
проверка на взаимную несовместимость...
Цели (1): cmake-2.8.9-1
Будет загружено: 3,94 MiB
Будет установлено: 29,86 MiB
Приступить к установке? [Y/n] Y
:: Получение пакетов с extra...
cmake-2.8.9-1-i686 3,9 MiB 369K/s 00:11 [##############################] 100%
(1/1) проверяется целостность пакета [##############################] 100%
(1/1) загрузка файлов пакета [##############################] 100%
(1/1) проверка возможных конфликтов файлов [##############################] 100%
(1/1) проверяется доступное место [##############################] 100%
(1/1) установка cmake [##############################] 100%
[daedalus@icarus cutecom-0.22.0]$ cd ..
[daedalus@icarus ~]$ cmake cutecom-0.22.0
-- The C compiler identification is GNU 4.7.1
-- The CXX compiler identification is GNU 4.7.1
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Looking for Q_WS_X11
-- Looking for Q_WS_X11 - found
-- Looking for Q_WS_WIN
-- Looking for Q_WS_WIN - not found.
-- Looking for Q_WS_QWS
-- Looking for Q_WS_QWS - not found.
-- Looking for Q_WS_MAC
-- Looking for Q_WS_MAC - not found.
-- Found Qt4: /usr/bin/qmake (found suitable version "4.8.3", required is "4.1.0")
-- Configuring done
-- Generating done
-- Build files have been written to: /home/daedalus
[daedalus@icarus ~]$ ls
121360-Matrix-Flux.tar.gz CMakeFiles P4018258.JPG_small.jpg
3LLx_9ImR7M.jpg cmake_install.cmake System-Shock-1-0LJ09H3X64-1024x768.jpg
8e0fa1a71cd8.jpg cutecom-0.22.0 time_stats_log
8ZBNpkdUAHY.jpg cutecom-0.22.0.tar.gz Видео
all_projects_list.xml daily_xfer_history.xml Документы
av-75954.jpeg Desktop Загрузки
bf2.sh gui_rpc_auth.cfg Изображения
BlackGold.tar lockfile Музыка
client_state_prev.xml Makefile Общедоступные
client_state.xml merida_rockshox.jpg Шаблоны
CMakeCache.txt notices
[daedalus@icarus ~]$ ./configure
bash: ./configure: Нет такого файла или каталога
[daedalus@icarus ~]$ make
[ 20%] Generating ui_cutecommdlg.h
[ 40%] Generating cutecom-0.22.0/moc_qcppdialogimpl.cxx
Scanning dependencies of target cutecom
[ 60%] Building CXX object CMakeFiles/cutecom.dir/main.o
[ 80%] Building CXX object CMakeFiles/cutecom.dir/qcppdialogimpl.o
[100%] Building CXX object CMakeFiles/cutecom.dir/moc_qcppdialogimpl.o
Linking CXX executable cutecom
[100%] Built target cutecom
[daedalus@icarus ~]$ sudo make install
[100%] Built target cutecom
Install the project...
-- Install configuration: ""
-- Installing: /usr/local/bin/cutecom
-- Installing: /usr/local/share/man/man1/cutecom.1
[daedalus@icarus ~]$ sync
DESTINATION arguments specify the directory on disk to which a file will be installed. If a full path (with a leading slash or drive letter) is given it is used directly. If a relative path is given it is interpreted relative to the value of CMAKE_INSTALL_PREFIX.
DESTINATION arguments specify the directory on disk to which a file will be installed. If a full path (with a leading slash or drive letter) is given it is used directly. If a relative path is given it is interpreted relative to the value of CMAKE_INSTALL_PREFIX.
Как показал опыт в данном случае установка будет осуществляться в /usr/local/lib.
А как тогда описывать установку заголовочных файлов, документации и тому подобного? Вернее сказать так, как указывать директории для их установки? По аналогии с библиотекой это должно быть что-то типа bin/doc/include/..., где можно ознакомиться с полным списком?
Вариант с ${DEST_LIB_DIR} выглядит предпочтительнее, но почему Cmake не устанавливает значение по-умолчанию если эта переменная не установлена пользователем, я надеюсь это встроенная в CMake переменная?
Возьмём для примера тот же autotools:
Installation directories:
--prefix=PREFIX install architecture-independent files in PREFIX
[/usr/local]
--exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
[PREFIX]
................
For better control, use the options below.
Fine tuning of the installation directories:
--bindir=DIR user executables [EPREFIX/bin]
--sbindir=DIR system admin executables [EPREFIX/sbin]
--libexecdir=DIR program executables [EPREFIX/libexec]
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
--datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
--datadir=DIR read-only architecture-independent data [DATAROOTDIR]
--infodir=DIR info documentation [DATAROOTDIR/info]
--localedir=DIR locale-dependent data [DATAROOTDIR/locale]
--mandir=DIR man documentation [DATAROOTDIR/man]
--docdir=DIR documentation root [DATAROOTDIR/doc/librtnl]
--htmldir=DIR html documentation [DOCDIR]
--dvidir=DIR dvi documentation [DOCDIR]
--pdfdir=DIR pdf documentation [DOCDIR]
--psdir=DIR ps documentation [DOCDIR]
Т.е. даже если я не укажу куда установить собранное, то есть предопределённые места.
По умолчанию в Linux CMAKE_INSTALL_PREFIX указывает в /usr/local, в Windows Program Files. Как ты сам показал по умолчанию в autotools PREFIX указывает в /usr/local, а все остальные пути по умолчанию идут относительными от PREFIX и EPREFIX
Пример оформления либы можно посмотреть тут.
Ну думаю с Windows ситуация должна быть аналогична Linux - есть некое место по-умолчанию, но мы немного отошли от первоначально вопроса.
Собственно с установкой более-менее прояснилось, пока не понятно где почерпнуть данные о ${DEST_LIB_DIR} и Co.
Ну думаю с Windows ситуация должна быть аналогична Linux - есть некое место по-умолчанию, но мы немного отошли от первоначально вопроса.
Собственно с установкой более-менее прояснилось, пока не понятно где почерпнуть данные о ${DEST_LIB_DIR} и Co.