Commit 4793d6a2 authored by Dominik Charousset's avatar Dominik Charousset

Look for CMakeLists.txt in submodules

Instead of looking for $subdir/caf, we now look for $subdir/CMakeLists.txt to
identify loaded submodules.
parent f6d2a84c
...@@ -22,6 +22,9 @@ endif() ...@@ -22,6 +22,9 @@ endif()
if(NOT CAF_BUILD_STATIC) if(NOT CAF_BUILD_STATIC)
set(CAF_BUILD_STATIC no) set(CAF_BUILD_STATIC no)
endif() endif()
if(NOT CAF_NO_OPENCL)
set(CAF_NO_OPENCL no)
endif()
################################################################################ ################################################################################
...@@ -184,7 +187,7 @@ install(DIRECTORY libcaf_core/cppa/ ...@@ -184,7 +187,7 @@ install(DIRECTORY libcaf_core/cppa/
install(DIRECTORY libcaf_io/caf/ DESTINATION include/caf install(DIRECTORY libcaf_io/caf/ DESTINATION include/caf
FILES_MATCHING PATTERN "*.hpp") FILES_MATCHING PATTERN "*.hpp")
# install includes from opencl # install includes from opencl
if(EXISTS "${CMAKE_SOURCE_DIR}/libcaf_opencl/caf") if(EXISTS "${CMAKE_SOURCE_DIR}/libcaf_opencl/CMakeLists.txt")
install(DIRECTORY libcaf_opencl/caf/ DESTINATION include/caf install(DIRECTORY libcaf_opencl/caf/ DESTINATION include/caf
FILES_MATCHING PATTERN "*.hpp") FILES_MATCHING PATTERN "*.hpp")
endif() endif()
...@@ -208,7 +211,7 @@ set(LIBCAF_INCLUDE_DIRS ...@@ -208,7 +211,7 @@ set(LIBCAF_INCLUDE_DIRS
"${CMAKE_SOURCE_DIR}/libcaf_core" "${CMAKE_SOURCE_DIR}/libcaf_core"
"${CMAKE_SOURCE_DIR}/libcaf_io") "${CMAKE_SOURCE_DIR}/libcaf_io")
# path to caf opencl headers # path to caf opencl headers
if(EXISTS "${CMAKE_SOURCE_DIR}/libcaf_opencl/caf") if(EXISTS "${CMAKE_SOURCE_DIR}/libcaf_opencl/CMakeLists.txt")
set(LIBCAF_INCLUDE_DIRS set(LIBCAF_INCLUDE_DIRS
"${CMAKE_SOURCE_DIR}/libcaf_opencl/" "${LIBCAF_INCLUDE_DIRS}") "${CMAKE_SOURCE_DIR}/libcaf_opencl/" "${LIBCAF_INCLUDE_DIRS}")
endif() endif()
...@@ -230,7 +233,7 @@ add_subdirectory(libcaf_io) ...@@ -230,7 +233,7 @@ add_subdirectory(libcaf_io)
# set io lib for sub directories # set io lib for sub directories
set(LIBCAF_IO_LIBRARY libcaf_io) set(LIBCAF_IO_LIBRARY libcaf_io)
# set opencl lib for sub directories if not told otherwise # set opencl lib for sub directories if not told otherwise
if(NOT CAF_NO_OPENCL AND EXISTS "${CMAKE_SOURCE_DIR}/libcaf_opencl/caf") if(NOT CAF_NO_OPENCL AND EXISTS "${CMAKE_SOURCE_DIR}/libcaf_opencl/CMakeLists.txt")
message(STATUS "Enter subdirectory libcaf_opencl") message(STATUS "Enter subdirectory libcaf_opencl")
find_package(OPENCL REQUIRED) find_package(OPENCL REQUIRED)
add_subdirectory(libcaf_opencl) add_subdirectory(libcaf_opencl)
...@@ -253,7 +256,7 @@ if(NOT CAF_NO_UNIT_TESTS) ...@@ -253,7 +256,7 @@ if(NOT CAF_NO_UNIT_TESTS)
message(STATUS "Enter subdirectory unit_testing") message(STATUS "Enter subdirectory unit_testing")
add_subdirectory(unit_testing) add_subdirectory(unit_testing)
add_dependencies(all_unit_tests libcaf_io) add_dependencies(all_unit_tests libcaf_io)
if(NOT CAF_NO_OPENCL AND EXISTS "${CMAKE_SOURCE_DIR}/libcaf_opencl/caf") if(NOT CAF_NO_OPENCL AND EXISTS "${CMAKE_SOURCE_DIR}/libcaf_opencl/CMakeLists.txt")
add_subdirectory(libcaf_opencl/unit_testing) add_subdirectory(libcaf_opencl/unit_testing)
endif() endif()
endif() endif()
...@@ -262,13 +265,13 @@ if(NOT CAF_NO_EXAMPLES) ...@@ -262,13 +265,13 @@ if(NOT CAF_NO_EXAMPLES)
message(STATUS "Enter subdirectory examples") message(STATUS "Enter subdirectory examples")
add_subdirectory(examples) add_subdirectory(examples)
add_dependencies(all_examples libcaf_io) add_dependencies(all_examples libcaf_io)
if(NOT CAF_NO_OPENCL AND EXISTS "${CMAKE_SOURCE_DIR}/libcaf_opencl/caf") if(NOT CAF_NO_OPENCL AND EXISTS "${CMAKE_SOURCE_DIR}/libcaf_opencl/CMakeLists.txt")
add_subdirectory(libcaf_opencl/examples) add_subdirectory(libcaf_opencl/examples)
add_dependencies(opencl_examples libcaf_opencl) add_dependencies(opencl_examples libcaf_opencl)
endif() endif()
endif() endif()
# build RIAC if not being told otherwise # build RIAC if not being told otherwise
if(NOT CAF_NO_RIAC AND EXISTS "${CMAKE_SOURCE_DIR}/libcaf_riac/caf/") if(NOT CAF_NO_RIAC AND EXISTS "${CMAKE_SOURCE_DIR}/libcaf_riac/CMakeLists.txt")
message(STATUS "Enter subdirectory probe") message(STATUS "Enter subdirectory probe")
add_subdirectory(libcaf_riac) add_subdirectory(libcaf_riac)
if(CAF_BUILD_STATIC_ONLY OR CAF_BUILD_STATIC) if(CAF_BUILD_STATIC_ONLY OR CAF_BUILD_STATIC)
...@@ -288,7 +291,7 @@ else() ...@@ -288,7 +291,7 @@ else()
set(CAF_HAS_RIAC no) set(CAF_HAS_RIAC no)
endif() endif()
# build nexus if not being told otherwise # build nexus if not being told otherwise
if(NOT CAF_NO_NEXUS AND EXISTS "${CMAKE_SOURCE_DIR}/nexus/caf/") if(NOT CAF_NO_NEXUS AND EXISTS "${CMAKE_SOURCE_DIR}/nexus/CMakeLists.txt")
if(NOT CAF_HAS_RIAC) if(NOT CAF_HAS_RIAC)
message(WARNING "cannot build nexus without RIAC submodule") message(WARNING "cannot build nexus without RIAC submodule")
set(CAF_NO_NEXUS yes) set(CAF_NO_NEXUS yes)
...@@ -307,7 +310,7 @@ else() ...@@ -307,7 +310,7 @@ else()
set(CAF_NO_NEXUS yes) set(CAF_NO_NEXUS yes)
endif() endif()
# build cash if not being told otherwise # build cash if not being told otherwise
if(NOT CAF_NO_CASH AND EXISTS "${CMAKE_SOURCE_DIR}/cash/caf/") if(NOT CAF_NO_CASH AND EXISTS "${CMAKE_SOURCE_DIR}/cash/CMakeLists.txt")
if(NOT CAF_HAS_RIAC) if(NOT CAF_HAS_RIAC)
message(WARNING "cannot build cash without RIAC submodule") message(WARNING "cannot build cash without RIAC submodule")
set(CAF_NO_CASH yes) set(CAF_NO_CASH yes)
...@@ -326,7 +329,7 @@ else() ...@@ -326,7 +329,7 @@ else()
set(CAF_NO_CASH yes) set(CAF_NO_CASH yes)
endif() endif()
# build benchmarks if not being told otherwise # build benchmarks if not being told otherwise
if(NOT CAF_NO_BENCHMARKS AND EXISTS "${CMAKE_SOURCE_DIR}/benchmarks/caf/") if(NOT CAF_NO_BENCHMARKS AND EXISTS "${CMAKE_SOURCE_DIR}/benchmarks/CMakeLists.txt")
message(STATUS "Enter subdirectory benchmarks") message(STATUS "Enter subdirectory benchmarks")
add_subdirectory(benchmarks) add_subdirectory(benchmarks)
add_dependencies(all_benchmarks libcaf_io) add_dependencies(all_benchmarks libcaf_io)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment