-
-
Notifications
You must be signed in to change notification settings - Fork 60
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
89 lines (73 loc) · 2.74 KB
/
Copy pathCMakeLists.txt
File metadata and controls
89 lines (73 loc) · 2.74 KB
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
86
87
88
89
# CMakeLists.txt --- CMake project settings
##############################################################################
# CMake minimum version
cmake_minimum_required(VERSION 3.10)
# use new policy
cmake_policy(SET CMP0054 NEW)
cmake_policy(SET CMP0003 NEW)
if(POLICY CMP0091)
cmake_policy(SET CMP0091 NEW)
endif()
# enable testing
enable_testing()
# project name, version, and languages
project(RisohEditor VERSION 6.0.8 LANGUAGES CXX RC)
# PROJECT_VERSION macro
add_definitions(-DPROJECT_VERSION=\"${PROJECT_VERSION}\")
# set output directory (build/)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/build)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/build)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/build)
# define RISOHEDITOR
add_definitions(-DRISOHEDITOR)
# statically link
if (WIN32)
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
# using Clang
set(CMAKE_C_FLAGS "-static -W -Wno-missing-field-initializers")
set(CMAKE_CXX_FLAGS "-static -W -Wno-missing-field-initializers")
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
# using GCC
set(CMAKE_C_FLAGS "-static -W -Wno-missing-field-initializers")
set(CMAKE_CXX_FLAGS "-static -W -Wno-missing-field-initializers")
elseif (MSVC)
# use explicit runtime library settings (/MTd in Debug, /MT in others)
if(POLICY CMP0091)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
else()
# fallback for older CMake versions
set(CompilerFlags
CMAKE_C_FLAGS
CMAKE_C_FLAGS_DEBUG
CMAKE_C_FLAGS_RELEASE
CMAKE_C_FLAGS_MINSIZEREL
CMAKE_C_FLAGS_RELWITHDEBINFO
CMAKE_CXX_FLAGS
CMAKE_CXX_FLAGS_DEBUG
CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_MINSIZEREL
CMAKE_CXX_FLAGS_RELWITHDEBINFO)
foreach(CompilerFlags ${CompilerFlags})
string(REPLACE "/MD" "/MT" ${CompilerFlags} "${${CompilerFlags}}")
endforeach()
endif()
endif()
endif()
##############################################################################
include_directories(WonRes)
include_directories(WonSetThreadUILanguage)
add_subdirectory(WonRes)
if(MSVC AND TARGET WonRes AND DEFINED CMAKE_MSVC_RUNTIME_LIBRARY AND NOT CMAKE_MSVC_RUNTIME_LIBRARY STREQUAL "")
set_property(TARGET WonRes PROPERTY MSVC_RUNTIME_LIBRARY "${CMAKE_MSVC_RUNTIME_LIBRARY}")
endif()
add_definitions(-DMZC4_HANDLE_MAP=1)
add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NON_CONFORMING_WCSTOK -D_SCL_SECURE_NO_WARNINGS)
include_directories(EGA)
add_subdirectory(EGA)
include_directories(LineNumEdit)
add_subdirectory(LineNumEdit)
add_subdirectory(src)
add_subdirectory(tests)
add_subdirectory(mcdx)
add_subdirectory(MyWndCtrl)
##############################################################################