cmake_minimum_required(VERSION 3.3) option(AARCH64 "option for aarch64" OFF) if(${AARCH64} STREQUAL ON) message("======>> use aarch64") set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/aarch64.cmake) endif() set(BIN shmparser) project(${BIN}) if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE "Release") endif() set(CMAKE_CXX_FLAGS "-DLIB_CFFMPEG -fPIC -Wl,-Bsymbolic ${CMAKE_CXX_FLAGS}") set(CMAKE_C_FLAGS "-DLIB_CFFMPEG -fPIC -Wl,-Bsymbolic ${CMAKE_C_FLAGS}") set(CMAKE_CXX_FLAGS_DEBUG "-w -g -O0 -std=c++11 ${CMAKE_CXX_FLAGS}") set(CMAKE_C_FLAGS_DEBUG "-w -g -O0 ${CMAKE_C_FLAGS}") set(CMAKE_CXX_FLAGS_RELEASE "-w -g -O2 -std=c++11 ${CMAKE_CXX_FLAGS}") set(CMAKE_C_FLAGS_RELEASE "-w -g -O2 ${CMAKE_C_FLAGS}") include_directories( ${CMAKE_SOURCE_DIR} ) add_library(${BIN} SHARED shmparser/shmparser.c) target_link_libraries(${BIN}) add_executable(c_shm_test shmparser/shmparser.c ctest/main.c)