-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
62 lines (52 loc) · 1.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
CMAKE_MINIMUM_REQUIRED(VERSION 3.0.0)
PROJECT(efdl)
SET(CMAKE_COLOR_MAKEFILE ON)
SET(CMAKE_VERBOSE_MAKEFILE OFF)
SET(CMAKE_INCLUDE_CURRENT_DIR TRUE)
SET(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS TRUE)
SET(CMAKE_MODULE_PATH
${CMAKE_MODULE_PATH}
"${CMAKE_CURRENT_SOURCE_DIR}/cmake"
)
IF (NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE MinSizeRel)
ENDIF()
IF (NOT LIBRARY_TYPE)
SET(LIBRARY_TYPE STATIC)
ENDIF()
STRING(TOUPPER ${LIBRARY_TYPE} LIBRARY_TYPE)
INCLUDE(platform)
INCLUDE(target)
ADD_SUBDIRECTORY(src)
ADD_CUSTOM_TARGET(
uninstall
"${CMAKE_COMMAND}" -P "${CMAKE_MODULE_PATH}/uninstall.cmake"
)
ADD_CUSTOM_TARGET(
dist
COMMENT "Creating distribution"
)
SET(DIST_DIR "${BIN_DIR}/dist")
IF (APPLE OR LINUX)
IF (APPLE)
SET(ZIP_FILE "efdl_mac64.zip")
ELSE()
SET(ZIP_FILE "efdl_linux64.zip")
ENDIF()
SET(ZIP_DIST "${BIN_DIR}/${ZIP_FILE}")
ADD_CUSTOM_COMMAND(
TARGET dist
POST_BUILD
COMMAND scripts/makedist.sh ${BIN_DIR} ${DIST_DIR} ${ZIP_DIST}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
ENDIF()
MESSAGE(STATUS "BUILD TYPE: ${CMAKE_BUILD_TYPE}")
MESSAGE(STATUS "INSTALL PREFIX: ${CMAKE_INSTALL_PREFIX}")
MESSAGE(STATUS "LIBRARY TYPE: ${LIBRARY_TYPE}")
IF (${LIBRARY_TYPE} MATCHES "STATIC")
SET(BIN_STATUS "BUILDING")
ELSE()
SET(BIN_STATUS "NOT BUILDING")
ENDIF()
MESSAGE(STATUS "EFDL BINARY: ${BIN_STATUS}")