├── 01-basic ├── 1.1 hello-cmake.md ├── 1.10 imported-targets.adoc ├── 1.11 cpp-standard.adoc ├── 1.2 hello-headers.md ├── 1.3 Static Library.md ├── 1.4 Shared Library.md ├── 1.5 build-type.md ├── 1.6 Compile Flags.md ├── 1.7 Including Third Party Library.md ├── 1.8 compiling-with-clang.adoc ├── 1.9 J-building-with-ninja.adoc └── README.adoc ├── 02-sub-projects ├── A-basic │ ├── CMakeLists.txt │ ├── README.adoc │ ├── subbinary │ │ ├── CMakeLists.txt │ │ └── main.cpp │ ├── sublibrary1 │ │ ├── CMakeLists.txt │ │ ├── include │ │ │ └── sublib1 │ │ │ │ └── sublib1.h │ │ └── src │ │ │ └── sublib1.cpp │ └── sublibrary2 │ │ ├── CMakeLists.txt │ │ └── include │ │ └── sublib2 │ │ └── sublib2.h └── README.adoc ├── 03-code-generation ├── README.adoc ├── configure-files │ ├── CMakeLists.txt │ ├── README.adoc │ ├── main.cpp │ ├── path.h.in │ └── ver.h.in └── protobuf │ ├── AddressBook.proto │ ├── CMakeLists.txt │ ├── README.adoc │ └── main.cpp ├── CMake-scope.md ├── README.md ├── SUMMARY.md ├── book.json ├── package-lock.json └── 实践案例 ├── README.md ├── dcmtk ├── CMakeLists.txt ├── README.md ├── cmake-build-debug │ ├── CMakeCache.txt │ ├── CMakeFiles │ │ ├── 3.17.5 │ │ │ ├── CMakeCCompiler.cmake │ │ │ ├── CMakeCXXCompiler.cmake │ │ │ ├── CMakeDetermineCompilerABI_C.bin │ │ │ ├── CMakeDetermineCompilerABI_CXX.bin │ │ │ ├── CMakeRCCompiler.cmake │ │ │ ├── CMakeSystem.cmake │ │ │ ├── CompilerIdC │ │ │ │ ├── CMakeCCompilerId.c │ │ │ │ └── a.exe │ │ │ └── CompilerIdCXX │ │ │ │ ├── CMakeCXXCompilerId.cpp │ │ │ │ └── a.exe │ │ ├── CMakeDirectoryInformation.cmake │ │ ├── CMakeOutput.log │ │ ├── Makefile.cmake │ │ ├── Makefile2 │ │ ├── TargetDirectories.txt │ │ ├── clion-environment.txt │ │ ├── clion-log.txt │ │ ├── cmake.check_cache │ │ ├── progress.marks │ │ └── testapp.dir │ │ │ ├── DependInfo.cmake │ │ │ ├── build.make │ │ │ ├── cmake_clean.cmake │ │ │ ├── depend.make │ │ │ ├── flags.make │ │ │ ├── includes_CXX.rsp │ │ │ ├── link.txt │ │ │ ├── linklibs.rsp │ │ │ ├── objects1.rsp │ │ │ └── progress.make │ ├── Makefile │ ├── Testing │ │ └── Temporary │ │ │ └── LastTest.log │ ├── cmake_install.cmake │ └── testapp.cbp ├── main.cpp └── out │ └── build │ └── x64-Debug │ ├── .cmake │ └── api │ │ └── v1 │ │ ├── query │ │ └── client-MicrosoftVS │ │ │ └── query.json │ │ └── reply │ │ ├── cache-v2-5433edd50e87420ea6ba.json │ │ ├── cmakeFiles-v1-deeb65e5eba942407b1b.json │ │ ├── codemodel-v2-7a679d93ea057bb2953b.json │ │ ├── index-2021-06-09T14-23-24-0727.json │ │ └── target-testapp-Debug-a1f2119db25734d54667.json │ ├── .ninja_deps │ ├── .ninja_log │ ├── CMakeCache.txt │ ├── CMakeFiles │ ├── 3.19.20122902-MSVC_2 │ │ ├── CMakeCCompiler.cmake │ │ ├── CMakeCXXCompiler.cmake │ │ ├── CMakeDetermineCompilerABI_C.bin │ │ ├── CMakeDetermineCompilerABI_CXX.bin │ │ ├── CMakeRCCompiler.cmake │ │ ├── CMakeSystem.cmake │ │ ├── CompilerIdC │ │ │ ├── CMakeCCompilerId.c │ │ │ ├── CMakeCCompilerId.exe │ │ │ └── CMakeCCompilerId.obj │ │ └── CompilerIdCXX │ │ │ ├── CMakeCXXCompilerId.cpp │ │ │ ├── CMakeCXXCompilerId.exe │ │ │ └── CMakeCXXCompilerId.obj │ ├── CMakeOutput.log │ ├── ShowIncludes │ │ ├── foo.h │ │ ├── main.c │ │ └── main.obj │ ├── TargetDirectories.txt │ ├── cmake.check_cache │ ├── rules.ninja │ └── testapp.dir │ │ ├── embed.manifest │ │ ├── intermediate.manifest │ │ ├── main.cpp.obj │ │ ├── manifest.rc │ │ └── manifest.res │ ├── Testing │ └── Temporary │ │ └── LastTest.log │ ├── VSInheritEnvironments.txt │ ├── build.ninja │ ├── cmake_install.cmake │ ├── dcmdata.dll │ ├── image-00000.dcm │ ├── oflog.dll │ ├── ofstd.dll │ ├── testapp.exe │ ├── testapp.ilk │ └── testapp.pdb ├── opencv ├── CMakeLists.txt ├── cmake-build-debug │ ├── CMakeCache.txt │ ├── CMakeFiles │ │ ├── 3.14.3 │ │ │ ├── CMakeCCompiler.cmake │ │ │ ├── CMakeCXXCompiler.cmake │ │ │ ├── CMakeDetermineCompilerABI_C.bin │ │ │ ├── CMakeDetermineCompilerABI_CXX.bin │ │ │ ├── CMakeRCCompiler.cmake │ │ │ ├── CMakeSystem.cmake │ │ │ ├── CompilerIdC │ │ │ │ ├── CMakeCCompilerId.c │ │ │ │ └── a.exe │ │ │ └── CompilerIdCXX │ │ │ │ ├── CMakeCXXCompilerId.cpp │ │ │ │ └── a.exe │ │ ├── 3.17.5 │ │ │ ├── CMakeCCompiler.cmake │ │ │ ├── CMakeCXXCompiler.cmake │ │ │ ├── CMakeDetermineCompilerABI_C.bin │ │ │ ├── CMakeDetermineCompilerABI_CXX.bin │ │ │ ├── CMakeRCCompiler.cmake │ │ │ ├── CMakeSystem.cmake │ │ │ ├── CompilerIdC │ │ │ │ ├── CMakeCCompilerId.c │ │ │ │ └── a.exe │ │ │ └── CompilerIdCXX │ │ │ │ ├── CMakeCXXCompilerId.cpp │ │ │ │ └── a.exe │ │ ├── CMakeDirectoryInformation.cmake │ │ ├── CMakeOutput.log │ │ ├── Makefile.cmake │ │ ├── Makefile2 │ │ ├── Progress │ │ │ ├── 1 │ │ │ ├── 2 │ │ │ └── count.txt │ │ ├── TargetDirectories.txt │ │ ├── clion-environment.txt │ │ ├── clion-log.txt │ │ ├── cmake.check_cache │ │ ├── feature_tests.bin │ │ ├── feature_tests.c │ │ ├── feature_tests.cxx │ │ ├── opencv_demo.dir │ │ │ ├── CXX.includecache │ │ │ ├── DependInfo.cmake │ │ │ ├── build.make │ │ │ ├── cmake_clean.cmake │ │ │ ├── depend.internal │ │ │ ├── depend.make │ │ │ ├── flags.make │ │ │ ├── includes_CXX.rsp │ │ │ ├── link.txt │ │ │ ├── linklibs.rsp │ │ │ ├── main.cpp.obj │ │ │ ├── objects.a │ │ │ ├── objects1.rsp │ │ │ └── progress.make │ │ └── progress.marks │ ├── Makefile │ ├── Project.cbp │ ├── Testing │ │ └── Temporary │ │ │ └── LastTest.log │ ├── cmake_install.cmake │ └── opencv_demo.cbp └── main.cpp ├── qt+opencv ├── CMakeLists.txt ├── README.md ├── main.cpp ├── mainwindow.cpp ├── mainwindow.h └── mainwindow.ui └── qt ├── CMakeLists.txt ├── README.md ├── main.cpp ├── mainwindow.cpp ├── mainwindow.h └── mainwindow.ui /01-basic/1.1 hello-cmake.md: -------------------------------------------------------------------------------- 1 | # RoboMaster视觉教程CMake(一)hello-cmake 2 | 3 | CMake是一个跨平台的安装(编译)工具,可以用简单的语句来描述所有平台的安装(编译过程)。他能够输出各种各样的makefile或者project文件,能测试编译器所支持的C++特性,类似UNIX下的automake。 4 | 5 | CMake的学习资料较少,只能通过github的各种例子进行学习。不过仍然建议在学习之前看一下《CMake实践》这本中文书 6 | 7 | 本CMake系列是依据github上的cmake-examples进行翻译总结。 8 | 9 | [英文github地址](https://github.com/ttroy50/cmake-examples):https://github.com/ttroy50/cmake-examples 10 | 11 | [TOC] 12 | 13 | ## 文件树 14 | 15 | ```tree 16 | ├── CMakeLists.txt 17 | 18 | ├── main.cpp 19 | ``` 20 | 21 | ## main.cpp 22 | 23 | ```c 24 | #include 25 | 26 | int main(int argc, char *argv[]) 27 | { 28 | std::cout << "Hello CMake!" << std::endl; 29 | return 0; 30 | } 31 | ``` 32 | 33 | ## CMakeLists.txt 34 | 35 | ```cmake 36 | cmake_minimum_required(VERSION 3.5) #设置CMake最小版本 37 | project (hello_cmake) #设置工程名 38 | add_executable(hello_cmake main.cpp) #生成可执行文件 39 | ``` 40 | 41 | ## 解析 42 | 43 | ### 命令作用解析 44 | 45 | ```cmake 46 | project (hello_cmake) #设置工程名 47 | ``` 48 | 49 | CMake构建包含一个项目名称,上面的命令会自动生成一些变量,在使用多个项目时引用某些变量会更加容易。 50 | 51 | 比如生成了: PROJECT_NAME 这个变量。PROJECT_NAME是变量名,${PROJECT_NAME}是变量值,值为hello_cmake 52 | 53 | ```cmake 54 | add_executable(hello_cmake main.cpp) #生成可执行文件 55 | ``` 56 | 57 | add_executable()命令指定某些源文件生成可执行文件,本例中是main.cpp。 add_executable()函数的第一个参数是可执行文件名,第二个参数是要编译的源文件列表。 58 | 59 | ### 生成与工程同名的二进制文件 60 | 61 | ```cmake 62 | cmake_minimum_required(VERSION 2.6) 63 | project (hello_cmake) 64 | add_executable(${PROJECT_NAME} main.cpp) 65 | ``` 66 | 67 | project(hello_cmake)函数执行时会生成一个变量,是PROJECT_NAME,${PROJECT_NAME}表示PROJECT_NAME变量的值为hello_cmake,所以把${PROJECT_NAME}用在add_executable()里可以生成可执行文件名字叫hello_cmake 68 | 69 | ### 外部构建与内部构建 70 | 71 | 变量CMAKE_BINARY_DIR指向 cmake命令的根文件夹,所有二进制文件在这个文件夹里产生。 72 | 73 | #### 外部构建(推荐) 74 | 75 | 使用外部构建,我们可以创建一个可以位于文件系统上任何位置的构建文件夹。 所有临时构建和目标文件都位于此目录中,以保持源代码树的整洁。 76 | 77 | 拿本例子来说: 78 | 79 | 运行下述代码,新建build构建文件夹,并运行cmake命令 80 | 81 | ```shell 82 | mkdir build 83 | cd build/ 84 | cmake .. 85 | ``` 86 | 87 | 文件树如下: 88 | 89 | ```cmake 90 | ├── build 91 | │ ├── CMakeCache.txt 92 | │ ├── CMakeFiles 93 | │ │ ├── 2.8.12.2 94 | │ │ │ ├── CMakeCCompiler.cmake 95 | │ │ │ ├── CMakeCXXCompiler.cmake 96 | │ │ │ ├── CMakeDetermineCompilerABI_C.bin 97 | │ │ │ ├── CMakeDetermineCompilerABI_CXX.bin 98 | │ │ │ ├── CMakeSystem.cmake 99 | │ │ │ ├── CompilerIdC 100 | │ │ │ │ ├── a.out 101 | │ │ │ │ └── CMakeCCompilerId.c 102 | │ │ │ └── CompilerIdCXX 103 | │ │ │ ├── a.out 104 | │ │ │ └── CMakeCXXCompilerId.cpp 105 | │ │ ├── cmake.check_cache 106 | │ │ ├── CMakeDirectoryInformation.cmake 107 | │ │ ├── CMakeOutput.log 108 | │ │ ├── CMakeTmp 109 | │ │ ├── hello_cmake.dir 110 | │ │ │ ├── build.make 111 | │ │ │ ├── cmake_clean.cmake 112 | │ │ │ ├── DependInfo.cmake 113 | │ │ │ ├── depend.make 114 | │ │ │ ├── flags.make 115 | │ │ │ ├── link.txt 116 | │ │ │ └── progress.make 117 | │ │ ├── Makefile2 118 | │ │ ├── Makefile.cmake 119 | │ │ ├── progress.marks 120 | │ │ └── TargetDirectories.txt 121 | │ ├── cmake_install.cmake 122 | │ └── Makefile 123 | ├── CMakeLists.txt 124 | ├── main.cpp 125 | ``` 126 | 127 | 可以看到,build文件夹下生成了许多二进制文件,如果要从头开始重新创建cmake环境,只需删除构建目录build,然后重新运行cmake。 非常方便 128 | 129 | 以后使用外部构建。 130 | 131 | #### 内部构建 132 | 133 | 内部构件将所有临时文件和源文件生成到一起,没有build,临时文件会和源代码文件在一起。(不推荐) 134 | 135 | ## 微信公众号 136 | 137 | 欢迎大家关注我的个人公众号,现阶段主要总结Robomaster相关的计算机视觉知识。 138 | 公众号名称:三丰杂货铺 139 | ![在这里插入图片描述](https://img-blog.csdnimg.cn/20200316110807276.jpg) -------------------------------------------------------------------------------- /01-basic/1.10 imported-targets.adoc: -------------------------------------------------------------------------------- 1 | = 导入第三方库到目标 2 | :toc: 3 | :toc-placement!: 4 | 5 | toc::[] 6 | 7 | ## 介绍 8 | 9 | 如先前在第三方库中所述,较新版本的CMake允许您使用导入的ALIASlink:https://cmake.org/cmake/help/v3.6/prop_tgt/IMPORTED.html#prop_tgt:IMPORTED[imported]目标链接第三方库。 10 | 11 | 本教程中的文件树如下: 12 | 13 | ``` 14 | $ tree 15 | . 16 | ├── CMakeLists.txt 17 | ├── main.cpp 18 | ``` 19 | 20 | * link:CMakeLists.txt[] - CMake指令 21 | * link:main.cpp[] - 源文件 22 | 23 | ## 环境版本 24 | 25 | * CMake v3.5+ 26 | * 安装在默认位置的boost库 27 | 28 | ## 解析 29 | 30 | ### 导入目标 31 | 32 | Imported targets是FindXXX模块导出的只读目标。 33 | 34 | 35 | 在CMake命令中包含boost这个库: 36 | 37 | [source,cmake] 38 | ---- 39 | target_link_libraries( imported_targets 40 | PRIVATE 41 | Boost::filesystem 42 | ) 43 | ---- 44 | 45 | 作用是自动链接Boost :: filesystem和Boost :: system库,同时还包括Boost 头文件目录。 46 | 47 | ## 编译例子 48 | 49 | [source,bash] 50 | ---- 51 | $ mkdir build 52 | 53 | $ cd build/ 54 | 55 | $ cmake .. 56 | -- The C compiler identification is GNU 5.4.0 57 | -- The CXX compiler identification is GNU 5.4.0 58 | -- Check for working C compiler: /usr/bin/cc 59 | -- Check for working C compiler: /usr/bin/cc -- works 60 | -- Detecting C compiler ABI info 61 | -- Detecting C compiler ABI info - done 62 | -- Detecting C compile features 63 | -- Detecting C compile features - done 64 | -- Check for working CXX compiler: /usr/bin/c++ 65 | -- Check for working CXX compiler: /usr/bin/c++ -- works 66 | -- Detecting CXX compiler ABI info 67 | -- Detecting CXX compiler ABI info - done 68 | -- Detecting CXX compile features 69 | -- Detecting CXX compile features - done 70 | -- Boost version: 1.58.0 71 | -- Found the following Boost libraries: 72 | -- filesystem 73 | -- system 74 | boost found 75 | -- Configuring done 76 | -- Generating done 77 | -- Build files have been written to: /data/code/01-basic/K-imported-targets/build 78 | 79 | $ make 80 | Scanning dependencies of target imported_targets 81 | [ 50%] Building CXX object CMakeFiles/imported_targets.dir/main.cpp.o 82 | [100%] Linking CXX executable imported_targets 83 | [100%] Built target imported_targets 84 | 85 | 86 | $ ./imported_targets 87 | Hello Third Party Include! 88 | Path is not relative 89 | 90 | 91 | ---- 92 | -------------------------------------------------------------------------------- /01-basic/1.11 cpp-standard.adoc: -------------------------------------------------------------------------------- 1 | = 设置C++ 标准 2 | 3 | 4 | 自C ++ 11和C ++ 14发行以来,普遍做法是调用编译器以使用这些标准。 随着CMake的发展,有了新的使用这些标准的方式。 5 | 6 | 7 | 以下示例显示了设置C ++标准的不同方法,以及提供哪些版本的CMake。 8 | 9 | The examples include: 10 | 11 | - link:i-common-method[common-method]. 可以与大多数版本的CMake一起使用的简单方法。 12 | - link:ii-cxx-standard[cxx-standard]. 使用CMake v3.1中引入的CMAKE_CXX_STANDARD变量。 13 | - link:iii-compile-features[compile-features]. 使用CMake v3.1中引入的target_compile_features函数。 14 | 15 | 16 | == C++ Standard Common Method 17 | :toc: 18 | :toc-placement!: 19 | 20 | toc::[] 21 | 22 | ## Introduction 23 | 24 | This example shows a common method to set the C++ Standard. This can be used with most versions of CMake. However, if you are targeting a recent version of CMake there are more convenient methods available.此示例显示了设置C ++标准的常用方法。 可以与大多数版本的CMake一起使用。 但是,如果有CMake的最新版本建议使用其他更便捷的方法。 25 | 26 | The files in this tutorial are below: 27 | 28 | ``` 29 | A-hello-cmake$ tree 30 | . 31 | ├── CMakeLists.txt 32 | ├── main.cpp 33 | ``` 34 | 35 | * link:CMakeLists.txt[CMakeLists.txt] - Contains the CMake commands you wish to run 36 | * link:main.cpp[main.cpp] - A simple "Hello World" cpp file targeting C++11. 37 | 38 | ## Concepts 39 | 40 | ### Checking Compile flags 41 | 42 | CMake has support for attempting to compile a program with any flags you pass into the function `CMAKE_CXX_COMPILER_FLAG`. The result is then stored in a variable that you pass in.CMake支持传递一个变量给函数CMAKE_CXX_COMPILER_FLAG来编译程序。 然后将结果存储在您传递的变量中。 43 | 44 | For example: 45 | 46 | [source,cmake] 47 | ---- 48 | include(CheckCXXCompilerFlag) 49 | CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11) 50 | ---- 51 | 52 | This example will attempt to compile a program with the flag `-std=c++11` and store the result in the variable `COMPILER_SUPPORTS_CXX11`.这个例子将flag “-std=c++11”传递给变量COMPILER_SUPPORTS_CXX11 53 | 54 | The line `include(CheckCXXCompilerFlag)` tells CMake to include this function to make it available for use. 55 | 想使用这个函数,必须使用include(CheckCXXCompilerFlag)包含这个函数 56 | 57 | ### Adding the flag 58 | 59 | Once you have determined if the compile supports a flag, you can then use the link:../../G-compile-flags/[standard cmake methods] to add this flag to a target. In this example we use the `CMAKE_CXX_FLAGS` to propegate the flag to all targets .确定编译器是否支持标志后,即可使用标准cmake方法将此标志添加到目标。 在此示例中,我们使用CMAKE_CXX_FLAGS将标志(c++标准)传播给所有目标。 60 | 61 | [source,cmake] 62 | ---- 63 | if(COMPILER_SUPPORTS_CXX11)# 64 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") 65 | elseif(COMPILER_SUPPORTS_CXX0X)# 66 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") 67 | else() 68 | message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.") 69 | endif() 70 | ---- 71 | 72 | The above example only checks for the gcc version of the compile flags and supports fallback from C+\+11 to the pre-standardisation C+\+0x flag. In real usage you may want to check for C++14, or add support for different methods of setting the compile, e.g. `-std=gnu++11`上面的示例仅检查编译标志的gcc版本,并支持从C ++ 11到预标准化C + \ + 0x标志的回退。 在实际使用中,您可能需要检查C14,或添加对设置编译方法的不同支持,例如 `-std = gnu11` 73 | 74 | ## Building the Examples 75 | 76 | Below is sample output from building this example. 77 | 78 | [source,bash] 79 | ---- 80 | $ mkdir build 81 | $ cd build 82 | 83 | $ cmake .. 84 | -- The C compiler identification is GNU 4.8.4 85 | -- The CXX compiler identification is GNU 4.8.4 86 | -- Check for working C compiler: /usr/bin/cc 87 | -- Check for working C compiler: /usr/bin/cc -- works 88 | -- Detecting C compiler ABI info 89 | -- Detecting C compiler ABI info - done 90 | -- Check for working CXX compiler: /usr/bin/c++ 91 | -- Check for working CXX compiler: /usr/bin/c++ -- works 92 | -- Detecting CXX compiler ABI info 93 | -- Detecting CXX compiler ABI info - done 94 | -- Performing Test COMPILER_SUPPORTS_CXX11 95 | -- Performing Test COMPILER_SUPPORTS_CXX11 - Success 96 | -- Performing Test COMPILER_SUPPORTS_CXX0X 97 | -- Performing Test COMPILER_SUPPORTS_CXX0X - Success 98 | -- Configuring done 99 | -- Generating done 100 | -- Build files have been written to: /data/code/01-basic/L-cpp-standard/i-common-method/build 101 | 102 | $ make VERBOSE=1 103 | /usr/bin/cmake -H/data/code/01-basic/L-cpp-standard/i-common-method -B/data/code/01-basic/L-cpp-standard/i-common-method/build --check-build-system CMakeFiles/Makefile.cmake 0 104 | /usr/bin/cmake -E cmake_progress_start /data/code/01-basic/L-cpp-standard/i-common-method/build/CMakeFiles /data/code/01-basic/L-cpp-standard/i-common-method/build/CMakeFiles/progress.marks 105 | make -f CMakeFiles/Makefile2 all 106 | make[1]: Entering directory `/data/code/01-basic/L-cpp-standard/i-common-method/build' 107 | make -f CMakeFiles/hello_cpp11.dir/build.make CMakeFiles/hello_cpp11.dir/depend 108 | make[2]: Entering directory `/data/code/01-basic/L-cpp-standard/i-common-method/build' 109 | cd /data/code/01-basic/L-cpp-standard/i-common-method/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /data/code/01-basic/L-cpp-standard/i-common-method /data/code/01-basic/L-cpp-standard/i-common-method /data/code/01-basic/L-cpp-standard/i-common-method/build /data/code/01-basic/L-cpp-standard/i-common-method/build /data/code/01-basic/L-cpp-standard/i-common-method/build/CMakeFiles/hello_cpp11.dir/DependInfo.cmake --color= 110 | Dependee "/data/code/01-basic/L-cpp-standard/i-common-method/build/CMakeFiles/hello_cpp11.dir/DependInfo.cmake" is newer than depender "/data/code/01-basic/L-cpp-standard/i-common-method/build/CMakeFiles/hello_cpp11.dir/depend.internal". 111 | Dependee "/data/code/01-basic/L-cpp-standard/i-common-method/build/CMakeFiles/CMakeDirectoryInformation.cmake" is newer than depender "/data/code/01-basic/L-cpp-standard/i-common-method/build/CMakeFiles/hello_cpp11.dir/depend.internal". 112 | Scanning dependencies of target hello_cpp11 113 | make[2]: Leaving directory `/data/code/01-basic/L-cpp-standard/i-common-method/build' 114 | make -f CMakeFiles/hello_cpp11.dir/build.make CMakeFiles/hello_cpp11.dir/build 115 | make[2]: Entering directory `/data/code/01-basic/L-cpp-standard/i-common-method/build' 116 | /usr/bin/cmake -E cmake_progress_report /data/code/01-basic/L-cpp-standard/i-common-method/build/CMakeFiles 1 117 | [100%] Building CXX object CMakeFiles/hello_cpp11.dir/main.cpp.o 118 | /usr/bin/c++ -std=c++11 -o CMakeFiles/hello_cpp11.dir/main.cpp.o -c /data/code/01-basic/L-cpp-standard/i-common-method/main.cpp 119 | Linking CXX executable hello_cpp11 120 | /usr/bin/cmake -E cmake_link_script CMakeFiles/hello_cpp11.dir/link.txt --verbose=1 121 | /usr/bin/c++ -std=c++11 CMakeFiles/hello_cpp11.dir/main.cpp.o -o hello_cpp11 -rdynamic 122 | make[2]: Leaving directory `/data/code/01-basic/L-cpp-standard/i-common-method/build' 123 | /usr/bin/cmake -E cmake_progress_report /data/code/01-basic/L-cpp-standard/i-common-method/build/CMakeFiles 1 124 | [100%] Built target hello_cpp11 125 | make[1]: Leaving directory `/data/code/01-basic/L-cpp-standard/i-common-method/build' 126 | /usr/bin/cmake -E cmake_progress_start /data/code/01-basic/L-cpp-standard/i-common-method/build/CMakeFiles 0 127 | ---- 128 | -------------------------------------------------------------------------------- /01-basic/1.4 Shared Library.md: -------------------------------------------------------------------------------- 1 | # RoboMaster视觉笔记CMake(四)Shared Library 2 | 3 | 4 | 5 | 本CMake系列是依据github上的cmake-examples进行翻译总结。同时对于不懂的地方进行总结与标注。希望本系列能节省你学习CMake的时间。 6 | 7 | [英文github地址](https://github.com/ttroy50/cmake-examples):https://github.com/ttroy50/cmake-examples 8 | 9 | CMake英文官方教程: https://cmake.org/cmake/help/latest/guide/tutorial/index.html 10 | 11 | [TOC] 12 | 13 | 本文自己创建动态库的操作,应该暂时用不到。但是关于如何添加路径,链接库的命令,还是需要掌握的。 14 | 15 | ## 一 文件树 16 | 17 | ```tree 18 | ├── CMakeLists.txt 19 | ├── include 20 | │   └── shared 21 | │   └── Hello.h 22 | └── src 23 | ├── Hello.cpp 24 | └── main.cpp 25 | ``` 26 | 27 | ### 1.1 Hello.h 28 | 29 | ```c++ 30 | /*声明了Hello类,Hello的方法是print(),*/ 31 | #ifndef __HELLO_H__ 32 | #define __HELLO_H__ 33 | 34 | class Hello 35 | { 36 | public: 37 | void print(); 38 | }; 39 | 40 | #endif 41 | 42 | ``` 43 | 44 | ### 1.2 Hello.cpp 45 | 46 | ```c++ 47 | /*实现了Hello::print()*/ 48 | #include 49 | 50 | #include "shared/Hello.h" 51 | 52 | void Hello::print() 53 | { 54 | std::cout << "Hello Shared Library!" << std::endl; 55 | } 56 | 57 | 58 | ``` 59 | 60 | ### 1.3 main.cpp 61 | 62 | ```c 63 | #include "shared/Hello.h" 64 | 65 | int main(int argc, char *argv[]) 66 | { 67 | Hello hi; 68 | hi.print(); 69 | return 0; 70 | } 71 | 72 | ``` 73 | 74 | ### 1.4 CMakeLists.txt 75 | 76 | ```cmake 77 | cmake_minimum_required(VERSION 3.5) 78 | project(hello_library) 79 | ############################################################ 80 | # Create a library 81 | ############################################################ 82 | #根据Hello.cpp生成动态库 83 | add_library(hello_library SHARED 84 | src/Hello.cpp 85 | ) 86 | #给动态库hello_library起一个别的名字hello::library 87 | add_library(hello::library ALIAS hello_library) 88 | #为这个库目标,添加头文件路径,PUBLIC表示包含了这个库的目标也会包含这个路径 89 | target_include_directories(hello_library 90 | PUBLIC 91 | ${PROJECT_SOURCE_DIR}/include 92 | ) 93 | ############################################################ 94 | # Create an executable 95 | ############################################################ 96 | #根据main.cpp生成可执行文件 97 | add_executable(hello_binary 98 | src/main.cpp 99 | ) 100 | #链接库和可执行文件,使用的是这个库的别名。PRIVATE 表示 101 | target_link_libraries( hello_binary 102 | PRIVATE 103 | hello::library 104 | ) 105 | 106 | ``` 107 | 108 | ## 二 CMake解析 109 | 110 | ### 2.1 创建动态库 111 | 112 | add_library()函数用于从某些源文件创建一个动态库,默认生成在构建文件夹。 写法如下: 113 | 114 | ```cmake 115 | add_library(hello_library SHARED 116 | src/Hello.cpp 117 | ) 118 | ``` 119 | 120 | 在add_library调用中包含了源文件,用于创建名称为libhello_library.so的动态库。 121 | 122 | | NOTE | 如前面的示例所述,将源文件直接传递给add_library调用,这是modern CMake的建议。(而不是先把Hello.cpp赋给一个变量) | 123 | | ---- | ------------------------------------------------------------ | 124 | | | | 125 | 126 | ### 2.2 创建别名目标 127 | 128 | 顾名思义,别名目标是在只读上下文中可以代替真实目标名称的替代名称。 129 | 130 | ```cmake 131 | add_library(hello::library ALIAS hello_library) 132 | ``` 133 | 134 | 如下所示,当您将目标链接到其他目标时,使用别名可以引用目标。 135 | 136 | 链接共享库与链接静态库相同。 创建可执行文件时,请使用target_link_library()函数指向您的库 。 137 | 138 | ```cmake 139 | add_executable(hello_binary 140 | src/main.cpp 141 | ) 142 | 143 | target_link_libraries(hello_binary 144 | PRIVATE 145 | hello::library 146 | ) 147 | ``` 148 | 149 | 这告诉CMake使用别名目标名称将hello_library链接到hello_binary可执行文件。 150 | 151 | ## 三 构建示例 152 | 153 | ```bash 154 | $ mkdir build 155 | 156 | $ cd build 157 | 158 | $ cmake .. 159 | -- The C compiler identification is GNU 4.8.4 160 | -- The CXX compiler identification is GNU 4.8.4 161 | -- Check for working C compiler: /usr/bin/cc 162 | -- Check for working C compiler: /usr/bin/cc -- works 163 | -- Detecting C compiler ABI info 164 | -- Detecting C compiler ABI info - done 165 | -- Check for working CXX compiler: /usr/bin/c++ 166 | -- Check for working CXX compiler: /usr/bin/c++ -- works 167 | -- Detecting CXX compiler ABI info 168 | -- Detecting CXX compiler ABI info - done 169 | -- Configuring done 170 | -- Generating done 171 | -- Build files have been written to: /home/matrim/workspace/cmake-examples/01-basic/D-shared-library/build 172 | 173 | $ make 174 | Scanning dependencies of target hello_library 175 | [ 50%] Building CXX object CMakeFiles/hello_library.dir/src/Hello.cpp.o 176 | Linking CXX shared library libhello_library.so 177 | [ 50%] Built target hello_library 178 | Scanning dependencies of target hello_binary 179 | [100%] Building CXX object CMakeFiles/hello_binary.dir/src/main.cpp.o 180 | Linking CXX executable hello_binary 181 | [100%] Built target hello_binary 182 | 183 | $ ls 184 | CMakeCache.txt CMakeFiles cmake_install.cmake hello_binary libhello_library.so Makefile 185 | 186 | $ ./hello_binary 187 | Hello Shared Library! 188 | ``` 189 | 190 | 191 | 192 | ## 微信公众号 193 | 194 | 欢迎大家关注我的个人公众号,现阶段主要总结Robomaster相关的计算机视觉知识。 195 | 公众号名称:三丰杂货铺 196 | ![在这里插入图片描述](https://img-blog.csdnimg.cn/20200316110807276.jpg) -------------------------------------------------------------------------------- /01-basic/1.9 J-building-with-ninja.adoc: -------------------------------------------------------------------------------- 1 | = Building with ninja 2 | :toc: 3 | :toc-placement!: 4 | 5 | toc::[] 6 | 7 | ## 介绍 8 | 9 | 如前所述,CMake是一个元构建系统,可用于为许多其他构建工具创建构建文件。 这个例子展示了如何让CMake使用ninja构建工具。 10 | 11 | ## 文件树 12 | 13 | ``` 14 | $ tree 15 | . 16 | ├── CMakeLists.txt 17 | ├── main.cpp 18 | ``` 19 | 20 | * link:CMakeLists.txt[] - CMake命令 21 | * link:main.cpp[] - 一个简单的"Hello World" cpp文件. 22 | 23 | ## 解析 24 | 25 | ### 生成器 26 | 27 | CMake are 28 | responsible for writing the input files (e.g. Makefiles) for the underlying build system. Running `cmake --help` 29 | will show the generators available. For cmake v2.8.12.2 the generators supported 30 | on my system include: 31 | CMakehttps://cmake.org/cmake/help/v3.0/manual/cmake-generators.7.html[generators]负责为基础构建系统编写输入文件(例如Makefile)。 运行cmake --help将显示可用的生成器。 对于cmake v2.8.12.2,我的系统支持的生成器包括: 32 | 33 | [source,bash] 34 | ---- 35 | Generators 36 | 37 | The following generators are available on this platform: 38 | Unix Makefiles = Generates standard UNIX makefiles. 39 | Ninja = Generates build.ninja files (experimental). 40 | CodeBlocks - Ninja = Generates CodeBlocks project files. 41 | CodeBlocks - Unix Makefiles = Generates CodeBlocks project files. 42 | Eclipse CDT4 - Ninja = Generates Eclipse CDT 4.0 project files. 43 | Eclipse CDT4 - Unix Makefiles 44 | = Generates Eclipse CDT 4.0 project files. 45 | KDevelop3 = Generates KDevelop 3 project files. 46 | KDevelop3 - Unix Makefiles = Generates KDevelop 3 project files. 47 | Sublime Text 2 - Ninja = Generates Sublime Text 2 project files. 48 | Sublime Text 2 - Unix Makefiles 49 | = Generates Sublime Text 2 project files.Generators 50 | ---- 51 | 52 | As specified in this https://stackoverflow.com/questions/25941536/what-is-a-cmake-generator[post], 53 | CMake includes different types of generators such as Command-Line, IDE, and Extra generators.如本文所指定,CMake包括不同类型的生成器,例如命令行,IDE和其他生成器。 54 | 55 | #### Command-Line Build Tool Generators命令行编译工具生成器 56 | 57 | These generators are for command-line build tools, like Make and Ninja. The chosen tool chain must be configured prior to generating the build system with CMake.这些生成器用于命令行构建工具,例如Make和Ninja。 在使用CMake生成构建系统之前,必须先配置所选的工具链。 58 | 59 | The supported generators include:支持的生成器包括: 60 | 61 | * Borland Makefiles 62 | * MSYS Makefiles 63 | * MinGW Makefiles 64 | * NMake Makefiles 65 | * NMake Makefiles JOM 66 | * Ninja ninja用的 67 | * Unix Makefiles make用的 68 | * Watcom WMake 69 | 70 | #### IDE Build Tool Generators 71 | 72 | These generators are for Integrated Development Environments that include their own compiler. Examples are Visual Studio and Xcode which include a compiler natively.这些生成器用于自己有编译器的IDE。 示例是Visual Studio和Xcode。 73 | 74 | The supported generators include: 75 | 76 | * Visual Studio 6 77 | * Visual Studio 7 78 | * Visual Studio 7 .NET 2003 79 | * Visual Studio 8 2005 80 | * Visual Studio 9 2008 81 | * Visual Studio 10 2010 82 | * Visual Studio 11 2012 83 | * Visual Studio 12 2013 84 | * Xcode 85 | 86 | #### Extra Generators 87 | 88 | These are generators create a configuration to work with an alternative IDE tool and must be included with either an IDE or Command-Line generator.这些生成器,用于其他IDE工具一起使用的配置,并且必须包含在IDE或命令行生成器中。 89 | 90 | The supported generators include: 91 | 92 | * CodeBlocks 93 | * CodeLite 94 | * Eclipse CDT4 95 | * KDevelop3 96 | * Kate 97 | * Sublime Text 2 98 | 99 | 100 | [NOTE] 101 | ==== 102 | In this example ninja is installed via the command `sudo apt-get install ninja-build`安装ninja的命令 103 | ==== 104 | 105 | ### Calling a Generator 106 | 107 | To call a CMake generator you can use the `-G` command line switch, for example:使用-G参数来唤醒CMake的生成器 108 | 109 | [source,cmake] 110 | ---- 111 | cmake .. -G Ninja 112 | ---- 113 | 114 | After doing the above CMake will generate the required Ninja build files, which can be run 115 | from using the `ninja` command.完成上述操作后,CMake将生成所需的Ninja构建文件,可以使用ninja命令运行该文件 116 | 117 | [source,bash] 118 | ---- 119 | $ cmake .. -G Ninja 120 | 121 | $ ls 122 | build.ninja CMakeCache.txt CMakeFiles cmake_install.cmake rules.ninja 123 | ---- 124 | 125 | ## 构建示例 126 | 127 | Below is sample output from building this example. 128 | 129 | [source,bash] 130 | ---- 131 | $ mkdir build.ninja 132 | 133 | $ cd build.ninja/ 134 | 135 | $ cmake .. -G Ninja 136 | -- The C compiler identification is GNU 4.8.4 137 | -- The CXX compiler identification is GNU 4.8.4 138 | -- Check for working C compiler using: Ninja 139 | -- Check for working C compiler using: Ninja -- works 140 | -- Detecting C compiler ABI info 141 | -- Detecting C compiler ABI info - done 142 | -- Check for working CXX compiler using: Ninja 143 | -- Check for working CXX compiler using: Ninja -- works 144 | -- Detecting CXX compiler ABI info 145 | -- Detecting CXX compiler ABI info - done 146 | -- Configuring done 147 | -- Generating done 148 | -- Build files have been written to: /home/matrim/workspace/cmake-examples/01-basic/J-building-with-ninja/build.ninja 149 | 150 | $ ninja -v 151 | [1/2] /usr/bin/c++ -MMD -MT CMakeFiles/hello_cmake.dir/main.cpp.o -MF "CMakeFiles/hello_cmake.dir/main.cpp.o.d" -o CMakeFiles/hello_cmake.dir/main.cpp.o -c ../main.cpp 152 | [2/2] : && /usr/bin/c++ CMakeFiles/hello_cmake.dir/main.cpp.o -o hello_cmake -rdynamic && : 153 | 154 | $ ls 155 | build.ninja CMakeCache.txt CMakeFiles cmake_install.cmake hello_cmake rules.ninja 156 | 157 | $ ./hello_cmake 158 | Hello CMake! 159 | ---- 160 | -------------------------------------------------------------------------------- /01-basic/README.adoc: -------------------------------------------------------------------------------- 1 | = 基本例子 2 | 3 | 此目录中的基本示例显示了如何设置CMake项目, 4 | 设置编译标志,创建并链接可执行文件和库,然后安装它们。 5 | 6 | 例子包括: 7 | 8 | - link:A-hello-cmake[hello-cmake]. 一个hello world例子. 9 | - link:B-hello-headers[hello-headers]. 一个稍微复杂的hello world示例,使用单独的源和包含文件夹。 10 | - link:C-static-library[static-library]. 使用静态库的示例。 11 | - link:D-shared-library[shared-library]. 使用共享库的示例。 12 | - link:E-installing[installing]. 显示如何创建将安装二进制文件和库的“ make install”目标。 13 | - link:F-build-type[build-type]. 显示如何为项目设置默认构建和优化标志的示例。 14 | - link:G-compile-flags[compile-flags]. 显示如何设置其他编译标志。 15 | - link:H-third-party-library[third-party-library]. 显示有关如何链接第三方库的示例。 16 | - link:I-compiling-with-clang[compiling-with-clang]. 调用clang编译器的示例。 17 | - link:J-building-with-ninja[building-with-ninja] - 18 | 显示如何用ninja构建文件 19 | - link:K-imported-targets[imported-targets] - 显示如何使用新导入的目标链接目标 20 | - link:L-cpp-standard[cpp-standard] - 21 | 显示设置C ++标准的各种方法 22 | -------------------------------------------------------------------------------- /02-sub-projects/A-basic/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.5) 2 | 3 | project(subprojects) 4 | 5 | # Add sub directories 6 | add_subdirectory(sublibrary1) 7 | add_subdirectory(sublibrary2) 8 | add_subdirectory(subbinary) 9 | -------------------------------------------------------------------------------- /02-sub-projects/A-basic/README.adoc: -------------------------------------------------------------------------------- 1 | = 子项目 2 | :toc: 3 | :toc-placement!: 4 | 5 | toc::[] 6 | 7 | ## Introduction 8 | 9 | 本示例说明如何包含子项目。 顶级CMakeLists.txt调用子目录中的CMakeLists.txt来创建以下内容: 10 | 11 | * sublibrary1 - 一个静态库 12 | * sublibrary2 - 只有头文件的库 13 | * subbinary - 一个可执行文件 14 | 15 | 文件树如下: 16 | 17 | ``` 18 | $ tree 19 | . 20 | ├── CMakeLists.txt 21 | ├── subbinary 22 | │   ├── CMakeLists.txt 23 | │   └── main.cpp 24 | ├── sublibrary1 25 | │   ├── CMakeLists.txt 26 | │   ├── include 27 | │   │   └── sublib1 28 | │   │   └── sublib1.h 29 | │   └── src 30 | │   └── sublib1.cpp 31 | └── sublibrary2 32 | ├── CMakeLists.txt 33 | └── include 34 | └── sublib2 35 | └── sublib2.h 36 | ``` 37 | 38 | * link:CMakeLists.txt[] - 最高层的CMakeLists.txt 39 | * link:subbinary/CMakeLists.txt[] - 生成可执行文件的CMakeLists.txt 40 | * link:subbinary/main.cpp[] - 可执行文件的源文件 41 | * link:sublibrary1/CMakeLists.txt[] - 生成静态库的CMakeLists.txt 42 | * link:sublibrary1/include/sublib1/sublib1.h[] 43 | * link:sublibrary1/src/sublib1.cpp[] 44 | * link:sublibrary2/CMakeLists.txt[] - 生成仅有头文件的库的CMakeLists.txt 45 | * link:sublibrary2/include/sublib2/sublib2.h[] 46 | 47 | [提示] 48 | ==== 49 | 在此示例中,我已将头文件移至每个项目include目录下的子文件夹,而将目标include保留为根include文件夹。 这是防止文件名冲突的一个好主意,因为您必须包括以下文件: 50 | [source,cpp] 51 | ---- 52 | #include "sublib1/sublib1.h" 53 | ---- 54 | 55 | 如果您为其他用户安装库,则默认安装位置为/usr/local/include/sublib1/sublib1.h。 56 | ==== 57 | 58 | ## 概念 59 | 60 | ## 添加子目录 61 | 62 | CMakeLists.txt文件可以包含和调用包含CMakeLists.txt文件的子目录。 63 | 64 | [source,cmake] 65 | ---- 66 | add_subdirectory(sublibrary1) 67 | add_subdirectory(sublibrary2) 68 | add_subdirectory(subbinary) 69 | ---- 70 | 71 | ## 引用子项目目录 72 | 73 | 使用project()命令创建项目时,CMake将自动创建许多变量,这些变量可用于引用有关该项目的详细信息。 这些变量然后可以由其他子项目或主项目使用。 例如,要引用您可以使用的其他项目的源目录。 74 | 75 | [source,cmake] 76 | ---- 77 | ${sublibrary1_SOURCE_DIR} 78 | ${sublibrary2_SOURCE_DIR} 79 | ---- 80 | CMake中有一些变量会自动创建: 81 | 82 | [cols=",",options="header",] 83 | |======================================================================= 84 | |Variable |Info 85 | |PROJECT_NAME | 当前project()设置的项目的名称。 86 | 87 | |CMAKE_PROJECT_NAME |由project()命令设置的第一个项目的名称,即顶层项目。 88 | 89 | |PROJECT_SOURCE_DIR |当前项目的源文件目录。 90 | 91 | |PROJECT_BINARY_DIR |当前项目的构建目录。 92 | 93 | |name_SOURCE_DIR |在此示例中,创建的源目录为 94 | `sublibrary1_SOURCE_DIR`, 95 | `sublibrary2_SOURCE_DIR`, and `subbinary_SOURCE_DIR` 96 | 97 | |name_BINARY_DIR | 本工程的二进制目录是`sublibrary1_BINARY_DIR`, 98 | `sublibrary2_BINARY_DIR`,和 `subbinary_BINARY_DIR` 99 | 100 | |======================================================================= 101 | 102 | ## Header only Libraries 103 | 104 | 如果您有一个库被创建为仅头文件的库,则cmake支持INTERFACE目标,以允许创建没有任何构建输出的目标。 可以从link:https://cmake.org/cmake/help/v3.4/command/add_library.html#interface-libraries[here]找到更多详细信息 105 | 106 | [source,cmake] 107 | ---- 108 | add_library(${PROJECT_NAME} INTERFACE) 109 | ---- 110 | 创建目标时,您还可以使用INTERFACE范围包含该目标的目录。 INTERFACE范围用于制定在链接此目标的任何库中使用的目标需求,但在目标本身的编译中不使用。 111 | 112 | [source,cmake] 113 | ---- 114 | target_include_directories(${PROJECT_NAME} 115 | INTERFACE 116 | ${PROJECT_SOURCE_DIR}/include 117 | ) 118 | ---- 119 | 120 | ## 引用子项目中的库 121 | 122 | 如果子项目创建了一个库,则其他项目可以通过在target_link_libraries()命令中调用该项目的名称来引用该库。 这意味着您不必引用新库的完整路径,而是将其添加为依赖项。 123 | 124 | [source,cmake] 125 | ---- 126 | target_link_libraries(subbinary 127 | PUBLIC 128 | sublibrary1 129 | ) 130 | ---- 131 | 或者,您可以创建一个别名目标,该目标允许您在上下文(其实就是某个目标的绰号)中引用该目标。 132 | 133 | 134 | [source,cmake] 135 | ---- 136 | add_library(sublibrary2) 137 | add_library(sub::lib2 ALIAS sublibrary2) 138 | ---- 139 | 140 | To reference the alias, just it as follows: 141 | [source,cmake] 142 | ---- 143 | target_link_libraries(subbinary 144 | sub::lib2 145 | ) 146 | ---- 147 | 148 | ## 包含子项目中的目录 149 | 150 | 从cmake v3开始从子项目添加库时,无需将项目include目录添加到二进制文件的include目录中。 151 | 152 | 153 | 创建库时,这由target_include_directories()命令中的作用域控制。 在此示例中,因为子二进制可执行文件链接了sublibrary1和sublibrary2库,所以当它们与库的PUBLIC和INTERFACE范围一起导出时,它将自动包含$ {sublibrary1_SOURCE_DIR} / inc和$ {sublibrary2_SOURCE_DIR} / inc文件夹。(这个地方设及到了PUBLIC和INTERFACE的使用,本电子书的CMake-scope是讲这个的) 154 | 155 | ## 构建示例 156 | 157 | [source,bash] 158 | ---- 159 | $ mkdir build 160 | 161 | $ cd build/ 162 | 163 | $ cmake .. 164 | -- The C compiler identification is GNU 4.8.4 165 | -- The CXX compiler identification is GNU 4.8.4 166 | -- Check for working C compiler: /usr/bin/cc 167 | -- Check for working C compiler: /usr/bin/cc -- works 168 | -- Detecting C compiler ABI info 169 | -- Detecting C compiler ABI info - done 170 | -- Check for working CXX compiler: /usr/bin/c++ 171 | -- Check for working CXX compiler: /usr/bin/c++ -- works 172 | -- Detecting CXX compiler ABI info 173 | -- Detecting CXX compiler ABI info - done 174 | -- Configuring done 175 | -- Generating done 176 | -- Build files have been written to: /home/matrim/workspace/cmake-examples/02-sub-projects/A-basic/build 177 | 178 | $ make 179 | Scanning dependencies of target sublibrary1 180 | [ 50%] Building CXX object sublibrary1/CMakeFiles/sublibrary1.dir/src/sublib1.cpp.o 181 | Linking CXX static library libsublibrary1.a 182 | [ 50%] Built target sublibrary1 183 | Scanning dependencies of target subbinary 184 | [100%] Building CXX object subbinary/CMakeFiles/subbinary.dir/main.cpp.o 185 | Linking CXX executable subbinary 186 | [100%] Built target subbinary 187 | 188 | ---- 189 | -------------------------------------------------------------------------------- /02-sub-projects/A-basic/subbinary/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(subbinary) 2 | 3 | # Create the executable 4 | add_executable(${PROJECT_NAME} main.cpp) 5 | 6 | # Link the static library from subproject1 using it's alias sub::lib1 7 | # Link the header only library from subproject2 using it's alias sub::lib2 8 | # This will cause the include directories for that target to be added to this project 9 | #使用别名sub :: lib1从subproject1链接静态库 10 | #使用别名sub :: lib2从subproject2链接仅标头的库 11 | #这将导致该目标的包含目录添加到该项目中 12 | target_link_libraries(${PROJECT_NAME} 13 | sub::lib1 14 | sub::lib2 15 | ) 16 | -------------------------------------------------------------------------------- /02-sub-projects/A-basic/subbinary/main.cpp: -------------------------------------------------------------------------------- 1 | #include "sublib1/sublib1.h" 2 | #include "sublib2/sublib2.h" 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | sublib1 hi; 7 | hi.print(); 8 | 9 | sublib2 howdy; 10 | howdy.print(); 11 | 12 | return 0; 13 | } 14 | -------------------------------------------------------------------------------- /02-sub-projects/A-basic/sublibrary1/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Set the project name 2 | project (sublibrary1) 3 | 4 | # Add a library with the above sources 5 | #此处${PROJECT_NAME}是当前project的名字,sublibrary1 6 | add_library(${PROJECT_NAME} src/sublib1.cpp) 7 | add_library(sub::lib1 ALIAS ${PROJECT_NAME}) 8 | 9 | target_include_directories( ${PROJECT_NAME} 10 | PUBLIC ${PROJECT_SOURCE_DIR}/include 11 | ) 12 | -------------------------------------------------------------------------------- /02-sub-projects/A-basic/sublibrary1/include/sublib1/sublib1.h: -------------------------------------------------------------------------------- 1 | #ifndef __SUBLIB_1_H__ 2 | #define __SUBLIB_1_H__ 3 | 4 | class sublib1 5 | { 6 | public: 7 | void print(); 8 | }; 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /02-sub-projects/A-basic/sublibrary1/src/sublib1.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "sublib1/sublib1.h" 4 | 5 | void sublib1::print() 6 | { 7 | std::cout << "Hello sub-library 1!" << std::endl; 8 | } 9 | -------------------------------------------------------------------------------- /02-sub-projects/A-basic/sublibrary2/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Set the project name 2 | project (sublibrary2) 3 | 4 | add_library(${PROJECT_NAME} INTERFACE) 5 | add_library(sub::lib2 ALIAS ${PROJECT_NAME}) 6 | 7 | target_include_directories(${PROJECT_NAME} 8 | INTERFACE 9 | ${PROJECT_SOURCE_DIR}/include 10 | ) 11 | -------------------------------------------------------------------------------- /02-sub-projects/A-basic/sublibrary2/include/sublib2/sublib2.h: -------------------------------------------------------------------------------- 1 | #ifndef __SUBLIB_2_H__ 2 | #define __SUBLIB_2_H__ 3 | 4 | #include 5 | 6 | class sublib2 7 | { 8 | public: 9 | void print() 10 | { 11 | std::cout << "Hello header only sub-library 2!" << std::endl; 12 | } 13 | }; 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /02-sub-projects/README.adoc: -------------------------------------------------------------------------------- 1 | = 子项目 2 | 3 | 许多大型项目由不同的库和二进制文件组成。本文利用多个CMakeLists.txt文件组织这些库和文件。 4 | 5 | 包括的示例是 6 | 7 | - link:A-basic[basic] - 此基本示例包括一个静态库,一个仅有头文件的库和一个可执行文件。 -------------------------------------------------------------------------------- /03-code-generation/README.adoc: -------------------------------------------------------------------------------- 1 | = Code Generation - 代码生成 2 | 3 | Code generation can be useful to create source code in different languages from a common description file. This can reduce the amount of manual code to write and increase interoperability. 4 | 5 | 代码生成是一个很好用的功能,它可以使用一份公共的描述文件,生成不同语言下的源代码。这个功能使得需要人工编写的代码大幅减少,同时也增加了互操作性。 6 | 7 | 8 | Examples showing code generation using variables from CMake and also using some common tools. 9 | 10 | 下面的例子展示了如何使用CMake变量和其他常用的工具进行代码生成。 11 | 12 | * link:configure-files[configure-file] 13 | ** Using the CMake configure_file function to inject CMake variables. 14 | ** 使用CMake中的configure_file函数注入CMake变量 15 | * link:protobuf[Protocol Buffers] 16 | ** Using Google Protocol Buffers to generate C++ source. 17 | ** 使用Google Protocol Buffers来生成C++源码 18 | -------------------------------------------------------------------------------- /03-code-generation/configure-files/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.5) 2 | 3 | # Set the project name 4 | project (cf_example) 5 | 6 | # set a project version 7 | set (cf_example_VERSION_MAJOR 0) 8 | set (cf_example_VERSION_MINOR 2) 9 | set (cf_example_VERSION_PATCH 1) 10 | set (cf_example_VERSION "${cf_example_VERSION_MAJOR}.${cf_example_VERSION_MINOR}.${cf_example_VERSION_PATCH}") 11 | 12 | # Call configure files on ver.h.in to set the version. 13 | # Uses the standard ${VARIABLE} syntax in the file 14 | configure_file(ver.h.in ${PROJECT_BINARY_DIR}/ver.h) 15 | 16 | # configure the path.h.in file. 17 | # This file can only use the @VARIABLE@ syntax in the file 18 | configure_file(path.h.in ${PROJECT_BINARY_DIR}/path.h @ONLY) 19 | 20 | # Add an executable 21 | add_executable(cf_example 22 | main.cpp 23 | ) 24 | 25 | # include the directory with the new files 26 | target_include_directories( cf_example 27 | PUBLIC 28 | ${CMAKE_BINARY_DIR} 29 | ) 30 | -------------------------------------------------------------------------------- /03-code-generation/configure-files/README.adoc: -------------------------------------------------------------------------------- 1 | = Configure Files Generation - 使用配置文件的代码生成 2 | :toc: 3 | :toc-placement!: 4 | 5 | toc::[] 6 | 7 | ## Introduction - 简介 8 | 9 | 在CMake的调用过程中可能会使用CMakeList.txt和CMake缓存中的变量来创建文件;在CMake的生成过程中,该文件会被复制到新的位置,其中所有的变量将被使用他们的值替换。 10 | 11 | During the call to cmake it is possible to create files that use variables from 12 | the CMakeLists.txt and cmake cache. During CMake generation the file is copied to a 13 | new location and any cmake variables are replaced. 14 | 15 | 本教程的目录结构如下所示: 16 | 17 | The files in this tutorial are below: 18 | 19 | ``` 20 | $ tree 21 | . 22 | ├── CMakeLists.txt 23 | ├── main.cpp 24 | ├── path.h.in 25 | ├── ver.h.in 26 | ``` 27 | 28 | * link:CMakeLists.txt[] - 描述你希望能够运行的CMake命令 29 | ** link:CMakeLists.txt[] - Contains the CMake commands you wish to run 30 | * link:main.cpp[] - 包含主函数的源文件 31 | ** link:main.cpp[] - The source file with main 32 | * link:path.h.in[] - 描述待构建目录的文件 33 | ** link:path.h.in[] - File to contain a path to the build directory 34 | * link:ver.h.in[] - 描述工程版本信息的文件 35 | ** link:ver.h.in[] - File to contain the version of the project 36 | 37 | ## Concepts - 概念 38 | 39 | ### Configure Files - 配置文件 40 | 41 | 在CMake中,你可以在文件中使用 `configure_file()` 函数进行变量的替换,这一函数的必要参数是源文件和目标文件。 42 | 43 | To do variable substitution in a file you can use the `configure_file()` function 44 | in CMake. This core arguments for this function are source file and destination file. 45 | 46 | [source,cmake] 47 | ---- 48 | configure_file(ver.h.in ${PROJECT_BINARY_DIR}/ver.h) 49 | 50 | configure_file(path.h.in ${PROJECT_BINARY_DIR}/path.h @ONLY) 51 | ---- 52 | 53 | 第一个例子,在ver.h.in文件中,CMake可以将使用 `${}` 或 `@@` 的语法来定义一个CMake变量。在执行代码生成之后,在 `PROJECT_BINARY_DIR` 目录下将会出现一个新的ver.h文件。 54 | 55 | The first example above, allows the variable to be defined like a CMake variables using 56 | the `${}` syntax or an `@@` in the ver.h.in file. After generation a new file ver.h will be available 57 | in the `PROJECT_BINARY_DIR`. 58 | 59 | ``` 60 | const char* ver = "${cf_example_VERSION}"; 61 | ``` 62 | 63 | 第二个例子,在path.h.in文件中,`@ONLY` 指定了它只能用 `@@` 的语法来定义一个CMake变量。同样地,在执行代码生成之后,在 `PROJECT_BINARY_DIR` 目录下将会出现一个新的path.h文件。 64 | 65 | The second example, only allows variables to be defined using the `@@` syntax in the path.h.in file. 66 | After generation a new file path.h will be available in the `PROJECT_BINARY_DIR`. 67 | 68 | ``` 69 | const char* path = "@CMAKE_SOURCE_DIR@"; 70 | ``` 71 | 72 | ## 构建示例 73 | 74 | [source,bash] 75 | ---- 76 | $ mkdir build 77 | 78 | $ cd build/ 79 | 80 | $ cmake .. 81 | -- The C compiler identification is GNU 4.8.4 82 | -- The CXX compiler identification is GNU 4.8.4 83 | -- Check for working C compiler: /usr/bin/cc 84 | -- Check for working C compiler: /usr/bin/cc -- works 85 | -- Detecting C compiler ABI info 86 | -- Detecting C compiler ABI info - done 87 | -- Check for working CXX compiler: /usr/bin/c++ 88 | -- Check for working CXX compiler: /usr/bin/c++ -- works 89 | -- Detecting CXX compiler ABI info 90 | -- Detecting CXX compiler ABI info - done 91 | -- Configuring done 92 | -- Generating done 93 | -- Build files have been written to: /home/matrim/workspace/cmake-examples/03-code-generation/configure-files/build 94 | 95 | $ ls 96 | CMakeCache.txt CMakeFiles cmake_install.cmake Makefile path.h ver.h 97 | 98 | $ cat path.h 99 | #ifndef __PATH_H__ 100 | #define __PATH_H__ 101 | 102 | // version variable that will be substituted by cmake 103 | // This shows an example using the @ variable type 104 | const char* path = "/home/matrim/workspace/cmake-examples/03-code-generation/configure-files"; 105 | 106 | #endif 107 | 108 | $ cat ver.h 109 | #ifndef __VER_H__ 110 | #define __VER_H__ 111 | 112 | // version variable that will be substituted by cmake 113 | // This shows an example using the $ variable type 114 | const char* ver = "0.2.1"; 115 | 116 | #endif 117 | 118 | $ make 119 | Scanning dependencies of target cf_example 120 | [100%] Building CXX object CMakeFiles/cf_example.dir/main.cpp.o 121 | Linking CXX executable cf_example 122 | [100%] Built target cf_example 123 | 124 | $ ./cf_example 125 | Hello Version 0.2.1! 126 | Path is /home/matrim/workspace/cmake-examples/03-code-generation/configure-files 127 | ---- 128 | -------------------------------------------------------------------------------- /03-code-generation/configure-files/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "ver.h" 3 | #include "path.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | std::cout << "Hello Version " << ver << "!" << std::endl; 8 | std::cout << "Path is " << path << std::endl; 9 | return 0; 10 | } 11 | -------------------------------------------------------------------------------- /03-code-generation/configure-files/path.h.in: -------------------------------------------------------------------------------- 1 | #ifndef __PATH_H__ 2 | #define __PATH_H__ 3 | 4 | // version variable that will be substituted by cmake 5 | // This shows an example using the @ variable type 6 | const char* path = "@CMAKE_SOURCE_DIR@"; 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /03-code-generation/configure-files/ver.h.in: -------------------------------------------------------------------------------- 1 | #ifndef __VER_H__ 2 | #define __VER_H__ 3 | 4 | // version variable that will be substituted by cmake 5 | // This shows an example using the $ variable type 6 | const char* ver = "${cf_example_VERSION}"; 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /03-code-generation/protobuf/AddressBook.proto: -------------------------------------------------------------------------------- 1 | package tutorial; 2 | 3 | message Person { 4 | required string name = 1; 5 | required int32 id = 2; 6 | optional string email = 3; 7 | 8 | enum PhoneType { 9 | MOBILE = 0; 10 | HOME = 1; 11 | WORK = 2; 12 | } 13 | 14 | message PhoneNumber { 15 | required string number = 1; 16 | optional PhoneType type = 2 [default = HOME]; 17 | } 18 | 19 | repeated PhoneNumber phone = 4; 20 | } 21 | 22 | message AddressBook { 23 | repeated Person person = 1; 24 | } 25 | -------------------------------------------------------------------------------- /03-code-generation/protobuf/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.5) 2 | 3 | # Set the project name 4 | project (protobuf_example) 5 | 6 | # find the protobuf compiler and libraries 7 | find_package(Protobuf REQUIRED) 8 | 9 | # check if protobuf was found 10 | if(PROTOBUF_FOUND) 11 | message ("protobuf found") 12 | else() 13 | message (FATAL_ERROR "Cannot find Protobuf") 14 | endif() 15 | 16 | # Generate the .h and .cxx files 17 | PROTOBUF_GENERATE_CPP(PROTO_SRCS PROTO_HDRS AddressBook.proto) 18 | 19 | # Print path to generated files 20 | message ("PROTO_SRCS = ${PROTO_SRCS}") 21 | message ("PROTO_HDRS = ${PROTO_HDRS}") 22 | 23 | # Add an executable 24 | add_executable(protobuf_example 25 | main.cpp 26 | ${PROTO_SRCS} 27 | ${PROTO_HDRS}) 28 | 29 | target_include_directories(protobuf_example 30 | PUBLIC 31 | ${PROTOBUF_INCLUDE_DIRS} 32 | ${CMAKE_CURRENT_BINARY_DIR} 33 | ) 34 | 35 | # link the exe against the libraries 36 | target_link_libraries(protobuf_example 37 | PUBLIC 38 | ${PROTOBUF_LIBRARIES} 39 | ) 40 | -------------------------------------------------------------------------------- /03-code-generation/protobuf/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "AddressBook.pb.h" 5 | using namespace std; 6 | 7 | // This function fills in a Person message based on user input. 8 | void PromptForAddress(tutorial::Person* person) { 9 | cout << "Enter person ID number: "; 10 | int id; 11 | cin >> id; 12 | person->set_id(id); 13 | cin.ignore(256, '\n'); 14 | 15 | cout << "Enter name: "; 16 | getline(cin, *person->mutable_name()); 17 | 18 | cout << "Enter email address (blank for none): "; 19 | string email; 20 | getline(cin, email); 21 | if (!email.empty()) { 22 | person->set_email(email); 23 | } 24 | 25 | while (true) { 26 | cout << "Enter a phone number (or leave blank to finish): "; 27 | string number; 28 | getline(cin, number); 29 | if (number.empty()) { 30 | break; 31 | } 32 | 33 | tutorial::Person::PhoneNumber* phone_number = person->add_phone(); 34 | phone_number->set_number(number); 35 | 36 | cout << "Is this a mobile, home, or work phone? "; 37 | string type; 38 | getline(cin, type); 39 | if (type == "mobile") { 40 | phone_number->set_type(tutorial::Person::MOBILE); 41 | } else if (type == "home") { 42 | phone_number->set_type(tutorial::Person::HOME); 43 | } else if (type == "work") { 44 | phone_number->set_type(tutorial::Person::WORK); 45 | } else { 46 | cout << "Unknown phone type. Using default." << endl; 47 | } 48 | } 49 | } 50 | 51 | // Main function: Reads the entire address book from a file, 52 | // adds one person based on user input, then writes it back out to the same 53 | // file. 54 | int main(int argc, char* argv[]) { 55 | // Verify that the version of the library that we linked against is 56 | // compatible with the version of the headers we compiled against. 57 | GOOGLE_PROTOBUF_VERIFY_VERSION; 58 | 59 | if (argc != 2) { 60 | cerr << "Usage: " << argv[0] << " ADDRESS_BOOK_FILE" << endl; 61 | return -1; 62 | } 63 | 64 | tutorial::AddressBook address_book; 65 | 66 | { 67 | // Read the existing address book. 68 | fstream input(argv[1], ios::in | ios::binary); 69 | if (!input) { 70 | cout << argv[1] << ": File not found. Creating a new file." << endl; 71 | } else if (!address_book.ParseFromIstream(&input)) { 72 | cerr << "Failed to parse address book." << endl; 73 | return -1; 74 | } 75 | } 76 | 77 | // Add an address. 78 | PromptForAddress(address_book.add_person()); 79 | 80 | { 81 | // Write the new address book back to disk. 82 | fstream output(argv[1], ios::out | ios::trunc | ios::binary); 83 | if (!address_book.SerializeToOstream(&output)) { 84 | cerr << "Failed to write address book." << endl; 85 | return -1; 86 | } 87 | } 88 | 89 | // Optional: Delete all global objects allocated by libprotobuf. 90 | google::protobuf::ShutdownProtobufLibrary(); 91 | 92 | return 0; 93 | } 94 | -------------------------------------------------------------------------------- /CMake-scope.md: -------------------------------------------------------------------------------- 1 | 这三个属性在不同命令中有不同的含义。 2 | 我把它总结为一个表格,如果看不太明白,再看下方的翻译。 3 | 4 | ![在这里插入图片描述](https://gitee.com/umecjf/figures/raw/master/2020051109320685.png) 5 | 6 | 7 | 8 | 下面的内容均来自Cmake英文官方手册。主要是翻译了三处CMake手册的介绍。 9 | 10 | 11 | 对于target_link_libraries()我认为这三个变量是用来控制库传递过程中,库所包含的依赖是否也能被连接到这个库的其他目标所包含。同时,这个手册建议,根据库的cpp以及库的h(注意不是工程)是否用到依赖,来设置这个依赖的scope范围。 12 | 13 | 对于target_include_directories()这三个关键词设置了这个目录A会被包含到目标B的哪个属性,同时,在使用target_link_libraries()将目标B链接给目标C的时候,B所包含的目录也会因为关键字的设置而决定是否能被C包含。 14 | 15 | 英文原文: 16 | 17 | https://cmake.org/cmake/help/latest/manual/cmake-buildsystem.7.html#build-specification-and-usage-requirements 18 | 英文翻译: 19 | 20 | 传递用法要求 21 | 目标的使用要求可以传递给依赖对象。 target_link_libraries()命令具有PRIVATE,INTERFACE和PUBLIC关键字来控制传播使用要求。 22 | 23 | ```c 24 | add_library(archive archive.cpp) 25 | target_compile_definitions(archive INTERFACE USING_ARCHIVE_LIB) 26 | 27 | add_library(serialization serialization.cpp) 28 | target_compile_definitions(serialization INTERFACE USING_SERIALIZATION_LIB) 29 | 30 | add_library(archiveExtras extras.cpp) 31 | target_link_libraries(archiveExtras PUBLIC archive) 32 | target_link_libraries(archiveExtras PRIVATE serialization) 33 | # archiveExtras is compiled with -DUSING_ARCHIVE_LIB 34 | # and -DUSING_SERIALIZATION_LIB 35 | 36 | add_executable(consumer consumer.cpp) 37 | # consumer is compiled with -DUSING_ARCHIVE_LIB 38 | target_link_libraries(consumer archiveExtras) 39 | ``` 40 | 41 | 因为`archive`库是目标`archiveExtras`的PUBLIC依赖项,所以它(`archive`)的使用要求也传播到了`consumer`。因为`serialization`是`archiveExtras`的`PRIVATE`依赖项,所以它(`serialization`)的使用要求不会传播到`consumer`。 42 | 通常,如果只有库的实现而不是头文件使用了依赖项(生成库的cpp文件中使用依赖项,但是库所包含的头文件没有包含依赖项),则应在使用target_link_libraries()时用PRIVATE关键字指定依赖项。如果在库的头文件中还使用了依赖项(例如,用于类继承),则应将其指定为PUBLIC依赖项。库的实现不使用依赖项,而是仅由其头文件使用的依赖项应指定为INTERFACE依赖项。 43 | 44 | 可以通过多次使用每个关键字来调用target_link_libraries()命令: 45 | 46 | ```cmake 47 | target_link_libraries(archiveExtras 48 | PUBLIC archive 49 | PRIVATE serialization 50 | ) 51 | ``` 52 | 英文原文: 53 | https://cmake.org/cmake/help/latest/command/target_include_directories.html 54 | 英文翻译: 55 | target_include_directories 56 | 将包含目录添加到目标。 57 | 58 | ```cmake 59 | target_include_directories( [SYSTEM] [BEFORE] 60 | [items1...] 61 | [ [items2...] ...]) 62 | ``` 63 | 64 | 在编译给定目标时,要指定包含目录。必须由诸如add_executable()或add_library()之类的命令创建,并且不能为ALIAS(别名)目标。 65 | 66 | 如果指定了BEFORE,则内容将被添加到该属性的前面,而不是被附加。 67 | 68 | INTERFACE,PUBLIC和PRIVATE关键字来指定以下参数的范围。 PRIVATE和PUBLIC项目将放到的INCLUDE_DIRECTORIES变量里。 PUBLIC和INTERFACE项目将放到的INTERFACE_INCLUDE_DIRECTORIES变量里。 (导入的目标仅支持INTERFACE项。)以下参数指定包含目录。 69 | 70 | 指定的包含目录可以是绝对路径或相对路径。对相同的重复调用将按调用顺序追加项目。如果指定了SYSTEM,则会在某些平台上告知编译器目录为系统包含目录(对此设置进行信号化可能会产生效果,例如编译器跳过警告,或者在依赖性计算中不考虑这些固定安装的系统文件-请参阅编译器文档)。如果将SYSTEM与PUBLIC或INTERFACE一起使用,则INTERFACE_SYSTEM_INCLUDE_DIRECTORIES目标属性将使用指定的目录填充。 71 | 72 | 73 | 英文原文: 74 | https://cmake.org/cmake/help/latest/command/target_link_libraries.html?highlight=target_link_libraries#libraries-for-both-a-target-and-its-dependents 75 | 英文翻译: 76 | ```cmake 77 | target_link_libraries( ...) 78 | ``` 79 | 80 | 默认情况下,使用这个函数(signature)的库依赖关系是可传递的(我认为默认是PUBLIC关键词)。 当这个目标(假设为库A,我认为不是库无法被链接,所以如果这是一个单纯的可执行文件,那么这个scope关键词就没有意义)被链接到另一个目标(目标B)时,链接到这个目标(库A)的库也可以被另一个目标(目标B)链接上。 81 | 82 | 这个可传递的“链接接口”存储在INTERFACE_LINK_LIBRARIES目标属性中,可以直接设置该属性。 当CMP0022未设置为NEW时,将建立传递链接,但可被LINK_INTERFACE_LIBRARIES属性覆盖。 调用此命令的其他签名可能会设置该属性,从而使由该签名专有链接的任何库都变为私有。 83 | 84 | 欢迎关注我的公众号一起交流讨论: 85 | 公众号名称:三丰杂货铺 86 | ![在这里插入图片描述](https://gitee.com/umecjf/figures/raw/master/2020051109320685.png) -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 |

20 | 21 | ubuntu 22 | 23 | 24 | vue-router 25 | 26 | 27 | vuex 28 | 29 |

30 | 31 | 32 | 仓库受到的关注度越来越高,考虑到大家学习容易出现问题,现在创建一个qq交流群:433323162。微信群可以扫码加入。 33 | 34 | 35 | # cmake-examples-Chinese 36 | 37 | 项目在线阅读电子书地址:[通过例子学习CMake](https://sfumecjf.github.io/cmake-examples-Chinese/) 38 | 39 | 本教程全部采用中文,通过一个个例子帮助读者由浅入深逐渐理解CMake的语法。教程主要来源于github优秀CMake项目,项目贡献者在翻译中,又查阅CMake官方手册,或者与已经工作的C++开发者交流,对于模糊的地方予以详细说明。 40 | 41 | 非常适合完全没接触过CMake以及shell的人从头阅读。 42 | 43 | 另外,在部署过程中,main分支的代码会比在线电子书的更新进度快,因为页面部署总是出现问题。最近打算弃用部署页面的`gitbook`工具(它已经过时了,过时至少2年)。 44 | 45 | 46 | **觉得有用的话,希望给个star哦~** 47 | ## 什么是cmake 48 | CMake是一个跨平台的安装(编译)工具,可以用简单的语句来描述所有平台的安装(编译过程)。他能够输出各种各样的makefile或者project文件,CMake 的组态档取名为 CMakeLists.txt。也就是在CMakeLists.txt这个文件中写cmake代码。 49 | 一句话:cmake就是将多个cpp、hpp文件组合构建为一个大工程的语言。 50 | 51 | ## 本cmake系列介绍 52 | 首先大家学习cmake一定会遇到《cmake practice》这本书,但是纯粹讲理论,如果没有实践的话是学不会的。learning by doing是学习各种知识的不二法门。 53 | 54 | 另外,在不太大的工程中,其实cmake也不需要钻研到多深入,日后工作用得多了自然就会了。比如说PRIVATE、INTERFACE、PUBLIC这三个参数在实际中的用途,当时请教了wps的一位前辈,最终的理解在这篇文章中[cmake-scope](https://github.com/SFUMECJF/cmake-examples-Chinese/blob/main/CMake-scope.md)。他自己也是偶尔有一次用这三个参数测试了一下,其他时候不怎么关心。 55 | 56 | 而如果作为在校学生,花费很多时间钻这块内容,不实践也很快会忘掉。所以,基本上cmake写出来,能用就行,学习阶段不要钻牛角尖,工作了再钻研。 57 | 58 | 如果想要快速入门,直接学习`01-basic`即可,学完就可以动手编写自己的工程了。有时间可以学习`02-sub-projects`以及`03-code-generation`。 59 | 60 | 另外,大家学习CMake的主要目的还是用于实操,所以本文作者在第4个文件夹`实践案例`中提供了使用CMake包含`Open CV`,`dcmtk`, `qt`的CMake工程,大家可以直接下载使用,根据里面的readme进行初步配置。如果遇到错误可以告诉我,我来修改。 61 | 62 | ## 学习途径 63 | 64 | 推荐在线阅读该电子书,快速过一遍知识点。 65 | 66 | 时间充足想打基础的人,可以结合[原项目例子](https://github.com/ttroy50/cmake-examples),在Linux系统下载运行代码。当遇到有疑问的地方,查阅本项目手册。 67 | 68 | 69 | 70 | 点个star以后,直接将本github克隆到本地或者fork,欢迎PR。 71 | 72 | ```shell 73 | git clone https://github.com/SFUMECJF/cmake-examples-Chinese.git 74 | ``` 75 | ## 微信公众号 76 | 最后,博主也只是一个初学者罢了,只是把自己学习过程中的东西做了总结,如果大家有什么想法,欢迎指正。我的微信公众号如下: 77 | 现阶段主要总结计算机视觉知识:Qt,C++,CMake,OpenCV等等 78 | 公众号名称:三丰杂货铺 79 | 80 | ![在这里插入图片描述](https://img-blog.csdnimg.cn/20200529103009878.gif#pic_center) 81 | -------------------------------------------------------------------------------- /SUMMARY.md: -------------------------------------------------------------------------------- 1 | # Summary 2 | 3 | * [前言](README.md) 4 | * [1 基本例程](01-basic/README.adoc) 5 | * [1.1 hello-CMake](01-basic/1.1 hello-cmake.md) 6 | * [1.2 包含头文件](01-basic/1.2 hello-headers.md) 7 | * [1.3 包含静态库](01-basic/1.3 Static Library.md) 8 | * [1.4 包含动态库](01-basic/1.4 Shared Library.md) 9 | * [1.5 设置构建类型](01-basic/1.5 build-type.md) 10 | * [1.6 设置编译方式](01-basic/1.6 Compile Flags.md) 11 | * [1.7 包含第三方库](01-basic/1.7 Including Third Party Library.md) 12 | * [1.8 使用clang编译工程](01-basic/1.8 compiling-with-clang.adoc) 13 | * [1.9 使用ninja构建工程](01-basic/1.9 J-building-with-ninja.adoc) 14 | * [1.10 导入目标](01-basic/1.10 imported-targets.adoc) 15 | * [1.11 C++标准](01-basic/1.11 cpp-standard.adoc) 16 | * 2 [子目录中使用多个CMake文件](02-sub-projects/README.adoc) 17 | - [2.1 使用子工程CMake](02-sub-projects/A-basic/README.adoc) 18 | * 3 [生成源代码](03-code-generation/README.adoc) 19 | - [3.1 配置文件](03-code-generation/configure-files/README.adoc) 20 | - [3.2 protobuf](03-code-generation/protobuf/README.adoc) 21 | * 4 [实践案例](https://github.com/SFUMECJF/cmake-examples-Chinese/tree/main/%E5%AE%9E%E8%B7%B5%E6%A1%88%E4%BE%8B) 22 | - 4.1 [qt](https://github.com/SFUMECJF/cmake-examples-Chinese/tree/main/%E5%AE%9E%E8%B7%B5%E6%A1%88%E4%BE%8B/qt) 23 | - 4.2 [dcmtk](https://github.com/SFUMECJF/cmake-examples-Chinese/tree/main/%E5%AE%9E%E8%B7%B5%E6%A1%88%E4%BE%8B/dcmtk) 24 | - 4.3 [opencv](https://github.com/SFUMECJF/cmake-examples-Chinese/tree/main/%E5%AE%9E%E8%B7%B5%E6%A1%88%E4%BE%8B/opencv) 25 | - 4.4 [opencv + qt](https://github.com/SFUMECJF/cmake-examples-Chinese/tree/main/%E5%AE%9E%E8%B7%B5%E6%A1%88%E4%BE%8B/qt%2Bopencv) 26 | * 细节思考 27 | - [PUBLIC、INTERFACE和PRIVATE](CMake-scope.md) -------------------------------------------------------------------------------- /book.json: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": [ 3 | "github-buttons" 4 | ], 5 | "pluginsConfig": { 6 | "github-buttons": { 7 | "buttons": [{ 8 | "user": "SFUMECJF", 9 | "repo": "cmake-examples-Chinese", 10 | "type": "star", 11 | "size": "large" 12 | }, { 13 | "user": "SFUMECJF", 14 | "type": "follow", 15 | "width": "230", 16 | "count": false 17 | }] 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "requires": true, 3 | "lockfileVersion": 1, 4 | "dependencies": { 5 | "gitbook-plugin-github-buttons": { 6 | "version": "3.0.0", 7 | "resolved": "https://registry.npm.taobao.org/gitbook-plugin-github-buttons/download/gitbook-plugin-github-buttons-3.0.0.tgz", 8 | "integrity": "sha1-ClfJJmUU/gWbgIRSDTuYRCTba+E=" 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /实践案例/README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [TOC] 4 | 5 | 6 | 7 | ## 本案例说明 8 | 9 | 现有的工程demo都是针对windows的。并且,需要利用cmake提前将库(例如Open CV)的源码按照不同的编译器版本如MSVC2017生成对应的静态库和动态库。 10 | 11 | 例如我的Open CV安装好后: 12 | 13 | `D:\Programs\opencv\opencv\build\x64\vc15\bin`是动态库路径,这个路径需要加到环境变量中。CMake中不需要包含这个路径。 14 | 15 | `D:/Programs/opencv/opencv/build/include;D:/Programs/opencv/opencv/build/include/opencv`是我的两个头文件路径。 16 | 17 | `D:/Programs/opencv/opencv/build/x64/vc15/lib`是库文件路径。 18 | 19 | 之后在CMake中使用这三个语句包含库的头文件路径,库文件路径,把程序用的库名加入到可执行程序中。 20 | 21 | ```cmake 22 | target_link_directories(reconstruction PUBLIC 23 | ${OpenCV_LIB_DIRS} 24 | ) 25 | target_link_libraries(reconstruction 26 | ${OpenCV_LIBS} 27 | ) 28 | target_include_directories(reconstruction PUBLIC 29 | ${OpenCV_INCLUDE_DIRS} 30 | ) 31 | ``` 32 | 33 | 34 | 35 | 36 | 37 | ## 库包含说明 38 | 39 | 类似Open CV,dcmtk,qt这样的大库,都有动态库和静态库两种。 40 | 41 | 工程查看链接:https://github.com/SFUMECJF/cmake-examples-Chinese/tree/main/%E5%AE%9E%E8%B7%B5%E6%A1%88%E4%BE%8B 42 | 43 | ## 互相交流 44 | 45 | 46 | 读者你好!如果你对本文内容感兴趣,我十分希望能够和你互相学习,可以扫码和我联系!一起进步 47 | 48 | 49 | 50 | ![在这里插入图片描述](https://img-blog.csdnimg.cn/20200529103009878.gif#pic_center) 51 | 52 | -------------------------------------------------------------------------------- /实践案例/dcmtk/README.md: -------------------------------------------------------------------------------- 1 | 开发环境: 2 | 3 |

4 | 5 | ubuntu 6 | 7 | 8 | vue-router 9 | 10 | 11 | vuex 12 | 13 |

14 | 15 | [toc] 16 | 17 | 18 | [TOC] 19 | 20 | ## 0 前言 21 | 22 | 前面记录了编译好VS库之后,利用Visual Studio来构建工程,也就是说有一个很大的.vs文件夹以及.sln文件来储存工程的配置。 23 | 24 | 但是,CMake更为轻量,笔者不否认VS的强大,VS本身就可以打开CMake的工程。因此,本文,笔者使用CMake构建工程。可以利用CLIon或者还是VS来打开CMake的工程。 25 | 26 | ## 1 构建CMake工程步骤 27 | 28 | [一个很有用的英文参考资料](https://stackoverflow.com/questions/5052148/how-to-use-dcmtk-in-qt) 29 | 30 | 事实上,网络关于利用CMake导入dcmtk库的代码相当少,基本没有。也找到一些资料,但是过于复杂。 31 | 32 | ### 文件树 33 | 34 | ```tree 35 | 36 | -CMakeLists.txt 37 | -main.cpp 38 | -README.md 39 | ─out 40 | └─build 41 | └─x64-Debug 42 | │ dcmdata.dll 43 | │ oflog.dll 44 | │ ofstd.dll 45 | │ testapp.exe 46 | ``` 47 | 48 | 其实只需要`CMakeLists.txt`和`main.cpp`就可以,Readme.md就是你看到的这篇文章,而out是我用VS生成的,最终的testapp.exe就是可执行文件,然后我们要把 `dcmdata.dll`和 `oflog.dll`和 `ofstd.dll`放到和可执行文件同一个目录。 49 | 50 | ### CMakeLists.txt 51 | 52 | ```cmake 53 | cmake_minimum_required(VERSION 2.8) 54 | PROJECT(testapp) 55 | 56 | SET(DCMTK_INCLUDE_DIRS "D:\\Programs\\dcmtkdll\\include") 57 | SET(DCMTK_LIBRARIES "D:\\Programs\\dcmtkdll\\lib") 58 | SET(DCMTK_DIR "D:\\Programs\\dcmtkdll") 59 | #an example: SET(DCMTK_DIR "C:\\Users\\test\\test_dcmtk\\DCMTK") 60 | #set(CMAKE_CXX_FLAGS -std=c++11) 61 | # settings for Microsoft Visual C++ 6 62 | SET(CMAKE_C_FLAGS "/nologo /W3 /GX /Gy /YX") 63 | SET(CMAKE_C_FLAGS_DEBUG "/MTd /Z7 /Od") 64 | SET(CMAKE_C_FLAGS_RELEASE "/MT /O2") 65 | SET(CMAKE_CXX_FLAGS "/nologo /W3 /GX /Gy /YX") 66 | SET(CMAKE_CXX_FLAGS_DEBUG "/MTd /Z7 /Od") 67 | SET(CMAKE_CXX_FLAGS_RELEASE "/MT /O2") 68 | 69 | ADD_DEFINITIONS(-D_REENTRANT) 70 | 71 | INCLUDE_DIRECTORIES(${DCMTK_DIR}/include) 72 | LINK_DIRECTORIES(${DCMTK_DIR}/lib) 73 | 74 | ADD_EXECUTABLE(testapp main.cpp) 75 | TARGET_LINK_LIBRARIES(testapp netapi32 wsock32 ofstd dcmdata) 76 | message("-------------\n") 77 | message("${DCMTK_INCLUDE_DIRS}") 78 | message("${DCMTK_LIBRARIES}") 79 | message(STATUS "${DCMTK_FOUND}") 80 | #message("${DCMTK_INCLUDE_DIRS}") 81 | message("${DCMTK_DIR}") 82 | message(STATUS "-------------\n") 83 | ``` 84 | 85 | 86 | 87 | ### main.cpp 88 | 89 | ```c++ 90 | // C++_Dicom_Sample.cpp : Defines the entry point for the console application. 91 | // 92 | 93 | //#include "stdafx.h" 94 | //C++中stdafx.h的英文全称为:standard application fram extend,中文名为:头文件预编译。 95 | // 96 | //stdafx.h在c++中起到的作用是:把C++工程中使用的MFC头文件预先编译,以后该工程编译时,直接使用预编译的结果,这样可以加快编译速度。 97 | 98 | //#include "dcmtk/config/osconfig.h" 99 | #include "dcmtk/dcmdata/dctk.h" 100 | #include 101 | 102 | 103 | bool ReadPatientName(DcmFileFormat& fileformat, std::string& filePath) 104 | { 105 | OFCondition status = fileformat.loadFile(filePath.c_str()); 106 | if (!status.good()) 107 | { 108 | std::cout << "Load Dimcom File Error: " << status.text() << std::endl; 109 | return false; 110 | } 111 | OFString PatientName; 112 | status = fileformat.getDataset()->findAndGetOFString(DCM_PatientName, PatientName); 113 | if (status.good()) 114 | { 115 | std::cout << "Get PatientName:" << PatientName << std::endl; 116 | } 117 | else 118 | { 119 | std::cout << "Get PatientName Error:" << status.text() << std::endl; 120 | return false; 121 | } 122 | return true; 123 | } 124 | 125 | bool SavePatientName(DcmFileFormat& fileformat, std::string& filePath, const std::string& info) 126 | { 127 | OFCondition status = fileformat.getDataset()->putAndInsertString(DCM_PatientName, info.c_str()); 128 | if (status.good()) 129 | { 130 | std::cout << "Save PatientName:" << info.c_str() << std::endl; 131 | } 132 | else 133 | { 134 | std::cout << "Save PatientName Error: " << status.text() << std::endl; 135 | return false; 136 | } 137 | 138 | status = fileformat.saveFile(filePath.c_str()); 139 | if (!status.good()) 140 | { 141 | std::cout << "Save Dimcom File Error: " << status.text() << std::endl; 142 | return false; 143 | } 144 | return true; 145 | } 146 | 147 | int main() 148 | { 149 | DcmFileFormat dicomFileformat; 150 | 151 | std::string dicomFile = "image-00000.dcm"; 152 | 153 | ReadPatientName(dicomFileformat, dicomFile); 154 | 155 | //SavePatientName(dicomFileformat, dicomFile, "John Snow"); 156 | 157 | //ReadPatientName(dicomFileformat, dicomFile); 158 | 159 | system("pause"); 160 | 161 | return 0; 162 | } 163 | ``` 164 | 165 | 166 | 167 | 168 | 169 | ### 使用 170 | 171 | 其实只需要`CMakeLists.txt`和`main.cpp`就可以,直接用VIsual Studio打开`CMakeLists.txt`,会生成out,然后复制那三个文件。注意,现在因为我写的CMakeLists的原因,只能使用VS默认的编译器,CLion默认打开运行会报错。可能需要设置一下。 172 | 173 | 之后进行优化。 174 | 175 | ## 2 资料 176 | 177 | 从网上找的各种cmake工程的资料: 178 | 179 | 总感觉是我需要先把dcmtk编译成一个可以用cmake调用的版本,然后CMake使用正确的代码? 180 | 181 | 182 | 183 | [gitee](https://gitee.com/qiangge_666/t_dcmtk/tree/master#https://github.com/Geant4/geant4/tree/master/examples/extended/medical/DICOM) 184 | 185 | [微信文章](https://mp.weixin.qq.com/s/EEJIwGRUqXPhuSFDs4Scgw) 186 | 187 | [2](https://gitee.com/QQ975150313/vtk-dicom) 188 | 189 | [3](https://gitee.com/lspKK/dcmtkDemo) 190 | 191 | [4](https://github.com/sprinfall/dcm/blob/master/dcm/CMakeLists.txt) 192 | 193 | [5](https://github.com/marcinwol/dcmtk-basic-example/blob/master/CMakeLists.txt) 194 | 195 | ### 使用其他基于dcmtk的库 196 | 197 | 比如CTk就是对dcmtk的再利用,一个很好的轮子。可以从最基础版本学?或者添加到我的代码中? 198 | 199 | [CTK](http://commontk.org/index.php/Main_Page) 200 | 201 | [slicer](https://www.slicer.org/) 202 | 203 | [MITK](http://mitk.org/wiki/MITK) 204 | 205 | [ITKSNAP] 206 | 207 | ### 论坛 208 | 209 | 论坛不用vpn才能顺畅地浏览: 210 | 211 | 总感觉这里会有想要的答案,可惜无法搜索。建个dcmtk群? 212 | 213 | ## 互相交流 214 | 215 | 216 | 读者你好!如果你对本文内容感兴趣,我十分希望能够和你互相学习,可以扫码和我联系!一起进步 217 | 218 | 219 | 220 | ![在这里插入图片描述](https://img-blog.csdnimg.cn/20200529103009878.gif#pic_center) 221 | 222 | -------------------------------------------------------------------------------- /实践案例/dcmtk/cmake-build-debug/CMakeFiles/3.17.5/CMakeCCompiler.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_C_COMPILER "D:/Programs/mingw/mingw64/mingw64/bin/gcc.exe") 2 | set(CMAKE_C_COMPILER_ARG1 "") 3 | set(CMAKE_C_COMPILER_ID "GNU") 4 | set(CMAKE_C_COMPILER_VERSION "8.1.0") 5 | set(CMAKE_C_COMPILER_VERSION_INTERNAL "") 6 | set(CMAKE_C_COMPILER_WRAPPER "") 7 | set(CMAKE_C_STANDARD_COMPUTED_DEFAULT "11") 8 | set(CMAKE_C_COMPILE_FEATURES "c_std_90;c_function_prototypes;c_std_99;c_restrict;c_variadic_macros;c_std_11;c_static_assert") 9 | set(CMAKE_C90_COMPILE_FEATURES "c_std_90;c_function_prototypes") 10 | set(CMAKE_C99_COMPILE_FEATURES "c_std_99;c_restrict;c_variadic_macros") 11 | set(CMAKE_C11_COMPILE_FEATURES "c_std_11;c_static_assert") 12 | 13 | set(CMAKE_C_PLATFORM_ID "MinGW") 14 | set(CMAKE_C_SIMULATE_ID "") 15 | set(CMAKE_C_COMPILER_FRONTEND_VARIANT "") 16 | set(CMAKE_C_SIMULATE_VERSION "") 17 | 18 | 19 | 20 | set(CMAKE_AR "D:/Programs/mingw/mingw64/mingw64/bin/ar.exe") 21 | set(CMAKE_C_COMPILER_AR "D:/Programs/mingw/mingw64/mingw64/bin/gcc-ar.exe") 22 | set(CMAKE_RANLIB "D:/Programs/mingw/mingw64/mingw64/bin/ranlib.exe") 23 | set(CMAKE_C_COMPILER_RANLIB "D:/Programs/mingw/mingw64/mingw64/bin/gcc-ranlib.exe") 24 | set(CMAKE_LINKER "D:/Programs/mingw/mingw64/mingw64/bin/ld.exe") 25 | set(CMAKE_MT "") 26 | set(CMAKE_COMPILER_IS_GNUCC 1) 27 | set(CMAKE_C_COMPILER_LOADED 1) 28 | set(CMAKE_C_COMPILER_WORKS TRUE) 29 | set(CMAKE_C_ABI_COMPILED TRUE) 30 | set(CMAKE_COMPILER_IS_MINGW 1) 31 | set(CMAKE_COMPILER_IS_CYGWIN ) 32 | if(CMAKE_COMPILER_IS_CYGWIN) 33 | set(CYGWIN 1) 34 | set(UNIX 1) 35 | endif() 36 | 37 | set(CMAKE_C_COMPILER_ENV_VAR "CC") 38 | 39 | if(CMAKE_COMPILER_IS_MINGW) 40 | set(MINGW 1) 41 | endif() 42 | set(CMAKE_C_COMPILER_ID_RUN 1) 43 | set(CMAKE_C_SOURCE_FILE_EXTENSIONS c;m) 44 | set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC) 45 | set(CMAKE_C_LINKER_PREFERENCE 10) 46 | 47 | # Save compiler ABI information. 48 | set(CMAKE_C_SIZEOF_DATA_PTR "8") 49 | set(CMAKE_C_COMPILER_ABI "") 50 | set(CMAKE_C_LIBRARY_ARCHITECTURE "") 51 | 52 | if(CMAKE_C_SIZEOF_DATA_PTR) 53 | set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}") 54 | endif() 55 | 56 | if(CMAKE_C_COMPILER_ABI) 57 | set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}") 58 | endif() 59 | 60 | if(CMAKE_C_LIBRARY_ARCHITECTURE) 61 | set(CMAKE_LIBRARY_ARCHITECTURE "") 62 | endif() 63 | 64 | set(CMAKE_C_CL_SHOWINCLUDES_PREFIX "") 65 | if(CMAKE_C_CL_SHOWINCLUDES_PREFIX) 66 | set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_C_CL_SHOWINCLUDES_PREFIX}") 67 | endif() 68 | 69 | 70 | 71 | 72 | 73 | set(CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES "D:/Programs/mingw/mingw64/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include;D:/Programs/mingw/mingw64/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include-fixed;D:/Programs/mingw/mingw64/mingw64/x86_64-w64-mingw32/include") 74 | set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "mingw32;gcc;moldname;mingwex;pthread;advapi32;shell32;user32;kernel32;iconv;mingw32;gcc;moldname;mingwex") 75 | set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "D:/Programs/mingw/mingw64/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0;D:/Programs/mingw/mingw64/mingw64/lib/gcc;D:/Programs/mingw/mingw64/mingw64/x86_64-w64-mingw32/lib;D:/Programs/mingw/mingw64/mingw64/lib") 76 | set(CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "") 77 | -------------------------------------------------------------------------------- /实践案例/dcmtk/cmake-build-debug/CMakeFiles/3.17.5/CMakeCXXCompiler.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_CXX_COMPILER "D:/Programs/mingw/mingw64/mingw64/bin/g++.exe") 2 | set(CMAKE_CXX_COMPILER_ARG1 "") 3 | set(CMAKE_CXX_COMPILER_ID "GNU") 4 | set(CMAKE_CXX_COMPILER_VERSION "8.1.0") 5 | set(CMAKE_CXX_COMPILER_VERSION_INTERNAL "") 6 | set(CMAKE_CXX_COMPILER_WRAPPER "") 7 | set(CMAKE_CXX_STANDARD_COMPUTED_DEFAULT "14") 8 | set(CMAKE_CXX_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters;cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates;cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates;cxx_std_17;cxx_std_20") 9 | set(CMAKE_CXX98_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters") 10 | set(CMAKE_CXX11_COMPILE_FEATURES "cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates") 11 | set(CMAKE_CXX14_COMPILE_FEATURES "cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates") 12 | set(CMAKE_CXX17_COMPILE_FEATURES "cxx_std_17") 13 | set(CMAKE_CXX20_COMPILE_FEATURES "cxx_std_20") 14 | 15 | set(CMAKE_CXX_PLATFORM_ID "MinGW") 16 | set(CMAKE_CXX_SIMULATE_ID "") 17 | set(CMAKE_CXX_COMPILER_FRONTEND_VARIANT "") 18 | set(CMAKE_CXX_SIMULATE_VERSION "") 19 | 20 | 21 | 22 | set(CMAKE_AR "D:/Programs/mingw/mingw64/mingw64/bin/ar.exe") 23 | set(CMAKE_CXX_COMPILER_AR "D:/Programs/mingw/mingw64/mingw64/bin/gcc-ar.exe") 24 | set(CMAKE_RANLIB "D:/Programs/mingw/mingw64/mingw64/bin/ranlib.exe") 25 | set(CMAKE_CXX_COMPILER_RANLIB "D:/Programs/mingw/mingw64/mingw64/bin/gcc-ranlib.exe") 26 | set(CMAKE_LINKER "D:/Programs/mingw/mingw64/mingw64/bin/ld.exe") 27 | set(CMAKE_MT "") 28 | set(CMAKE_COMPILER_IS_GNUCXX 1) 29 | set(CMAKE_CXX_COMPILER_LOADED 1) 30 | set(CMAKE_CXX_COMPILER_WORKS TRUE) 31 | set(CMAKE_CXX_ABI_COMPILED TRUE) 32 | set(CMAKE_COMPILER_IS_MINGW 1) 33 | set(CMAKE_COMPILER_IS_CYGWIN ) 34 | if(CMAKE_COMPILER_IS_CYGWIN) 35 | set(CYGWIN 1) 36 | set(UNIX 1) 37 | endif() 38 | 39 | set(CMAKE_CXX_COMPILER_ENV_VAR "CXX") 40 | 41 | if(CMAKE_COMPILER_IS_MINGW) 42 | set(MINGW 1) 43 | endif() 44 | set(CMAKE_CXX_COMPILER_ID_RUN 1) 45 | set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;CPP) 46 | set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC) 47 | 48 | foreach (lang C OBJC OBJCXX) 49 | if (CMAKE_${lang}_COMPILER_ID_RUN) 50 | foreach(extension IN LISTS CMAKE_${lang}_SOURCE_FILE_EXTENSIONS) 51 | list(REMOVE_ITEM CMAKE_CXX_SOURCE_FILE_EXTENSIONS ${extension}) 52 | endforeach() 53 | endif() 54 | endforeach() 55 | 56 | set(CMAKE_CXX_LINKER_PREFERENCE 30) 57 | set(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1) 58 | 59 | # Save compiler ABI information. 60 | set(CMAKE_CXX_SIZEOF_DATA_PTR "8") 61 | set(CMAKE_CXX_COMPILER_ABI "") 62 | set(CMAKE_CXX_LIBRARY_ARCHITECTURE "") 63 | 64 | if(CMAKE_CXX_SIZEOF_DATA_PTR) 65 | set(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}") 66 | endif() 67 | 68 | if(CMAKE_CXX_COMPILER_ABI) 69 | set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}") 70 | endif() 71 | 72 | if(CMAKE_CXX_LIBRARY_ARCHITECTURE) 73 | set(CMAKE_LIBRARY_ARCHITECTURE "") 74 | endif() 75 | 76 | set(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX "") 77 | if(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX) 78 | set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_CXX_CL_SHOWINCLUDES_PREFIX}") 79 | endif() 80 | 81 | 82 | 83 | 84 | 85 | set(CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES "D:/Programs/mingw/mingw64/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++;D:/Programs/mingw/mingw64/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/x86_64-w64-mingw32;D:/Programs/mingw/mingw64/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/backward;D:/Programs/mingw/mingw64/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include;D:/Programs/mingw/mingw64/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include-fixed;D:/Programs/mingw/mingw64/mingw64/x86_64-w64-mingw32/include") 86 | set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "stdc++;mingw32;gcc_s;gcc;moldname;mingwex;pthread;advapi32;shell32;user32;kernel32;iconv;mingw32;gcc_s;gcc;moldname;mingwex") 87 | set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "D:/Programs/mingw/mingw64/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0;D:/Programs/mingw/mingw64/mingw64/lib/gcc;D:/Programs/mingw/mingw64/mingw64/x86_64-w64-mingw32/lib;D:/Programs/mingw/mingw64/mingw64/lib") 88 | set(CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "") 89 | -------------------------------------------------------------------------------- /实践案例/dcmtk/cmake-build-debug/CMakeFiles/3.17.5/CMakeDetermineCompilerABI_C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SFUMECJF/cmake-examples-Chinese/979abb2fb0b4189f0181e4051d2b269964eb22ba/实践案例/dcmtk/cmake-build-debug/CMakeFiles/3.17.5/CMakeDetermineCompilerABI_C.bin -------------------------------------------------------------------------------- /实践案例/dcmtk/cmake-build-debug/CMakeFiles/3.17.5/CMakeDetermineCompilerABI_CXX.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SFUMECJF/cmake-examples-Chinese/979abb2fb0b4189f0181e4051d2b269964eb22ba/实践案例/dcmtk/cmake-build-debug/CMakeFiles/3.17.5/CMakeDetermineCompilerABI_CXX.bin -------------------------------------------------------------------------------- /实践案例/dcmtk/cmake-build-debug/CMakeFiles/3.17.5/CMakeRCCompiler.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_RC_COMPILER "D:/Programs/mingw/mingw64/mingw64/bin/windres.exe") 2 | set(CMAKE_RC_COMPILER_ARG1 "") 3 | set(CMAKE_RC_COMPILER_LOADED 1) 4 | set(CMAKE_RC_SOURCE_FILE_EXTENSIONS rc;RC) 5 | set(CMAKE_RC_OUTPUT_EXTENSION .obj) 6 | set(CMAKE_RC_COMPILER_ENV_VAR "RC") 7 | -------------------------------------------------------------------------------- /实践案例/dcmtk/cmake-build-debug/CMakeFiles/3.17.5/CMakeSystem.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_HOST_SYSTEM "Windows-10.0.19041") 2 | set(CMAKE_HOST_SYSTEM_NAME "Windows") 3 | set(CMAKE_HOST_SYSTEM_VERSION "10.0.19041") 4 | set(CMAKE_HOST_SYSTEM_PROCESSOR "AMD64") 5 | 6 | 7 | 8 | set(CMAKE_SYSTEM "Windows-10.0.19041") 9 | set(CMAKE_SYSTEM_NAME "Windows") 10 | set(CMAKE_SYSTEM_VERSION "10.0.19041") 11 | set(CMAKE_SYSTEM_PROCESSOR "AMD64") 12 | 13 | set(CMAKE_CROSSCOMPILING "FALSE") 14 | 15 | set(CMAKE_SYSTEM_LOADED 1) 16 | -------------------------------------------------------------------------------- /实践案例/dcmtk/cmake-build-debug/CMakeFiles/3.17.5/CompilerIdC/a.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SFUMECJF/cmake-examples-Chinese/979abb2fb0b4189f0181e4051d2b269964eb22ba/实践案例/dcmtk/cmake-build-debug/CMakeFiles/3.17.5/CompilerIdC/a.exe -------------------------------------------------------------------------------- /实践案例/dcmtk/cmake-build-debug/CMakeFiles/3.17.5/CompilerIdCXX/a.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SFUMECJF/cmake-examples-Chinese/979abb2fb0b4189f0181e4051d2b269964eb22ba/实践案例/dcmtk/cmake-build-debug/CMakeFiles/3.17.5/CompilerIdCXX/a.exe -------------------------------------------------------------------------------- /实践案例/dcmtk/cmake-build-debug/CMakeFiles/CMakeDirectoryInformation.cmake: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "MinGW Makefiles" Generator, CMake Version 3.17 3 | 4 | # Relative path conversion top directories. 5 | set(CMAKE_RELATIVE_PATH_TOP_SOURCE "D:/workspace/github_repos/awesome_dcmtk/1-hello_world/hello_dcmtk_cmake") 6 | set(CMAKE_RELATIVE_PATH_TOP_BINARY "D:/workspace/github_repos/awesome_dcmtk/1-hello_world/hello_dcmtk_cmake/cmake-build-debug") 7 | 8 | # Force unix paths in dependencies. 9 | set(CMAKE_FORCE_UNIX_PATHS 1) 10 | 11 | 12 | # The C and CXX include file regular expressions for this directory. 13 | set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$") 14 | set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$") 15 | set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN}) 16 | set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN}) 17 | -------------------------------------------------------------------------------- /实践案例/dcmtk/cmake-build-debug/CMakeFiles/Makefile2: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "MinGW Makefiles" Generator, CMake Version 3.17 3 | 4 | # Default target executed when no arguments are given to make. 5 | default_target: all 6 | 7 | .PHONY : default_target 8 | 9 | #============================================================================= 10 | # Special targets provided by cmake. 11 | 12 | # Disable implicit rules so canonical targets will work. 13 | .SUFFIXES: 14 | 15 | 16 | # Disable VCS-based implicit rules. 17 | % : %,v 18 | 19 | 20 | # Disable VCS-based implicit rules. 21 | % : RCS/% 22 | 23 | 24 | # Disable VCS-based implicit rules. 25 | % : RCS/%,v 26 | 27 | 28 | # Disable VCS-based implicit rules. 29 | % : SCCS/s.% 30 | 31 | 32 | # Disable VCS-based implicit rules. 33 | % : s.% 34 | 35 | 36 | .SUFFIXES: .hpux_make_needs_suffix_list 37 | 38 | 39 | # Command-line flag to silence nested $(MAKE). 40 | $(VERBOSE)MAKESILENT = -s 41 | 42 | # Suppress display of executed commands. 43 | $(VERBOSE).SILENT: 44 | 45 | 46 | # A target that is always out of date. 47 | cmake_force: 48 | 49 | .PHONY : cmake_force 50 | 51 | #============================================================================= 52 | # Set environment variables for the build. 53 | 54 | SHELL = cmd.exe 55 | 56 | # The CMake executable. 57 | CMAKE_COMMAND = "D:\Program Files\clion\CLion 2020.3.3\bin\cmake\win\bin\cmake.exe" 58 | 59 | # The command to remove a file. 60 | RM = "D:\Program Files\clion\CLion 2020.3.3\bin\cmake\win\bin\cmake.exe" -E rm -f 61 | 62 | # Escaping for special characters. 63 | EQUALS = = 64 | 65 | # The top-level source directory on which CMake was run. 66 | CMAKE_SOURCE_DIR = D:\workspace\github_repos\awesome_dcmtk\1-hello_world\hello_dcmtk_cmake 67 | 68 | # The top-level build directory on which CMake was run. 69 | CMAKE_BINARY_DIR = D:\workspace\github_repos\awesome_dcmtk\1-hello_world\hello_dcmtk_cmake\cmake-build-debug 70 | 71 | #============================================================================= 72 | # Directory level rules for the build root directory 73 | 74 | # The main recursive "all" target. 75 | all: CMakeFiles/testapp.dir/all 76 | 77 | .PHONY : all 78 | 79 | # The main recursive "preinstall" target. 80 | preinstall: 81 | 82 | .PHONY : preinstall 83 | 84 | # The main recursive "clean" target. 85 | clean: CMakeFiles/testapp.dir/clean 86 | 87 | .PHONY : clean 88 | 89 | #============================================================================= 90 | # Target rules for target CMakeFiles/testapp.dir 91 | 92 | # All Build rule for target. 93 | CMakeFiles/testapp.dir/all: 94 | $(MAKE) $(MAKESILENT) -f CMakeFiles\testapp.dir\build.make CMakeFiles/testapp.dir/depend 95 | $(MAKE) $(MAKESILENT) -f CMakeFiles\testapp.dir\build.make CMakeFiles/testapp.dir/build 96 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --progress-dir=D:\workspace\github_repos\awesome_dcmtk\1-hello_world\hello_dcmtk_cmake\cmake-build-debug\CMakeFiles --progress-num=1,2 "Built target testapp" 97 | .PHONY : CMakeFiles/testapp.dir/all 98 | 99 | # Build rule for subdir invocation for target. 100 | CMakeFiles/testapp.dir/rule: cmake_check_build_system 101 | $(CMAKE_COMMAND) -E cmake_progress_start D:\workspace\github_repos\awesome_dcmtk\1-hello_world\hello_dcmtk_cmake\cmake-build-debug\CMakeFiles 2 102 | $(MAKE) $(MAKESILENT) -f CMakeFiles\Makefile2 CMakeFiles/testapp.dir/all 103 | $(CMAKE_COMMAND) -E cmake_progress_start D:\workspace\github_repos\awesome_dcmtk\1-hello_world\hello_dcmtk_cmake\cmake-build-debug\CMakeFiles 0 104 | .PHONY : CMakeFiles/testapp.dir/rule 105 | 106 | # Convenience name for target. 107 | testapp: CMakeFiles/testapp.dir/rule 108 | 109 | .PHONY : testapp 110 | 111 | # clean rule for target. 112 | CMakeFiles/testapp.dir/clean: 113 | $(MAKE) $(MAKESILENT) -f CMakeFiles\testapp.dir\build.make CMakeFiles/testapp.dir/clean 114 | .PHONY : CMakeFiles/testapp.dir/clean 115 | 116 | #============================================================================= 117 | # Special targets to cleanup operation of make. 118 | 119 | # Special rule to run CMake to check the build system integrity. 120 | # No rule that depends on this can have commands that come from listfiles 121 | # because they might be regenerated. 122 | cmake_check_build_system: 123 | $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles\Makefile.cmake 0 124 | .PHONY : cmake_check_build_system 125 | 126 | -------------------------------------------------------------------------------- /实践案例/dcmtk/cmake-build-debug/CMakeFiles/TargetDirectories.txt: -------------------------------------------------------------------------------- 1 | D:/workspace/github_repos/awesome_dcmtk/1-hello_world/hello_dcmtk_cmake/cmake-build-debug/CMakeFiles/testapp.dir 2 | D:/workspace/github_repos/awesome_dcmtk/1-hello_world/hello_dcmtk_cmake/cmake-build-debug/CMakeFiles/edit_cache.dir 3 | D:/workspace/github_repos/awesome_dcmtk/1-hello_world/hello_dcmtk_cmake/cmake-build-debug/CMakeFiles/rebuild_cache.dir 4 | -------------------------------------------------------------------------------- /实践案例/dcmtk/cmake-build-debug/CMakeFiles/clion-environment.txt: -------------------------------------------------------------------------------- 1 | ToolSet: w64 6.0 (local)@D:\Programs\mingw\mingw64\mingw64 2 | Options: 3 | 4 | Options: -------------------------------------------------------------------------------- /实践案例/dcmtk/cmake-build-debug/CMakeFiles/clion-log.txt: -------------------------------------------------------------------------------- 1 | "D:\Program Files\clion\CLion 2020.3.3\bin\cmake\win\bin\cmake.exe" -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - MinGW Makefiles" D:\workspace\github_repos\awesome_dcmtk\1-hello_world\hello_dcmtk_cmake 2 | -- The C compiler identification is GNU 8.1.0 3 | -- The CXX compiler identification is GNU 8.1.0 4 | -- Check for working C compiler: D:/Programs/mingw/mingw64/mingw64/bin/gcc.exe 5 | -- Check for working C compiler: D:/Programs/mingw/mingw64/mingw64/bin/gcc.exe - works 6 | -- Detecting C compiler ABI info 7 | -- Detecting C compiler ABI info - done 8 | -- Detecting C compile features 9 | -- Detecting C compile features - done 10 | -- Check for working CXX compiler: D:/Programs/mingw/mingw64/mingw64/bin/g++.exe 11 | -- Check for working CXX compiler: D:/Programs/mingw/mingw64/mingw64/bin/g++.exe - works 12 | -- Detecting CXX compiler ABI info 13 | -- Detecting CXX compiler ABI info - done 14 | -- Detecting CXX compile features 15 | -- Detecting CXX compile features - done 16 | ------------- 17 | 18 | D:\Programs\dcmtkdll\include 19 | D:\Programs\dcmtkdll\lib 20 | -- 21 | D:\Programs\dcmtkdll 22 | -- ------------- 23 | 24 | 25 | -- Configuring done 26 | -- Generating done 27 | -- Build files have been written to: D:/workspace/github_repos/awesome_dcmtk/1-hello_world/hello_dcmtk_cmake/cmake-build-debug 28 | 29 | Problems were encountered while collecting compiler information: 30 | g++.exe: error: /nologo: No such file or directory 31 | g++.exe: error: /W3: No such file or directory 32 | g++.exe: error: /GX: No such file or directory 33 | g++.exe: error: /Gy: No such file or directory 34 | g++.exe: error: /YX: No such file or directory 35 | g++.exe: error: /MTd: No such file or directory 36 | g++.exe: error: /Z7: No such file or directory 37 | g++.exe: error: /Od: No such file or directory 38 | -------------------------------------------------------------------------------- /实践案例/dcmtk/cmake-build-debug/CMakeFiles/cmake.check_cache: -------------------------------------------------------------------------------- 1 | # This file is generated by cmake for dependency checking of the CMakeCache.txt file 2 | -------------------------------------------------------------------------------- /实践案例/dcmtk/cmake-build-debug/CMakeFiles/progress.marks: -------------------------------------------------------------------------------- 1 | 2 2 | -------------------------------------------------------------------------------- /实践案例/dcmtk/cmake-build-debug/CMakeFiles/testapp.dir/DependInfo.cmake: -------------------------------------------------------------------------------- 1 | # The set of languages for which implicit dependencies are needed: 2 | set(CMAKE_DEPENDS_LANGUAGES 3 | "CXX" 4 | ) 5 | # The set of files for implicit dependencies of each language: 6 | set(CMAKE_DEPENDS_CHECK_CXX 7 | "D:/workspace/github_repos/awesome_dcmtk/1-hello_world/hello_dcmtk_cmake/main.cpp" "D:/workspace/github_repos/awesome_dcmtk/1-hello_world/hello_dcmtk_cmake/cmake-build-debug/CMakeFiles/testapp.dir/main.cpp.obj" 8 | ) 9 | set(CMAKE_CXX_COMPILER_ID "GNU") 10 | 11 | # Preprocessor definitions for this target. 12 | set(CMAKE_TARGET_DEFINITIONS_CXX 13 | "_REENTRANT" 14 | ) 15 | 16 | # The include file search paths: 17 | set(CMAKE_CXX_TARGET_INCLUDE_PATH 18 | "D:/Programs/dcmtkdll/include" 19 | ) 20 | 21 | # Targets to which this target links. 22 | set(CMAKE_TARGET_LINKED_INFO_FILES 23 | ) 24 | 25 | # Fortran module output directory. 26 | set(CMAKE_Fortran_TARGET_MODULE_DIR "") 27 | -------------------------------------------------------------------------------- /实践案例/dcmtk/cmake-build-debug/CMakeFiles/testapp.dir/build.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "MinGW Makefiles" Generator, CMake Version 3.17 3 | 4 | # Delete rule output on recipe failure. 5 | .DELETE_ON_ERROR: 6 | 7 | 8 | #============================================================================= 9 | # Special targets provided by cmake. 10 | 11 | # Disable implicit rules so canonical targets will work. 12 | .SUFFIXES: 13 | 14 | 15 | # Disable VCS-based implicit rules. 16 | % : %,v 17 | 18 | 19 | # Disable VCS-based implicit rules. 20 | % : RCS/% 21 | 22 | 23 | # Disable VCS-based implicit rules. 24 | % : RCS/%,v 25 | 26 | 27 | # Disable VCS-based implicit rules. 28 | % : SCCS/s.% 29 | 30 | 31 | # Disable VCS-based implicit rules. 32 | % : s.% 33 | 34 | 35 | .SUFFIXES: .hpux_make_needs_suffix_list 36 | 37 | 38 | # Command-line flag to silence nested $(MAKE). 39 | $(VERBOSE)MAKESILENT = -s 40 | 41 | # Suppress display of executed commands. 42 | $(VERBOSE).SILENT: 43 | 44 | 45 | # A target that is always out of date. 46 | cmake_force: 47 | 48 | .PHONY : cmake_force 49 | 50 | #============================================================================= 51 | # Set environment variables for the build. 52 | 53 | SHELL = cmd.exe 54 | 55 | # The CMake executable. 56 | CMAKE_COMMAND = "D:\Program Files\clion\CLion 2020.3.3\bin\cmake\win\bin\cmake.exe" 57 | 58 | # The command to remove a file. 59 | RM = "D:\Program Files\clion\CLion 2020.3.3\bin\cmake\win\bin\cmake.exe" -E rm -f 60 | 61 | # Escaping for special characters. 62 | EQUALS = = 63 | 64 | # The top-level source directory on which CMake was run. 65 | CMAKE_SOURCE_DIR = D:\workspace\github_repos\awesome_dcmtk\1-hello_world\hello_dcmtk_cmake 66 | 67 | # The top-level build directory on which CMake was run. 68 | CMAKE_BINARY_DIR = D:\workspace\github_repos\awesome_dcmtk\1-hello_world\hello_dcmtk_cmake\cmake-build-debug 69 | 70 | # Include any dependencies generated for this target. 71 | include CMakeFiles/testapp.dir/depend.make 72 | 73 | # Include the progress variables for this target. 74 | include CMakeFiles/testapp.dir/progress.make 75 | 76 | # Include the compile flags for this target's objects. 77 | include CMakeFiles/testapp.dir/flags.make 78 | 79 | CMakeFiles/testapp.dir/main.cpp.obj: CMakeFiles/testapp.dir/flags.make 80 | CMakeFiles/testapp.dir/main.cpp.obj: CMakeFiles/testapp.dir/includes_CXX.rsp 81 | CMakeFiles/testapp.dir/main.cpp.obj: ../main.cpp 82 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=D:\workspace\github_repos\awesome_dcmtk\1-hello_world\hello_dcmtk_cmake\cmake-build-debug\CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Building CXX object CMakeFiles/testapp.dir/main.cpp.obj" 83 | D:\Programs\mingw\mingw64\mingw64\bin\g++.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles\testapp.dir\main.cpp.obj -c D:\workspace\github_repos\awesome_dcmtk\1-hello_world\hello_dcmtk_cmake\main.cpp 84 | 85 | CMakeFiles/testapp.dir/main.cpp.i: cmake_force 86 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/testapp.dir/main.cpp.i" 87 | D:\Programs\mingw\mingw64\mingw64\bin\g++.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E D:\workspace\github_repos\awesome_dcmtk\1-hello_world\hello_dcmtk_cmake\main.cpp > CMakeFiles\testapp.dir\main.cpp.i 88 | 89 | CMakeFiles/testapp.dir/main.cpp.s: cmake_force 90 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/testapp.dir/main.cpp.s" 91 | D:\Programs\mingw\mingw64\mingw64\bin\g++.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S D:\workspace\github_repos\awesome_dcmtk\1-hello_world\hello_dcmtk_cmake\main.cpp -o CMakeFiles\testapp.dir\main.cpp.s 92 | 93 | # Object files for target testapp 94 | testapp_OBJECTS = \ 95 | "CMakeFiles/testapp.dir/main.cpp.obj" 96 | 97 | # External object files for target testapp 98 | testapp_EXTERNAL_OBJECTS = 99 | 100 | testapp.exe: CMakeFiles/testapp.dir/main.cpp.obj 101 | testapp.exe: CMakeFiles/testapp.dir/build.make 102 | testapp.exe: CMakeFiles/testapp.dir/linklibs.rsp 103 | testapp.exe: CMakeFiles/testapp.dir/objects1.rsp 104 | testapp.exe: CMakeFiles/testapp.dir/link.txt 105 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --bold --progress-dir=D:\workspace\github_repos\awesome_dcmtk\1-hello_world\hello_dcmtk_cmake\cmake-build-debug\CMakeFiles --progress-num=$(CMAKE_PROGRESS_2) "Linking CXX executable testapp.exe" 106 | $(CMAKE_COMMAND) -E cmake_link_script CMakeFiles\testapp.dir\link.txt --verbose=$(VERBOSE) 107 | 108 | # Rule to build all files generated by this target. 109 | CMakeFiles/testapp.dir/build: testapp.exe 110 | 111 | .PHONY : CMakeFiles/testapp.dir/build 112 | 113 | CMakeFiles/testapp.dir/clean: 114 | $(CMAKE_COMMAND) -P CMakeFiles\testapp.dir\cmake_clean.cmake 115 | .PHONY : CMakeFiles/testapp.dir/clean 116 | 117 | CMakeFiles/testapp.dir/depend: 118 | $(CMAKE_COMMAND) -E cmake_depends "MinGW Makefiles" D:\workspace\github_repos\awesome_dcmtk\1-hello_world\hello_dcmtk_cmake D:\workspace\github_repos\awesome_dcmtk\1-hello_world\hello_dcmtk_cmake D:\workspace\github_repos\awesome_dcmtk\1-hello_world\hello_dcmtk_cmake\cmake-build-debug D:\workspace\github_repos\awesome_dcmtk\1-hello_world\hello_dcmtk_cmake\cmake-build-debug D:\workspace\github_repos\awesome_dcmtk\1-hello_world\hello_dcmtk_cmake\cmake-build-debug\CMakeFiles\testapp.dir\DependInfo.cmake --color=$(COLOR) 119 | .PHONY : CMakeFiles/testapp.dir/depend 120 | 121 | -------------------------------------------------------------------------------- /实践案例/dcmtk/cmake-build-debug/CMakeFiles/testapp.dir/cmake_clean.cmake: -------------------------------------------------------------------------------- 1 | file(REMOVE_RECURSE 2 | "CMakeFiles/testapp.dir/main.cpp.obj" 3 | "libtestapp.dll.a" 4 | "testapp.exe" 5 | "testapp.exe.manifest" 6 | "testapp.pdb" 7 | ) 8 | 9 | # Per-language clean rules from dependency scanning. 10 | foreach(lang CXX) 11 | include(CMakeFiles/testapp.dir/cmake_clean_${lang}.cmake OPTIONAL) 12 | endforeach() 13 | -------------------------------------------------------------------------------- /实践案例/dcmtk/cmake-build-debug/CMakeFiles/testapp.dir/depend.make: -------------------------------------------------------------------------------- 1 | # Empty dependencies file for testapp. 2 | # This may be replaced when dependencies are built. 3 | -------------------------------------------------------------------------------- /实践案例/dcmtk/cmake-build-debug/CMakeFiles/testapp.dir/flags.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "MinGW Makefiles" Generator, CMake Version 3.17 3 | 4 | # compile CXX with D:/Programs/mingw/mingw64/mingw64/bin/g++.exe 5 | CXX_FLAGS = /nologo /W3 /GX /Gy /YX /MTd /Z7 /Od 6 | 7 | CXX_DEFINES = -D_REENTRANT 8 | 9 | CXX_INCLUDES = @CMakeFiles/testapp.dir/includes_CXX.rsp 10 | 11 | -------------------------------------------------------------------------------- /实践案例/dcmtk/cmake-build-debug/CMakeFiles/testapp.dir/includes_CXX.rsp: -------------------------------------------------------------------------------- 1 | -ID:/Programs/dcmtkdll/include 2 | -------------------------------------------------------------------------------- /实践案例/dcmtk/cmake-build-debug/CMakeFiles/testapp.dir/link.txt: -------------------------------------------------------------------------------- 1 | "D:\Program Files\clion\CLion 2020.3.3\bin\cmake\win\bin\cmake.exe" -E rm -f CMakeFiles\testapp.dir/objects.a 2 | D:\Programs\mingw\mingw64\mingw64\bin\ar.exe cr CMakeFiles\testapp.dir/objects.a @CMakeFiles\testapp.dir\objects1.rsp 3 | D:\Programs\mingw\mingw64\mingw64\bin\g++.exe /nologo /W3 /GX /Gy /YX /MTd /Z7 /Od -Wl,--whole-archive CMakeFiles\testapp.dir/objects.a -Wl,--no-whole-archive -o testapp.exe -Wl,--out-implib,libtestapp.dll.a -Wl,--major-image-version,0,--minor-image-version,0 @CMakeFiles\testapp.dir\linklibs.rsp 4 | -------------------------------------------------------------------------------- /实践案例/dcmtk/cmake-build-debug/CMakeFiles/testapp.dir/linklibs.rsp: -------------------------------------------------------------------------------- 1 | -LD:/Programs/dcmtkdll/lib -lnetapi32 -lwsock32 -lofstd -ldcmdata -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 2 | -------------------------------------------------------------------------------- /实践案例/dcmtk/cmake-build-debug/CMakeFiles/testapp.dir/objects1.rsp: -------------------------------------------------------------------------------- 1 | CMakeFiles/testapp.dir/main.cpp.obj 2 | -------------------------------------------------------------------------------- /实践案例/dcmtk/cmake-build-debug/CMakeFiles/testapp.dir/progress.make: -------------------------------------------------------------------------------- 1 | CMAKE_PROGRESS_1 = 1 2 | CMAKE_PROGRESS_2 = 2 3 | 4 | -------------------------------------------------------------------------------- /实践案例/dcmtk/cmake-build-debug/Makefile: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "MinGW Makefiles" Generator, CMake Version 3.17 3 | 4 | # Default target executed when no arguments are given to make. 5 | default_target: all 6 | 7 | .PHONY : default_target 8 | 9 | # Allow only one "make -f Makefile2" at a time, but pass parallelism. 10 | .NOTPARALLEL: 11 | 12 | 13 | #============================================================================= 14 | # Special targets provided by cmake. 15 | 16 | # Disable implicit rules so canonical targets will work. 17 | .SUFFIXES: 18 | 19 | 20 | # Disable VCS-based implicit rules. 21 | % : %,v 22 | 23 | 24 | # Disable VCS-based implicit rules. 25 | % : RCS/% 26 | 27 | 28 | # Disable VCS-based implicit rules. 29 | % : RCS/%,v 30 | 31 | 32 | # Disable VCS-based implicit rules. 33 | % : SCCS/s.% 34 | 35 | 36 | # Disable VCS-based implicit rules. 37 | % : s.% 38 | 39 | 40 | .SUFFIXES: .hpux_make_needs_suffix_list 41 | 42 | 43 | # Command-line flag to silence nested $(MAKE). 44 | $(VERBOSE)MAKESILENT = -s 45 | 46 | # Suppress display of executed commands. 47 | $(VERBOSE).SILENT: 48 | 49 | 50 | # A target that is always out of date. 51 | cmake_force: 52 | 53 | .PHONY : cmake_force 54 | 55 | #============================================================================= 56 | # Set environment variables for the build. 57 | 58 | SHELL = cmd.exe 59 | 60 | # The CMake executable. 61 | CMAKE_COMMAND = "D:\Program Files\clion\CLion 2020.3.3\bin\cmake\win\bin\cmake.exe" 62 | 63 | # The command to remove a file. 64 | RM = "D:\Program Files\clion\CLion 2020.3.3\bin\cmake\win\bin\cmake.exe" -E rm -f 65 | 66 | # Escaping for special characters. 67 | EQUALS = = 68 | 69 | # The top-level source directory on which CMake was run. 70 | CMAKE_SOURCE_DIR = D:\workspace\github_repos\awesome_dcmtk\1-hello_world\hello_dcmtk_cmake 71 | 72 | # The top-level build directory on which CMake was run. 73 | CMAKE_BINARY_DIR = D:\workspace\github_repos\awesome_dcmtk\1-hello_world\hello_dcmtk_cmake\cmake-build-debug 74 | 75 | #============================================================================= 76 | # Targets provided globally by CMake. 77 | 78 | # Special rule for the target edit_cache 79 | edit_cache: 80 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "No interactive CMake dialog available..." 81 | "D:\Program Files\clion\CLion 2020.3.3\bin\cmake\win\bin\cmake.exe" -E echo "No interactive CMake dialog available." 82 | .PHONY : edit_cache 83 | 84 | # Special rule for the target edit_cache 85 | edit_cache/fast: edit_cache 86 | 87 | .PHONY : edit_cache/fast 88 | 89 | # Special rule for the target rebuild_cache 90 | rebuild_cache: 91 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." 92 | "D:\Program Files\clion\CLion 2020.3.3\bin\cmake\win\bin\cmake.exe" --regenerate-during-build -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) 93 | .PHONY : rebuild_cache 94 | 95 | # Special rule for the target rebuild_cache 96 | rebuild_cache/fast: rebuild_cache 97 | 98 | .PHONY : rebuild_cache/fast 99 | 100 | # The main all target 101 | all: cmake_check_build_system 102 | $(CMAKE_COMMAND) -E cmake_progress_start D:\workspace\github_repos\awesome_dcmtk\1-hello_world\hello_dcmtk_cmake\cmake-build-debug\CMakeFiles D:\workspace\github_repos\awesome_dcmtk\1-hello_world\hello_dcmtk_cmake\cmake-build-debug\CMakeFiles\progress.marks 103 | $(MAKE) $(MAKESILENT) -f CMakeFiles\Makefile2 all 104 | $(CMAKE_COMMAND) -E cmake_progress_start D:\workspace\github_repos\awesome_dcmtk\1-hello_world\hello_dcmtk_cmake\cmake-build-debug\CMakeFiles 0 105 | .PHONY : all 106 | 107 | # The main clean target 108 | clean: 109 | $(MAKE) $(MAKESILENT) -f CMakeFiles\Makefile2 clean 110 | .PHONY : clean 111 | 112 | # The main clean target 113 | clean/fast: clean 114 | 115 | .PHONY : clean/fast 116 | 117 | # Prepare targets for installation. 118 | preinstall: all 119 | $(MAKE) $(MAKESILENT) -f CMakeFiles\Makefile2 preinstall 120 | .PHONY : preinstall 121 | 122 | # Prepare targets for installation. 123 | preinstall/fast: 124 | $(MAKE) $(MAKESILENT) -f CMakeFiles\Makefile2 preinstall 125 | .PHONY : preinstall/fast 126 | 127 | # clear depends 128 | depend: 129 | $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles\Makefile.cmake 1 130 | .PHONY : depend 131 | 132 | #============================================================================= 133 | # Target rules for targets named testapp 134 | 135 | # Build rule for target. 136 | testapp: cmake_check_build_system 137 | $(MAKE) $(MAKESILENT) -f CMakeFiles\Makefile2 testapp 138 | .PHONY : testapp 139 | 140 | # fast build rule for target. 141 | testapp/fast: 142 | $(MAKE) $(MAKESILENT) -f CMakeFiles\testapp.dir\build.make CMakeFiles/testapp.dir/build 143 | .PHONY : testapp/fast 144 | 145 | main.obj: main.cpp.obj 146 | 147 | .PHONY : main.obj 148 | 149 | # target to build an object file 150 | main.cpp.obj: 151 | $(MAKE) $(MAKESILENT) -f CMakeFiles\testapp.dir\build.make CMakeFiles/testapp.dir/main.cpp.obj 152 | .PHONY : main.cpp.obj 153 | 154 | main.i: main.cpp.i 155 | 156 | .PHONY : main.i 157 | 158 | # target to preprocess a source file 159 | main.cpp.i: 160 | $(MAKE) $(MAKESILENT) -f CMakeFiles\testapp.dir\build.make CMakeFiles/testapp.dir/main.cpp.i 161 | .PHONY : main.cpp.i 162 | 163 | main.s: main.cpp.s 164 | 165 | .PHONY : main.s 166 | 167 | # target to generate assembly for a file 168 | main.cpp.s: 169 | $(MAKE) $(MAKESILENT) -f CMakeFiles\testapp.dir\build.make CMakeFiles/testapp.dir/main.cpp.s 170 | .PHONY : main.cpp.s 171 | 172 | # Help Target 173 | help: 174 | @echo The following are some of the valid targets for this Makefile: 175 | @echo ... all (the default if no target is provided) 176 | @echo ... clean 177 | @echo ... depend 178 | @echo ... edit_cache 179 | @echo ... rebuild_cache 180 | @echo ... testapp 181 | @echo ... main.obj 182 | @echo ... main.i 183 | @echo ... main.s 184 | .PHONY : help 185 | 186 | 187 | 188 | #============================================================================= 189 | # Special targets to cleanup operation of make. 190 | 191 | # Special rule to run CMake to check the build system integrity. 192 | # No rule that depends on this can have commands that come from listfiles 193 | # because they might be regenerated. 194 | cmake_check_build_system: 195 | $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles\Makefile.cmake 0 196 | .PHONY : cmake_check_build_system 197 | 198 | -------------------------------------------------------------------------------- /实践案例/dcmtk/cmake-build-debug/Testing/Temporary/LastTest.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SFUMECJF/cmake-examples-Chinese/979abb2fb0b4189f0181e4051d2b269964eb22ba/实践案例/dcmtk/cmake-build-debug/Testing/Temporary/LastTest.log -------------------------------------------------------------------------------- /实践案例/dcmtk/cmake-build-debug/cmake_install.cmake: -------------------------------------------------------------------------------- 1 | # Install script for directory: D:/workspace/github_repos/awesome_dcmtk/1-hello_world/hello_dcmtk_cmake 2 | 3 | # Set the install prefix 4 | if(NOT DEFINED CMAKE_INSTALL_PREFIX) 5 | set(CMAKE_INSTALL_PREFIX "C:/Program Files (x86)/testapp") 6 | endif() 7 | string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") 8 | 9 | # Set the install configuration name. 10 | if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME) 11 | if(BUILD_TYPE) 12 | string(REGEX REPLACE "^[^A-Za-z0-9_]+" "" 13 | CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}") 14 | else() 15 | set(CMAKE_INSTALL_CONFIG_NAME "Debug") 16 | endif() 17 | message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"") 18 | endif() 19 | 20 | # Set the component getting installed. 21 | if(NOT CMAKE_INSTALL_COMPONENT) 22 | if(COMPONENT) 23 | message(STATUS "Install component: \"${COMPONENT}\"") 24 | set(CMAKE_INSTALL_COMPONENT "${COMPONENT}") 25 | else() 26 | set(CMAKE_INSTALL_COMPONENT) 27 | endif() 28 | endif() 29 | 30 | # Is this installation the result of a crosscompile? 31 | if(NOT DEFINED CMAKE_CROSSCOMPILING) 32 | set(CMAKE_CROSSCOMPILING "FALSE") 33 | endif() 34 | 35 | if(CMAKE_INSTALL_COMPONENT) 36 | set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt") 37 | else() 38 | set(CMAKE_INSTALL_MANIFEST "install_manifest.txt") 39 | endif() 40 | 41 | string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT 42 | "${CMAKE_INSTALL_MANIFEST_FILES}") 43 | file(WRITE "D:/workspace/github_repos/awesome_dcmtk/1-hello_world/hello_dcmtk_cmake/cmake-build-debug/${CMAKE_INSTALL_MANIFEST}" 44 | "${CMAKE_INSTALL_MANIFEST_CONTENT}") 45 | -------------------------------------------------------------------------------- /实践案例/dcmtk/main.cpp: -------------------------------------------------------------------------------- 1 | // C++_Dicom_Sample.cpp : Defines the entry point for the console application. 2 | // 3 | 4 | //#include "stdafx.h" 5 | //C++中stdafx.h的英文全称为:standard application fram extend,中文名为:头文件预编译。 6 | // 7 | //stdafx.h在c++中起到的作用是:把C++工程中使用的MFC头文件预先编译,以后该工程编译时,直接使用预编译的结果,这样可以加快编译速度。 8 | 9 | //#include "dcmtk/config/osconfig.h" 10 | #include "dcmtk/dcmdata/dctk.h" 11 | #include 12 | 13 | 14 | bool ReadPatientName(DcmFileFormat& fileformat, std::string& filePath) 15 | { 16 | OFCondition status = fileformat.loadFile(filePath.c_str()); 17 | if (!status.good()) 18 | { 19 | std::cout << "Load Dimcom File Error: " << status.text() << std::endl; 20 | return false; 21 | } 22 | OFString PatientName; 23 | status = fileformat.getDataset()->findAndGetOFString(DCM_PatientName, PatientName); 24 | if (status.good()) 25 | { 26 | std::cout << "Get PatientName:" << PatientName << std::endl; 27 | } 28 | else 29 | { 30 | std::cout << "Get PatientName Error:" << status.text() << std::endl; 31 | return false; 32 | } 33 | return true; 34 | } 35 | 36 | bool SavePatientName(DcmFileFormat& fileformat, std::string& filePath, const std::string& info) 37 | { 38 | OFCondition status = fileformat.getDataset()->putAndInsertString(DCM_PatientName, info.c_str()); 39 | if (status.good()) 40 | { 41 | std::cout << "Save PatientName:" << info.c_str() << std::endl; 42 | } 43 | else 44 | { 45 | std::cout << "Save PatientName Error: " << status.text() << std::endl; 46 | return false; 47 | } 48 | 49 | status = fileformat.saveFile(filePath.c_str()); 50 | if (!status.good()) 51 | { 52 | std::cout << "Save Dimcom File Error: " << status.text() << std::endl; 53 | return false; 54 | } 55 | return true; 56 | } 57 | 58 | int main() 59 | { 60 | DcmFileFormat dicomFileformat; 61 | 62 | std::string dicomFile = "image-00000.dcm"; 63 | 64 | ReadPatientName(dicomFileformat, dicomFile); 65 | 66 | //SavePatientName(dicomFileformat, dicomFile, "John Snow"); 67 | 68 | //ReadPatientName(dicomFileformat, dicomFile); 69 | 70 | system("pause"); 71 | 72 | return 0; 73 | } -------------------------------------------------------------------------------- /实践案例/dcmtk/out/build/x64-Debug/.cmake/api/v1/query/client-MicrosoftVS/query.json: -------------------------------------------------------------------------------- 1 | {"requests":[{"kind":"cache","version":2},{"kind":"cmakeFiles","version":1},{"kind":"codemodel","version":2}]} -------------------------------------------------------------------------------- /实践案例/dcmtk/out/build/x64-Debug/.cmake/api/v1/reply/cmakeFiles-v1-deeb65e5eba942407b1b.json: -------------------------------------------------------------------------------- 1 | { 2 | "inputs" : 3 | [ 4 | { 5 | "path" : "CMakeLists.txt" 6 | }, 7 | { 8 | "isGenerated" : true, 9 | "path" : "out/build/x64-Debug/CMakeFiles/3.19.20122902-MSVC_2/CMakeSystem.cmake" 10 | }, 11 | { 12 | "isCMake" : true, 13 | "isExternal" : true, 14 | "path" : "D:/Programs/vs/vside/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.19/Modules/CMakeSystemSpecificInitialize.cmake" 15 | }, 16 | { 17 | "isGenerated" : true, 18 | "path" : "out/build/x64-Debug/CMakeFiles/3.19.20122902-MSVC_2/CMakeCCompiler.cmake" 19 | }, 20 | { 21 | "isGenerated" : true, 22 | "path" : "out/build/x64-Debug/CMakeFiles/3.19.20122902-MSVC_2/CMakeCXXCompiler.cmake" 23 | }, 24 | { 25 | "isCMake" : true, 26 | "isExternal" : true, 27 | "path" : "D:/Programs/vs/vside/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.19/Modules/CMakeSystemSpecificInformation.cmake" 28 | }, 29 | { 30 | "isCMake" : true, 31 | "isExternal" : true, 32 | "path" : "D:/Programs/vs/vside/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.19/Modules/CMakeGenericSystem.cmake" 33 | }, 34 | { 35 | "isCMake" : true, 36 | "isExternal" : true, 37 | "path" : "D:/Programs/vs/vside/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.19/Modules/CMakeInitializeConfigs.cmake" 38 | }, 39 | { 40 | "isCMake" : true, 41 | "isExternal" : true, 42 | "path" : "D:/Programs/vs/vside/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.19/Modules/Platform/Windows.cmake" 43 | }, 44 | { 45 | "isCMake" : true, 46 | "isExternal" : true, 47 | "path" : "D:/Programs/vs/vside/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.19/Modules/Platform/WindowsPaths.cmake" 48 | }, 49 | { 50 | "isCMake" : true, 51 | "isExternal" : true, 52 | "path" : "D:/Programs/vs/vside/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.19/Modules/CMakeCInformation.cmake" 53 | }, 54 | { 55 | "isCMake" : true, 56 | "isExternal" : true, 57 | "path" : "D:/Programs/vs/vside/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.19/Modules/CMakeLanguageInformation.cmake" 58 | }, 59 | { 60 | "isCMake" : true, 61 | "isExternal" : true, 62 | "path" : "D:/Programs/vs/vside/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.19/Modules/Compiler/MSVC-C.cmake" 63 | }, 64 | { 65 | "isCMake" : true, 66 | "isExternal" : true, 67 | "path" : "D:/Programs/vs/vside/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.19/Modules/Compiler/CMakeCommonCompilerMacros.cmake" 68 | }, 69 | { 70 | "isCMake" : true, 71 | "isExternal" : true, 72 | "path" : "D:/Programs/vs/vside/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.19/Modules/Platform/Windows-MSVC-C.cmake" 73 | }, 74 | { 75 | "isCMake" : true, 76 | "isExternal" : true, 77 | "path" : "D:/Programs/vs/vside/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.19/Modules/Platform/Windows-MSVC.cmake" 78 | }, 79 | { 80 | "isGenerated" : true, 81 | "path" : "out/build/x64-Debug/CMakeFiles/3.19.20122902-MSVC_2/CMakeRCCompiler.cmake" 82 | }, 83 | { 84 | "isCMake" : true, 85 | "isExternal" : true, 86 | "path" : "D:/Programs/vs/vside/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.19/Modules/CMakeRCInformation.cmake" 87 | }, 88 | { 89 | "isCMake" : true, 90 | "isExternal" : true, 91 | "path" : "D:/Programs/vs/vside/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.19/Modules/CMakeCommonLanguageInclude.cmake" 92 | }, 93 | { 94 | "isCMake" : true, 95 | "isExternal" : true, 96 | "path" : "D:/Programs/vs/vside/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.19/Modules/CMakeCXXInformation.cmake" 97 | }, 98 | { 99 | "isCMake" : true, 100 | "isExternal" : true, 101 | "path" : "D:/Programs/vs/vside/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.19/Modules/CMakeLanguageInformation.cmake" 102 | }, 103 | { 104 | "isCMake" : true, 105 | "isExternal" : true, 106 | "path" : "D:/Programs/vs/vside/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.19/Modules/Compiler/MSVC-CXX.cmake" 107 | }, 108 | { 109 | "isCMake" : true, 110 | "isExternal" : true, 111 | "path" : "D:/Programs/vs/vside/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.19/Modules/Compiler/CMakeCommonCompilerMacros.cmake" 112 | }, 113 | { 114 | "isCMake" : true, 115 | "isExternal" : true, 116 | "path" : "D:/Programs/vs/vside/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.19/Modules/Platform/Windows-MSVC-CXX.cmake" 117 | }, 118 | { 119 | "isCMake" : true, 120 | "isExternal" : true, 121 | "path" : "D:/Programs/vs/vside/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.19/Modules/Platform/Windows-MSVC.cmake" 122 | }, 123 | { 124 | "isCMake" : true, 125 | "isExternal" : true, 126 | "path" : "D:/Programs/vs/vside/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.19/Modules/CMakeCommonLanguageInclude.cmake" 127 | } 128 | ], 129 | "kind" : "cmakeFiles", 130 | "paths" : 131 | { 132 | "build" : "D:/workspace/github_repos/awesome_dcmtk/1-hello_world/hello_dcmtk_cmake/out/build/x64-Debug", 133 | "source" : "D:/workspace/github_repos/awesome_dcmtk/1-hello_world/hello_dcmtk_cmake" 134 | }, 135 | "version" : 136 | { 137 | "major" : 1, 138 | "minor" : 0 139 | } 140 | } 141 | -------------------------------------------------------------------------------- /实践案例/dcmtk/out/build/x64-Debug/.cmake/api/v1/reply/codemodel-v2-7a679d93ea057bb2953b.json: -------------------------------------------------------------------------------- 1 | { 2 | "configurations" : 3 | [ 4 | { 5 | "directories" : 6 | [ 7 | { 8 | "build" : ".", 9 | "minimumCMakeVersion" : 10 | { 11 | "string" : "2.8" 12 | }, 13 | "projectIndex" : 0, 14 | "source" : ".", 15 | "targetIndexes" : 16 | [ 17 | 0 18 | ] 19 | } 20 | ], 21 | "name" : "Debug", 22 | "projects" : 23 | [ 24 | { 25 | "directoryIndexes" : 26 | [ 27 | 0 28 | ], 29 | "name" : "testapp", 30 | "targetIndexes" : 31 | [ 32 | 0 33 | ] 34 | } 35 | ], 36 | "targets" : 37 | [ 38 | { 39 | "directoryIndex" : 0, 40 | "id" : "testapp::@6890427a1f51a3e7e1df", 41 | "jsonFile" : "target-testapp-Debug-a1f2119db25734d54667.json", 42 | "name" : "testapp", 43 | "projectIndex" : 0 44 | } 45 | ] 46 | } 47 | ], 48 | "kind" : "codemodel", 49 | "paths" : 50 | { 51 | "build" : "D:/workspace/github_repos/awesome_dcmtk/1-hello_world/hello_dcmtk_cmake/out/build/x64-Debug", 52 | "source" : "D:/workspace/github_repos/awesome_dcmtk/1-hello_world/hello_dcmtk_cmake" 53 | }, 54 | "version" : 55 | { 56 | "major" : 2, 57 | "minor" : 2 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /实践案例/dcmtk/out/build/x64-Debug/.cmake/api/v1/reply/index-2021-06-09T14-23-24-0727.json: -------------------------------------------------------------------------------- 1 | { 2 | "cmake" : 3 | { 4 | "generator" : 5 | { 6 | "multiConfig" : false, 7 | "name" : "Ninja" 8 | }, 9 | "paths" : 10 | { 11 | "cmake" : "D:/Programs/vs/vside/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/cmake.exe", 12 | "cpack" : "D:/Programs/vs/vside/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/cpack.exe", 13 | "ctest" : "D:/Programs/vs/vside/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/ctest.exe", 14 | "root" : "D:/Programs/vs/vside/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.19" 15 | }, 16 | "version" : 17 | { 18 | "isDirty" : false, 19 | "major" : 3, 20 | "minor" : 19, 21 | "patch" : 20122902, 22 | "string" : "3.19.20122902-MSVC_2", 23 | "suffix" : "" 24 | } 25 | }, 26 | "objects" : 27 | [ 28 | { 29 | "jsonFile" : "codemodel-v2-7a679d93ea057bb2953b.json", 30 | "kind" : "codemodel", 31 | "version" : 32 | { 33 | "major" : 2, 34 | "minor" : 2 35 | } 36 | }, 37 | { 38 | "jsonFile" : "cache-v2-5433edd50e87420ea6ba.json", 39 | "kind" : "cache", 40 | "version" : 41 | { 42 | "major" : 2, 43 | "minor" : 0 44 | } 45 | }, 46 | { 47 | "jsonFile" : "cmakeFiles-v1-deeb65e5eba942407b1b.json", 48 | "kind" : "cmakeFiles", 49 | "version" : 50 | { 51 | "major" : 1, 52 | "minor" : 0 53 | } 54 | } 55 | ], 56 | "reply" : 57 | { 58 | "client-MicrosoftVS" : 59 | { 60 | "query.json" : 61 | { 62 | "requests" : 63 | [ 64 | { 65 | "kind" : "cache", 66 | "version" : 2 67 | }, 68 | { 69 | "kind" : "cmakeFiles", 70 | "version" : 1 71 | }, 72 | { 73 | "kind" : "codemodel", 74 | "version" : 2 75 | } 76 | ], 77 | "responses" : 78 | [ 79 | { 80 | "jsonFile" : "cache-v2-5433edd50e87420ea6ba.json", 81 | "kind" : "cache", 82 | "version" : 83 | { 84 | "major" : 2, 85 | "minor" : 0 86 | } 87 | }, 88 | { 89 | "jsonFile" : "cmakeFiles-v1-deeb65e5eba942407b1b.json", 90 | "kind" : "cmakeFiles", 91 | "version" : 92 | { 93 | "major" : 1, 94 | "minor" : 0 95 | } 96 | }, 97 | { 98 | "jsonFile" : "codemodel-v2-7a679d93ea057bb2953b.json", 99 | "kind" : "codemodel", 100 | "version" : 101 | { 102 | "major" : 2, 103 | "minor" : 2 104 | } 105 | } 106 | ] 107 | } 108 | } 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /实践案例/dcmtk/out/build/x64-Debug/.cmake/api/v1/reply/target-testapp-Debug-a1f2119db25734d54667.json: -------------------------------------------------------------------------------- 1 | { 2 | "artifacts" : 3 | [ 4 | { 5 | "path" : "testapp.exe" 6 | }, 7 | { 8 | "path" : "testapp.pdb" 9 | } 10 | ], 11 | "backtrace" : 1, 12 | "backtraceGraph" : 13 | { 14 | "commands" : 15 | [ 16 | "ADD_EXECUTABLE", 17 | "LINK_DIRECTORIES", 18 | "TARGET_LINK_LIBRARIES", 19 | "ADD_DEFINITIONS", 20 | "INCLUDE_DIRECTORIES" 21 | ], 22 | "files" : 23 | [ 24 | "CMakeLists.txt" 25 | ], 26 | "nodes" : 27 | [ 28 | { 29 | "file" : 0 30 | }, 31 | { 32 | "command" : 0, 33 | "file" : 0, 34 | "line" : 22, 35 | "parent" : 0 36 | }, 37 | { 38 | "command" : 1, 39 | "file" : 0, 40 | "line" : 20, 41 | "parent" : 0 42 | }, 43 | { 44 | "command" : 2, 45 | "file" : 0, 46 | "line" : 23, 47 | "parent" : 0 48 | }, 49 | { 50 | "command" : 3, 51 | "file" : 0, 52 | "line" : 17, 53 | "parent" : 0 54 | }, 55 | { 56 | "command" : 4, 57 | "file" : 0, 58 | "line" : 19, 59 | "parent" : 0 60 | } 61 | ] 62 | }, 63 | "compileGroups" : 64 | [ 65 | { 66 | "compileCommandFragments" : 67 | [ 68 | { 69 | "fragment" : "/nologo /W3 /GX /Gy /YX /MTd /Z7 /Od" 70 | } 71 | ], 72 | "defines" : 73 | [ 74 | { 75 | "backtrace" : 4, 76 | "define" : "_REENTRANT" 77 | } 78 | ], 79 | "includes" : 80 | [ 81 | { 82 | "backtrace" : 5, 83 | "path" : "D:/Programs/dcmtkdll/include" 84 | } 85 | ], 86 | "language" : "CXX", 87 | "sourceIndexes" : 88 | [ 89 | 0 90 | ] 91 | } 92 | ], 93 | "id" : "testapp::@6890427a1f51a3e7e1df", 94 | "link" : 95 | { 96 | "commandFragments" : 97 | [ 98 | { 99 | "fragment" : "/nologo /W3 /GX /Gy /YX /MTd /Z7 /Od", 100 | "role" : "flags" 101 | }, 102 | { 103 | "fragment" : "/machine:x64 /debug /INCREMENTAL /subsystem:console", 104 | "role" : "flags" 105 | }, 106 | { 107 | "backtrace" : 2, 108 | "fragment" : "-LIBPATH:D:\\Programs\\dcmtkdll\\lib", 109 | "role" : "libraryPath" 110 | }, 111 | { 112 | "backtrace" : 3, 113 | "fragment" : "netapi32.lib", 114 | "role" : "libraries" 115 | }, 116 | { 117 | "backtrace" : 3, 118 | "fragment" : "wsock32.lib", 119 | "role" : "libraries" 120 | }, 121 | { 122 | "backtrace" : 3, 123 | "fragment" : "ofstd.lib", 124 | "role" : "libraries" 125 | }, 126 | { 127 | "backtrace" : 3, 128 | "fragment" : "dcmdata.lib", 129 | "role" : "libraries" 130 | }, 131 | { 132 | "fragment" : "kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib", 133 | "role" : "libraries" 134 | } 135 | ], 136 | "language" : "CXX" 137 | }, 138 | "name" : "testapp", 139 | "nameOnDisk" : "testapp.exe", 140 | "paths" : 141 | { 142 | "build" : ".", 143 | "source" : "." 144 | }, 145 | "sourceGroups" : 146 | [ 147 | { 148 | "name" : "Source Files", 149 | "sourceIndexes" : 150 | [ 151 | 0 152 | ] 153 | } 154 | ], 155 | "sources" : 156 | [ 157 | { 158 | "backtrace" : 1, 159 | "compileGroupIndex" : 0, 160 | "path" : "main.cpp", 161 | "sourceGroupIndex" : 0 162 | } 163 | ], 164 | "type" : "EXECUTABLE" 165 | } 166 | -------------------------------------------------------------------------------- /实践案例/dcmtk/out/build/x64-Debug/.ninja_deps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SFUMECJF/cmake-examples-Chinese/979abb2fb0b4189f0181e4051d2b269964eb22ba/实践案例/dcmtk/out/build/x64-Debug/.ninja_deps -------------------------------------------------------------------------------- /实践案例/dcmtk/out/build/x64-Debug/.ninja_log: -------------------------------------------------------------------------------- 1 | # ninja log v5 2 | 0 548 6447536739692386 CMakeFiles/testapp.dir/main.cpp.obj cf7138d8a67c2ba9 3 | 550 1367 6447536747801184 testapp.exe d006979b8bf7baaa 4 | -------------------------------------------------------------------------------- /实践案例/dcmtk/out/build/x64-Debug/CMakeFiles/3.19.20122902-MSVC_2/CMakeCCompiler.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_C_COMPILER "D:/Programs/vs/vside/VC/Tools/MSVC/14.28.29910/bin/Hostx64/x64/cl.exe") 2 | set(CMAKE_C_COMPILER_ARG1 "") 3 | set(CMAKE_C_COMPILER_ID "MSVC") 4 | set(CMAKE_C_COMPILER_VERSION "19.28.29912.0") 5 | set(CMAKE_C_COMPILER_VERSION_INTERNAL "") 6 | set(CMAKE_C_COMPILER_WRAPPER "") 7 | set(CMAKE_C_STANDARD_COMPUTED_DEFAULT "90") 8 | set(CMAKE_C_COMPILE_FEATURES "c_std_90;c_std_99;c_std_11;c_function_prototypes;c_variadic_macros;c_restrict;c_static_assert") 9 | set(CMAKE_C90_COMPILE_FEATURES "c_std_90;c_function_prototypes") 10 | set(CMAKE_C99_COMPILE_FEATURES "c_std_99;c_variadic_macros;c_restrict") 11 | set(CMAKE_C11_COMPILE_FEATURES "c_std_11;c_static_assert") 12 | 13 | set(CMAKE_C_PLATFORM_ID "Windows") 14 | set(CMAKE_C_SIMULATE_ID "") 15 | set(CMAKE_C_COMPILER_FRONTEND_VARIANT "") 16 | set(CMAKE_C_SIMULATE_VERSION "") 17 | set(CMAKE_C_COMPILER_ARCHITECTURE_ID x64) 18 | 19 | set(MSVC_C_ARCHITECTURE_ID x64) 20 | 21 | set(CMAKE_AR "D:/Programs/vs/vside/VC/Tools/MSVC/14.28.29910/bin/Hostx64/x64/lib.exe") 22 | set(CMAKE_C_COMPILER_AR "") 23 | set(CMAKE_RANLIB "") 24 | set(CMAKE_C_COMPILER_RANLIB "") 25 | set(CMAKE_LINKER "D:/Programs/vs/vside/VC/Tools/MSVC/14.28.29910/bin/Hostx64/x64/link.exe") 26 | set(CMAKE_MT "C:/Program Files (x86)/Windows Kits/10/bin/10.0.19041.0/x64/mt.exe") 27 | set(CMAKE_COMPILER_IS_GNUCC ) 28 | set(CMAKE_C_COMPILER_LOADED 1) 29 | set(CMAKE_C_COMPILER_WORKS TRUE) 30 | set(CMAKE_C_ABI_COMPILED TRUE) 31 | set(CMAKE_COMPILER_IS_MINGW ) 32 | set(CMAKE_COMPILER_IS_CYGWIN ) 33 | if(CMAKE_COMPILER_IS_CYGWIN) 34 | set(CYGWIN 1) 35 | set(UNIX 1) 36 | endif() 37 | 38 | set(CMAKE_C_COMPILER_ENV_VAR "CC") 39 | 40 | if(CMAKE_COMPILER_IS_MINGW) 41 | set(MINGW 1) 42 | endif() 43 | set(CMAKE_C_COMPILER_ID_RUN 1) 44 | set(CMAKE_C_SOURCE_FILE_EXTENSIONS c;m) 45 | set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC) 46 | set(CMAKE_C_LINKER_PREFERENCE 10) 47 | 48 | # Save compiler ABI information. 49 | set(CMAKE_C_SIZEOF_DATA_PTR "8") 50 | set(CMAKE_C_COMPILER_ABI "") 51 | set(CMAKE_C_LIBRARY_ARCHITECTURE "") 52 | 53 | if(CMAKE_C_SIZEOF_DATA_PTR) 54 | set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}") 55 | endif() 56 | 57 | if(CMAKE_C_COMPILER_ABI) 58 | set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}") 59 | endif() 60 | 61 | if(CMAKE_C_LIBRARY_ARCHITECTURE) 62 | set(CMAKE_LIBRARY_ARCHITECTURE "") 63 | endif() 64 | 65 | set(CMAKE_C_CL_SHOWINCLUDES_PREFIX "注意: 包含文件: ") 66 | if(CMAKE_C_CL_SHOWINCLUDES_PREFIX) 67 | set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_C_CL_SHOWINCLUDES_PREFIX}") 68 | endif() 69 | 70 | 71 | 72 | 73 | 74 | set(CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES "") 75 | set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "") 76 | set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "") 77 | set(CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "") 78 | -------------------------------------------------------------------------------- /实践案例/dcmtk/out/build/x64-Debug/CMakeFiles/3.19.20122902-MSVC_2/CMakeCXXCompiler.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_CXX_COMPILER "D:/Programs/vs/vside/VC/Tools/MSVC/14.28.29910/bin/Hostx64/x64/cl.exe") 2 | set(CMAKE_CXX_COMPILER_ARG1 "") 3 | set(CMAKE_CXX_COMPILER_ID "MSVC") 4 | set(CMAKE_CXX_COMPILER_VERSION "19.28.29912.0") 5 | set(CMAKE_CXX_COMPILER_VERSION_INTERNAL "") 6 | set(CMAKE_CXX_COMPILER_WRAPPER "") 7 | set(CMAKE_CXX_STANDARD_COMPUTED_DEFAULT "14") 8 | set(CMAKE_CXX_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters;cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates;cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates;cxx_std_17;cxx_std_20") 9 | set(CMAKE_CXX98_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters") 10 | set(CMAKE_CXX11_COMPILE_FEATURES "cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates") 11 | set(CMAKE_CXX14_COMPILE_FEATURES "cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates") 12 | set(CMAKE_CXX17_COMPILE_FEATURES "cxx_std_17") 13 | set(CMAKE_CXX20_COMPILE_FEATURES "cxx_std_20") 14 | 15 | set(CMAKE_CXX_PLATFORM_ID "Windows") 16 | set(CMAKE_CXX_SIMULATE_ID "") 17 | set(CMAKE_CXX_COMPILER_FRONTEND_VARIANT "") 18 | set(CMAKE_CXX_SIMULATE_VERSION "") 19 | set(CMAKE_CXX_COMPILER_ARCHITECTURE_ID x64) 20 | 21 | set(MSVC_CXX_ARCHITECTURE_ID x64) 22 | 23 | set(CMAKE_AR "D:/Programs/vs/vside/VC/Tools/MSVC/14.28.29910/bin/Hostx64/x64/lib.exe") 24 | set(CMAKE_CXX_COMPILER_AR "") 25 | set(CMAKE_RANLIB "") 26 | set(CMAKE_CXX_COMPILER_RANLIB "") 27 | set(CMAKE_LINKER "D:/Programs/vs/vside/VC/Tools/MSVC/14.28.29910/bin/Hostx64/x64/link.exe") 28 | set(CMAKE_MT "C:/Program Files (x86)/Windows Kits/10/bin/10.0.19041.0/x64/mt.exe") 29 | set(CMAKE_COMPILER_IS_GNUCXX ) 30 | set(CMAKE_CXX_COMPILER_LOADED 1) 31 | set(CMAKE_CXX_COMPILER_WORKS TRUE) 32 | set(CMAKE_CXX_ABI_COMPILED TRUE) 33 | set(CMAKE_COMPILER_IS_MINGW ) 34 | set(CMAKE_COMPILER_IS_CYGWIN ) 35 | if(CMAKE_COMPILER_IS_CYGWIN) 36 | set(CYGWIN 1) 37 | set(UNIX 1) 38 | endif() 39 | 40 | set(CMAKE_CXX_COMPILER_ENV_VAR "CXX") 41 | 42 | if(CMAKE_COMPILER_IS_MINGW) 43 | set(MINGW 1) 44 | endif() 45 | set(CMAKE_CXX_COMPILER_ID_RUN 1) 46 | set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;CPP) 47 | set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC) 48 | 49 | foreach (lang C OBJC OBJCXX) 50 | if (CMAKE_${lang}_COMPILER_ID_RUN) 51 | foreach(extension IN LISTS CMAKE_${lang}_SOURCE_FILE_EXTENSIONS) 52 | list(REMOVE_ITEM CMAKE_CXX_SOURCE_FILE_EXTENSIONS ${extension}) 53 | endforeach() 54 | endif() 55 | endforeach() 56 | 57 | set(CMAKE_CXX_LINKER_PREFERENCE 30) 58 | set(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1) 59 | 60 | # Save compiler ABI information. 61 | set(CMAKE_CXX_SIZEOF_DATA_PTR "8") 62 | set(CMAKE_CXX_COMPILER_ABI "") 63 | set(CMAKE_CXX_LIBRARY_ARCHITECTURE "") 64 | 65 | if(CMAKE_CXX_SIZEOF_DATA_PTR) 66 | set(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}") 67 | endif() 68 | 69 | if(CMAKE_CXX_COMPILER_ABI) 70 | set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}") 71 | endif() 72 | 73 | if(CMAKE_CXX_LIBRARY_ARCHITECTURE) 74 | set(CMAKE_LIBRARY_ARCHITECTURE "") 75 | endif() 76 | 77 | set(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX "注意: 包含文件: ") 78 | if(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX) 79 | set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_CXX_CL_SHOWINCLUDES_PREFIX}") 80 | endif() 81 | 82 | 83 | 84 | 85 | 86 | set(CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES "") 87 | set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "") 88 | set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "") 89 | set(CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "") 90 | -------------------------------------------------------------------------------- /实践案例/dcmtk/out/build/x64-Debug/CMakeFiles/3.19.20122902-MSVC_2/CMakeDetermineCompilerABI_C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SFUMECJF/cmake-examples-Chinese/979abb2fb0b4189f0181e4051d2b269964eb22ba/实践案例/dcmtk/out/build/x64-Debug/CMakeFiles/3.19.20122902-MSVC_2/CMakeDetermineCompilerABI_C.bin -------------------------------------------------------------------------------- /实践案例/dcmtk/out/build/x64-Debug/CMakeFiles/3.19.20122902-MSVC_2/CMakeDetermineCompilerABI_CXX.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SFUMECJF/cmake-examples-Chinese/979abb2fb0b4189f0181e4051d2b269964eb22ba/实践案例/dcmtk/out/build/x64-Debug/CMakeFiles/3.19.20122902-MSVC_2/CMakeDetermineCompilerABI_CXX.bin -------------------------------------------------------------------------------- /实践案例/dcmtk/out/build/x64-Debug/CMakeFiles/3.19.20122902-MSVC_2/CMakeRCCompiler.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_RC_COMPILER "C:/Program Files (x86)/Windows Kits/10/bin/10.0.19041.0/x64/rc.exe") 2 | set(CMAKE_RC_COMPILER_ARG1 "") 3 | set(CMAKE_RC_COMPILER_LOADED 1) 4 | set(CMAKE_RC_SOURCE_FILE_EXTENSIONS rc;RC) 5 | set(CMAKE_RC_OUTPUT_EXTENSION .res) 6 | set(CMAKE_RC_COMPILER_ENV_VAR "RC") 7 | -------------------------------------------------------------------------------- /实践案例/dcmtk/out/build/x64-Debug/CMakeFiles/3.19.20122902-MSVC_2/CMakeSystem.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_HOST_SYSTEM "Windows-10.0.19041") 2 | set(CMAKE_HOST_SYSTEM_NAME "Windows") 3 | set(CMAKE_HOST_SYSTEM_VERSION "10.0.19041") 4 | set(CMAKE_HOST_SYSTEM_PROCESSOR "AMD64") 5 | 6 | 7 | 8 | set(CMAKE_SYSTEM "Windows-10.0.19041") 9 | set(CMAKE_SYSTEM_NAME "Windows") 10 | set(CMAKE_SYSTEM_VERSION "10.0.19041") 11 | set(CMAKE_SYSTEM_PROCESSOR "AMD64") 12 | 13 | set(CMAKE_CROSSCOMPILING "FALSE") 14 | 15 | set(CMAKE_SYSTEM_LOADED 1) 16 | -------------------------------------------------------------------------------- /实践案例/dcmtk/out/build/x64-Debug/CMakeFiles/3.19.20122902-MSVC_2/CompilerIdC/CMakeCCompilerId.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SFUMECJF/cmake-examples-Chinese/979abb2fb0b4189f0181e4051d2b269964eb22ba/实践案例/dcmtk/out/build/x64-Debug/CMakeFiles/3.19.20122902-MSVC_2/CompilerIdC/CMakeCCompilerId.exe -------------------------------------------------------------------------------- /实践案例/dcmtk/out/build/x64-Debug/CMakeFiles/3.19.20122902-MSVC_2/CompilerIdC/CMakeCCompilerId.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SFUMECJF/cmake-examples-Chinese/979abb2fb0b4189f0181e4051d2b269964eb22ba/实践案例/dcmtk/out/build/x64-Debug/CMakeFiles/3.19.20122902-MSVC_2/CompilerIdC/CMakeCCompilerId.obj -------------------------------------------------------------------------------- /实践案例/dcmtk/out/build/x64-Debug/CMakeFiles/3.19.20122902-MSVC_2/CompilerIdCXX/CMakeCXXCompilerId.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SFUMECJF/cmake-examples-Chinese/979abb2fb0b4189f0181e4051d2b269964eb22ba/实践案例/dcmtk/out/build/x64-Debug/CMakeFiles/3.19.20122902-MSVC_2/CompilerIdCXX/CMakeCXXCompilerId.exe -------------------------------------------------------------------------------- /实践案例/dcmtk/out/build/x64-Debug/CMakeFiles/3.19.20122902-MSVC_2/CompilerIdCXX/CMakeCXXCompilerId.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SFUMECJF/cmake-examples-Chinese/979abb2fb0b4189f0181e4051d2b269964eb22ba/实践案例/dcmtk/out/build/x64-Debug/CMakeFiles/3.19.20122902-MSVC_2/CompilerIdCXX/CMakeCXXCompilerId.obj -------------------------------------------------------------------------------- /实践案例/dcmtk/out/build/x64-Debug/CMakeFiles/CMakeOutput.log: -------------------------------------------------------------------------------- 1 | The system is: Windows - 10.0.19041 - AMD64 2 | Compiling the C compiler identification source file "CMakeCCompilerId.c" succeeded. 3 | Compiler: D:/Programs/vs/vside/VC/Tools/MSVC/14.28.29910/bin/Hostx64/x64/cl.exe 4 | Build flags: 5 | Id flags: 6 | 7 | The output was: 8 | 0 9 | 用于 x64 的 Microsoft (R) C/C++ 优化编译器 19.28.29912 版 10 | 版权所有(C) Microsoft Corporation。保留所有权利。 11 | 12 | CMakeCCompilerId.c 13 | Microsoft (R) Incremental Linker Version 14.28.29912.0 14 | Copyright (C) Microsoft Corporation. All rights reserved. 15 | 16 | /out:CMakeCCompilerId.exe 17 | CMakeCCompilerId.obj 18 | 19 | 20 | Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "CMakeCCompilerId.exe" 21 | 22 | Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "CMakeCCompilerId.obj" 23 | 24 | The C compiler identification is MSVC, found in "D:/workspace/github_repos/awesome_dcmtk/1-hello_world/hello_dcmtk_cmake/out/build/x64-Debug/CMakeFiles/3.19.20122902-MSVC_2/CompilerIdC/CMakeCCompilerId.exe" 25 | 26 | Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" succeeded. 27 | Compiler: D:/Programs/vs/vside/VC/Tools/MSVC/14.28.29910/bin/Hostx64/x64/cl.exe 28 | Build flags: 29 | Id flags: 30 | 31 | The output was: 32 | 0 33 | 用于 x64 的 Microsoft (R) C/C++ 优化编译器 19.28.29912 版 34 | 版权所有(C) Microsoft Corporation。保留所有权利。 35 | 36 | CMakeCXXCompilerId.cpp 37 | Microsoft (R) Incremental Linker Version 14.28.29912.0 38 | Copyright (C) Microsoft Corporation. All rights reserved. 39 | 40 | /out:CMakeCXXCompilerId.exe 41 | CMakeCXXCompilerId.obj 42 | 43 | 44 | Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "CMakeCXXCompilerId.exe" 45 | 46 | Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "CMakeCXXCompilerId.obj" 47 | 48 | The CXX compiler identification is MSVC, found in "D:/workspace/github_repos/awesome_dcmtk/1-hello_world/hello_dcmtk_cmake/out/build/x64-Debug/CMakeFiles/3.19.20122902-MSVC_2/CompilerIdCXX/CMakeCXXCompilerId.exe" 49 | 50 | Detecting C compiler ABI info compiled with the following output: 51 | Change Dir: D:/workspace/github_repos/awesome_dcmtk/1-hello_world/hello_dcmtk_cmake/out/build/x64-Debug/CMakeFiles/CMakeTmp 52 | 53 | Run Build Command(s):d:\programs\vs\vside\common7\ide\commonextensions\microsoft\cmake\Ninja\ninja.exe cmTC_91dce && [1/2] Building C object CMakeFiles\cmTC_91dce.dir\CMakeCCompilerABI.c.obj 54 | [2/2] Linking C executable cmTC_91dce.exe 55 | 56 | 57 | 58 | Detecting CXX compiler ABI info compiled with the following output: 59 | Change Dir: D:/workspace/github_repos/awesome_dcmtk/1-hello_world/hello_dcmtk_cmake/out/build/x64-Debug/CMakeFiles/CMakeTmp 60 | 61 | Run Build Command(s):d:\programs\vs\vside\common7\ide\commonextensions\microsoft\cmake\Ninja\ninja.exe cmTC_64b3e && [1/2] Building CXX object CMakeFiles\cmTC_64b3e.dir\CMakeCXXCompilerABI.cpp.obj 62 | [2/2] Linking CXX executable cmTC_64b3e.exe 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /实践案例/dcmtk/out/build/x64-Debug/CMakeFiles/ShowIncludes/foo.h: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /实践案例/dcmtk/out/build/x64-Debug/CMakeFiles/ShowIncludes/main.c: -------------------------------------------------------------------------------- 1 | #include "foo.h" 2 | int main(){} 3 | -------------------------------------------------------------------------------- /实践案例/dcmtk/out/build/x64-Debug/CMakeFiles/ShowIncludes/main.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SFUMECJF/cmake-examples-Chinese/979abb2fb0b4189f0181e4051d2b269964eb22ba/实践案例/dcmtk/out/build/x64-Debug/CMakeFiles/ShowIncludes/main.obj -------------------------------------------------------------------------------- /实践案例/dcmtk/out/build/x64-Debug/CMakeFiles/TargetDirectories.txt: -------------------------------------------------------------------------------- 1 | D:/workspace/github_repos/awesome_dcmtk/1-hello_world/hello_dcmtk_cmake/out/build/x64-Debug/CMakeFiles/testapp.dir 2 | D:/workspace/github_repos/awesome_dcmtk/1-hello_world/hello_dcmtk_cmake/out/build/x64-Debug/CMakeFiles/edit_cache.dir 3 | D:/workspace/github_repos/awesome_dcmtk/1-hello_world/hello_dcmtk_cmake/out/build/x64-Debug/CMakeFiles/rebuild_cache.dir 4 | -------------------------------------------------------------------------------- /实践案例/dcmtk/out/build/x64-Debug/CMakeFiles/cmake.check_cache: -------------------------------------------------------------------------------- 1 | # This file is generated by cmake for dependency checking of the CMakeCache.txt file 2 | -------------------------------------------------------------------------------- /实践案例/dcmtk/out/build/x64-Debug/CMakeFiles/rules.ninja: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Ninja" Generator, CMake Version 3.19 3 | 4 | # This file contains all the rules used to get the outputs files 5 | # built from the input files. 6 | # It is included in the main 'build.ninja'. 7 | 8 | # ============================================================================= 9 | # Project: testapp 10 | # Configurations: Debug 11 | # ============================================================================= 12 | # ============================================================================= 13 | 14 | ############################################# 15 | # localized /showIncludes string 16 | 17 | msvc_deps_prefix = 注意: 包含文件: 18 | 19 | 20 | ############################################# 21 | # Rule for compiling CXX files. 22 | 23 | rule CXX_COMPILER__testapp_Debug 24 | deps = msvc 25 | command = D:\Programs\vs\vside\VC\Tools\MSVC\14.28.29910\bin\Hostx64\x64\cl.exe /nologo /TP $DEFINES $INCLUDES $FLAGS /showIncludes /Fo$out /Fd$TARGET_COMPILE_PDB /FS -c $in 26 | description = Building CXX object $out 27 | 28 | 29 | ############################################# 30 | # Rule for linking CXX executable. 31 | 32 | rule CXX_EXECUTABLE_LINKER__testapp_Debug 33 | command = cmd.exe /C "$PRE_LINK && D:\Programs\vs\vside\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe -E vs_link_exe --intdir=$OBJECT_DIR --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100190~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100190~1.0\x64\mt.exe --manifests $MANIFESTS -- D:\Programs\vs\vside\VC\Tools\MSVC\14.28.29910\bin\Hostx64\x64\link.exe /nologo $in /out:$TARGET_FILE /implib:$TARGET_IMPLIB /pdb:$TARGET_PDB /version:0.0 $LINK_FLAGS $LINK_PATH $LINK_LIBRARIES && $POST_BUILD" 34 | description = Linking CXX executable $TARGET_FILE 35 | restat = $RESTAT 36 | 37 | 38 | ############################################# 39 | # Rule for running custom commands. 40 | 41 | rule CUSTOM_COMMAND 42 | command = $COMMAND 43 | description = $DESC 44 | 45 | 46 | ############################################# 47 | # Rule for re-running cmake. 48 | 49 | rule RERUN_CMAKE 50 | command = D:\Programs\vs\vside\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe --regenerate-during-build -SD:\workspace\github_repos\awesome_dcmtk\1-hello_world\hello_dcmtk_cmake -BD:\workspace\github_repos\awesome_dcmtk\1-hello_world\hello_dcmtk_cmake\out\build\x64-Debug 51 | description = Re-running CMake... 52 | generator = 1 53 | 54 | 55 | ############################################# 56 | # Rule for cleaning all built files. 57 | 58 | rule CLEAN 59 | command = d:\programs\vs\vside\common7\ide\commonextensions\microsoft\cmake\Ninja\ninja.exe $FILE_ARG -t clean $TARGETS 60 | description = Cleaning all built files... 61 | 62 | 63 | ############################################# 64 | # Rule for printing all primary targets available. 65 | 66 | rule HELP 67 | command = d:\programs\vs\vside\common7\ide\commonextensions\microsoft\cmake\Ninja\ninja.exe -t targets 68 | description = All primary targets available: 69 | 70 | -------------------------------------------------------------------------------- /实践案例/dcmtk/out/build/x64-Debug/CMakeFiles/testapp.dir/embed.manifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /实践案例/dcmtk/out/build/x64-Debug/CMakeFiles/testapp.dir/intermediate.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /实践案例/dcmtk/out/build/x64-Debug/CMakeFiles/testapp.dir/main.cpp.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SFUMECJF/cmake-examples-Chinese/979abb2fb0b4189f0181e4051d2b269964eb22ba/实践案例/dcmtk/out/build/x64-Debug/CMakeFiles/testapp.dir/main.cpp.obj -------------------------------------------------------------------------------- /实践案例/dcmtk/out/build/x64-Debug/CMakeFiles/testapp.dir/manifest.rc: -------------------------------------------------------------------------------- 1 | #pragma code_page(65001) 2 | 1 /* CREATEPROCESS_MANIFEST_RESOURCE_ID */ 24 /* RT_MANIFEST */ "D:/workspace/github_repos/awesome_dcmtk/1-hello_world/hello_dcmtk_cmake/out/build/x64-Debug/CMakeFiles/testapp.dir/embed.manifest" -------------------------------------------------------------------------------- /实践案例/dcmtk/out/build/x64-Debug/CMakeFiles/testapp.dir/manifest.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SFUMECJF/cmake-examples-Chinese/979abb2fb0b4189f0181e4051d2b269964eb22ba/实践案例/dcmtk/out/build/x64-Debug/CMakeFiles/testapp.dir/manifest.res -------------------------------------------------------------------------------- /实践案例/dcmtk/out/build/x64-Debug/Testing/Temporary/LastTest.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SFUMECJF/cmake-examples-Chinese/979abb2fb0b4189f0181e4051d2b269964eb22ba/实践案例/dcmtk/out/build/x64-Debug/Testing/Temporary/LastTest.log -------------------------------------------------------------------------------- /实践案例/dcmtk/out/build/x64-Debug/VSInheritEnvironments.txt: -------------------------------------------------------------------------------- 1 | msvc_x64_x64 -------------------------------------------------------------------------------- /实践案例/dcmtk/out/build/x64-Debug/cmake_install.cmake: -------------------------------------------------------------------------------- 1 | # Install script for directory: D:/workspace/github_repos/awesome_dcmtk/1-hello_world/hello_dcmtk_cmake 2 | 3 | # Set the install prefix 4 | if(NOT DEFINED CMAKE_INSTALL_PREFIX) 5 | set(CMAKE_INSTALL_PREFIX "D:/workspace/github_repos/awesome_dcmtk/1-hello_world/hello_dcmtk_cmake/out/install/x64-Debug") 6 | endif() 7 | string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") 8 | 9 | # Set the install configuration name. 10 | if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME) 11 | if(BUILD_TYPE) 12 | string(REGEX REPLACE "^[^A-Za-z0-9_]+" "" 13 | CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}") 14 | else() 15 | set(CMAKE_INSTALL_CONFIG_NAME "Debug") 16 | endif() 17 | message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"") 18 | endif() 19 | 20 | # Set the component getting installed. 21 | if(NOT CMAKE_INSTALL_COMPONENT) 22 | if(COMPONENT) 23 | message(STATUS "Install component: \"${COMPONENT}\"") 24 | set(CMAKE_INSTALL_COMPONENT "${COMPONENT}") 25 | else() 26 | set(CMAKE_INSTALL_COMPONENT) 27 | endif() 28 | endif() 29 | 30 | # Is this installation the result of a crosscompile? 31 | if(NOT DEFINED CMAKE_CROSSCOMPILING) 32 | set(CMAKE_CROSSCOMPILING "FALSE") 33 | endif() 34 | 35 | if(CMAKE_INSTALL_COMPONENT) 36 | set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt") 37 | else() 38 | set(CMAKE_INSTALL_MANIFEST "install_manifest.txt") 39 | endif() 40 | 41 | string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT 42 | "${CMAKE_INSTALL_MANIFEST_FILES}") 43 | file(WRITE "D:/workspace/github_repos/awesome_dcmtk/1-hello_world/hello_dcmtk_cmake/out/build/x64-Debug/${CMAKE_INSTALL_MANIFEST}" 44 | "${CMAKE_INSTALL_MANIFEST_CONTENT}") 45 | -------------------------------------------------------------------------------- /实践案例/dcmtk/out/build/x64-Debug/dcmdata.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SFUMECJF/cmake-examples-Chinese/979abb2fb0b4189f0181e4051d2b269964eb22ba/实践案例/dcmtk/out/build/x64-Debug/dcmdata.dll -------------------------------------------------------------------------------- /实践案例/dcmtk/out/build/x64-Debug/image-00000.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SFUMECJF/cmake-examples-Chinese/979abb2fb0b4189f0181e4051d2b269964eb22ba/实践案例/dcmtk/out/build/x64-Debug/image-00000.dcm -------------------------------------------------------------------------------- /实践案例/dcmtk/out/build/x64-Debug/oflog.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SFUMECJF/cmake-examples-Chinese/979abb2fb0b4189f0181e4051d2b269964eb22ba/实践案例/dcmtk/out/build/x64-Debug/oflog.dll -------------------------------------------------------------------------------- /实践案例/dcmtk/out/build/x64-Debug/ofstd.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SFUMECJF/cmake-examples-Chinese/979abb2fb0b4189f0181e4051d2b269964eb22ba/实践案例/dcmtk/out/build/x64-Debug/ofstd.dll -------------------------------------------------------------------------------- /实践案例/dcmtk/out/build/x64-Debug/testapp.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SFUMECJF/cmake-examples-Chinese/979abb2fb0b4189f0181e4051d2b269964eb22ba/实践案例/dcmtk/out/build/x64-Debug/testapp.exe -------------------------------------------------------------------------------- /实践案例/dcmtk/out/build/x64-Debug/testapp.ilk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SFUMECJF/cmake-examples-Chinese/979abb2fb0b4189f0181e4051d2b269964eb22ba/实践案例/dcmtk/out/build/x64-Debug/testapp.ilk -------------------------------------------------------------------------------- /实践案例/dcmtk/out/build/x64-Debug/testapp.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SFUMECJF/cmake-examples-Chinese/979abb2fb0b4189f0181e4051d2b269964eb22ba/实践案例/dcmtk/out/build/x64-Debug/testapp.pdb -------------------------------------------------------------------------------- /实践案例/opencv/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 2.6) 2 | 3 | cmake_policy(SET CMP0012 NEW) 4 | 5 | PROJECT(opencv_demo) 6 | set(CMAKE_MODULE_PATH ) 7 | message("${CMAKE_MODULE_PATH}") 8 | # Requires OpenCV 9 | FIND_PACKAGE( OpenCV REQUIRED ) 10 | MESSAGE("OpenCV version : ${OpenCV_VERSION}") 11 | #SET(OpenCV_INCLUDE_DIRS "D:\\Programs\\opencvsolution\\install\\include\\") 12 | #SET(OpenCV_LIB_DIR "D:\\Programs\\opencvsolution\\install\\x64\\vc16\\lib\\") 13 | 14 | include_directories(${OpenCV_INCLUDE_DIRS}) 15 | link_directories(${OpenCV_LIB_DIR}) 16 | MESSAGE("OpenCV version : ${OpenCV_LIB_DIR}") 17 | MESSAGE("OpenCV version : ${OpenCV_LIBS}") 18 | ADD_EXECUTABLE( opencv_demo ${PROJECT_SOURCE_DIR}/main.cpp ) 19 | #TARGET_LINK_LIBRARIES( opencv_demo ${OpenCV_LIBS} ) 20 | 21 | #TARGET_LINK_LIBRARIES( opencv_demo opencv_world3414.lib opencv_img_hash3414.lib ) -------------------------------------------------------------------------------- /实践案例/opencv/cmake-build-debug/CMakeFiles/3.14.3/CMakeCCompiler.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_C_COMPILER "D:/Programs/mingw/mingw64/mingw64/bin/gcc.exe") 2 | set(CMAKE_C_COMPILER_ARG1 "") 3 | set(CMAKE_C_COMPILER_ID "GNU") 4 | set(CMAKE_C_COMPILER_VERSION "8.1.0") 5 | set(CMAKE_C_COMPILER_VERSION_INTERNAL "") 6 | set(CMAKE_C_COMPILER_WRAPPER "") 7 | set(CMAKE_C_STANDARD_COMPUTED_DEFAULT "11") 8 | set(CMAKE_C_COMPILE_FEATURES "c_std_90;c_function_prototypes;c_std_99;c_restrict;c_variadic_macros;c_std_11;c_static_assert") 9 | set(CMAKE_C90_COMPILE_FEATURES "c_std_90;c_function_prototypes") 10 | set(CMAKE_C99_COMPILE_FEATURES "c_std_99;c_restrict;c_variadic_macros") 11 | set(CMAKE_C11_COMPILE_FEATURES "c_std_11;c_static_assert") 12 | 13 | set(CMAKE_C_PLATFORM_ID "MinGW") 14 | set(CMAKE_C_SIMULATE_ID "") 15 | set(CMAKE_C_SIMULATE_VERSION "") 16 | 17 | 18 | 19 | set(CMAKE_AR "D:/Programs/mingw/mingw64/mingw64/bin/ar.exe") 20 | set(CMAKE_C_COMPILER_AR "D:/Programs/mingw/mingw64/mingw64/bin/gcc-ar.exe") 21 | set(CMAKE_RANLIB "D:/Programs/mingw/mingw64/mingw64/bin/ranlib.exe") 22 | set(CMAKE_C_COMPILER_RANLIB "D:/Programs/mingw/mingw64/mingw64/bin/gcc-ranlib.exe") 23 | set(CMAKE_LINKER "D:/Programs/mingw/mingw64/mingw64/bin/ld.exe") 24 | set(CMAKE_MT "") 25 | set(CMAKE_COMPILER_IS_GNUCC 1) 26 | set(CMAKE_C_COMPILER_LOADED 1) 27 | set(CMAKE_C_COMPILER_WORKS TRUE) 28 | set(CMAKE_C_ABI_COMPILED TRUE) 29 | set(CMAKE_COMPILER_IS_MINGW 1) 30 | set(CMAKE_COMPILER_IS_CYGWIN ) 31 | if(CMAKE_COMPILER_IS_CYGWIN) 32 | set(CYGWIN 1) 33 | set(UNIX 1) 34 | endif() 35 | 36 | set(CMAKE_C_COMPILER_ENV_VAR "CC") 37 | 38 | if(CMAKE_COMPILER_IS_MINGW) 39 | set(MINGW 1) 40 | endif() 41 | set(CMAKE_C_COMPILER_ID_RUN 1) 42 | set(CMAKE_C_SOURCE_FILE_EXTENSIONS c;m) 43 | set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC) 44 | set(CMAKE_C_LINKER_PREFERENCE 10) 45 | 46 | # Save compiler ABI information. 47 | set(CMAKE_C_SIZEOF_DATA_PTR "8") 48 | set(CMAKE_C_COMPILER_ABI "") 49 | set(CMAKE_C_LIBRARY_ARCHITECTURE "") 50 | 51 | if(CMAKE_C_SIZEOF_DATA_PTR) 52 | set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}") 53 | endif() 54 | 55 | if(CMAKE_C_COMPILER_ABI) 56 | set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}") 57 | endif() 58 | 59 | if(CMAKE_C_LIBRARY_ARCHITECTURE) 60 | set(CMAKE_LIBRARY_ARCHITECTURE "") 61 | endif() 62 | 63 | set(CMAKE_C_CL_SHOWINCLUDES_PREFIX "") 64 | if(CMAKE_C_CL_SHOWINCLUDES_PREFIX) 65 | set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_C_CL_SHOWINCLUDES_PREFIX}") 66 | endif() 67 | 68 | 69 | 70 | 71 | 72 | set(CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES "D:/Programs/mingw/mingw64/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include;D:/Programs/mingw/mingw64/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include-fixed;D:/Programs/mingw/mingw64/mingw64/x86_64-w64-mingw32/include") 73 | set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "mingw32;gcc;moldname;mingwex;pthread;advapi32;shell32;user32;kernel32;iconv;mingw32;gcc;moldname;mingwex") 74 | set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "D:/Programs/mingw/mingw64/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0;D:/Programs/mingw/mingw64/mingw64/lib/gcc;D:/Programs/mingw/mingw64/mingw64/x86_64-w64-mingw32/lib;D:/Programs/mingw/mingw64/mingw64/lib") 75 | set(CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "") 76 | -------------------------------------------------------------------------------- /实践案例/opencv/cmake-build-debug/CMakeFiles/3.14.3/CMakeCXXCompiler.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_CXX_COMPILER "D:/Programs/mingw/mingw64/mingw64/bin/g++.exe") 2 | set(CMAKE_CXX_COMPILER_ARG1 "") 3 | set(CMAKE_CXX_COMPILER_ID "GNU") 4 | set(CMAKE_CXX_COMPILER_VERSION "8.1.0") 5 | set(CMAKE_CXX_COMPILER_VERSION_INTERNAL "") 6 | set(CMAKE_CXX_COMPILER_WRAPPER "") 7 | set(CMAKE_CXX_STANDARD_COMPUTED_DEFAULT "14") 8 | set(CMAKE_CXX_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters;cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates;cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates;cxx_std_17;cxx_std_20") 9 | set(CMAKE_CXX98_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters") 10 | set(CMAKE_CXX11_COMPILE_FEATURES "cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates") 11 | set(CMAKE_CXX14_COMPILE_FEATURES "cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates") 12 | set(CMAKE_CXX17_COMPILE_FEATURES "cxx_std_17") 13 | set(CMAKE_CXX20_COMPILE_FEATURES "cxx_std_20") 14 | 15 | set(CMAKE_CXX_PLATFORM_ID "MinGW") 16 | set(CMAKE_CXX_SIMULATE_ID "") 17 | set(CMAKE_CXX_SIMULATE_VERSION "") 18 | 19 | 20 | 21 | set(CMAKE_AR "D:/Programs/mingw/mingw64/mingw64/bin/ar.exe") 22 | set(CMAKE_CXX_COMPILER_AR "D:/Programs/mingw/mingw64/mingw64/bin/gcc-ar.exe") 23 | set(CMAKE_RANLIB "D:/Programs/mingw/mingw64/mingw64/bin/ranlib.exe") 24 | set(CMAKE_CXX_COMPILER_RANLIB "D:/Programs/mingw/mingw64/mingw64/bin/gcc-ranlib.exe") 25 | set(CMAKE_LINKER "D:/Programs/mingw/mingw64/mingw64/bin/ld.exe") 26 | set(CMAKE_MT "") 27 | set(CMAKE_COMPILER_IS_GNUCXX 1) 28 | set(CMAKE_CXX_COMPILER_LOADED 1) 29 | set(CMAKE_CXX_COMPILER_WORKS TRUE) 30 | set(CMAKE_CXX_ABI_COMPILED TRUE) 31 | set(CMAKE_COMPILER_IS_MINGW 1) 32 | set(CMAKE_COMPILER_IS_CYGWIN ) 33 | if(CMAKE_COMPILER_IS_CYGWIN) 34 | set(CYGWIN 1) 35 | set(UNIX 1) 36 | endif() 37 | 38 | set(CMAKE_CXX_COMPILER_ENV_VAR "CXX") 39 | 40 | if(CMAKE_COMPILER_IS_MINGW) 41 | set(MINGW 1) 42 | endif() 43 | set(CMAKE_CXX_COMPILER_ID_RUN 1) 44 | set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC) 45 | set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;mm;CPP) 46 | set(CMAKE_CXX_LINKER_PREFERENCE 30) 47 | set(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1) 48 | 49 | # Save compiler ABI information. 50 | set(CMAKE_CXX_SIZEOF_DATA_PTR "8") 51 | set(CMAKE_CXX_COMPILER_ABI "") 52 | set(CMAKE_CXX_LIBRARY_ARCHITECTURE "") 53 | 54 | if(CMAKE_CXX_SIZEOF_DATA_PTR) 55 | set(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}") 56 | endif() 57 | 58 | if(CMAKE_CXX_COMPILER_ABI) 59 | set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}") 60 | endif() 61 | 62 | if(CMAKE_CXX_LIBRARY_ARCHITECTURE) 63 | set(CMAKE_LIBRARY_ARCHITECTURE "") 64 | endif() 65 | 66 | set(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX "") 67 | if(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX) 68 | set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_CXX_CL_SHOWINCLUDES_PREFIX}") 69 | endif() 70 | 71 | 72 | 73 | 74 | 75 | set(CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES "D:/Programs/mingw/mingw64/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++;D:/Programs/mingw/mingw64/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/x86_64-w64-mingw32;D:/Programs/mingw/mingw64/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/backward;D:/Programs/mingw/mingw64/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include;D:/Programs/mingw/mingw64/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include-fixed;D:/Programs/mingw/mingw64/mingw64/x86_64-w64-mingw32/include") 76 | set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "stdc++;mingw32;gcc_s;gcc;moldname;mingwex;pthread;advapi32;shell32;user32;kernel32;iconv;mingw32;gcc_s;gcc;moldname;mingwex") 77 | set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "D:/Programs/mingw/mingw64/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0;D:/Programs/mingw/mingw64/mingw64/lib/gcc;D:/Programs/mingw/mingw64/mingw64/x86_64-w64-mingw32/lib;D:/Programs/mingw/mingw64/mingw64/lib") 78 | set(CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "") 79 | -------------------------------------------------------------------------------- /实践案例/opencv/cmake-build-debug/CMakeFiles/3.14.3/CMakeDetermineCompilerABI_C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SFUMECJF/cmake-examples-Chinese/979abb2fb0b4189f0181e4051d2b269964eb22ba/实践案例/opencv/cmake-build-debug/CMakeFiles/3.14.3/CMakeDetermineCompilerABI_C.bin -------------------------------------------------------------------------------- /实践案例/opencv/cmake-build-debug/CMakeFiles/3.14.3/CMakeDetermineCompilerABI_CXX.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SFUMECJF/cmake-examples-Chinese/979abb2fb0b4189f0181e4051d2b269964eb22ba/实践案例/opencv/cmake-build-debug/CMakeFiles/3.14.3/CMakeDetermineCompilerABI_CXX.bin -------------------------------------------------------------------------------- /实践案例/opencv/cmake-build-debug/CMakeFiles/3.14.3/CMakeRCCompiler.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_RC_COMPILER "D:/Programs/mingw/mingw64/mingw64/bin/windres.exe") 2 | set(CMAKE_RC_COMPILER_ARG1 "") 3 | set(CMAKE_RC_COMPILER_LOADED 1) 4 | set(CMAKE_RC_SOURCE_FILE_EXTENSIONS rc;RC) 5 | set(CMAKE_RC_OUTPUT_EXTENSION .obj) 6 | set(CMAKE_RC_COMPILER_ENV_VAR "RC") 7 | -------------------------------------------------------------------------------- /实践案例/opencv/cmake-build-debug/CMakeFiles/3.14.3/CMakeSystem.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_HOST_SYSTEM "Windows-10.0.19041") 2 | set(CMAKE_HOST_SYSTEM_NAME "Windows") 3 | set(CMAKE_HOST_SYSTEM_VERSION "10.0.19041") 4 | set(CMAKE_HOST_SYSTEM_PROCESSOR "AMD64") 5 | 6 | 7 | 8 | set(CMAKE_SYSTEM "Windows-10.0.19041") 9 | set(CMAKE_SYSTEM_NAME "Windows") 10 | set(CMAKE_SYSTEM_VERSION "10.0.19041") 11 | set(CMAKE_SYSTEM_PROCESSOR "AMD64") 12 | 13 | set(CMAKE_CROSSCOMPILING "FALSE") 14 | 15 | set(CMAKE_SYSTEM_LOADED 1) 16 | -------------------------------------------------------------------------------- /实践案例/opencv/cmake-build-debug/CMakeFiles/3.14.3/CompilerIdC/a.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SFUMECJF/cmake-examples-Chinese/979abb2fb0b4189f0181e4051d2b269964eb22ba/实践案例/opencv/cmake-build-debug/CMakeFiles/3.14.3/CompilerIdC/a.exe -------------------------------------------------------------------------------- /实践案例/opencv/cmake-build-debug/CMakeFiles/3.14.3/CompilerIdCXX/a.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SFUMECJF/cmake-examples-Chinese/979abb2fb0b4189f0181e4051d2b269964eb22ba/实践案例/opencv/cmake-build-debug/CMakeFiles/3.14.3/CompilerIdCXX/a.exe -------------------------------------------------------------------------------- /实践案例/opencv/cmake-build-debug/CMakeFiles/3.17.5/CMakeCCompiler.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_C_COMPILER "D:/Programs/mingw/mingw64/mingw64/bin/gcc.exe") 2 | set(CMAKE_C_COMPILER_ARG1 "") 3 | set(CMAKE_C_COMPILER_ID "GNU") 4 | set(CMAKE_C_COMPILER_VERSION "8.1.0") 5 | set(CMAKE_C_COMPILER_VERSION_INTERNAL "") 6 | set(CMAKE_C_COMPILER_WRAPPER "") 7 | set(CMAKE_C_STANDARD_COMPUTED_DEFAULT "11") 8 | set(CMAKE_C_COMPILE_FEATURES "c_std_90;c_function_prototypes;c_std_99;c_restrict;c_variadic_macros;c_std_11;c_static_assert") 9 | set(CMAKE_C90_COMPILE_FEATURES "c_std_90;c_function_prototypes") 10 | set(CMAKE_C99_COMPILE_FEATURES "c_std_99;c_restrict;c_variadic_macros") 11 | set(CMAKE_C11_COMPILE_FEATURES "c_std_11;c_static_assert") 12 | 13 | set(CMAKE_C_PLATFORM_ID "MinGW") 14 | set(CMAKE_C_SIMULATE_ID "") 15 | set(CMAKE_C_COMPILER_FRONTEND_VARIANT "") 16 | set(CMAKE_C_SIMULATE_VERSION "") 17 | 18 | 19 | 20 | set(CMAKE_AR "D:/Programs/mingw/mingw64/mingw64/bin/ar.exe") 21 | set(CMAKE_C_COMPILER_AR "D:/Programs/mingw/mingw64/mingw64/bin/gcc-ar.exe") 22 | set(CMAKE_RANLIB "D:/Programs/mingw/mingw64/mingw64/bin/ranlib.exe") 23 | set(CMAKE_C_COMPILER_RANLIB "D:/Programs/mingw/mingw64/mingw64/bin/gcc-ranlib.exe") 24 | set(CMAKE_LINKER "D:/Programs/mingw/mingw64/mingw64/bin/ld.exe") 25 | set(CMAKE_MT "") 26 | set(CMAKE_COMPILER_IS_GNUCC 1) 27 | set(CMAKE_C_COMPILER_LOADED 1) 28 | set(CMAKE_C_COMPILER_WORKS TRUE) 29 | set(CMAKE_C_ABI_COMPILED TRUE) 30 | set(CMAKE_COMPILER_IS_MINGW 1) 31 | set(CMAKE_COMPILER_IS_CYGWIN ) 32 | if(CMAKE_COMPILER_IS_CYGWIN) 33 | set(CYGWIN 1) 34 | set(UNIX 1) 35 | endif() 36 | 37 | set(CMAKE_C_COMPILER_ENV_VAR "CC") 38 | 39 | if(CMAKE_COMPILER_IS_MINGW) 40 | set(MINGW 1) 41 | endif() 42 | set(CMAKE_C_COMPILER_ID_RUN 1) 43 | set(CMAKE_C_SOURCE_FILE_EXTENSIONS c;m) 44 | set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC) 45 | set(CMAKE_C_LINKER_PREFERENCE 10) 46 | 47 | # Save compiler ABI information. 48 | set(CMAKE_C_SIZEOF_DATA_PTR "8") 49 | set(CMAKE_C_COMPILER_ABI "") 50 | set(CMAKE_C_LIBRARY_ARCHITECTURE "") 51 | 52 | if(CMAKE_C_SIZEOF_DATA_PTR) 53 | set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}") 54 | endif() 55 | 56 | if(CMAKE_C_COMPILER_ABI) 57 | set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}") 58 | endif() 59 | 60 | if(CMAKE_C_LIBRARY_ARCHITECTURE) 61 | set(CMAKE_LIBRARY_ARCHITECTURE "") 62 | endif() 63 | 64 | set(CMAKE_C_CL_SHOWINCLUDES_PREFIX "") 65 | if(CMAKE_C_CL_SHOWINCLUDES_PREFIX) 66 | set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_C_CL_SHOWINCLUDES_PREFIX}") 67 | endif() 68 | 69 | 70 | 71 | 72 | 73 | set(CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES "D:/Programs/mingw/mingw64/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include;D:/Programs/mingw/mingw64/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include-fixed;D:/Programs/mingw/mingw64/mingw64/x86_64-w64-mingw32/include") 74 | set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "mingw32;gcc;moldname;mingwex;pthread;advapi32;shell32;user32;kernel32;iconv;mingw32;gcc;moldname;mingwex") 75 | set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "D:/Programs/mingw/mingw64/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0;D:/Programs/mingw/mingw64/mingw64/lib/gcc;D:/Programs/mingw/mingw64/mingw64/x86_64-w64-mingw32/lib;D:/Programs/mingw/mingw64/mingw64/lib") 76 | set(CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "") 77 | -------------------------------------------------------------------------------- /实践案例/opencv/cmake-build-debug/CMakeFiles/3.17.5/CMakeCXXCompiler.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_CXX_COMPILER "D:/Programs/mingw/mingw64/mingw64/bin/g++.exe") 2 | set(CMAKE_CXX_COMPILER_ARG1 "") 3 | set(CMAKE_CXX_COMPILER_ID "GNU") 4 | set(CMAKE_CXX_COMPILER_VERSION "8.1.0") 5 | set(CMAKE_CXX_COMPILER_VERSION_INTERNAL "") 6 | set(CMAKE_CXX_COMPILER_WRAPPER "") 7 | set(CMAKE_CXX_STANDARD_COMPUTED_DEFAULT "14") 8 | set(CMAKE_CXX_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters;cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates;cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates;cxx_std_17;cxx_std_20") 9 | set(CMAKE_CXX98_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters") 10 | set(CMAKE_CXX11_COMPILE_FEATURES "cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates") 11 | set(CMAKE_CXX14_COMPILE_FEATURES "cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates") 12 | set(CMAKE_CXX17_COMPILE_FEATURES "cxx_std_17") 13 | set(CMAKE_CXX20_COMPILE_FEATURES "cxx_std_20") 14 | 15 | set(CMAKE_CXX_PLATFORM_ID "MinGW") 16 | set(CMAKE_CXX_SIMULATE_ID "") 17 | set(CMAKE_CXX_COMPILER_FRONTEND_VARIANT "") 18 | set(CMAKE_CXX_SIMULATE_VERSION "") 19 | 20 | 21 | 22 | set(CMAKE_AR "D:/Programs/mingw/mingw64/mingw64/bin/ar.exe") 23 | set(CMAKE_CXX_COMPILER_AR "D:/Programs/mingw/mingw64/mingw64/bin/gcc-ar.exe") 24 | set(CMAKE_RANLIB "D:/Programs/mingw/mingw64/mingw64/bin/ranlib.exe") 25 | set(CMAKE_CXX_COMPILER_RANLIB "D:/Programs/mingw/mingw64/mingw64/bin/gcc-ranlib.exe") 26 | set(CMAKE_LINKER "D:/Programs/mingw/mingw64/mingw64/bin/ld.exe") 27 | set(CMAKE_MT "") 28 | set(CMAKE_COMPILER_IS_GNUCXX 1) 29 | set(CMAKE_CXX_COMPILER_LOADED 1) 30 | set(CMAKE_CXX_COMPILER_WORKS TRUE) 31 | set(CMAKE_CXX_ABI_COMPILED TRUE) 32 | set(CMAKE_COMPILER_IS_MINGW 1) 33 | set(CMAKE_COMPILER_IS_CYGWIN ) 34 | if(CMAKE_COMPILER_IS_CYGWIN) 35 | set(CYGWIN 1) 36 | set(UNIX 1) 37 | endif() 38 | 39 | set(CMAKE_CXX_COMPILER_ENV_VAR "CXX") 40 | 41 | if(CMAKE_COMPILER_IS_MINGW) 42 | set(MINGW 1) 43 | endif() 44 | set(CMAKE_CXX_COMPILER_ID_RUN 1) 45 | set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;CPP) 46 | set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC) 47 | 48 | foreach (lang C OBJC OBJCXX) 49 | if (CMAKE_${lang}_COMPILER_ID_RUN) 50 | foreach(extension IN LISTS CMAKE_${lang}_SOURCE_FILE_EXTENSIONS) 51 | list(REMOVE_ITEM CMAKE_CXX_SOURCE_FILE_EXTENSIONS ${extension}) 52 | endforeach() 53 | endif() 54 | endforeach() 55 | 56 | set(CMAKE_CXX_LINKER_PREFERENCE 30) 57 | set(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1) 58 | 59 | # Save compiler ABI information. 60 | set(CMAKE_CXX_SIZEOF_DATA_PTR "8") 61 | set(CMAKE_CXX_COMPILER_ABI "") 62 | set(CMAKE_CXX_LIBRARY_ARCHITECTURE "") 63 | 64 | if(CMAKE_CXX_SIZEOF_DATA_PTR) 65 | set(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}") 66 | endif() 67 | 68 | if(CMAKE_CXX_COMPILER_ABI) 69 | set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}") 70 | endif() 71 | 72 | if(CMAKE_CXX_LIBRARY_ARCHITECTURE) 73 | set(CMAKE_LIBRARY_ARCHITECTURE "") 74 | endif() 75 | 76 | set(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX "") 77 | if(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX) 78 | set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_CXX_CL_SHOWINCLUDES_PREFIX}") 79 | endif() 80 | 81 | 82 | 83 | 84 | 85 | set(CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES "D:/Programs/mingw/mingw64/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++;D:/Programs/mingw/mingw64/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/x86_64-w64-mingw32;D:/Programs/mingw/mingw64/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/backward;D:/Programs/mingw/mingw64/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include;D:/Programs/mingw/mingw64/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include-fixed;D:/Programs/mingw/mingw64/mingw64/x86_64-w64-mingw32/include") 86 | set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "stdc++;mingw32;gcc_s;gcc;moldname;mingwex;pthread;advapi32;shell32;user32;kernel32;iconv;mingw32;gcc_s;gcc;moldname;mingwex") 87 | set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "D:/Programs/mingw/mingw64/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0;D:/Programs/mingw/mingw64/mingw64/lib/gcc;D:/Programs/mingw/mingw64/mingw64/x86_64-w64-mingw32/lib;D:/Programs/mingw/mingw64/mingw64/lib") 88 | set(CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "") 89 | -------------------------------------------------------------------------------- /实践案例/opencv/cmake-build-debug/CMakeFiles/3.17.5/CMakeDetermineCompilerABI_C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SFUMECJF/cmake-examples-Chinese/979abb2fb0b4189f0181e4051d2b269964eb22ba/实践案例/opencv/cmake-build-debug/CMakeFiles/3.17.5/CMakeDetermineCompilerABI_C.bin -------------------------------------------------------------------------------- /实践案例/opencv/cmake-build-debug/CMakeFiles/3.17.5/CMakeDetermineCompilerABI_CXX.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SFUMECJF/cmake-examples-Chinese/979abb2fb0b4189f0181e4051d2b269964eb22ba/实践案例/opencv/cmake-build-debug/CMakeFiles/3.17.5/CMakeDetermineCompilerABI_CXX.bin -------------------------------------------------------------------------------- /实践案例/opencv/cmake-build-debug/CMakeFiles/3.17.5/CMakeRCCompiler.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_RC_COMPILER "D:/Programs/mingw/mingw64/mingw64/bin/windres.exe") 2 | set(CMAKE_RC_COMPILER_ARG1 "") 3 | set(CMAKE_RC_COMPILER_LOADED 1) 4 | set(CMAKE_RC_SOURCE_FILE_EXTENSIONS rc;RC) 5 | set(CMAKE_RC_OUTPUT_EXTENSION .obj) 6 | set(CMAKE_RC_COMPILER_ENV_VAR "RC") 7 | -------------------------------------------------------------------------------- /实践案例/opencv/cmake-build-debug/CMakeFiles/3.17.5/CMakeSystem.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_HOST_SYSTEM "Windows-10.0.19041") 2 | set(CMAKE_HOST_SYSTEM_NAME "Windows") 3 | set(CMAKE_HOST_SYSTEM_VERSION "10.0.19041") 4 | set(CMAKE_HOST_SYSTEM_PROCESSOR "AMD64") 5 | 6 | 7 | 8 | set(CMAKE_SYSTEM "Windows-10.0.19041") 9 | set(CMAKE_SYSTEM_NAME "Windows") 10 | set(CMAKE_SYSTEM_VERSION "10.0.19041") 11 | set(CMAKE_SYSTEM_PROCESSOR "AMD64") 12 | 13 | set(CMAKE_CROSSCOMPILING "FALSE") 14 | 15 | set(CMAKE_SYSTEM_LOADED 1) 16 | -------------------------------------------------------------------------------- /实践案例/opencv/cmake-build-debug/CMakeFiles/3.17.5/CompilerIdC/a.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SFUMECJF/cmake-examples-Chinese/979abb2fb0b4189f0181e4051d2b269964eb22ba/实践案例/opencv/cmake-build-debug/CMakeFiles/3.17.5/CompilerIdC/a.exe -------------------------------------------------------------------------------- /实践案例/opencv/cmake-build-debug/CMakeFiles/3.17.5/CompilerIdCXX/a.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SFUMECJF/cmake-examples-Chinese/979abb2fb0b4189f0181e4051d2b269964eb22ba/实践案例/opencv/cmake-build-debug/CMakeFiles/3.17.5/CompilerIdCXX/a.exe -------------------------------------------------------------------------------- /实践案例/opencv/cmake-build-debug/CMakeFiles/CMakeDirectoryInformation.cmake: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "MinGW Makefiles" Generator, CMake Version 3.17 3 | 4 | # Relative path conversion top directories. 5 | set(CMAKE_RELATIVE_PATH_TOP_SOURCE "D:/workspace/github_repos/cmake-examples-Chinese/practice/opencv_demo") 6 | set(CMAKE_RELATIVE_PATH_TOP_BINARY "D:/workspace/github_repos/cmake-examples-Chinese/practice/opencv_demo/cmake-build-debug") 7 | 8 | # Force unix paths in dependencies. 9 | set(CMAKE_FORCE_UNIX_PATHS 1) 10 | 11 | 12 | # The C and CXX include file regular expressions for this directory. 13 | set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$") 14 | set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$") 15 | set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN}) 16 | set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN}) 17 | -------------------------------------------------------------------------------- /实践案例/opencv/cmake-build-debug/CMakeFiles/Makefile.cmake: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "MinGW Makefiles" Generator, CMake Version 3.17 3 | 4 | # The generator used is: 5 | set(CMAKE_DEPENDS_GENERATOR "MinGW Makefiles") 6 | 7 | # The top level Makefile was generated from the following files: 8 | set(CMAKE_MAKEFILE_DEPENDS 9 | "CMakeCache.txt" 10 | "D:/Program Files/clion/CLion 2020.3.3/bin/cmake/win/share/cmake-3.17/Modules/CMakeCInformation.cmake" 11 | "D:/Program Files/clion/CLion 2020.3.3/bin/cmake/win/share/cmake-3.17/Modules/CMakeCXXInformation.cmake" 12 | "D:/Program Files/clion/CLion 2020.3.3/bin/cmake/win/share/cmake-3.17/Modules/CMakeCheckCompilerFlagCommonPatterns.cmake" 13 | "D:/Program Files/clion/CLion 2020.3.3/bin/cmake/win/share/cmake-3.17/Modules/CMakeCommonLanguageInclude.cmake" 14 | "D:/Program Files/clion/CLion 2020.3.3/bin/cmake/win/share/cmake-3.17/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake" 15 | "D:/Program Files/clion/CLion 2020.3.3/bin/cmake/win/share/cmake-3.17/Modules/CMakeFindCodeBlocks.cmake" 16 | "D:/Program Files/clion/CLion 2020.3.3/bin/cmake/win/share/cmake-3.17/Modules/CMakeGenericSystem.cmake" 17 | "D:/Program Files/clion/CLion 2020.3.3/bin/cmake/win/share/cmake-3.17/Modules/CMakeInitializeConfigs.cmake" 18 | "D:/Program Files/clion/CLion 2020.3.3/bin/cmake/win/share/cmake-3.17/Modules/CMakeLanguageInformation.cmake" 19 | "D:/Program Files/clion/CLion 2020.3.3/bin/cmake/win/share/cmake-3.17/Modules/CMakeRCInformation.cmake" 20 | "D:/Program Files/clion/CLion 2020.3.3/bin/cmake/win/share/cmake-3.17/Modules/CMakeSystemSpecificInformation.cmake" 21 | "D:/Program Files/clion/CLion 2020.3.3/bin/cmake/win/share/cmake-3.17/Modules/CMakeSystemSpecificInitialize.cmake" 22 | "D:/Program Files/clion/CLion 2020.3.3/bin/cmake/win/share/cmake-3.17/Modules/Compiler/CMakeCommonCompilerMacros.cmake" 23 | "D:/Program Files/clion/CLion 2020.3.3/bin/cmake/win/share/cmake-3.17/Modules/Compiler/GNU-C.cmake" 24 | "D:/Program Files/clion/CLion 2020.3.3/bin/cmake/win/share/cmake-3.17/Modules/Compiler/GNU-CXX.cmake" 25 | "D:/Program Files/clion/CLion 2020.3.3/bin/cmake/win/share/cmake-3.17/Modules/Compiler/GNU.cmake" 26 | "D:/Program Files/clion/CLion 2020.3.3/bin/cmake/win/share/cmake-3.17/Modules/Internal/CMakeCheckCompilerFlag.cmake" 27 | "D:/Program Files/clion/CLion 2020.3.3/bin/cmake/win/share/cmake-3.17/Modules/Platform/Windows-GNU-C-ABI.cmake" 28 | "D:/Program Files/clion/CLion 2020.3.3/bin/cmake/win/share/cmake-3.17/Modules/Platform/Windows-GNU-C.cmake" 29 | "D:/Program Files/clion/CLion 2020.3.3/bin/cmake/win/share/cmake-3.17/Modules/Platform/Windows-GNU-CXX-ABI.cmake" 30 | "D:/Program Files/clion/CLion 2020.3.3/bin/cmake/win/share/cmake-3.17/Modules/Platform/Windows-GNU-CXX.cmake" 31 | "D:/Program Files/clion/CLion 2020.3.3/bin/cmake/win/share/cmake-3.17/Modules/Platform/Windows-GNU.cmake" 32 | "D:/Program Files/clion/CLion 2020.3.3/bin/cmake/win/share/cmake-3.17/Modules/Platform/Windows-windres.cmake" 33 | "D:/Program Files/clion/CLion 2020.3.3/bin/cmake/win/share/cmake-3.17/Modules/Platform/Windows.cmake" 34 | "D:/Program Files/clion/CLion 2020.3.3/bin/cmake/win/share/cmake-3.17/Modules/Platform/WindowsPaths.cmake" 35 | "D:/Program Files/clion/CLion 2020.3.3/bin/cmake/win/share/cmake-3.17/Modules/ProcessorCount.cmake" 36 | "../CMakeLists.txt" 37 | "CMakeFiles/3.17.5/CMakeCCompiler.cmake" 38 | "CMakeFiles/3.17.5/CMakeCXXCompiler.cmake" 39 | "CMakeFiles/3.17.5/CMakeRCCompiler.cmake" 40 | "CMakeFiles/3.17.5/CMakeSystem.cmake" 41 | ) 42 | 43 | # The corresponding makefile is: 44 | set(CMAKE_MAKEFILE_OUTPUTS 45 | "Makefile" 46 | "CMakeFiles/cmake.check_cache" 47 | ) 48 | 49 | # Byproducts of CMake generate step: 50 | set(CMAKE_MAKEFILE_PRODUCTS 51 | "CMakeFiles/CMakeDirectoryInformation.cmake" 52 | ) 53 | 54 | # Dependency information for all targets: 55 | set(CMAKE_DEPEND_INFO_FILES 56 | "CMakeFiles/opencv_demo.dir/DependInfo.cmake" 57 | ) 58 | -------------------------------------------------------------------------------- /实践案例/opencv/cmake-build-debug/CMakeFiles/Makefile2: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "MinGW Makefiles" Generator, CMake Version 3.17 3 | 4 | # Default target executed when no arguments are given to make. 5 | default_target: all 6 | 7 | .PHONY : default_target 8 | 9 | #============================================================================= 10 | # Special targets provided by cmake. 11 | 12 | # Disable implicit rules so canonical targets will work. 13 | .SUFFIXES: 14 | 15 | 16 | # Disable VCS-based implicit rules. 17 | % : %,v 18 | 19 | 20 | # Disable VCS-based implicit rules. 21 | % : RCS/% 22 | 23 | 24 | # Disable VCS-based implicit rules. 25 | % : RCS/%,v 26 | 27 | 28 | # Disable VCS-based implicit rules. 29 | % : SCCS/s.% 30 | 31 | 32 | # Disable VCS-based implicit rules. 33 | % : s.% 34 | 35 | 36 | .SUFFIXES: .hpux_make_needs_suffix_list 37 | 38 | 39 | # Command-line flag to silence nested $(MAKE). 40 | $(VERBOSE)MAKESILENT = -s 41 | 42 | # Suppress display of executed commands. 43 | $(VERBOSE).SILENT: 44 | 45 | 46 | # A target that is always out of date. 47 | cmake_force: 48 | 49 | .PHONY : cmake_force 50 | 51 | #============================================================================= 52 | # Set environment variables for the build. 53 | 54 | SHELL = cmd.exe 55 | 56 | # The CMake executable. 57 | CMAKE_COMMAND = "D:\Program Files\clion\CLion 2020.3.3\bin\cmake\win\bin\cmake.exe" 58 | 59 | # The command to remove a file. 60 | RM = "D:\Program Files\clion\CLion 2020.3.3\bin\cmake\win\bin\cmake.exe" -E rm -f 61 | 62 | # Escaping for special characters. 63 | EQUALS = = 64 | 65 | # The top-level source directory on which CMake was run. 66 | CMAKE_SOURCE_DIR = D:\workspace\github_repos\cmake-examples-Chinese\practice\opencv_demo 67 | 68 | # The top-level build directory on which CMake was run. 69 | CMAKE_BINARY_DIR = D:\workspace\github_repos\cmake-examples-Chinese\practice\opencv_demo\cmake-build-debug 70 | 71 | #============================================================================= 72 | # Directory level rules for the build root directory 73 | 74 | # The main recursive "all" target. 75 | all: CMakeFiles/opencv_demo.dir/all 76 | 77 | .PHONY : all 78 | 79 | # The main recursive "preinstall" target. 80 | preinstall: 81 | 82 | .PHONY : preinstall 83 | 84 | # The main recursive "clean" target. 85 | clean: CMakeFiles/opencv_demo.dir/clean 86 | 87 | .PHONY : clean 88 | 89 | #============================================================================= 90 | # Target rules for target CMakeFiles/opencv_demo.dir 91 | 92 | # All Build rule for target. 93 | CMakeFiles/opencv_demo.dir/all: 94 | $(MAKE) $(MAKESILENT) -f CMakeFiles\opencv_demo.dir\build.make CMakeFiles/opencv_demo.dir/depend 95 | $(MAKE) $(MAKESILENT) -f CMakeFiles\opencv_demo.dir\build.make CMakeFiles/opencv_demo.dir/build 96 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --progress-dir=D:\workspace\github_repos\cmake-examples-Chinese\practice\opencv_demo\cmake-build-debug\CMakeFiles --progress-num=1,2 "Built target opencv_demo" 97 | .PHONY : CMakeFiles/opencv_demo.dir/all 98 | 99 | # Build rule for subdir invocation for target. 100 | CMakeFiles/opencv_demo.dir/rule: cmake_check_build_system 101 | $(CMAKE_COMMAND) -E cmake_progress_start D:\workspace\github_repos\cmake-examples-Chinese\practice\opencv_demo\cmake-build-debug\CMakeFiles 2 102 | $(MAKE) $(MAKESILENT) -f CMakeFiles\Makefile2 CMakeFiles/opencv_demo.dir/all 103 | $(CMAKE_COMMAND) -E cmake_progress_start D:\workspace\github_repos\cmake-examples-Chinese\practice\opencv_demo\cmake-build-debug\CMakeFiles 0 104 | .PHONY : CMakeFiles/opencv_demo.dir/rule 105 | 106 | # Convenience name for target. 107 | opencv_demo: CMakeFiles/opencv_demo.dir/rule 108 | 109 | .PHONY : opencv_demo 110 | 111 | # clean rule for target. 112 | CMakeFiles/opencv_demo.dir/clean: 113 | $(MAKE) $(MAKESILENT) -f CMakeFiles\opencv_demo.dir\build.make CMakeFiles/opencv_demo.dir/clean 114 | .PHONY : CMakeFiles/opencv_demo.dir/clean 115 | 116 | #============================================================================= 117 | # Special targets to cleanup operation of make. 118 | 119 | # Special rule to run CMake to check the build system integrity. 120 | # No rule that depends on this can have commands that come from listfiles 121 | # because they might be regenerated. 122 | cmake_check_build_system: 123 | $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles\Makefile.cmake 0 124 | .PHONY : cmake_check_build_system 125 | 126 | -------------------------------------------------------------------------------- /实践案例/opencv/cmake-build-debug/CMakeFiles/Progress/1: -------------------------------------------------------------------------------- 1 | empty -------------------------------------------------------------------------------- /实践案例/opencv/cmake-build-debug/CMakeFiles/Progress/2: -------------------------------------------------------------------------------- 1 | empty -------------------------------------------------------------------------------- /实践案例/opencv/cmake-build-debug/CMakeFiles/Progress/count.txt: -------------------------------------------------------------------------------- 1 | 2 2 | -------------------------------------------------------------------------------- /实践案例/opencv/cmake-build-debug/CMakeFiles/TargetDirectories.txt: -------------------------------------------------------------------------------- 1 | D:/workspace/github_repos/cmake-examples-Chinese/practice/opencv_demo/cmake-build-debug/CMakeFiles/opencv_demo.dir 2 | D:/workspace/github_repos/cmake-examples-Chinese/practice/opencv_demo/cmake-build-debug/CMakeFiles/edit_cache.dir 3 | D:/workspace/github_repos/cmake-examples-Chinese/practice/opencv_demo/cmake-build-debug/CMakeFiles/rebuild_cache.dir 4 | -------------------------------------------------------------------------------- /实践案例/opencv/cmake-build-debug/CMakeFiles/clion-environment.txt: -------------------------------------------------------------------------------- 1 | ToolSet: w64 6.0 (local)@D:\Programs\mingw\mingw64\mingw64 2 | Options: 3 | 4 | Options: -------------------------------------------------------------------------------- /实践案例/opencv/cmake-build-debug/CMakeFiles/clion-log.txt: -------------------------------------------------------------------------------- 1 | "D:\Program Files\clion\CLion 2020.3.3\bin\cmake\win\bin\cmake.exe" -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - MinGW Makefiles" D:\workspace\github_repos\cmake-examples-Chinese\practice\opencv_demo 2 | 3 | CMake Error at CMakeLists.txt:8 (FIND_PACKAGE): 4 | By not providing "FindOpenCV.cmake" in CMAKE_MODULE_PATH this project has 5 | asked CMake to find a package configuration file provided by "OpenCV", but 6 | CMake did not find one. 7 | 8 | Could not find a package configuration file provided by "OpenCV" with any 9 | of the following names: 10 | 11 | OpenCVConfig.cmake 12 | opencv-config.cmake 13 | 14 | Add the installation prefix of "OpenCV" to CMAKE_PREFIX_PATH or set 15 | "OpenCV_DIR" to a directory containing one of the above files. If "OpenCV" 16 | provides a separate development package or SDK, be sure it has been 17 | installed. 18 | 19 | 20 | -- Configuring incomplete, errors occurred! 21 | See also "D:/workspace/github_repos/cmake-examples-Chinese/practice/opencv_demo/cmake-build-debug/CMakeFiles/CMakeOutput.log". 22 | -------------------------------------------------------------------------------- /实践案例/opencv/cmake-build-debug/CMakeFiles/cmake.check_cache: -------------------------------------------------------------------------------- 1 | # This file is generated by cmake for dependency checking of the CMakeCache.txt file 2 | -------------------------------------------------------------------------------- /实践案例/opencv/cmake-build-debug/CMakeFiles/feature_tests.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SFUMECJF/cmake-examples-Chinese/979abb2fb0b4189f0181e4051d2b269964eb22ba/实践案例/opencv/cmake-build-debug/CMakeFiles/feature_tests.bin -------------------------------------------------------------------------------- /实践案例/opencv/cmake-build-debug/CMakeFiles/feature_tests.c: -------------------------------------------------------------------------------- 1 | 2 | const char features[] = {"\n" 3 | "C_FEATURE:" 4 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 304 5 | "1" 6 | #else 7 | "0" 8 | #endif 9 | "c_function_prototypes\n" 10 | "C_FEATURE:" 11 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 304 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 12 | "1" 13 | #else 14 | "0" 15 | #endif 16 | "c_restrict\n" 17 | "C_FEATURE:" 18 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201000L 19 | "1" 20 | #else 21 | "0" 22 | #endif 23 | "c_static_assert\n" 24 | "C_FEATURE:" 25 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 304 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 26 | "1" 27 | #else 28 | "0" 29 | #endif 30 | "c_variadic_macros\n" 31 | 32 | }; 33 | 34 | int main(int argc, char** argv) { (void)argv; return features[argc]; } 35 | -------------------------------------------------------------------------------- /实践案例/opencv/cmake-build-debug/CMakeFiles/opencv_demo.dir/DependInfo.cmake: -------------------------------------------------------------------------------- 1 | # The set of languages for which implicit dependencies are needed: 2 | set(CMAKE_DEPENDS_LANGUAGES 3 | "CXX" 4 | ) 5 | # The set of files for implicit dependencies of each language: 6 | set(CMAKE_DEPENDS_CHECK_CXX 7 | "D:/workspace/github_repos/cmake-examples-Chinese/practice/opencv_demo/main.cpp" "D:/workspace/github_repos/cmake-examples-Chinese/practice/opencv_demo/cmake-build-debug/CMakeFiles/opencv_demo.dir/main.cpp.obj" 8 | ) 9 | set(CMAKE_CXX_COMPILER_ID "GNU") 10 | 11 | # The include file search paths: 12 | set(CMAKE_CXX_TARGET_INCLUDE_PATH 13 | "D:/Programs/opencvsolution/install/include" 14 | ) 15 | 16 | # Targets to which this target links. 17 | set(CMAKE_TARGET_LINKED_INFO_FILES 18 | ) 19 | 20 | # Fortran module output directory. 21 | set(CMAKE_Fortran_TARGET_MODULE_DIR "") 22 | -------------------------------------------------------------------------------- /实践案例/opencv/cmake-build-debug/CMakeFiles/opencv_demo.dir/build.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "MinGW Makefiles" Generator, CMake Version 3.17 3 | 4 | # Delete rule output on recipe failure. 5 | .DELETE_ON_ERROR: 6 | 7 | 8 | #============================================================================= 9 | # Special targets provided by cmake. 10 | 11 | # Disable implicit rules so canonical targets will work. 12 | .SUFFIXES: 13 | 14 | 15 | # Disable VCS-based implicit rules. 16 | % : %,v 17 | 18 | 19 | # Disable VCS-based implicit rules. 20 | % : RCS/% 21 | 22 | 23 | # Disable VCS-based implicit rules. 24 | % : RCS/%,v 25 | 26 | 27 | # Disable VCS-based implicit rules. 28 | % : SCCS/s.% 29 | 30 | 31 | # Disable VCS-based implicit rules. 32 | % : s.% 33 | 34 | 35 | .SUFFIXES: .hpux_make_needs_suffix_list 36 | 37 | 38 | # Command-line flag to silence nested $(MAKE). 39 | $(VERBOSE)MAKESILENT = -s 40 | 41 | # Suppress display of executed commands. 42 | $(VERBOSE).SILENT: 43 | 44 | 45 | # A target that is always out of date. 46 | cmake_force: 47 | 48 | .PHONY : cmake_force 49 | 50 | #============================================================================= 51 | # Set environment variables for the build. 52 | 53 | SHELL = cmd.exe 54 | 55 | # The CMake executable. 56 | CMAKE_COMMAND = "D:\Program Files\clion\CLion 2020.3.3\bin\cmake\win\bin\cmake.exe" 57 | 58 | # The command to remove a file. 59 | RM = "D:\Program Files\clion\CLion 2020.3.3\bin\cmake\win\bin\cmake.exe" -E rm -f 60 | 61 | # Escaping for special characters. 62 | EQUALS = = 63 | 64 | # The top-level source directory on which CMake was run. 65 | CMAKE_SOURCE_DIR = D:\workspace\github_repos\cmake-examples-Chinese\practice\opencv_demo 66 | 67 | # The top-level build directory on which CMake was run. 68 | CMAKE_BINARY_DIR = D:\workspace\github_repos\cmake-examples-Chinese\practice\opencv_demo\cmake-build-debug 69 | 70 | # Include any dependencies generated for this target. 71 | include CMakeFiles/opencv_demo.dir/depend.make 72 | 73 | # Include the progress variables for this target. 74 | include CMakeFiles/opencv_demo.dir/progress.make 75 | 76 | # Include the compile flags for this target's objects. 77 | include CMakeFiles/opencv_demo.dir/flags.make 78 | 79 | CMakeFiles/opencv_demo.dir/main.cpp.obj: CMakeFiles/opencv_demo.dir/flags.make 80 | CMakeFiles/opencv_demo.dir/main.cpp.obj: CMakeFiles/opencv_demo.dir/includes_CXX.rsp 81 | CMakeFiles/opencv_demo.dir/main.cpp.obj: ../main.cpp 82 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=D:\workspace\github_repos\cmake-examples-Chinese\practice\opencv_demo\cmake-build-debug\CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Building CXX object CMakeFiles/opencv_demo.dir/main.cpp.obj" 83 | D:\Programs\mingw\mingw64\mingw64\bin\g++.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles\opencv_demo.dir\main.cpp.obj -c D:\workspace\github_repos\cmake-examples-Chinese\practice\opencv_demo\main.cpp 84 | 85 | CMakeFiles/opencv_demo.dir/main.cpp.i: cmake_force 86 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/opencv_demo.dir/main.cpp.i" 87 | D:\Programs\mingw\mingw64\mingw64\bin\g++.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E D:\workspace\github_repos\cmake-examples-Chinese\practice\opencv_demo\main.cpp > CMakeFiles\opencv_demo.dir\main.cpp.i 88 | 89 | CMakeFiles/opencv_demo.dir/main.cpp.s: cmake_force 90 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/opencv_demo.dir/main.cpp.s" 91 | D:\Programs\mingw\mingw64\mingw64\bin\g++.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S D:\workspace\github_repos\cmake-examples-Chinese\practice\opencv_demo\main.cpp -o CMakeFiles\opencv_demo.dir\main.cpp.s 92 | 93 | # Object files for target opencv_demo 94 | opencv_demo_OBJECTS = \ 95 | "CMakeFiles/opencv_demo.dir/main.cpp.obj" 96 | 97 | # External object files for target opencv_demo 98 | opencv_demo_EXTERNAL_OBJECTS = 99 | 100 | opencv_demo.exe: CMakeFiles/opencv_demo.dir/main.cpp.obj 101 | opencv_demo.exe: CMakeFiles/opencv_demo.dir/build.make 102 | opencv_demo.exe: CMakeFiles/opencv_demo.dir/linklibs.rsp 103 | opencv_demo.exe: CMakeFiles/opencv_demo.dir/objects1.rsp 104 | opencv_demo.exe: CMakeFiles/opencv_demo.dir/link.txt 105 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --bold --progress-dir=D:\workspace\github_repos\cmake-examples-Chinese\practice\opencv_demo\cmake-build-debug\CMakeFiles --progress-num=$(CMAKE_PROGRESS_2) "Linking CXX executable opencv_demo.exe" 106 | $(CMAKE_COMMAND) -E cmake_link_script CMakeFiles\opencv_demo.dir\link.txt --verbose=$(VERBOSE) 107 | 108 | # Rule to build all files generated by this target. 109 | CMakeFiles/opencv_demo.dir/build: opencv_demo.exe 110 | 111 | .PHONY : CMakeFiles/opencv_demo.dir/build 112 | 113 | CMakeFiles/opencv_demo.dir/clean: 114 | $(CMAKE_COMMAND) -P CMakeFiles\opencv_demo.dir\cmake_clean.cmake 115 | .PHONY : CMakeFiles/opencv_demo.dir/clean 116 | 117 | CMakeFiles/opencv_demo.dir/depend: 118 | $(CMAKE_COMMAND) -E cmake_depends "MinGW Makefiles" D:\workspace\github_repos\cmake-examples-Chinese\practice\opencv_demo D:\workspace\github_repos\cmake-examples-Chinese\practice\opencv_demo D:\workspace\github_repos\cmake-examples-Chinese\practice\opencv_demo\cmake-build-debug D:\workspace\github_repos\cmake-examples-Chinese\practice\opencv_demo\cmake-build-debug D:\workspace\github_repos\cmake-examples-Chinese\practice\opencv_demo\cmake-build-debug\CMakeFiles\opencv_demo.dir\DependInfo.cmake --color=$(COLOR) 119 | .PHONY : CMakeFiles/opencv_demo.dir/depend 120 | 121 | -------------------------------------------------------------------------------- /实践案例/opencv/cmake-build-debug/CMakeFiles/opencv_demo.dir/cmake_clean.cmake: -------------------------------------------------------------------------------- 1 | file(REMOVE_RECURSE 2 | "CMakeFiles/opencv_demo.dir/main.cpp.obj" 3 | "libopencv_demo.dll.a" 4 | "opencv_demo.exe" 5 | "opencv_demo.exe.manifest" 6 | "opencv_demo.pdb" 7 | ) 8 | 9 | # Per-language clean rules from dependency scanning. 10 | foreach(lang CXX) 11 | include(CMakeFiles/opencv_demo.dir/cmake_clean_${lang}.cmake OPTIONAL) 12 | endforeach() 13 | -------------------------------------------------------------------------------- /实践案例/opencv/cmake-build-debug/CMakeFiles/opencv_demo.dir/flags.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "MinGW Makefiles" Generator, CMake Version 3.17 3 | 4 | # compile CXX with D:/Programs/mingw/mingw64/mingw64/bin/g++.exe 5 | CXX_FLAGS = -g 6 | 7 | CXX_DEFINES = 8 | 9 | CXX_INCLUDES = @CMakeFiles/opencv_demo.dir/includes_CXX.rsp 10 | 11 | -------------------------------------------------------------------------------- /实践案例/opencv/cmake-build-debug/CMakeFiles/opencv_demo.dir/includes_CXX.rsp: -------------------------------------------------------------------------------- 1 | -ID:/Programs/opencvsolution/install/include 2 | -------------------------------------------------------------------------------- /实践案例/opencv/cmake-build-debug/CMakeFiles/opencv_demo.dir/link.txt: -------------------------------------------------------------------------------- 1 | "D:\Program Files\clion\CLion 2020.3.3\bin\cmake\win\bin\cmake.exe" -E rm -f CMakeFiles\opencv_demo.dir/objects.a 2 | D:\Programs\mingw\mingw64\mingw64\bin\ar.exe cr CMakeFiles\opencv_demo.dir/objects.a @CMakeFiles\opencv_demo.dir\objects1.rsp 3 | D:\Programs\mingw\mingw64\mingw64\bin\g++.exe -g -Wl,--whole-archive CMakeFiles\opencv_demo.dir/objects.a -Wl,--no-whole-archive -o opencv_demo.exe -Wl,--out-implib,libopencv_demo.dll.a -Wl,--major-image-version,0,--minor-image-version,0 @CMakeFiles\opencv_demo.dir\linklibs.rsp 4 | -------------------------------------------------------------------------------- /实践案例/opencv/cmake-build-debug/CMakeFiles/opencv_demo.dir/linklibs.rsp: -------------------------------------------------------------------------------- 1 | -LD:/Programs/opencvsolution/install/x64/vc16/lib -lopencv_world3414 -lopencv_img_hash3414 -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 2 | -------------------------------------------------------------------------------- /实践案例/opencv/cmake-build-debug/CMakeFiles/opencv_demo.dir/main.cpp.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SFUMECJF/cmake-examples-Chinese/979abb2fb0b4189f0181e4051d2b269964eb22ba/实践案例/opencv/cmake-build-debug/CMakeFiles/opencv_demo.dir/main.cpp.obj -------------------------------------------------------------------------------- /实践案例/opencv/cmake-build-debug/CMakeFiles/opencv_demo.dir/objects.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SFUMECJF/cmake-examples-Chinese/979abb2fb0b4189f0181e4051d2b269964eb22ba/实践案例/opencv/cmake-build-debug/CMakeFiles/opencv_demo.dir/objects.a -------------------------------------------------------------------------------- /实践案例/opencv/cmake-build-debug/CMakeFiles/opencv_demo.dir/objects1.rsp: -------------------------------------------------------------------------------- 1 | CMakeFiles/opencv_demo.dir/main.cpp.obj 2 | -------------------------------------------------------------------------------- /实践案例/opencv/cmake-build-debug/CMakeFiles/opencv_demo.dir/progress.make: -------------------------------------------------------------------------------- 1 | CMAKE_PROGRESS_1 = 1 2 | CMAKE_PROGRESS_2 = 2 3 | 4 | -------------------------------------------------------------------------------- /实践案例/opencv/cmake-build-debug/CMakeFiles/progress.marks: -------------------------------------------------------------------------------- 1 | 2 2 | -------------------------------------------------------------------------------- /实践案例/opencv/cmake-build-debug/Makefile: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "MinGW Makefiles" Generator, CMake Version 3.17 3 | 4 | # Default target executed when no arguments are given to make. 5 | default_target: all 6 | 7 | .PHONY : default_target 8 | 9 | # Allow only one "make -f Makefile2" at a time, but pass parallelism. 10 | .NOTPARALLEL: 11 | 12 | 13 | #============================================================================= 14 | # Special targets provided by cmake. 15 | 16 | # Disable implicit rules so canonical targets will work. 17 | .SUFFIXES: 18 | 19 | 20 | # Disable VCS-based implicit rules. 21 | % : %,v 22 | 23 | 24 | # Disable VCS-based implicit rules. 25 | % : RCS/% 26 | 27 | 28 | # Disable VCS-based implicit rules. 29 | % : RCS/%,v 30 | 31 | 32 | # Disable VCS-based implicit rules. 33 | % : SCCS/s.% 34 | 35 | 36 | # Disable VCS-based implicit rules. 37 | % : s.% 38 | 39 | 40 | .SUFFIXES: .hpux_make_needs_suffix_list 41 | 42 | 43 | # Command-line flag to silence nested $(MAKE). 44 | $(VERBOSE)MAKESILENT = -s 45 | 46 | # Suppress display of executed commands. 47 | $(VERBOSE).SILENT: 48 | 49 | 50 | # A target that is always out of date. 51 | cmake_force: 52 | 53 | .PHONY : cmake_force 54 | 55 | #============================================================================= 56 | # Set environment variables for the build. 57 | 58 | SHELL = cmd.exe 59 | 60 | # The CMake executable. 61 | CMAKE_COMMAND = "D:\Program Files\clion\CLion 2020.3.3\bin\cmake\win\bin\cmake.exe" 62 | 63 | # The command to remove a file. 64 | RM = "D:\Program Files\clion\CLion 2020.3.3\bin\cmake\win\bin\cmake.exe" -E rm -f 65 | 66 | # Escaping for special characters. 67 | EQUALS = = 68 | 69 | # The top-level source directory on which CMake was run. 70 | CMAKE_SOURCE_DIR = D:\workspace\github_repos\cmake-examples-Chinese\practice\opencv_demo 71 | 72 | # The top-level build directory on which CMake was run. 73 | CMAKE_BINARY_DIR = D:\workspace\github_repos\cmake-examples-Chinese\practice\opencv_demo\cmake-build-debug 74 | 75 | #============================================================================= 76 | # Targets provided globally by CMake. 77 | 78 | # Special rule for the target edit_cache 79 | edit_cache: 80 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "No interactive CMake dialog available..." 81 | "D:\Program Files\clion\CLion 2020.3.3\bin\cmake\win\bin\cmake.exe" -E echo "No interactive CMake dialog available." 82 | .PHONY : edit_cache 83 | 84 | # Special rule for the target edit_cache 85 | edit_cache/fast: edit_cache 86 | 87 | .PHONY : edit_cache/fast 88 | 89 | # Special rule for the target rebuild_cache 90 | rebuild_cache: 91 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." 92 | "D:\Program Files\clion\CLion 2020.3.3\bin\cmake\win\bin\cmake.exe" --regenerate-during-build -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) 93 | .PHONY : rebuild_cache 94 | 95 | # Special rule for the target rebuild_cache 96 | rebuild_cache/fast: rebuild_cache 97 | 98 | .PHONY : rebuild_cache/fast 99 | 100 | # The main all target 101 | all: cmake_check_build_system 102 | $(CMAKE_COMMAND) -E cmake_progress_start D:\workspace\github_repos\cmake-examples-Chinese\practice\opencv_demo\cmake-build-debug\CMakeFiles D:\workspace\github_repos\cmake-examples-Chinese\practice\opencv_demo\cmake-build-debug\CMakeFiles\progress.marks 103 | $(MAKE) $(MAKESILENT) -f CMakeFiles\Makefile2 all 104 | $(CMAKE_COMMAND) -E cmake_progress_start D:\workspace\github_repos\cmake-examples-Chinese\practice\opencv_demo\cmake-build-debug\CMakeFiles 0 105 | .PHONY : all 106 | 107 | # The main clean target 108 | clean: 109 | $(MAKE) $(MAKESILENT) -f CMakeFiles\Makefile2 clean 110 | .PHONY : clean 111 | 112 | # The main clean target 113 | clean/fast: clean 114 | 115 | .PHONY : clean/fast 116 | 117 | # Prepare targets for installation. 118 | preinstall: all 119 | $(MAKE) $(MAKESILENT) -f CMakeFiles\Makefile2 preinstall 120 | .PHONY : preinstall 121 | 122 | # Prepare targets for installation. 123 | preinstall/fast: 124 | $(MAKE) $(MAKESILENT) -f CMakeFiles\Makefile2 preinstall 125 | .PHONY : preinstall/fast 126 | 127 | # clear depends 128 | depend: 129 | $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles\Makefile.cmake 1 130 | .PHONY : depend 131 | 132 | #============================================================================= 133 | # Target rules for targets named opencv_demo 134 | 135 | # Build rule for target. 136 | opencv_demo: cmake_check_build_system 137 | $(MAKE) $(MAKESILENT) -f CMakeFiles\Makefile2 opencv_demo 138 | .PHONY : opencv_demo 139 | 140 | # fast build rule for target. 141 | opencv_demo/fast: 142 | $(MAKE) $(MAKESILENT) -f CMakeFiles\opencv_demo.dir\build.make CMakeFiles/opencv_demo.dir/build 143 | .PHONY : opencv_demo/fast 144 | 145 | main.obj: main.cpp.obj 146 | 147 | .PHONY : main.obj 148 | 149 | # target to build an object file 150 | main.cpp.obj: 151 | $(MAKE) $(MAKESILENT) -f CMakeFiles\opencv_demo.dir\build.make CMakeFiles/opencv_demo.dir/main.cpp.obj 152 | .PHONY : main.cpp.obj 153 | 154 | main.i: main.cpp.i 155 | 156 | .PHONY : main.i 157 | 158 | # target to preprocess a source file 159 | main.cpp.i: 160 | $(MAKE) $(MAKESILENT) -f CMakeFiles\opencv_demo.dir\build.make CMakeFiles/opencv_demo.dir/main.cpp.i 161 | .PHONY : main.cpp.i 162 | 163 | main.s: main.cpp.s 164 | 165 | .PHONY : main.s 166 | 167 | # target to generate assembly for a file 168 | main.cpp.s: 169 | $(MAKE) $(MAKESILENT) -f CMakeFiles\opencv_demo.dir\build.make CMakeFiles/opencv_demo.dir/main.cpp.s 170 | .PHONY : main.cpp.s 171 | 172 | # Help Target 173 | help: 174 | @echo The following are some of the valid targets for this Makefile: 175 | @echo ... all (the default if no target is provided) 176 | @echo ... clean 177 | @echo ... depend 178 | @echo ... edit_cache 179 | @echo ... rebuild_cache 180 | @echo ... opencv_demo 181 | @echo ... main.obj 182 | @echo ... main.i 183 | @echo ... main.s 184 | .PHONY : help 185 | 186 | 187 | 188 | #============================================================================= 189 | # Special targets to cleanup operation of make. 190 | 191 | # Special rule to run CMake to check the build system integrity. 192 | # No rule that depends on this can have commands that come from listfiles 193 | # because they might be regenerated. 194 | cmake_check_build_system: 195 | $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles\Makefile.cmake 0 196 | .PHONY : cmake_check_build_system 197 | 198 | -------------------------------------------------------------------------------- /实践案例/opencv/cmake-build-debug/Project.cbp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 45 | 46 | -------------------------------------------------------------------------------- /实践案例/opencv/cmake-build-debug/Testing/Temporary/LastTest.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SFUMECJF/cmake-examples-Chinese/979abb2fb0b4189f0181e4051d2b269964eb22ba/实践案例/opencv/cmake-build-debug/Testing/Temporary/LastTest.log -------------------------------------------------------------------------------- /实践案例/opencv/cmake-build-debug/cmake_install.cmake: -------------------------------------------------------------------------------- 1 | # Install script for directory: D:/workspace/github_repos/cmake-examples-Chinese/practice/opencv_demo 2 | 3 | # Set the install prefix 4 | if(NOT DEFINED CMAKE_INSTALL_PREFIX) 5 | set(CMAKE_INSTALL_PREFIX "C:/Program Files (x86)/Project") 6 | endif() 7 | string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") 8 | 9 | # Set the install configuration name. 10 | if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME) 11 | if(BUILD_TYPE) 12 | string(REGEX REPLACE "^[^A-Za-z0-9_]+" "" 13 | CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}") 14 | else() 15 | set(CMAKE_INSTALL_CONFIG_NAME "Debug") 16 | endif() 17 | message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"") 18 | endif() 19 | 20 | # Set the component getting installed. 21 | if(NOT CMAKE_INSTALL_COMPONENT) 22 | if(COMPONENT) 23 | message(STATUS "Install component: \"${COMPONENT}\"") 24 | set(CMAKE_INSTALL_COMPONENT "${COMPONENT}") 25 | else() 26 | set(CMAKE_INSTALL_COMPONENT) 27 | endif() 28 | endif() 29 | 30 | # Is this installation the result of a crosscompile? 31 | if(NOT DEFINED CMAKE_CROSSCOMPILING) 32 | set(CMAKE_CROSSCOMPILING "FALSE") 33 | endif() 34 | 35 | if(CMAKE_INSTALL_COMPONENT) 36 | set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt") 37 | else() 38 | set(CMAKE_INSTALL_MANIFEST "install_manifest.txt") 39 | endif() 40 | 41 | string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT 42 | "${CMAKE_INSTALL_MANIFEST_FILES}") 43 | file(WRITE "D:/workspace/github_repos/cmake-examples-Chinese/practice/opencv_demo/cmake-build-debug/${CMAKE_INSTALL_MANIFEST}" 44 | "${CMAKE_INSTALL_MANIFEST_CONTENT}") 45 | -------------------------------------------------------------------------------- /实践案例/opencv/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main() { 6 | // cv::VideoCapture capture(0, 0); 7 | cv::Mat frame; 8 | // 9 | // if (!capture.isOpened()) { 10 | // std::cout << "open camera error!" << std::endl; 11 | // return -1; 12 | // } 13 | // 14 | // cv::Mat frame; 15 | // while (1) { 16 | // capture >> frame; 17 | // if (frame.empty()) { 18 | // std::cout << "capture empty frame" << std::endl; 19 | // continue; 20 | // } 21 | // 22 | // cv::Mat shrink_frame; 23 | // cv::resize(frame, shrink_frame, 24 | // cv::Size(frame.cols / 2, frame.rows / 2), 25 | // 0, 0, 3); 26 | // 27 | // cv::imshow("detect", shrink_frame); 28 | // 29 | // int key = cv::waitKey(1); 30 | // if (key == 'q') { 31 | // break; 32 | // } 33 | // } 34 | return 0; 35 | } 36 | 37 | 38 | //#include 39 | //#include 40 | //#include 41 | //#include 42 | //#include 43 | //using namespace cv; 44 | //using namespace std; 45 | //int main( int argc, char** argv ) 46 | //{ 47 | // String imageName( "../data/HappyFish.jpg" ); // by default 48 | // if( argc > 1) 49 | // { 50 | // imageName = argv[1]; 51 | // } 52 | // Mat image; 53 | // image = imread( imageName, IMREAD_COLOR ); // Read the file 54 | // if( image.empty() ) // Check for invalid input 55 | // { 56 | // cout << "Could not open or find the image" << std::endl ; 57 | // return -1; 58 | // } 59 | // namedWindow( "Display window", WINDOW_AUTOSIZE ); // Create a window for display. 60 | // imshow( "Display window", image ); // Show our image inside it. 61 | // waitKey(0); // Wait for a keystroke in the window 62 | // return 0; 63 | //} -------------------------------------------------------------------------------- /实践案例/qt+opencv/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Set the minimum version of CMake that can be used 2 | #设置CMake最小版本 3 | # To find the cmake version run 4 | # $ cmake --version 5 | cmake_minimum_required(VERSION 3.5) 6 | 7 | # Set the project name 8 | #设置工程名 9 | project (reconstruction) 10 | 11 | 12 | 13 | #注意,在一个大工程里,这几个开关一定要尽量放在前面打开,否则有可能会报无法生成ui文件的错误 14 | set(CMAKE_AUTOMOC ON) 15 | set(CMAKE_AUTORCC ON) 16 | set(CMAKE_AUTOUIC ON) 17 | set(CMAKE_INCLUDE_CURRENT_DIR ON) 18 | #注意,在一个大工程里,这几个开关一定要尽量放在前面打开,否则有可能会报无法生成ui文件的错误 19 | #set(CMAKE_PREFIX_PATH "~/Qt5.9.9/5.9.9/gcc_64/")#为了不在Qt creator这个软件中也能CMake找到Qt的库 20 | 21 | # 1 find qt 22 | find_package(Qt5 COMPONENTS Widgets Gui REQUIRED) 23 | #get_target_property(QtCore_location Qt5::Widgets LOCATION) 24 | find_package(Qt5 COMPONENTS Core REQUIRED) 25 | #get_target_property(QtCore_location Qt5::Core LOCATION) 26 | #find_package(pthread REQUIRED) 27 | # Add an executable 28 | #生成可执行文件 29 | 30 | # 2 find open cv 31 | #FIND_PACKAGE( OpenCV REQUIRED ) 32 | find_package(OpenCV CONFIG REQUIRED PATHS) 33 | MESSAGE("OpenCV version : ${OpenCV_VERSION}") 34 | include_directories(${OpenCV_INCLUDE_DIRS}) 35 | link_directories(${OpenCV_LIB_DIR}) 36 | MESSAGE("OpenCV_LIB_DIR : ${OpenCV_LIB_DIR}") 37 | MESSAGE("OpenCV_LIBS : ${OpenCV_LIBS}") 38 | 39 | # add exe 40 | add_executable(reconstruction main.cpp mainwindow.cpp mainwindow.h mainwindow.ui) 41 | # 42 | target_link_libraries(reconstruction Qt5::Core Qt5::Widgets Qt5::Gui) 43 | 44 | target_link_directories(reconstruction PUBLIC 45 | ${OpenCV_LIB_DIRS} 46 | ) 47 | target_link_libraries(reconstruction 48 | ${OpenCV_LIBS} 49 | ) 50 | target_include_directories(reconstruction PUBLIC 51 | ${OpenCV_INCLUDE_DIRS} 52 | ) 53 | MESSAGE("OpenCV_INCLUDE_DIRS : ${OpenCV_INCLUDE_DIRS}") 54 | 55 | #在这里,为目标链接了/usr/lib/x86_64-linux-gnu/libpthread.so 56 | #如果不链接就会报错,这是系统里的库,直接链接就行。 57 | #如果是用的.pro文件,则在里面加上LIBS+=/usr/lib/x86_64-linux-gnu/libpthread.so 58 | #target_link_libraries(hello_cmake pthread) 59 | -------------------------------------------------------------------------------- /实践案例/qt+opencv/README.md: -------------------------------------------------------------------------------- 1 | # reconstruction 2 | 3 | ## 在CMake中包含Open CV库 4 | 5 | 首先,把动态库的路径包含到环境变量。 6 | 7 | 其次,在CMake中find package,并且链接头文件路径,库文件路径,以及库文件。 8 | 9 | ```cmake 10 | find_package(OpenCV CONFIG REQUIRED PATHS) 11 | 12 | target_link_directories(reconstruction PUBLIC 13 | ${OpenCV_LIB_DIRS} 14 | ) 15 | target_link_libraries(reconstruction 16 | ${OpenCV_LIBS} 17 | ) 18 | target_include_directories(reconstruction PUBLIC 19 | ${OpenCV_INCLUDE_DIRS} 20 | ) 21 | ``` 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /实践案例/qt+opencv/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "mainwindow.h" 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | using namespace std; 13 | using namespace cv; 14 | 15 | int main(int argc, char *argv[]) 16 | { 17 | cout << "Hello Qt-CMake!" << endl; 18 | 19 | QApplication a(argc, argv); 20 | 21 | MainWindow mainWin; 22 | mainWin.show(); 23 | 24 | Mat image(Size(100, 100), CV_8UC1); 25 | imshow("black",image); 26 | 27 | return a.exec(); 28 | } 29 | -------------------------------------------------------------------------------- /实践案例/qt+opencv/mainwindow.cpp: -------------------------------------------------------------------------------- 1 | #include "mainwindow.h" 2 | #include "ui_mainwindow.h" 3 | 4 | MainWindow::MainWindow(QWidget *parent) : 5 | QMainWindow(parent), 6 | ui(new Ui::MainWindow) 7 | { 8 | ui->setupUi(this); 9 | } 10 | 11 | MainWindow::~MainWindow() 12 | { 13 | delete ui; 14 | } 15 | 16 | void MainWindow::on_pushButton_pressed() 17 | { 18 | ui->label_2->setText(ui->lineEdit->text()); 19 | } 20 | -------------------------------------------------------------------------------- /实践案例/qt+opencv/mainwindow.h: -------------------------------------------------------------------------------- 1 | #ifndef MAINWINDOW_H 2 | #define MAINWINDOW_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class MainWindow; 8 | } 9 | 10 | class MainWindow : public QMainWindow 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | explicit MainWindow(QWidget *parent = nullptr); 16 | ~MainWindow(); 17 | 18 | private slots: 19 | void on_pushButton_pressed(); 20 | 21 | private: 22 | Ui::MainWindow *ui; 23 | }; 24 | 25 | #endif // MAINWINDOW_H 26 | -------------------------------------------------------------------------------- /实践案例/qt+opencv/mainwindow.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | MainWindow 4 | 5 | 6 | 7 | 0 8 | 0 9 | 299 10 | 366 11 | 12 | 13 | 14 | MainWindow 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | Qt::Horizontal 24 | 25 | 26 | 27 | 40 28 | 20 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | CMake-Qt-GUI 37 | 38 | 39 | 40 | 41 | 42 | 43 | Qt::Horizontal 44 | 45 | 46 | 47 | 40 48 | 20 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | Qt::Horizontal 64 | 65 | 66 | 67 | 40 68 | 20 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 显示 77 | 78 | 79 | 80 | 81 | 82 | 83 | Qt::Horizontal 84 | 85 | 86 | 87 | 40 88 | 20 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 显示按钮 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 0 108 | 0 109 | 299 110 | 28 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | -------------------------------------------------------------------------------- /实践案例/qt/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Set the minimum version of CMake that can be used 2 | #设置CMake最小版本 3 | # To find the cmake version run 4 | # $ cmake --version 5 | cmake_minimum_required(VERSION 3.5) 6 | 7 | # Set the project name 8 | #设置工程名 9 | project (reconstruction) 10 | 11 | 12 | 13 | #注意,在一个大工程里,这几个开关一定要尽量放在前面打开,否则有可能会报无法生成ui文件的错误 14 | set(CMAKE_AUTOMOC ON) 15 | set(CMAKE_AUTORCC ON) 16 | set(CMAKE_AUTOUIC ON) 17 | set(CMAKE_INCLUDE_CURRENT_DIR ON) 18 | #注意,在一个大工程里,这几个开关一定要尽量放在前面打开,否则有可能会报无法生成ui文件的错误 19 | set(CMAKE_PREFIX_PATH "~/Qt5.9.9/5.9.9/gcc_64/")#为了不在Qt creator这个软件中也能CMake找到Qt的库 20 | 21 | find_package(Qt5 COMPONENTS Widgets Gui REQUIRED) 22 | #get_target_property(QtCore_location Qt5::Widgets LOCATION) 23 | find_package(Qt5 COMPONENTS Core REQUIRED) 24 | #get_target_property(QtCore_location Qt5::Core LOCATION) 25 | #find_package(pthread REQUIRED) 26 | # Add an executable 27 | #生成可执行文件 28 | add_executable(hello_cmake main.cpp mainwindow.cpp mainwindow.h mainwindow.ui) 29 | # 30 | target_link_libraries(hello_cmake Qt5::Core Qt5::Widgets Qt5::Gui) 31 | 32 | 33 | #在这里,为目标链接了/usr/lib/x86_64-linux-gnu/libpthread.so 34 | #如果不链接就会报错,这是系统里的库,直接链接就行。 35 | #如果是用的.pro文件,则在里面加上LIBS+=/usr/lib/x86_64-linux-gnu/libpthread.so 36 | #target_link_libraries(hello_cmake pthread) 37 | -------------------------------------------------------------------------------- /实践案例/qt/README.md: -------------------------------------------------------------------------------- 1 | # reconstruction 2 | -------------------------------------------------------------------------------- /实践案例/qt/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "mainwindow.h" 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | using namespace std; 10 | //using namespace cv; 11 | 12 | int main(int argc, char *argv[]) 13 | { 14 | cout << "Hello Qt-CMake!" << endl; 15 | 16 | QApplication a(argc, argv); 17 | 18 | MainWindow mainWin; 19 | mainWin.show(); 20 | 21 | // Mat image = Mat.ones(20, 20); 22 | // imshow("black",image); 23 | 24 | return a.exec(); 25 | } 26 | -------------------------------------------------------------------------------- /实践案例/qt/mainwindow.cpp: -------------------------------------------------------------------------------- 1 | #include "mainwindow.h" 2 | #include "ui_mainwindow.h" 3 | 4 | MainWindow::MainWindow(QWidget *parent) : 5 | QMainWindow(parent), 6 | ui(new Ui::MainWindow) 7 | { 8 | ui->setupUi(this); 9 | } 10 | 11 | MainWindow::~MainWindow() 12 | { 13 | delete ui; 14 | } 15 | 16 | void MainWindow::on_pushButton_pressed() 17 | { 18 | ui->label_2->setText(ui->lineEdit->text()); 19 | } 20 | -------------------------------------------------------------------------------- /实践案例/qt/mainwindow.h: -------------------------------------------------------------------------------- 1 | #ifndef MAINWINDOW_H 2 | #define MAINWINDOW_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class MainWindow; 8 | } 9 | 10 | class MainWindow : public QMainWindow 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | explicit MainWindow(QWidget *parent = nullptr); 16 | ~MainWindow(); 17 | 18 | private slots: 19 | void on_pushButton_pressed(); 20 | 21 | private: 22 | Ui::MainWindow *ui; 23 | }; 24 | 25 | #endif // MAINWINDOW_H 26 | -------------------------------------------------------------------------------- /实践案例/qt/mainwindow.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | MainWindow 4 | 5 | 6 | 7 | 0 8 | 0 9 | 299 10 | 366 11 | 12 | 13 | 14 | MainWindow 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | Qt::Horizontal 24 | 25 | 26 | 27 | 40 28 | 20 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | CMake-Qt-GUI 37 | 38 | 39 | 40 | 41 | 42 | 43 | Qt::Horizontal 44 | 45 | 46 | 47 | 40 48 | 20 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | Qt::Horizontal 64 | 65 | 66 | 67 | 40 68 | 20 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 显示 77 | 78 | 79 | 80 | 81 | 82 | 83 | Qt::Horizontal 84 | 85 | 86 | 87 | 40 88 | 20 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 显示按钮 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 0 108 | 0 109 | 299 110 | 28 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | --------------------------------------------------------------------------------