CMakeLists.txt 2.22 KB
Newer Older
Scott Cyphers's avatar
Scott Cyphers committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
# ******************************************************************************
# Copyright 2017-2018 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ******************************************************************************

if(MKLDNN_INCLUDE_DIR)
    link_directories(${MKLDNN_LIB_DIR})
endif()

if (NGRAPH_CPU_ENABLE)
22 23 24 25 26 27 28

    set(HEADER_SEARCH_DEFINES
        "NGRAPH_HEADERS_PATH=\"${NGRAPH_INCLUDE_PATH}\""
    )

    # abc
    set (ABC_SRC
Scott Cyphers's avatar
Scott Cyphers committed
29 30 31
        ${PROJECT_SOURCE_DIR}/doc/examples/abc.cpp
    )

32 33
    set_source_files_properties(${ABC_SRC} PROPERTIES COMPILE_DEFINITIONS "${HEADER_SEARCH_DEFINES}")
    add_executable(abc ${ABC_SRC})
Scott Cyphers's avatar
Scott Cyphers committed
34
    add_dependencies(abc ngraph)
35
    target_link_libraries(abc ngraph)
Scott Cyphers's avatar
Scott Cyphers committed
36

37 38 39
    # abc_op
    set (ABC_OP_SRC
        ${PROJECT_SOURCE_DIR}/doc/examples/abc_operator.cpp
Scott Cyphers's avatar
Scott Cyphers committed
40 41
    )

42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
    set_source_files_properties(${ABC_OP_SRC} PROPERTIES COMPILE_DEFINITIONS "${HEADER_SEARCH_DEFINES}")
    add_executable(abc_op ${ABC_OP_SRC})
    add_dependencies(abc_op ngraph)
    target_link_libraries(abc_op ngraph)

    # update
    set (UPDATE_SRC
        ${PROJECT_SOURCE_DIR}/doc/examples/update.cpp
    )

    set_source_files_properties(${UPDATE_SRC} PROPERTIES COMPILE_DEFINITIONS "${HEADER_SEARCH_DEFINES}")
    add_executable(update ${UPDATE_SRC})
    add_dependencies(update ngraph)
    target_link_libraries(update ngraph)

    # mnist_mlp
    set(MNIST_SRC
        ${PROJECT_SOURCE_DIR}/doc/examples/mnist_loader.cpp 
        ${PROJECT_SOURCE_DIR}/doc/examples/mnist_mlp.cpp
    )
Scott Cyphers's avatar
Scott Cyphers committed
62

63 64 65 66
    set_source_files_properties(${MNIST_SRC} PROPERTIES COMPILE_DEFINITIONS "${HEADER_SEARCH_DEFINES}")
    add_executable(mnist_mlp ${MNIST_SRC})
    add_dependencies(mnist_mlp ngraph)
    target_link_libraries(mnist_mlp ngraph)
Scott Cyphers's avatar
Scott Cyphers committed
67 68

endif()