From b46a2fd7a80746c7d4f10fbf631a9b9859569fb7 Mon Sep 17 00:00:00 2001
From: rulrich <ralf.m.ulrich@kit.edu>
Date: Thu, 4 Jun 2020 22:01:27 +0200
Subject: [PATCH] cleanup findconex

---
 CMakeModules/FindCONEX.cmake | 85 ++----------------------------------
 1 file changed, 3 insertions(+), 82 deletions(-)

diff --git a/CMakeModules/FindCONEX.cmake b/CMakeModules/FindCONEX.cmake
index a3eecd173..b55793223 100644
--- a/CMakeModules/FindCONEX.cmake
+++ b/CMakeModules/FindCONEX.cmake
@@ -11,9 +11,9 @@
 # - find Conex
 #
 # This module defines
-# CONEX_FOUND
 # CONEX_PREFIX
 # CONEX_INCLUDE_DIR
+# CONEX_LIBRARY
 
 set (SEARCH_conex_
   ${WITH_CONEX}
@@ -44,88 +44,9 @@ find_library (CONEX_LIBRARY
   DOC "The CONEX library"
   )
 
-if (CONEX_INCLUDE_DIR)
-  if (NOT CONEX_FIND_QUIETLY)
-    message (STATUS "Conex include directory is ${CONEX_INCLUDE_DIR}")
-  endif ()
-  
-  set (CMAKE_REQUIRED_INCLUDES ${CONEX_INCLUDE_DIR})
-  include (CheckCXXSourceCompiles)
-  check_cxx_source_compiles (
-    "
-    #include <conexHEModels.h>
-    
-    int 
-    main() 
-    { 
-      EHEModel test = eSibyll23; 
-      if (test == eSibyll23) return 0;
-      return 0; 
-    }
-    "
-    HAS_SIBYLL23
-    )
-  
-  check_cxx_source_compiles (
-    "
-    #include <conexHEModels.h>
-    
-    int 
-    main() 
-    { 
-      EHEModel test = eEposLHC; 
-      if (test == eEposLHC) return 0;
-      return 0; 
-    }
-    " 
-    HAS_EPOS_LHC
-    )
-  
-  check_cxx_source_compiles (
-    "
-    #include <ConexDynamicInterface.h>
-    #include <ConexDynamicInterface.cc>
-    int 
-    main() 
-    {
-      ConexDynamicInterface cdi(eSibyll23);
-      cdi.GetLeadingInteractionsParticleData();
-      return 0; 
-    }
-    " 
-    HAS_LEADINGINTERACTION_INTERFACE
-    )
-  
-  if (HAS_LEADINGINTERACTION_INTERFACE)
-     # at least conex2r5.65
-     set (CONEX_VERSION 565)
-     if (NOT CONEX_FIND_QUIETLY)
-       message (STATUS "Conex has interface to leading interactions. Set _CONEX2R_VERSION=565.")
-     endif ()
-  elseif (HAS_SIBYLL23)
-     # at least conex2r5.30
-     set (CONEX_VERSION 530)
-     if (NOT CONEX_FIND_QUIETLY)
-       message (STATUS "Conex has SIBYLL2.3. Set _CONEX2R_VERSION=530.")
-     endif ()
-  elseif (HAS_EPOS_LHC)
-     # at least conex2r4.36
-     set (CONEX_VERSION 436)
-     if (NOT CONEX_FIND_QUIETLY)
-       message (STATUS "Conex has EPOS-LHC. Set _CONEX2R_VERSION=436.")
-     endif ()
-  else ()
-     # pre LHC
-     set (CONEX_VERSION 300)
-     if (NOT CONEX_FIND_QUIETLY)
-       message (STATUS "Conex is pre-LHC. Set _CONEX2R_VERSION=300.")
-     endif ()
-  endif ()
-endif ()
-
 # standard cmake infrastructure:
 include (FindPackageHandleStandardArgs)
 find_package_handle_standard_args (CONEX
   "Did not find system-level CONEX."
-  CONEX_INCLUDE_DIR CONEX_LIBRARY CONEX_VERSION)
-mark_as_advanced (CONEX_INCLUDE_DIR CONEX_LIBRARY CONEX_VERSION)
+  CONEX_INCLUDE_DIR CONEX_LIBRARY CONEX_PREFIX)
+mark_as_advanced (CONEX_INCLUDE_DIR CONEX_LIBRARY CONEX_PREFIX)
-- 
GitLab