You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
958 B
38 lines
958 B
cmake_minimum_required(VERSION 3.16)
|
|
|
|
project(
|
|
WireRouting
|
|
VERSION 1.0
|
|
LANGUAGES CXX
|
|
)
|
|
|
|
set(CMAKE_CXX_STANDARD 17 CACHE STRING "The C++ standard to use")
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
set(CMAKE_CXX_EXTENSIONS OFF)
|
|
|
|
configure_file(config.h.in config.h)
|
|
|
|
# 复制DLL文件到可执行文件目录
|
|
file(COPY ${CMAKE_SOURCE_DIR}/lib/WireRouting_DLL.dll DESTINATION ${PROJECT_BINARY_DIR}/Debug)
|
|
|
|
aux_source_directory(src SRC_DIR)
|
|
add_executable(
|
|
${PROJECT_NAME}
|
|
${SRC_DIR}
|
|
)
|
|
|
|
target_link_libraries(
|
|
${PROJECT_NAME} PUBLIC
|
|
${CMAKE_SOURCE_DIR}/lib/tinyxml.lib
|
|
${CMAKE_SOURCE_DIR}/lib/WireRouting_DLL.lib
|
|
)
|
|
|
|
|
|
# 为目标添加了一个目录,源码中的 #include "config.h" 将会被解析为 ${PROJECT_BINARY_DIR}/config.h
|
|
target_include_directories(
|
|
${PROJECT_NAME} PUBLIC
|
|
${PROJECT_BINARY_DIR} # config.h.in 会生成配置在 build 目录
|
|
${CMAKE_SOURCE_DIR}/include
|
|
${CMAKE_SOURCE_DIR}/lib/include
|
|
)
|
|
|
|
|