CMakeLists.txt 1.86 KB
Newer Older
1 2 3 4 5 6 7
project (project_dataflow_cpp)

file(GLOB_RECURSE EMBB_DATAFLOW_CPP_SOURCES "src/*.cc" "src/*.h")
file(GLOB_RECURSE EMBB_DATAFLOW_CPP_HEADERS "include/*.h")
file(GLOB_RECURSE EMBB_DATAFLOW_CPP_TEST_SOURCES "test/*.cc" "test/*.h")

# Execute the GroupSources macro
8
include(${CMAKE_SOURCE_DIR}/CMakeCommon/GroupSourcesMSVC.cmake)
9 10 11 12 13 14 15 16 17 18 19
GroupSourcesMSVC(include)
GroupSourcesMSVC(src)
GroupSourcesMSVC(test)

set (EMBB_DATAFLOW_CPP_INCLUDE_DIRS "include" "src" "test")
include_directories(${EMBB_DATAFLOW_CPP_INCLUDE_DIRS}
                    ${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
20 21
                    ${CMAKE_CURRENT_SOURCE_DIR}/../tasks_cpp/include
                    ${CMAKE_CURRENT_BINARY_DIR}/../tasks_cpp/include)
22 23

add_library (embb_dataflow_cpp ${EMBB_DATAFLOW_CPP_SOURCES} ${EMBB_DATAFLOW_CPP_HEADERS})
24
target_link_libraries(embb_dataflow_cpp embb_tasks_cpp embb_base_cpp embb_mtapi_c embb_base_c)
25 26 27 28

if (BUILD_TESTS STREQUAL ON)
  include_directories(${CMAKE_CURRENT_BINARY_DIR}/../partest/include)
  add_executable (embb_dataflow_cpp_test ${EMBB_DATAFLOW_CPP_TEST_SOURCES})
29
  target_link_libraries(embb_dataflow_cpp_test embb_dataflow_cpp embb_tasks_cpp embb_mtapi_c partest
30 31 32 33 34 35 36
                        embb_base_cpp embb_base_c ${compiler_libs})
  CopyBin(BIN embb_dataflow_cpp_test DEST ${local_install_dir})
endif()

install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/
        DESTINATION include FILES_MATCHING PATTERN "*.h")
install(TARGETS embb_dataflow_cpp DESTINATION lib)
37 38 39 40 41
if (MSVC)
  install(FILES ${CMAKE_CURRENT_BINARY_DIR}/Debug/embb_dataflow_cpp.pdb
          DESTINATION lib
          CONFIGURATIONS Debug)
endif()