[uchardet: 6/29] CMake: Use only CMAKE_INSTALL_BINDIR instead of DIR_BIN



commit 81ed86a26b37b55e5f8c72b85e6aec06eb86130c
Author: Ricardo Constantino (:RiCON) <wiiaboo gmail com>
Date:   Wed Mar 16 18:47:14 2016 +0000

    CMake: Use only CMAKE_INSTALL_BINDIR instead of DIR_BIN
    
    This way it always shows up in ccmake, even if not defined.
    
    A string is used instead of path because I personally think it makes more
    sense in the following use-cases:
    
    STRING:
    -DCMAKE_INSTALL_PREFIX=/home/user -DCMAKE_INSTALL_BINDIR=bins
    installs everything to /home/user/{lib,etc,share,(...)} and executables to
    ${CMAKE_INSTALL_PREFIX}/bins
    
    -DCMAKE_INSTALL_PREFIX=/home/user -DCMAKE_INSTALL_BINDIR=/opt/bin
    everything to /home/user/{lib,etc,share,(...)} and executables to
    /opt/bin
    
    PATH:
    -DCMAKE_INSTALL_PREFIX=/home/user -DCMAKE_INSTALL_BINDIR=bins
    everything to /home/user/{lib,etc,share,(...)} and executables to
    $(pwd)/bins (!)
    -DCMAKE_INSTALL_PREFIX=/home/user -DCMAKE_INSTALL_BINDIR=/opt/bin
    same as STRING

 CMakeLists.txt           |    6 ++----
 src/CMakeLists.txt       |    2 +-
 src/tools/CMakeLists.txt |    2 +-
 3 files changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b53420d..2909b30 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -34,12 +34,10 @@ set (DIR_LIBRARY ${DIR_PREFIX}/${CMAKE_SHARED_LIBRARY_PREFIX})
 set (DIR_LIBRARY_STATIC ${DIR_PREFIX}/${CMAKE_STATIC_LIBRARY_PREFIX})
 set (DIR_INCLUDE ${DIR_PREFIX}/include)
 set (DIR_SHARE ${DIR_PREFIX}/share)
-set (DIR_BIN ${DIR_PREFIX}/bin)
 set (DIR_ETC ${DIR_PREFIX}/etc)
 
-if (DEFINED CMAKE_INSTALL_BINDIR)
-       set (DIR_BIN ${CMAKE_INSTALL_BINDIR})
-endif (DEFINED CMAKE_INSTALL_BINDIR)
+set (CMAKE_INSTALL_BINDIR bin
+     CACHE STRING "Install location of executables")
 
 if (DEFINED CMAKE_INSTALL_LIBDIR)
        set (DIR_LIBRARY ${CMAKE_INSTALL_LIBDIR})
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index e50ae50..9a66412 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -108,7 +108,7 @@ install(
        TARGETS
                ${UCHARDET_TARGET}
         RUNTIME DESTINATION
-                ${DIR_BIN}
+                ${CMAKE_INSTALL_BINDIR}
        ARCHIVE DESTINATION
                ${DIR_LIBRARY}
 )
diff --git a/src/tools/CMakeLists.txt b/src/tools/CMakeLists.txt
index 7ad3ff5..a2ddf94 100644
--- a/src/tools/CMakeLists.txt
+++ b/src/tools/CMakeLists.txt
@@ -18,6 +18,6 @@ install(
                uchardet
        RUNTIME
        DESTINATION
-               ${DIR_BIN}
+               ${CMAKE_INSTALL_BINDIR}
 )
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]