-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
64 lines (48 loc) · 2.04 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
CMAKE_MINIMUM_REQUIRED(VERSION 3.14)
IF(POLICY CMP0135)
CMAKE_POLICY(SET CMP0135 NEW)
ENDIF()
IF(POLICY CMP0077)
CMAKE_POLICY(SET CMP0077 NEW)
ENDIF()
PROJECT(devue)
OPTION(DEVUE_BUILD_PLUGINS "Build plugins." ON)
SET(DEVUE_LIBRARIES_DIR "${CMAKE_SOURCE_DIR}/libraries")
IF(WIN32 AND "${CMAKE_SIZEOF_VOID_P}" STREQUAL "8")
ENABLE_LANGUAGE("RC")
SET(OUTPUT_DIR "binaries/windows/${CMAKE_CXX_COMPILER_ID}/${CMAKE_BUILD_TYPE}")
STRING(TOLOWER ${OUTPUT_DIR} OUTPUT_DIR_LOWER)
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/${OUTPUT_DIR_LOWER}")
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/${OUTPUT_DIR_LOWER}")
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/${OUTPUT_DIR_LOWER}")
IF (MSVC)
ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS)
ADD_DEFINITIONS(-D_WINDOWS)
SET(CMAKE_C_FLAGS "/W3 /utf-8")
SET(CMAKE_C_FLAGS_DEBUG "/MTd /Od /Ob0 /RTC1 /Zi")
SET(CMAKE_C_FLAGS_RELEASE "/MT /O2 /Ob2 /GL /DNDEBUG")
SET(CMAKE_CXX_FLAGS "/std:c++20 /W3 /EHsc /utf-8")
SET(CMAKE_CXX_FLAGS_DEBUG "/MTd /Od /Ob0 /RTC1 /Zi")
SET(CMAKE_CXX_FLAGS_RELEASE "/MT /O2 /Ob2 /GL /DNDEBUG")
IF(CMAKE_BUILD_TYPE STREQUAL "Debug")
ADD_LINK_OPTIONS("/DEBUG")
ELSEIF(CMAKE_BUILD_TYPE STREQUAL "Release")
ADD_LINK_OPTIONS("/LTCG")
ENDIF()
ELSE()
MESSAGE(FATAL_ERROR "${CMAKE_CXX_COMPILER_ID} currently not supported.")
ENDIF()
ADD_SUBDIRECTORY("dependencies")
FILE(GLOB_RECURSE DEVUE_PLUGIN_CORE_HEADERS CONFIGURE_DEPENDS
"${DEVUE_PLUGIN_CORE_INCLUDES}/*.hpp"
)
IF(DEVUE_BUILD_PLUGINS)
SET_TARGET_PROPERTIES(devue_official_plugin
PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/plugins"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/plugins"
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/plugins"
)
ENDIF()
ADD_SUBDIRECTORY("source")
ENDIF()