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

I wrote a small patch to deal with hardcoded, nonstandard installation dirs. #11

Closed
Petross404 opened this issue Jan 26, 2018 · 2 comments

Comments

@Petross404
Copy link
Contributor

Hello, I want to write an kdstatemachineeditor ebuild for gentoo portage. I am having trouble installing things where they are supposed by the standard to be installed, so I wrote this small patch for CMakeLists.txt.

--- KDStateMachineEditor/CMakeLists.txt	2018-01-26 12:21:37.000000000 +0200
+++ KDStateMachineEditor/CMakeLists.txt	2018-01-26 13:46:03.473920083 +0200
@@ -10,6 +10,9 @@
   cmake_policy(SET CMP0063 NEW)
 endif()
 
+#Let's deal with upstream's harcoded dirs.
+include(GNUInstallDirs)
+
 # Version setup
 set(KDSME_VERSION_MAJOR "1")
 set(KDSME_VERSION_MINOR "2")
@@ -92,11 +95,11 @@
 set(CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON)
 set(CMAKE_AUTOMOC TRUE)
 
-set(BIN_INSTALL_DIR bin)
-set(LIB_INSTALL_DIR lib CACHE STRING "Library install destination.")
-set(INCLUDE_INSTALL_DIR include/${CMAKE_PROJECT_NAME})
-set(XDG_DATA_INSTALL_DIR share/${CMAKE_PROJECT_NAME})
-set(QCH_INSTALL_DIR "doc" CACHE STRING "Install location of Qt Assistant help files.")
+set(BIN_INSTALL_DIR ${CMAKE_INSTALL_FULL_BINDIR})
+set(LIB_INSTALL_DIR ${CMAKE_INSTALL_FULL_LIBDIR} CACHE STRING "Library install destination.")
+set(INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_FULL_INCLUDEDIR}/${CMAKE_PROJECT_NAME})
+set(XDG_DATA_INSTALL_DIR ${CMAKE_INSTALL_FULL_DATAROOTDIR}/${CMAKE_PROJECT_NAME})
+set(QCH_INSTALL_DIR ${CMAKE_INSTALL_FULL_DOCDIR} CACHE STRING "Install location of Qt Assistant help files.")
 
 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/${BIN_INSTALL_DIR})
 set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/${LIB_INSTALL_DIR})

I hope you accept this. :)

@dfaure-kdab
Copy link
Member

I'm very much in favour of using GNUInstallDirs indeed. +1.

@krf
Copy link
Contributor

krf commented Jan 29, 2018

Superseded by #12 -- will discuss there.

@krf krf closed this as completed Jan 29, 2018
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

No branches or pull requests

3 participants