Add include directories to the build. :: include_directories([AFTER|BEFORE] [SYSTEM] dir1 [dir2 ...]) Add the given directories to those the compiler uses to search for include files. Relative paths are interpreted as relative to the current source directory. The include directories are adde...
set(CMAKE_C_FLAGS "-finput-charset=UTF-8") # 添加头文件目录include_directories(include) include_directories(${PROJECT_SOURCE_DIR}/External/glfw-3.3.8.bin.WIN32/glfw-3.3.8.bin.WIN32/include/GLFW) include_directories(${PROJECT_SOURCE_DIR}/External/glew-2.2.0-win32/glew-2.2.0/include/GL)...
project(yaml-example) # 添加include文件夹与lib文件夹,避免找不到yaml-cpp的头文件与库文件 include_directories(include) link_directories(lib) # 添加可执行文件add_executable(yaml-example src/yaml-example.cpp) # 在编译可执行文件时,添加YAML_CPP_STATIC_DEFINE宏 target_compile_definitions(yaml-example PU...
include_directories("D:/opencv/build_install/install/include") link_directories("D:/opencv/build_install/install/x64/mingw/bin") #导入sdl2 include_directories("D:/ffmpeg/dev/SDL2-2.28.5-dev/x86_64-w64-mingw32/include") link_directories("D:/ffmpeg/dev/SDL2-2.28.5-dev/x86_64-w64-ming...
# include_directories("dev/include/") 指定头文件的路径:-I # link_directories("dev/lib") 指定库文件的路径:-L add_definitions("-Wall -g -fexec-charset=gbk") #message("CMAKE_CXX_COMPILE_FEATURES = ${CMAKE_CXX_COMPILE_FEATURES}") ...
#include <iostream> using namespace std; int main() { cout << "Hello, World!"; return 0; } 1. 2. 3. 4. 5. 6. 7. 8. 先编译但不链接,然后链接生成可执行文件: $ g++ -c helloworld.cpp $ g++ helloworld.o -o helloworld.exe ...
directories(${OSG_BUILD_PATH}/lib)include_directories(${OSG_BUILD_PATH}/include)add_executable(${PROJECT_NAME}osg_fun.cpp main.cpp OSG_MainWindow.cpp OSG_MainWindow.ui osgrenderwidget.cpp groudmanipulator.cpp osg_fun.cpp)set(OSG_LINK_LIB_LIST osg osgQOpenGL osgViewer OpenThreads osgGA osgDB...
${CMAKE_CURRENT_SOURCE_DIR}/deps/hiredis)include_directories(${SRC_PATH}${CMAKE_CURRENT_SOURCE_DIR}/deps/lua/src ${CMAKE_CURRENT_SOURCE_DIR}/deps/hiredis ${CMAKE_CURRENT_SOURCE_DIR}/deps/hiredis/adapters ${CMAKE_CURRENT_SOURCE_DIR}/deps/jemalloc-win/include) ...
项目目录结构: 项目目录结构 sublib子库的cmake代码: cmake_minimum_required(VERSION3.8)project(sublib)include_directories(include)list(APPEND SOURCES_LIST"src/lib.cpp")add_library(${PROJECT_NAME}SHARED${SOURCES_LIST}) sublib-lib.h: #ifdefDLL_EXPORT#defineDLL_API__declspec(dllexport)#else#define...
(VERSION 3.4.1)#包含指定目录的头文件include_directories(include/)#添加库文件 参数:生成的库名称 动态库(即so库) 源文件add_library(native-lib SHARED native-lib.cpp)#创建导入的库目标,FFmpeg7个SO库add_library(avutil-55 SHARED IMPORTED)add_library(swresample-2 SHARED IMPORTED)add_library(avcodec-...