参照 《CMake入门实战》
cmake_minimum_required(VERSION 2.8)
project(JsonRead
LANGUAGES CXX
VERSION 1.0.0
DESCRIPTION "Import HouseType file and transfer to dxf."
)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
if(MSVC)
# set(CMAKE_CXX_STANDARD 14)
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
endif(MSVC)
if(not CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
set(EXECUTABLE_OUT_PATH ${PROJECT_SOURCE_DIR}/bin)
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
include_directories(lib_json json)
aux_source_directory(. DIR_SRCS)
add_executable(JsonRead $(DIR_SRCS))
cmake_policy(SET CMP0054 NEW)
set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
include(CPack)