From a23fb631ceb1fbf47eb993f477221e91ed102ce3 Mon Sep 17 00:00:00 2001 From: Paul Colby Date: Sat, 14 Mar 2015 21:13:41 +1100 Subject: [PATCH] Don't let CMake cache PMDA_INSTALL_DIR This fixes a regression added in the previous commit, that cause CMake to install all examples to the same directory. --- example/simple/CMakeLists.txt | 11 ++++++----- example/simplecpu/CMakeLists.txt | 11 ++++++----- example/trivial/CMakeLists.txt | 11 ++++++----- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/example/simple/CMakeLists.txt b/example/simple/CMakeLists.txt index f63dd7c..05feeca 100644 --- a/example/simple/CMakeLists.txt +++ b/example/simple/CMakeLists.txt @@ -47,15 +47,16 @@ endif () # Setup the default installation directory. if (PCP_PMDAS_DIR) - set(DEFAULT_PMDA_INSTALL_DIR ${PCP_PMDAS_DIR}/pcp-pmda-cpp-examples/pmdas/${PROJECT_NAME}) + set(DEFAULT_PMDAS_INSTALL_DIR ${PCP_PMDAS_DIR}/pcp-pmda-cpp-examples/pmdas) set( - PMDA_INSTALL_DIR ${DEFAULT_PMDA_INSTALL_DIR} - CACHE PATH "directory to install PMDA to (${DEFAULT_PMDA_INSTALL_DIR})" + PMDAS_INSTALL_DIR ${DEFAULT_PMDAS_INSTALL_DIR} + CACHE PATH "directory to install PMDAs to (${DEFAULT_PMDAS_INSTALL_DIR})" ) endif() -# Create an install target, but only if the PMDA_INSTALL_DIR directory was set. -if (PMDA_INSTALL_DIR) +# Create an install target, but only if the PMDAS_INSTALL_DIR directory was set. +if (PMDAS_INSTALL_DIR) + SET(PMDA_INSTALL_DIR ${PMDAS_INSTALL_DIR}/${PROJECT_NAME}) # Install the PMDA binaries. install( TARGETS "pmda${PROJECT_NAME}" "pmda${PROJECT_NAME}-noboost" diff --git a/example/simplecpu/CMakeLists.txt b/example/simplecpu/CMakeLists.txt index 755f964..905cb08 100644 --- a/example/simplecpu/CMakeLists.txt +++ b/example/simplecpu/CMakeLists.txt @@ -47,15 +47,16 @@ endif () # Setup the default installation directory. if (PCP_PMDAS_DIR) - set(DEFAULT_PMDA_INSTALL_DIR ${PCP_PMDAS_DIR}/pcp-pmda-cpp-examples/pmdas/${PROJECT_NAME}) + set(DEFAULT_PMDAS_INSTALL_DIR ${PCP_PMDAS_DIR}/pcp-pmda-cpp-examples/pmdas) set( - PMDA_INSTALL_DIR ${DEFAULT_PMDA_INSTALL_DIR} - CACHE PATH "directory to install PMDA to (${DEFAULT_PMDA_INSTALL_DIR})" + PMDAS_INSTALL_DIR ${DEFAULT_PMDAS_INSTALL_DIR} + CACHE PATH "directory to install PMDAs to (${DEFAULT_PMDAS_INSTALL_DIR})" ) endif() -# Create an install target, but only if the PMDA_INSTALL_DIR directory was set. -if (PMDA_INSTALL_DIR) +# Create an install target, but only if the PMDAS_INSTALL_DIR directory was set. +if (PMDAS_INSTALL_DIR) + SET(PMDA_INSTALL_DIR ${PMDAS_INSTALL_DIR}/${PROJECT_NAME}) # Install the PMDA binaries. install( TARGETS "pmda${PROJECT_NAME}" "pmda${PROJECT_NAME}-noboost" diff --git a/example/trivial/CMakeLists.txt b/example/trivial/CMakeLists.txt index d69fb4d..fe1b8ea 100644 --- a/example/trivial/CMakeLists.txt +++ b/example/trivial/CMakeLists.txt @@ -47,15 +47,16 @@ endif () # Setup the default installation directory. if (PCP_PMDAS_DIR) - set(DEFAULT_PMDA_INSTALL_DIR ${PCP_PMDAS_DIR}/pcp-pmda-cpp-examples/pmdas/${PROJECT_NAME}) + set(DEFAULT_PMDAS_INSTALL_DIR ${PCP_PMDAS_DIR}/pcp-pmda-cpp-examples/pmdas) set( - PMDA_INSTALL_DIR ${DEFAULT_PMDA_INSTALL_DIR} - CACHE PATH "directory to install PMDA to (${DEFAULT_PMDA_INSTALL_DIR})" + PMDAS_INSTALL_DIR ${DEFAULT_PMDAS_INSTALL_DIR} + CACHE PATH "directory to install PMDAs to (${DEFAULT_PMDAS_INSTALL_DIR})" ) endif() -# Create an install target, but only if the PMDA_INSTALL_DIR directory was set. -if (PMDA_INSTALL_DIR) +# Create an install target, but only if the PMDAS_INSTALL_DIR directory was set. +if (PMDAS_INSTALL_DIR) + SET(PMDA_INSTALL_DIR ${PMDAS_INSTALL_DIR}/${PROJECT_NAME}) # Install the PMDA binaries. install( TARGETS "pmda${PROJECT_NAME}" "pmda${PROJECT_NAME}-noboost"