CMakeLists.txt 1.91 KB
Newer Older
1
project (project_tasks_cpp)
2

3 4 5
file(GLOB_RECURSE EMBB_TASKS_CPP_SOURCES "src/*.cc" "src/*.h")
file(GLOB_RECURSE EMBB_TASKS_CPP_HEADERS "include/*.h")
file(GLOB_RECURSE EMBB_TASKS_CPP_TEST_SOURCES "test/*.cc" "test/*.h")
6

7
if (USE_AUTOMATIC_INITIALIZATION STREQUAL ON)
8
  set(TASKS_CPP_AUTOMATIC_INITIALIZE 1)
9
else()
10
  set(TASKS_CPP_AUTOMATIC_INITIALIZE 0)
11 12
endif()

13 14
configure_file("include/embb/tasks/internal/cmake_config.h.in"
               "include/embb/tasks/internal/cmake_config.h")
15

16
# Execute the GroupSources macro
17
include(${CMAKE_SOURCE_DIR}/CMakeCommon/GroupSourcesMSVC.cmake)
18 19 20 21
GroupSourcesMSVC(include)
GroupSourcesMSVC(src)
GroupSourcesMSVC(test)

22 23
set (EMBB_TASKS_CPP_INCLUDE_DIRS "include" "src" "test")
include_directories(${EMBB_TASKS_CPP_INCLUDE_DIRS}
24
                    ${CMAKE_CURRENT_BINARY_DIR}/include
25 26 27 28
                    ${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
29
                    ${CMAKE_CURRENT_SOURCE_DIR}/../mtapi_c/include)
30

31 32
add_library (embb_tasks_cpp ${EMBB_TASKS_CPP_SOURCES} ${EMBB_TASKS_CPP_HEADERS})
target_link_libraries(embb_tasks_cpp embb_mtapi_c)
33 34 35

if (BUILD_TESTS STREQUAL ON)
  include_directories(${CMAKE_CURRENT_BINARY_DIR}/../partest/include)
36 37
  add_executable (embb_tasks_cpp_test ${EMBB_TASKS_CPP_TEST_SOURCES})
  target_link_libraries(embb_tasks_cpp_test embb_tasks_cpp embb_mtapi_c partest 
38
                        embb_base_cpp embb_base_c ${compiler_libs})
39
  CopyBin(BIN embb_tasks_cpp_test DEST ${local_install_dir})
40 41 42 43
endif()

install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/
        DESTINATION include FILES_MATCHING PATTERN "*.h")
44 45
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/
        DESTINATION include FILES_MATCHING PATTERN "*.h")
46
install(TARGETS embb_tasks_cpp DESTINATION lib)