1. 程式人生 > >CMake基本工程

CMake基本工程

CMakeLists.txt

cmake_minimum_required (VERSION 2.6)

project (Test)

set (Test_VERSION_MAJOR 1)

set (Test_VERSION_MINOR 0)

configure_file ( "${PROJECT_SOURCE_DIR}/TestConfig.h.in"

                     "${PROJECT_BINARY_DIR}/TestConfig.h" )

include_directories("${PROJECT_BINARY_DIR}")

add_executable(Test main.cpp)

target_link_libraries (Test MathFunctions)

 

TestConfig.h.in

#define Tutorial_VERSION_MAJOR @[email protected]

#define Tutorial_VERSION_MINOR @[email protected]