-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
47 lines (35 loc) · 972 Bytes
/
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
43
44
45
46
47
PROJECT("cb2util" C)
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
# TODO auto-gen version
SET(CB2UTIL_VERSION "???")
IF (MINGW)
SET(ZLIB_PATH "$ENV{ZLIB_PATH}")
SET(ZLIB_INCLUDE_DIR "${ZLIB_PATH}/include")
SET(ZLIB_LIBRARIES "${ZLIB_PATH}/lib/libzdll.a")
ELSE (MINGW)
FIND_PACKAGE(ZLIB REQUIRED)
ENDIF (MINGW)
SET(BIGINT "libbig_int")
SET(LIBCHEATS "libcheats")
SET(CMAKE_C_FLAGS "-Wall -Werror -O2")
ADD_DEFINITIONS("-DHAVE_STDINT_H")
ADD_SUBDIRECTORY(${LIBCHEATS})
INCLUDE_DIRECTORIES(
${BIGINT}/include
${LIBCHEATS}/include
${ZLIB_INCLUDE_DIR}
/usr/local/include
)
FILE(GLOB BIGINT_SRC ${BIGINT}/src/*.c ${BIGINT}/src/low_level_funcs/*.c)
ADD_LIBRARY(bigint ${BIGINT_SRC})
FILE(GLOB CB2UTIL_SRC *.c)
ADD_EXECUTABLE(cb2util ${CB2UTIL_SRC})
SET_SOURCE_FILES_PROPERTIES(cb2util.c
PROPERTIES COMPILE_FLAGS "-DCB2UTIL_VERSION='\"${CB2UTIL_VERSION}\"'"
)
TARGET_LINK_LIBRARIES(cb2util
bigint
cheats
${ZLIB_LIBRARIES}
)
INSTALL(TARGETS cb2util DESTINATION bin)