CMake 基础
cmake
所需要的文件是 CMakeLists.txt
,是不能打错名字的。
基本框架
1 2 3 4 5 6 7 8 9
| cmake_minimum_required (VERSION 3.0) project(MYProject) set(CMAKEFLAG "-std=c++14 -g -w -fPIC") set(CMAKE_CXX_FLAGS "${CMAKEFLAG} ${CMAKE_CXX_FLAGS}") aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/cc CCSOURCE) find_path(HPATH NAMES op_kernel.h HINTS ${TFPATH}) add_library(TimeP SHARED ${CCSOURCE}) add_executable(TimeP ${CCSOURCE}) target_include_directories(TimeP PUBLIC ${TF_INC})
|