Skip to content

Commit

Permalink
Root CMakeLists.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
oudream committed Apr 26, 2018
1 parent 8b2dcd0 commit 10345b9
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 27 deletions.
1 change: 1 addition & 0 deletions 3rd/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@

add_subdirectory(./re2-2018-04-01)
add_subdirectory(./libuv-2018-04-26)
30 changes: 30 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,36 @@ endif()

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_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)
Expand Down
57 changes: 30 additions & 27 deletions build/cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,43 +24,45 @@ set(gs_project_enable_qt 1)
if (NOT gs_project_path)
set(gs_project_path ${CMAKE_CURRENT_SOURCE_DIR}/../..)
endif()

message('PROJECT-PATH: ' ${gs_project_path})
message(${CMAKE_C_COMPILER_ID})
message(${CMAKE_CXX_COMPILER_ID})
#message(${CMAKE_PREFIX_PATH})

set(gs_project_deploy_path ${gs_project_path}/build/deploy)
set(gs_project_include_path ${gs_project_path}/include)
set(gs_project_3rd_path ${gs_project_path}/3rd)

set(gs_ccxx_path ${gs_project_path})

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)
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(${CMAKE_C_COMPILER_ID})
message(${CMAKE_CXX_COMPILER_ID})
message(${gs_project_output_path_debug})
message(${gs_project_output_path_release})
#message(${CMAKE_PREFIX_PATH})
message("----------------------------------------------------------------------")

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}")

set(CMAKE_CXX_STANDARD 11)

include(common.cmake)
Expand All @@ -71,6 +73,7 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
include_directories(${gs_project_include_path})

###lib exe
set(gs_ccxx_path ${gs_project_path})
add_subdirectory(ccxx)

message(bging 001)
Expand Down

0 comments on commit 10345b9

Please sign in to comment.