# C/C++开发资料

# cmake资料

  1. cmake-commands (opens new window)
  2. Getting Started with CMake (opens new window)
  3. CMake Tutorial (opens new window)

cmake Example:

cmake_minimum_required(VERSION 3.0.0)
project(Test VERSION 0.1.0 LANGUAGES C CXX)

# specify the C++ standard
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED true)

string(TIMESTAMP COMPILE_TIME %Y%m%d-%H%M%S)
configure_file(TutorialConfig.h.in TutorialConfig.h)
#add the MathFunctions library
add_subdirectory(MathFunctions)
add_executable(${PROJECT_NAME} test.cpp)

target_link_libraries(${PROJECT_NAME} PUBLIC MathFunctions)
target_include_directories(${PROJECT_NAME} PUBLIC 
                            "${PROJECT_BINARY_DIR}" 
                            "${PROJECT_SOURCE_DIR}/MathFunctions"
                            )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Last Updated: 3/21/2024, 6:52:40 PM
Apache License 2.0 | Copyright © 2022 by xueliang.wu 苏ICP备15016087号