Compile with CMake

Steps for cmake compilation:

1. Create two folders, both under the xxx source folder
 xxx_temp_file is used to store the ITK project file generated by cmake

 xxx is used to save the bin, include, lib and other files after successful compilation

2. CMake compilation

(1) where is the source code select the folder location where the compiled source files are located

        where to build the binaries select xxx_temp_file to store the project file generated after CMake compilation


  (2) Click Configure, select the compiler: Visual studio 10 2010 Win64, select the vs version type installed on the computer

Click configure and wait for configure to complete.

(3) Check BUILD_SHARED_LIBS. (used to create shared libraries and dll files, and save other formats and encodings) in the options of cmake

    After checking Advanced, change CMAKE_INSTALL_PREFIX (representing the installation path of lib and include generated after compiling ITK) to xxx, that is, the location where bin, include, lib and other files are saved after successful compilation

    Click Configure again until all entries are grayed out, indicating that the configuration is successful, click Generate to confirm.

3. After the second step is successful, there are the following contents in xxx_temp_file. Each compilation is not exactly the same, but there will be a vs project file.
Open the ALL_BUILD project, compile it in the vs environment, debug or release, and pop out "n successes, 0 failures", indicating that the configuration is successful.
If there is an error in the compilation, you need to reconfigure in cmake, modify some options, and repeat the following steps

After the compilation is complete, right-click the INSTALL project and compile it separately. After the end, the corresponding bin, lib, and dll files are installed in the xxx folder.


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325518101&siteId=291194637
Recommended