You need to sign in or sign up before continuing.
CMakeLists.txt 1.62 KB
Newer Older
1
project (project_mtapi_cpp)
2

3 4 5
file(GLOB_RECURSE EMBB_MTAPI_CPP_SOURCES "src/*.cc" "src/*.h")
file(GLOB_RECURSE EMBB_MTAPI_CPP_HEADERS "include/*.h")
file(GLOB_RECURSE EMBB_MTAPI_CPP_TEST_SOURCES "test/*.cc" "test/*.h")
6 7 8 9 10 11 12 13 14 15 16 17 18

if (USE_AUTOMATIC_INITIALIZATION STREQUAL ON)
  set(MTAPI_CPP_AUTOMATIC_INITIALIZE 1)
else()
  set(MTAPI_CPP_AUTOMATIC_INITIALIZE 0)
endif()

# Execute the GroupSources macro
include(${CMAKE_SOURCE_DIR}/CMakeCommon/GroupSourcesMSVC.cmake)
GroupSourcesMSVC(include)
GroupSourcesMSVC(src)
GroupSourcesMSVC(test)

19 20
set (EMBB_MTAPI_CPP_INCLUDE_DIRS "include" "src" "test")
include_directories(${EMBB_MTAPI_CPP_INCLUDE_DIRS}
21 22 23 24 25 26
                    ${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)

27 28
add_library (embb_mtapi_cpp ${EMBB_MTAPI_CPP_SOURCES} ${EMBB_MTAPI_CPP_HEADERS})
target_link_libraries(embb_mtapi_cpp embb_mtapi_c)
29 30 31

if (BUILD_TESTS STREQUAL ON)
  include_directories(${CMAKE_CURRENT_BINARY_DIR}/../partest/include)
32 33
  add_executable (embb_mtapi_cpp_test ${EMBB_MTAPI_CPP_TEST_SOURCES})
  target_link_libraries(embb_mtapi_cpp_test embb_mtapi_cpp embb_mtapi_c partest 
34
                        embb_base_cpp embb_base_c ${compiler_libs})
35
  CopyBin(BIN embb_mtapi_cpp_test DEST ${local_install_dir})
36 37 38 39
endif()

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