提交 275b38a2 authored 作者: zhoush's avatar zhoush

add CMakeLists.txt

上级 9c984848
流水线 #2210 已失败 于阶段
cmake_minimum_required(VERSION 3.0)
project(AW-List)
add_definitions(-D_GNU_SOURCE -std=c11 -Wall)
if (CMAKE_BUILD_TYPE MATCHES "DEBUG")
add_definitions(-g -DDEBUG -rdynamic)
endif()
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_VERBOSE_MAKEFILE ON)
set(PROJECT_VERSION_MAJOR 1)
set(PROJECT_VERSION_MINOR 0)
set(PROJECT_VERSION_PATCH 0)
set(PROJECT_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
set(PROJECT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
if (${CMAKE_C_COMPILER} MATCHES "hisiv510")
set(PLATFORM "hisiv510")
elseif (${CMAKE_C_COMPILER} MATCHES "himix200")
set(PLATFORM "himix200")
link_directories(/root/lib)
elseif (${CMAKE_C_COMPILER} MATCHES "openwrt")
set(PLATFORM "openwrt")
else()
set(CMAKE_C_COMPILER cc)
set(PLATFORM "linux")
endif()
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/${PLATFORM})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib/${PLATFORM})
link_directories(lib/${PLATFORM} )
include_directories(.)
add_library(AWList SHARED ./AWList.c)
add_executable(tests tests.c)
target_link_libraries(tests AWList)
enable_testing()
add_test(NAME testlist
COMMAND ${PROJECT_SOURCE_DIR}/bin/${PLATFORM}/tests )
set_target_properties(AWList PROPERTIES VERSION ${PROJECT_VERSION}
SOVERSION ${PROJECT_VERSION_MAJOR})
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论