-
Notifications
You must be signed in to change notification settings - Fork 23
/
CMakeLists.txt
42 lines (34 loc) · 984 Bytes
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
cmake_minimum_required(VERSION 3.5)
project(boost)
macro(find_package NAME)
if(NOT "${NAME}" MATCHES "^boost_.*$" AND NOT "${NAME}" STREQUAL BCM)
_find_package(${ARGV})
else()
set(${ARGV0}_FOUND ON CACHE BOOL "")
endif()
endmacro()
include(bcm/share/bcm/cmake/BCMConfig.cmake)
set(EXCLUDE_LIBS)
find_package(PythonLibs)
if(NOT PythonLibs_FOUND)
list(APPEND EXCLUDE_LIBS python)
endif()
find_package(PythonLibs)
if(NOT PythonLibs_FOUND)
list(APPEND EXCLUDE_LIBS python)
endif()
find_package(MPI)
if(NOT MPI_FOUND)
list(APPEND EXCLUDE_LIBS mpi)
endif()
file(GLOB_RECURSE LIBS libs/*CMakeLists.txt)
foreach(lib ${LIBS})
file(READ ${lib} CONTENT)
if("${CONTENT}" MATCHES "project\\(")
get_filename_component(LIB_DIR ${lib} DIRECTORY)
get_filename_component(LIB_NAME ${LIB_DIR} NAME)
if(NOT "${LIB_NAME}" IN_LIST EXCLUDE_LIBS)
add_subdirectory(${LIB_DIR})
endif()
endif()
endforeach()