-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
85 lines (60 loc) · 2.34 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
########################################################################
# CMake project
PROJECT("dog-cat")
# Minimum required 2.6
# Minimum required 2.8.11 for automatic linking to qtmain.lib
CMAKE_MINIMUM_REQUIRED(VERSION 2.6 FATAL_ERROR)
# set (CMAKE_VERBOSE_MAKEFILE ON)
IF (POLICY CMP0020)
CMAKE_POLICY(SET CMP0020 NEW)
ENDIF ()
SET(CMAKE_CXX_STANDARD 11)
########################################################################
# Ensure that we are not building in our source directories.
SET(Build_Dir_OK "TRUE")
STRING(REGEX MATCH "^${CMAKE_SOURCE_DIR}" In_Sub_Dir ${CMAKE_BINARY_DIR})
IF (In_Sub_Dir)
STRING(REGEX MATCH "^${CMAKE_SOURCE_DIR}/[Bb]uild" In_Build_Dir ${CMAKE_BINARY_DIR})
IF (NOT In_Build_Dir)
SET(Build_Dir_OK "FALSE")
ENDIF ()
ENDIF ()
IF (NOT Build_Dir_OK)
MESSAGE(FATAL_ERROR "You must run cmake from a directory that is not in your source tree, or that is in a special subdirectory of the tree whose name begins with 'build'.")
ENDIF ()
########################################################################
# Set up the basic build environment
IF (CMAKE_BUILD_TYPE STREQUAL "")
# CMake defaults to leaving CMAKE_BUILD_TYPE empty. This messes up
# differentiation between debug and release builds.
SET(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE)
ENDIF ()
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/CMake/")
########################################################################
# Strip binary in release mode
IF (CMAKE_COMPILER_IS_GNUCXX)
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "-s")
ENDIF ()
########################################################################
LINK_DIRECTORIES(
)
INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}
)
########################################################################
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
########################################################################
FILE(GLOB SRCS *.cpp)
FILE(GLOB HDRS *.h)
SOURCE_GROUP("" FILES ${SRCS} ${HDRS})
INCLUDE_DIRECTORIES(
)
ADD_EXECUTABLE(dogcat
${SRCS}
${HDRS}
)
TARGET_LINK_LIBRARIES(dogcat
)
########################################################################