forked from xeonye/ccxx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
54 lines (40 loc) · 2.17 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
cmake_minimum_required(VERSION 3.0)
set(gs_project_path ${CMAKE_CURRENT_SOURCE_DIR})
if (NOT gs_project_deploy_path)
set(gs_project_deploy_path ${gs_project_path}/build/deploy)
if (UNIX)
set(gs_project_output_path_debug ${gs_project_deploy_path}/unix/bin_d)
set(gs_project_output_path_release ${gs_project_deploy_path}/unix/bin)
endif()
if (WIN32)
set(gs_project_output_path_debug ${gs_project_deploy_path}/win32/bin_d)
set(gs_project_output_path_release ${gs_project_deploy_path}/win32/bin)
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static-libgcc -static-libstdc++")
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libgcc -static-libstdc++")
set(gs_project_output_path_debug ${gs_project_deploy_path}/win32/bin_gnu_d)
set(gs_project_output_path_release ${gs_project_deploy_path}/win32/bin_gnu)
endif()
endif()
SET( CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG "${gs_project_output_path_debug}")
SET( CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE "${gs_project_output_path_release}")
SET( CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG "${gs_project_output_path_debug}")
SET( CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE "${gs_project_output_path_release}")
SET( CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG "${gs_project_output_path_debug}")
SET( CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE "${gs_project_output_path_release}")
message(${gs_project_output_path_debug})
message(${gs_project_output_path_release})
endif()
message("----------------------------------------------------------------------")
set(CMAKE_CXX_STANDARD 11)
include(./build/cmake/local.config.cmake)
include(./build/cmake/common.cmake)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
include_directories(${gs_project_include_path})
# set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
# set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
include(./gtest/googletest/googletest/cmake/internal_utils.cmake)
config_compiler_and_linker() # Defined in internal_utils.cmake.
add_subdirectory(./3rd)
add_subdirectory(./gtest)
add_subdirectory(./build/cmake)