在google上查了find_package和include的差别 网上说这两个语法是没有差别的
我做了一下试验 是没有差别的
CMakeLists.txt
cmake_minimum_required(VERSION 3.7.1)
project(hello-world)
##include
include(Findtest.cmake)
message(STATUS "===================>")
##find_package
set(CMAKE_MODULE_PATH /home/jack/projects/cmakePractice/findPackageVsInclude/) #为了能够让工程找到Findtest.cmake
find_package(test)
Findtest.cmake
message(STATUS "My name is Jack")
message(STATUS "My name is Lusi")
试验结果