Browse Source

PicoDst added as a submodule

PeterParfenov 2 years ago
parent
commit
f3ba27e103
3 changed files with 16 additions and 2 deletions
  1. 3 0
      .gitmodules
  2. 12 2
      CMakeLists.txt
  3. 1 0
      PicoDst

+ 3 - 0
.gitmodules

@@ -0,0 +1,3 @@
+[submodule "PicoDst"]
+	path = PicoDst
+	url = git@devel.mephi.ru:PEParfenov/PicoDst.git

+ 12 - 2
CMakeLists.txt

@@ -3,7 +3,17 @@ cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
 project(MpdFlow)
 
 #---Add PicoDst submodule with PicoDst shared library
-add_subdirectory(PicoDst)
+find_library(PicoDst NAMES PicoDst PATHS ${PICO_DST_BIN})
+if (PicoDst)
+  # If PicoDst is already installed, use the installed one
+  message(STATUS "PicoDst is found: ${PicoDst}")
+endif()
+if (NOT PicoDst)
+  # If PicoDst is not found in the system, compile it now
+  message(STATUS "PicoDst is not found: Compiling it from the submodule")
+  add_subdirectory(PicoDst)
+  set (PicoDst PicoDst)
+endif()
 
 # You need to tell CMake where to find the ROOT installation. This can be done
 # in a number of ways:
@@ -54,7 +64,7 @@ set(MPD_FLOW_INCLUDE_DIRECTORIES
 include_directories(${MPD_FLOW_INCLUDE_DIRECTORIES})
 
 set(MPD_FLOW_INCLUDE_LIBRARIES
-  PicoDst
+  ${PicoDst}
   ${ROOT_LIBRARIES}
 )
 

+ 1 - 0
PicoDst

@@ -0,0 +1 @@
+Subproject commit c8f5ff32cd9b2e56ce9adb24e58fbabce281971c