Added header guards for CMake add_subdirectory
This commit is contained in:
+5
-6
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.03)
|
||||
|
||||
project(midas_lan_gpib VERSION 0.1)
|
||||
|
||||
# If the target already exists in a project (e.g. if midas_lan_gpib is included multiple time as a submodule of submodules),
|
||||
# If the target already exists in a project (e.g. if lan_gpib_vxi11_linux_64bit is included multiple time as a submodule of submodules),
|
||||
# this "header guard"-style check prevents defining the same target multiple times (which will lead to CMake errors).
|
||||
if(TARGET midas_lan_gpib)
|
||||
return()
|
||||
@@ -25,11 +25,6 @@ set(
|
||||
$ENV{MIDASSYS}/drivers/class/generic.cxx
|
||||
)
|
||||
|
||||
# guard against multiple include
|
||||
if(NOT TARGET lan_gpib_vxi11_linux_64bit)
|
||||
add_subdirectory(lan_gpib_vxi11)
|
||||
endif()
|
||||
|
||||
set(SYS_LIBS
|
||||
pthread
|
||||
util
|
||||
@@ -45,6 +40,10 @@ set(MIDAS_LIBS
|
||||
|
||||
set(LIBS ${SYS_LIBS} ${MIDAS_LIBS})
|
||||
|
||||
if(NOT TARGET lan_gpib_vxi11_linux_64bit)
|
||||
add_subdirectory(lan_gpib_vxi11)
|
||||
endif()
|
||||
|
||||
################################################################################
|
||||
## Bus library
|
||||
################################################################################
|
||||
|
||||
+1
-1
Submodule lan_gpib_vxi11 updated: 59562b001d...04a5865598
Reference in New Issue
Block a user