-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
55 lines (42 loc) · 1.69 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
CMAKE_MINIMUM_REQUIRED(VERSION 3.14)
IF(POLICY CMP0135)
CMAKE_POLICY(SET CMP0135 NEW)
ENDIF()
PROJECT(devue_plugin CXX)
GET_DIRECTORY_PROPERTY(PARENT_DIR PARENT_DIRECTORY)
IF(PARENT_DIR STREQUAL "")
SET(PLUGIN_TOP_LEVEL TRUE)
ELSE()
SET(PLUGIN_TOP_LEVEL FALSE)
ENDIF()
IF(NOT WIN32)
MESSAGE(FATAL_ERROR "Unsupported platform.")
ENDIF()
IF(NOT "${CMAKE_SIZEOF_VOID_P}" STREQUAL "8")
MESSAGE(FATAL_ERROR "Unsupported architecture.")
ENDIF()
ENABLE_LANGUAGE("RC")
IF(PLUGIN_TOP_LEVEL)
SET(PLUGIN_OUTPUT_DIR "binaries/windows/${CMAKE_CXX_COMPILER_ID}/${CMAKE_BUILD_TYPE}")
STRING(TOLOWER ${PLUGIN_OUTPUT_DIR} PLUGIN_OUTPUT_DIR_LOWER)
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/${PLUGIN_OUTPUT_DIR_LOWER}")
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/${PLUGIN_OUTPUT_DIR_LOWER}")
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/${PLUGIN_OUTPUT_DIR_LOWER}")
IF(CMAKE_CXX_COMPILER_ID STREQUAL "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 /we4297")
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()
ENDIF()
ENDIF()
ADD_SUBDIRECTORY("dependencies")
ADD_SUBDIRECTORY("source")