-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathCMakeLists.txt
42 lines (34 loc) · 1.05 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
35
36
37
38
39
40
41
42
SET(PROJECT_NAME steg-png)
PROJECT(${PROJECT_NAME} C)
CMAKE_MINIMUM_REQUIRED(VERSION 3.7.2)
SET(CMAKE_C_STANDARD 11)
IF(CMAKE_COMPILER_IS_GNUCC)
ADD_DEFINITIONS(-Wall -Werror -pedantic -std=c11)
ENDIF(CMAKE_COMPILER_IS_GNUCC)
IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
SET(CMAKE_INSTALL_PREFIX $ENV{HOME}/ CACHE PATH "Install prefix default" FORCE)
ENDIF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
#
# Find Dependencies
#
FIND_PACKAGE(ZLIB REQUIRED)
FILE(GLOB_RECURSE SRC_LIST FOLLOW_SYMLINKS src/*.c)
FILE(GLOB_RECURSE HEAD_FILES FOLLOW_SYMLINKS include/*.h ${PROJECT_BINARY_DIR}/include/*.h)
#
# Set Include Directories
#
INCLUDE_DIRECTORIES(
"${PROJECT_SOURCE_DIR}/include/"
"${PROJECT_BINARY_DIR}/include/"
)
#
# Configure git-chat Executable and Installation
#
ADD_EXECUTABLE(${PROJECT_NAME} ${PROJECT_SOURCE_DIR}/src/main.c ${SRC_LIST})
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${ZLIB_LIBRARIES})
INSTALL(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION bin)
#
# Include Test Subdirectory
#
ENABLE_TESTING()
ADD_SUBDIRECTORY("${PROJECT_SOURCE_DIR}/test")