Skip to content

Instantly share code, notes, and snippets.

@sepfy
Last active August 18, 2020 07:17
Show Gist options
  • Save sepfy/d3f9884e609e858601bfb53bb8e87999 to your computer and use it in GitHub Desktop.
Save sepfy/d3f9884e609e858601bfb53bb8e87999 to your computer and use it in GitHub Desktop.
cmake_minimum_required(VERSION 3.1)
project(func)
add_library(func func.c)
option(UNITTEST_ENABLE "Build the unittest code" OFF)
file(GLOB func_SRC "*.c")
file(GLOB unittest_SRC "*unittest*")
list(REMOVE_ITEM func_SRC ${unittest_SRC})
if(UNITTEST_ENABLE)
add_executable(unittest ${unittest_SRC})
endif(UNITTEST_ENABLE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment