CMakeLists.txt 1.95 KB
Newer Older
1 2 3 4
project (project_embb_tutorials)

file(GLOB_RECURSE EXAMPLES_SOURCES "*.cc" "*.h")

5

6 7 8 9 10 11 12 13
include_directories(  
  ${CMAKE_CURRENT_SOURCE_DIR}/
  ${CMAKE_CURRENT_BINARY_DIR}/
  ${CMAKE_CURRENT_SOURCE_DIR}/../../base_c/include
  ${CMAKE_CURRENT_BINARY_DIR}/../../base_c/include
  ${CMAKE_CURRENT_SOURCE_DIR}/../../base_cpp/include
  ${CMAKE_CURRENT_BINARY_DIR}/../../base_cpp/include
  ${CMAKE_CURRENT_SOURCE_DIR}/../../mtapi_c/include
14
  ${CMAKE_CURRENT_SOURCE_DIR}/../../mtapi_c/src
15
  ${CMAKE_CURRENT_SOURCE_DIR}/../../mtapi_plugins_c/mtapi_network_c/include
16
  ${CMAKE_CURRENT_SOURCE_DIR}/../../mtapi_cpp/include
17 18
  ${CMAKE_CURRENT_SOURCE_DIR}/../../tasks_cpp/include
  ${CMAKE_CURRENT_BINARY_DIR}/../../tasks_cpp/include
19 20 21 22 23
  ${CMAKE_CURRENT_SOURCE_DIR}/../../containers_cpp/include
  ${CMAKE_CURRENT_SOURCE_DIR}/../../algorithms_cpp/include
  ${CMAKE_CURRENT_SOURCE_DIR}/../../dataflow_cpp/include
  )

24 25 26 27 28
if(OpenCL_FOUND)
  # used in source code, to include opencl code
  add_definitions(-DEMBB_WITH_OPENCL)
  # add opencl includes
  include_directories( 
29
    ${CMAKE_CURRENT_SOURCE_DIR}/../../mtapi_plugins_c/mtapi_opencl_c/include
30 31 32 33 34 35 36 37 38
  )
  # later used, to link opencl to target...
  set (EMBB_MTAPI_OPENCL_C_CONDITIONAL "embb_mtapi_opencl_c")
else()
  # remove opencl examples from sources (should not be build)
  file(GLOB_RECURSE EXAMPLES_SOURCES_OPENCL_TO_REMOVE "*opencl*" )
  list(REMOVE_ITEM EXAMPLES_SOURCES ${EXAMPLES_SOURCES_OPENCL_TO_REMOVE})
endif()

39 40
if(CMAKE_COMPILER_IS_GNUCXX)
  set(CMAKE_CXX_FLAGS "-std=c++11")
41
  set (EXTRA_LIBS dl)
42 43
endif()

44
IF(MSVC)
45
  set (EXTRA_LIBS ws2_32)
46 47
ENDIF()

48
add_executable(examples ${EXAMPLES_SOURCES})
49
target_link_libraries(examples embb_dataflow_cpp embb_algorithms_cpp embb_tasks_cpp embb_mtapi_cpp
50
                      embb_mtapi_network_c ${EMBB_MTAPI_OPENCL_C_CONDITIONAL} embb_mtapi_c
51
                      embb_base_cpp embb_base_c embb_containers_cpp
52
                      ${EXTRA_LIBS} ${compiler_libs})
53
CopyBin(BIN examples DEST ${local_install_dir})