在项目中找不到标题

时间:2019-09-24 10:28:02

标签: c++ cmake

我对CMakeLists文件有困难。我在其他项目中所做的几乎相同,因此我知道路径是正确的。但是我试图使其更加漂亮,所以我创建了一个新的CMakeLists文件。 现在我的项目找不到标题。

有人看到我错过了吗?

这是我的CMakeLists文件:

project("Test Cell Camera")
set(VERSION_MAJOR 0)
set(VERSION_MINOR 1)
set(VERSION_PATCH 0)

set(CMAKE_CXX_STANDARD 17)

set(lib_TARGET tcc)
set(exec_TARGET tcc_exe)
set(test_TARGET tcc_test)

set(SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src")
set(INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include")
set(TESTS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/tests")
set(LIBS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/libs")
set(CONFIG_DIR "${CMAKE_CURRENT_SOURCE_DIR}/config")
set(main_SRC_FILE "${SRC_DIR}/main.cpp")


include_directories(
    ${SRC_DIR}
    ${INCLUDE_DIR}
    "C:/Program Files/Basler/pylon 5/Development/include"  # Basler
)

file(GLOB lib_INCLUDE "${INCLUDE_DIR}/*/*.h")

file(GLOB lib_SRC "${SRC_DIR}/*.cpp")

list(FILTER lib_SRC EXCLUDE REGEX ${main_SRC_FILE})
file(GLOB main_SRC ${main_SRC_FILE})
# Add all test sources
file(GLOB test_SRC "${TESTS_DIR}/*.cpp")
# Documentation doxifile path
set(lib_DOC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/doc/")


link_directories("C:/Program Files/Basler/pylon 5/Development/lib/x64")
set(OpenCV_DIR "C:/OpenCV/3.4.7")
find_package(OpenCV REQUIRED)
include_directories(${OpenCV_INCLUDE_DIRS})


set(lib_dep_LIBS PylonC.lib ${OpenCV_LIBS})

add_library(${lib_TARGET} ${lib_SRC})
target_link_libraries(${lib_TARGET} ${lib_dep_LIBS})```

0 个答案:

没有答案