From f44eecb86b7c30427afd661645fe63a7d6a459ca Mon Sep 17 00:00:00 2001
From: adrien-matta <a.matta@surrey.ac.uk>
Date: Tue, 21 Apr 2015 16:31:24 +0100
Subject: [PATCH] * NPS now know what detector to build

---
 NPLib/CMakeLists.txt        | 3 ++-
 NPLib/NPLibConfig.cmake.in  | 3 ++-
 NPSimulation/CMakeLists.txt | 3 ++-
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/NPLib/CMakeLists.txt b/NPLib/CMakeLists.txt
index 38d17a052..abf40c026 100644
--- a/NPLib/CMakeLists.txt
+++ b/NPLib/CMakeLists.txt
@@ -15,7 +15,8 @@ set(CMAKE_BUILD_TYPE Release)
 
 set(DETLIST ${ETLIST})
 
-if("${DETLIST}" MATCHES "")
+string(COMPARE EQUAL "${DETLIST}" "" rdet)
+if(rdet)
     message("Building all detectors")
   else()
     message("Building the following detectors ${DETLIST}") 
diff --git a/NPLib/NPLibConfig.cmake.in b/NPLib/NPLibConfig.cmake.in
index f2e9b44f3..4d54a720a 100644
--- a/NPLib/NPLibConfig.cmake.in
+++ b/NPLib/NPLibConfig.cmake.in
@@ -6,9 +6,10 @@
  
 # Compute paths
 get_filename_component(NPLib_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
+set(NPLib_USE_FILE "@CMAKE_BINARY_DIR@/NPLibConfig.cmake")
 set(NPLib_INCLUDE_DIRS "@CMAKE_INCLUDE_OUTPUT_DIRECTORY@")
+set(NPLib_DETECTOR_LIST "@DETLIST@")
 include_directories("${NPLib_INCLUDE_DIRS}")
-set(NPLib_USE_FILE "@CMAKE_BINARY_DIR@/NPLibConfig.cmake")
 
 set(NPLib_LIBRARIES "-L@CMAKE_BINARY_DIR@/lib -lNPCore -lNPPhysics -lNPInteractionCoordinates -lNPInitialConditions")
 
diff --git a/NPSimulation/CMakeLists.txt b/NPSimulation/CMakeLists.txt
index 19d2c8324..e867dc2d7 100644
--- a/NPSimulation/CMakeLists.txt
+++ b/NPSimulation/CMakeLists.txt
@@ -21,7 +21,8 @@ configure_file(Core/NPSimulationVersion.hh.in Core/NPSimulationVersion.hh @ONLY)
 
 set(DETLIST ${NPLib_DETECTOR_LIST})
 
-if("${DETLIST}" MATCHES "")
+string(COMPARE EQUAL "${DETLIST}" "" rdet)
+if(rdet)
     message("Building all detectors")
   else()
     message("Building the following detectors ${DETLIST}") 
-- 
GitLab