-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
38 lines (28 loc) · 1.06 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
cmake_minimum_required(VERSION 3.8)
# project name init
project(
vita
VERSION 0.5.0
DESCRIPTION "Vita - a custom C library for memory management, string manipulation and more."
LANGUAGES C
)
# setting default build type
set(CMAKE_C_STANDARD 11)
set(DEFAULT_BUILD_TYPE "Debug")
set(CMAKE_C_FLAGS "-Wall -Wpedantic -Wextra -Wreturn-type -Wswitch -Wunused -Werror -O2")
# set(DEFAULT_BUILD_TYPE "Release")
# set(CMAKE_C_FLAGS "-DNDEBUG -Wall -Wpedantic -Wextra -Wreturn-type -Wswitch -Wunused -Werror -O2")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib)
if (APPLE)
set(CMAKE_OSX_DEPLOYMENT_TARGET 11.0)
endif()
# finding all headers and sources
file(GLOB_RECURSE SOURCES ${PROJECT_SOURCE_DIR}/src/*.c)
file(GLOB_RECURSE HEADERS ${PROJECT_SOURCE_DIR}/inc/*.h)
# include directories
include_directories(${PROJECT_SOURCE_DIR}/inc/)
# building library
add_library(${PROJECT_NAME} STATIC ${SOURCES} ${HEADERS})
#message("Installing the library to lib/...")
#install(TARGETS ${PROJECT_NAME}
# ARCHIVE DESTINATION ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY})