From e395516541ecd2071eb3f0e9a81ebaaf8091cd10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AD=BB=E4=BD=93?= Date: Sat, 18 Feb 2023 15:59:46 +0100 Subject: [PATCH] Cleanup cmake output --- CMakeLists.txt | 24 +++++++++++------------- cmake/FindV8.cmake | 26 +++++++++++++------------- dependencies/gs2lib | 2 +- server/CMakeLists.txt | 13 ++++++------- 4 files changed, 31 insertions(+), 34 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2b43e76b..505fe48f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -88,38 +88,33 @@ configure_file( ${PROJECT_BINARY_DIR}/server/include/IConfig.h ) +message(STATUS "Configuring ${PROJECT_NAME} v${VER_FULL}") +list(APPEND CMAKE_MESSAGE_INDENT "* ") option(STATIC "Compile as a static runtime." ON) +message(STATUS "Compile as static runtime:\t\t\t\t\t${STATIC}") if(STATIC) - message("Compile as static runtime") add_definitions(-DSTATICLIB) set(BUILD_SHARED_LIBS FALSE CACHE BOOL "-" FORCE) else() - message("Don't compile as a static runtime") set(BUILD_SHARED_LIBS TRUE CACHE BOOL "-" FORCE) endif() option(GRALATNPC "Compile with Gralat NPC support, only works when V8NPCSERVER is enabled." ON) +message(STATUS "Compile with Gralat NPC support:\t\t\t${GRALATNPC}") if(GRALATNPC) - message("Compile with Gralat NPC support") add_definitions(-DGRALATNPC) -else() - message("Don't compile with Gralat NPC support") endif() option(V8NPCSERVER "Compile built-in V8 NPC-Server" OFF) +message(STATUS "Compile with built-in V8 NPC-Server:\t\t${V8NPCSERVER}") if(V8NPCSERVER) - message("Enabling built-in V8 NPC-Server") add_definitions(-DV8NPCSERVER) -else() - message("Disabling built-in V8 NPC-Server") endif() option(UPNP "Compile with UPNP support" OFF) +message(STATUS "Compile with UPNP support:\t\t\t\t\t${UPNP}") if(UPNP) - message("Enabling UPNP support") add_definitions(-DUPNP) -else() - message("Disabling UPNP support") endif() # Packaging @@ -250,7 +245,7 @@ endif() if(V8NPCSERVER) find_package(V8) if(NOT V8_FOUND) - message("v8 not found in system") + message(FATAL_ERROR "V8 not found in system") endif() endif() @@ -258,7 +253,7 @@ if(UPNP) find_package(Miniupnpc) if(NOT MINIUPNPC_FOUND) - message("MiniUPNPC not found in system. Compiling it ourselves.") + message(STATUS "MiniUPNPC not found in system. Compiling it ourselves.") if(STATIC) add_definitions(-DMINIUPNP_STATICLIB) @@ -294,6 +289,9 @@ add_subdirectory(${PROJECT_SOURCE_DIR}/bin) add_subdirectory(${PROJECT_SOURCE_DIR}/server) enable_testing() +set(CMAKE_MESSAGE_INDENT "") +message(STATUS "Configure Unit Testing") +set(CMAKE_MESSAGE_INDENT "* ") add_subdirectory(${PROJECT_SOURCE_DIR}/Catch_tests) set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT ${PROJECT_NAME}) diff --git a/cmake/FindV8.cmake b/cmake/FindV8.cmake index 6e7fbc54..24de0c57 100644 --- a/cmake/FindV8.cmake +++ b/cmake/FindV8.cmake @@ -6,7 +6,7 @@ # V8_FOUND, if false, do not try to link to V8 # V8_INCLUDE_DIR, where to find the headers -message("Looking for monolithic v8...") +message(STATUS "Looking for monolithic V8...") IF (NOT $ENV{V8_DIR} STREQUAL "") SET(V8_DIR $ENV{V8_DIR}) @@ -113,13 +113,13 @@ FIND_LIBRARY(V8_LIBRARY if(NOT V8_LIBRARY OR NOT V8_INCLUDE_DIR) if(NOT V8_LIBRARY) - message("Couldn't find v8 library.") + message(STATUS "Couldn't find V8 library.") endif() if(NOT V8_INCLUDE_DIR) - message("Couldn't find v8 include dir.") + message(STATUS "Couldn't find v8 include dir.") endif() - message("Monolith search failed, looking for mingw package") + message(STATUS "Monolith search failed, looking for mingw package") find_library(V8_MAIN_LIBRARY libv8.dll.a PATHS ${V8_LIBRARY_SEARCH_PATHS} @@ -138,7 +138,7 @@ if(NOT V8_LIBRARY OR NOT V8_INCLUDE_DIR) endif() if(NOT V8_MAIN_LIBRARY OR NOT V8_BASE_LIBRARY OR NOT V8_PLATFORM_LIBRARY) - message("Mingw package search failed, looking for nuget package") + message(STATUS "Mingw package search failed, looking for nuget package") if (NOT V8_LIBRARY AND NOT V8_INCLUDE_DIR AND MSVC) file(DOWNLOAD https://dist.nuget.org/win-x86-commandline/latest/nuget.exe ${CMAKE_BINARY_DIR}/nuget.exe) @@ -154,7 +154,7 @@ if(NOT V8_LIBRARY OR NOT V8_INCLUDE_DIR) endif() if(CMAKE_BUILD_TYPE STREQUAL "Release") - message("Searching for Release libraries as chosen") + message(STATUS "Searching for Release libraries as chosen") set(V8_LIBRARY_SEARCH_PATHS ${CMAKE_SOURCE_DIR}/packages/${V8_NUGET_NAME}/lib/Release ${V8_DIR}/Release @@ -167,11 +167,11 @@ if(NOT V8_LIBRARY OR NOT V8_INCLUDE_DIR) set(V8_REDIST_DIR ${CMAKE_SOURCE_DIR}/packages/${V8_NUGET_REDIST}/lib/Release) else() if(NOT CMAKE_BUILD_TYPE) - message("Searching for Debug libraries by default") + message(STATUS "Searching for Debug libraries by default") elseif(CMAKE_BUILD_TYPE STREQUAL "Debug") - message("Searching for Debug library as chosen") + message(STATUS "Searching for Debug library as chosen") else() - message("Build type not recognized, searching for Debug libraries") + message(STATUS "Build type not recognized, searching for Debug libraries") endif() set(V8_LIBRARY_SEARCH_PATHS ${CMAKE_SOURCE_DIR}/packages/${V8_NUGET_NAME}/lib/Debug @@ -197,7 +197,7 @@ if(NOT V8_LIBRARY OR NOT V8_INCLUDE_DIR) endif() if(NOT V8_MAIN_LIBRARY OR NOT V8_BASE_LIBRARY OR NOT V8_PLATFORM_LIBRARY) - message("Couldn't find v8 libraries as nuget package") + message(STATUS "Couldn't find V8 libraries as nuget package") else() file(GLOB V8_REDIST_LIBS "${V8_REDIST_DIR}/*.dll" "${V8_REDIST_DIR}/snapshot_blob.bin") foreach(V8_REDIST_LIB ${V8_REDIST_LIBS}) @@ -206,15 +206,15 @@ if(NOT V8_LIBRARY OR NOT V8_INCLUDE_DIR) endforeach() endif() if(NOT V8_INCLUDE_DIR) - message("Couldn't find v8 include dir as nuget package") + message(STATUS "Couldn't find V8 include dir as nuget package") endif() endif() IF (V8_INCLUDE_DIR AND ((V8_LIBRARY) OR (V8_MAIN_LIBRARY AND V8_BASE_LIBRARY AND V8_PLATFORM_LIBRARY))) - message("V8 found!") + message(STATUS "V8 found!") set(V8_FOUND TRUE) ELSE() - message("V8 lookup failed.") + message(FATAL_ERROR "V8 lookup failed.") ENDIF() diff --git a/dependencies/gs2lib b/dependencies/gs2lib index 7185f914..e209b6ea 160000 --- a/dependencies/gs2lib +++ b/dependencies/gs2lib @@ -1 +1 @@ -Subproject commit 7185f914488d5efc7aef75e03efbf9fcbf045ff4 +Subproject commit e209b6ea192eeb2e2156323fb828c17055b44595 diff --git a/server/CMakeLists.txt b/server/CMakeLists.txt index f7dd2262..11cc45ea 100644 --- a/server/CMakeLists.txt +++ b/server/CMakeLists.txt @@ -219,7 +219,7 @@ elseif(WIN32) # Using MSVC now looks for V8 as a nuget package first # Looking in lib folders if not found if(NOT V8_FOUND) - message("Findv8 failed, looking for v8 in supplied folders") + message(STATUS "FindV8 failed, looking for V8 in supplied folders") target_link_libraries(${TARGET_NAME} v8.dll.lib v8_libbase.dll.lib v8_libplatform.dll.lib) endif() endif() @@ -284,7 +284,7 @@ if (MINGW) file(CHMOD "./objdump_unix2dos.sh" PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE) function(install_library_with_deps LIBRARY) - message("Getting dependencies for ${LIBRARY}") + message(STATUS "Getting dependencies for ${LIBRARY}") file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/" @@ -302,14 +302,14 @@ if (MINGW) if(NOT IS_SYMLINK ${FILE}) install_library_with_deps(${FILE}) else() - message( "Symlink ${LIBRARY}: ${FILE}") + message(STATUS "Symlink ${LIBRARY}: ${FILE}") endif() endforeach() foreach(FILE ${UNRESOLVED_DEPS}) - message( "Unresolved from ${LIBRARY}: ${FILE}") + message(STATUS "Unresolved from ${LIBRARY}: ${FILE}") endforeach() endfunction() - message("Getting dependencies for ${MY_EXE}") + message(STATUS "Getting dependencies for ${MY_EXE}") file(GET_RUNTIME_DEPENDENCIES EXECUTABLES ${MY_EXE} RESOLVED_DEPENDENCIES_VAR RESOLVED_DEPS @@ -321,7 +321,7 @@ if (MINGW) install_library_with_deps(${FILE}) endforeach() foreach(FILE ${UNRESOLVED_DEPS}) - message( "Unresolved: ${FILE}") + message(STATUS "Unresolved: ${FILE}") endforeach() ]]) endif() @@ -340,7 +340,6 @@ if(V8NPCSERVER) endif() endif() - message("V8 include: ${V8_INCLUDE_DIR}") include_directories(${V8_INCLUDE_DIR}) add_custom_command(