From 14ecf733bdf5899b552d4115dfa0216f74be6f2a Mon Sep 17 00:00:00 2001 From: "craig.p.drummond" Date: Fri, 17 Jan 2014 20:06:39 +0000 Subject: [PATCH] Set CMake defaults if not supplied on commandline; set prefix to /usr for Qt only Linux builds, path to `kde4-config --prefix` for KDE4 builds, and set build type to Release --- CMakeLists.txt | 22 ++++++++++++++++++++++ ChangeLog | 3 +++ INSTALL | 6 +++--- 3 files changed, 28 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 346b6f78a..64dc6e82e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -66,6 +66,28 @@ if (NOT WIN32 AND NOT APPLE AND ENABLE_DEVICES_SUPPORT AND ENABLE_UDISKS2) set(WITH_SOLID_UDISKS2 ON) endif (NOT WIN32 AND NOT APPLE AND ENABLE_DEVICES_SUPPORT AND ENABLE_UDISKS2) +if (NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE "Release") + message("-- Set build type to ${CMAKE_BUILD_TYPE}") +endif (NOT CMAKE_BUILD_TYPE) + +if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + if (ENABLE_KDE) + find_program(KDE4_KDECONFIG_EXECUTABLE NAMES kde4-config + PATHS ${CMAKE_INSTALL_PREFIX}/bin ${_KDEDIRS} /opt/kde4/bin NO_DEFAULT_PATH) + if (NOT KDE4_KDECONFIG_EXECUTABLE) + find_program(KDE4_KDECONFIG_EXECUTABLE NAMES kde4-config ) + endif (NOT KDE4_KDECONFIG_EXECUTABLE) + if (KDE4_KDECONFIG_EXECUTABLE) + exec_program(${KDE4_KDECONFIG_EXECUTABLE} ARGS --prefix OUTPUT_VARIABLE CMAKE_INSTALL_PREFIX) + message("-- Set install prefix to ${CMAKE_INSTALL_PREFIX}") + endif (KDE4_KDECONFIG_EXECUTABLE) + elseif (NOT APPLE AND NOT WIN32) + set(CMAKE_INSTALL_PREFIX "/usr") + message("-- Set install prefix to ${CMAKE_INSTALL_PREFIX}") + endif (ENABLE_KDE) +endif (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + if (ENABLE_TAGLIB) set(TAGLIB_MIN_VERSION "1.6") find_package(Taglib) diff --git a/ChangeLog b/ChangeLog index 7bd324e22..923e9ba5c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -60,6 +60,9 @@ but only images, and not icons, will be shown. 35. Europe and Canada regions in ListenLive are not re-loadable (as they are read from listenlive.xml) +36. Set CMake defaults if not supplied on commandline; set prefix to /usr for + Qt only Linux builds, path to `kde4-config --prefix` for KDE4 builds, and + set build type to Release 1.2.2 ----- diff --git a/INSTALL b/INSTALL index 1bb2d5ec2..553a3c6a1 100644 --- a/INSTALL +++ b/INSTALL @@ -6,7 +6,7 @@ KDE4 1. mkdir build 2. cd build -3. cmake .. -DCMAKE_INSTALL_PREFIX=`kde4-config --prefix` -DCMAKE_BUILD_TYPE=Release +3. cmake .. 4. make 5. sudo make install @@ -16,7 +16,7 @@ Qt4 1. mkdir build 2. cd build -3. cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DENABLE_KDE=OFF +3. cmake .. -DENABLE_KDE=OFF 4. make 5. sudo make install @@ -26,7 +26,7 @@ Qt5 1. mkdir build 2. cd build -3. cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DENABLE_KDE=OFF -DENABLE_QT5=ON +3. cmake .. -DENABLE_KDE=OFF -DENABLE_QT5=ON 4. make 5. sudo make install