CMakeLists.txt 2.38 KB
Newer Older
1 2 3 4 5
project (project_embb_algorithms)

file(GLOB_RECURSE EMBB_ALGORITHMS_CPP_SOURCES "src/*.cc" "src/*.h")
file(GLOB_RECURSE EMBB_ALGORITHMS_CPP_HEADERS "include/*.h")
file(GLOB_RECURSE EMBB_ALGORITHMS_CPP_TEST_SOURCES "test/*.cc" "test/*.h")
6
file(GLOB_RECURSE EMBB_ALGORITHMS_CPP_PERF_SOURCES "perf/*.cc" "perf/*.h")
7 8

# Execute the GroupSources macro
9
include(${CMAKE_SOURCE_DIR}/CMakeCommon/GroupSourcesMSVC.cmake)
10 11 12
GroupSourcesMSVC(include)
GroupSourcesMSVC(src)
GroupSourcesMSVC(test)
13
GroupSourcesMSVC(perf)
14

15
set (EMBB_ALGORITHMS_CPP_INCLUDE_DIRS "include" "src" "test" "perf")
16 17 18 19 20 21
include_directories(${EMBB_ALGORITHMS_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
22 23
                    ${CMAKE_CURRENT_SOURCE_DIR}/../tasks_cpp/include
                    ${CMAKE_CURRENT_BINARY_DIR}/../tasks_cpp/include)
24 25 26

add_library(embb_algorithms_cpp ${EMBB_ALGORITHMS_CPP_SOURCES}
            ${EMBB_ALGORITHMS_CPP_HEADERS})
27
target_link_libraries(embb_algorithms_cpp embb_tasks_cpp)
28 29

if (BUILD_TESTS STREQUAL ON)
30
  # Unit tests
31 32 33
  include_directories(${CMAKE_CURRENT_BINARY_DIR}/../partest/include)
  add_executable (embb_algorithms_cpp_test ${EMBB_ALGORITHMS_CPP_TEST_SOURCES})
  target_link_libraries(embb_algorithms_cpp_test embb_algorithms_cpp
34
                        embb_tasks_cpp embb_mtapi_c partest embb_base_cpp
35 36
                        embb_base_c ${compiler_libs})
  CopyBin(BIN embb_algorithms_cpp_test DEST ${local_install_dir})
37 38 39 40 41 42 43 44
  # Performance tests
  include_directories(${CMAKE_CURRENT_BINARY_DIR}/../partest/include
                      ${CMAKE_CURRENT_SOURCE_DIR}/../base_cpp/perf/include)
  add_executable (embb_algorithms_cpp_perf ${EMBB_ALGORITHMS_CPP_PERF_SOURCES})
  target_link_libraries(embb_algorithms_cpp_perf embb_algorithms_cpp
                        embb_tasks_cpp embb_mtapi_c partest embb_base_cpp
                        embb_base_c embb_base_cpp_perf ${compiler_libs})
  CopyBin(BIN embb_algorithms_cpp_perf DEST ${local_install_dir})
45 46 47 48 49
endif()

install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/embb
        DESTINATION include FILES_MATCHING PATTERN "*.h")
install(TARGETS embb_algorithms_cpp DESTINATION lib)