我试图从使用CMakeFiles的现有项目导入外部项目。为此,我试图添加一个静态库“.a”和我需要导入的文件。CMake shell查找
我CMakeFiles.txt:
cmake_minimum_required(VERSION 2.8.9)
project(TEST)
set(CMAKE_BUILD_TYPE Release)
#Bring the headers, such as Student.h into the project
include_directories(include)
#However,文件(GLOB ...)允许通配符补充:
file(GLOB SOURCES "src/examples/equality_prob/*.cpp" "src/examples/equality_prob/common/*.cpp")
#Generate the static library from the sources
add_library(testEquality STATIC ${SOURCES})
直到那里我认为我在r ight方式。但在文件中(GLOB SOURCES,我想添加所有文件* .cpp,* .h等等,其中包含其他文件夹的文件夹
我可以在Makefiles中这样做, :?
$(shell find ${SRC}/examples -type f -name '*.o')
,但我怎样才能使这个在CMakeFiles
'file(GLOB_RECURSE ...)'? – Florian