diff --git a/README.md b/README.md index afabba12..8860b34b 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ If Octopi package is available in your distro's repository, you can just type: # pacman -S octopi ``` -### Steps to build Octopi source code +### Steps to build Octopi source code (qmake) Assuming you have vala compiler and Qt5 libs properly installed, follow these steps: @@ -77,6 +77,32 @@ $ cd OCTOPI_PATH (where you git cloned the source code) $ makepkg -f ``` +### Steps to build Octopi source code (CMake) + +As an alternative to qmake, Octopi can also be built with CMake. Make sure that at least CMake 3.5 is installed. + +At first build and install alpm_octopi_utils. + +``` +$ git clone https://github.com/aarnt/alpm_octopi_utils +$ cd alpm_octopi_utils +$ mkdir build_dir && cd build_dir +$ cmake -G "Unix Makefiles" .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr +$ make +$ sudo make install +``` + +After that build and install Octopi. + +``` +$ git clone https://github.com/aarnt/octopi +$ cd octopi +$ mkdir build_dir && cd build_dir +$ cmake -G "Unix Makefiles" .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr +$ make +$ sudo make install +``` + ### To run Octopi ``` diff --git a/helper/CMakeLists.txt b/helper/CMakeLists.txt index 07b0f299..b6883aa6 100644 --- a/helper/CMakeLists.txt +++ b/helper/CMakeLists.txt @@ -10,4 +10,4 @@ add_executable(octphelper ${src} ${header}) target_compile_definitions(octphelper PRIVATE QT_DEPRECATED_WARNINGS QT_USE_QSTRINGBUILDER QT_NO_CAST_FROM_ASCII QT_NO_CAST_TO_ASCII QT_NO_URL_CAST_FROM_STRING QT_NO_CAST_FROM_BYTEARRAY QT_NO_FOREACH) target_include_directories(octphelper PRIVATE ${CMAKE_CURRENT_BINARY_DIR} ${Qt5Core_INCLUDE_DIRS} ${Qt5Network_INCLUDE_DIRS}) target_link_libraries(octphelper PRIVATE Qt5::Core Qt5::Network) -install(TARGETS octphelper RUNTIME DESTINATION bin LIBRARY DESTINATION lib PUBLIC_HEADER DESTINATION include) +install(TARGETS octphelper RUNTIME DESTINATION lib/octopi LIBRARY DESTINATION lib PUBLIC_HEADER DESTINATION include) diff --git a/notifier/CMakeLists.txt b/notifier/CMakeLists.txt index e11652e6..5c45c1df 100644 --- a/notifier/CMakeLists.txt +++ b/notifier/CMakeLists.txt @@ -71,4 +71,4 @@ if(KF5Notifications_FOUND) endif() install(TARGETS octopi-notifier RUNTIME DESTINATION bin LIBRARY DESTINATION lib PUBLIC_HEADER DESTINATION include) install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/octopi-notifier.desktop" DESTINATION share/applications) -install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/octopi-notifier.desktop" DESTINATION etc/xdg/autostart) +install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/octopi-notifier.desktop" DESTINATION /etc/xdg/autostart) diff --git a/sudo/CMakeLists.txt b/sudo/CMakeLists.txt index 3aeb3efc..440a8c1e 100644 --- a/sudo/CMakeLists.txt +++ b/sudo/CMakeLists.txt @@ -19,4 +19,4 @@ add_executable(octopi-sudo ${src} ${header} ${qmFiles}) target_compile_definitions(octopi-sudo PRIVATE QT_DEPRECATED_WARNINGS QT_USE_QSTRINGBUILDER QT_NO_CAST_FROM_ASCII QT_NO_CAST_TO_ASCII QT_NO_URL_CAST_FROM_STRING QT_NO_CAST_FROM_BYTEARRAY) target_include_directories(octopi-sudo PRIVATE ${CMAKE_CURRENT_BINARY_DIR} ${Qt5Core_INCLUDE_DIRS} ${Qt5Gui_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS}) target_link_libraries(octopi-sudo PRIVATE Threads::Threads Qt5::Core Qt5::Gui Qt5::Widgets ${UTIL_LIBRARY}) -install(TARGETS octopi-sudo RUNTIME DESTINATION bin LIBRARY DESTINATION lib PUBLIC_HEADER DESTINATION include) +install(TARGETS octopi-sudo RUNTIME DESTINATION lib/octopi LIBRARY DESTINATION lib PUBLIC_HEADER DESTINATION include)