@@ -3,44 +3,7 @@ cmake_minimum_required(VERSION 3.11)
33project (emmy)
44set (CMAKE_INSTALL_PREFIX install )
55
6- if (MSVC )
7- set (CompilerFlags
8- CMAKE_CXX_FLAGS
9- CMAKE_CXX_FLAGS_DEBUG
10- CMAKE_CXX_FLAGS_RELEASE
11- CMAKE_C_FLAGS
12- CMAKE_C_FLAGS_DEBUG
13- CMAKE_C_FLAGS_RELEASE
14- )
15- foreach (CompilerFlag ${CompilerFlags} )
16- string (REPLACE "/MD" "/MT" ${CompilerFlag} "${${CompilerFlag} }" )
17- endforeach ()
18-
19- # add_definitions(-DUNICODE -D_UNICODE)
20- elseif (CMAKE_SYSTEM_NAME MATCHES "Linux" )
21- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x" )
22- elseif (CMAKE_SYSTEM_NAME MATCHES "Android" )
23- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x" )
24- else (MSVC )
25- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x" )
26- endif (MSVC )
27-
28- macro (source_group_by_dir proj_dir source_files )
29- if (MSVC OR APPLE )
30- get_filename_component (sgbd_cur_dir ${proj_dir} ABSOLUTE )
31- foreach (sgbd_file ${${source_files} })
32- get_filename_component (sgbd_abs_file ${sgbd_file} ABSOLUTE )
33- file (RELATIVE_PATH sgbd_fpath ${sgbd_cur_dir} ${sgbd_abs_file} )
34- string (REGEX REPLACE "\( .*\) /.*" \\1 sgbd_group_name ${sgbd_fpath} )
35- string (COMPARE EQUAL ${sgbd_fpath} ${sgbd_group_name} sgbd_nogroup)
36- string (REPLACE "/" "\\ " sgbd_group_name ${sgbd_group_name} )
37- if (sgbd_nogroup)
38- set (sgbd_group_name "\\ " )
39- endif (sgbd_nogroup)
40- source_group (${sgbd_group_name} FILES ${sgbd_file} )
41- endforeach (sgbd_file)
42- endif (MSVC OR APPLE )
43- endmacro (source_group_by_dir)
6+ set (CMAKE_CXX_STANDARD 11)
447
458set (EMMY_LUA_VERSION "54" CACHE STRING "Lua version: jit/51/52/53/54" )
469
@@ -82,6 +45,22 @@ add_subdirectory(emmy_debugger)
8245add_subdirectory (emmy_core)
8346
8447if (WIN32 )
48+ macro (source_group_by_dir proj_dir source_files )
49+ if (MSVC OR APPLE )
50+ get_filename_component (sgbd_cur_dir ${proj_dir} ABSOLUTE )
51+ foreach (sgbd_file ${${source_files} })
52+ get_filename_component (sgbd_abs_file ${sgbd_file} ABSOLUTE )
53+ file (RELATIVE_PATH sgbd_fpath ${sgbd_cur_dir} ${sgbd_abs_file} )
54+ string (REGEX REPLACE "\( .*\) /.*" \\1 sgbd_group_name ${sgbd_fpath} )
55+ string (COMPARE EQUAL ${sgbd_fpath} ${sgbd_group_name} sgbd_nogroup)
56+ string (REPLACE "/" "\\ " sgbd_group_name ${sgbd_group_name} )
57+ if (sgbd_nogroup)
58+ set (sgbd_group_name "\\ " )
59+ endif (sgbd_nogroup)
60+ source_group (${sgbd_group_name} FILES ${sgbd_file} )
61+ endforeach (sgbd_file)
62+ endif (MSVC OR APPLE )
63+ endmacro (source_group_by_dir)
8564 add_subdirectory (shared)
8665 add_subdirectory (emmy_tool)
8766 add_subdirectory (third-party/EasyHook)
0 commit comments