From db2e468e918954d42fafbee3f690717aad59de22 Mon Sep 17 00:00:00 2001 From: halx99 Date: Thu, 12 Nov 2020 22:47:35 +0800 Subject: [PATCH] CMake, use file TO_CMAKE_PATH instead string replace [ci build] --- templates/cpp-template-default/CMakeLists.txt | 4 ++-- templates/lua-template-default/CMakeLists.txt | 4 ++-- tests/cpp-tests/CMakeLists.txt | 4 ++-- tests/fairygui-tests/CMakeLists.txt | 4 ++-- tests/lua-tests/project/CMakeLists.txt | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/templates/cpp-template-default/CMakeLists.txt b/templates/cpp-template-default/CMakeLists.txt index f5d031b44c..49e18e476c 100644 --- a/templates/cpp-template-default/CMakeLists.txt +++ b/templates/cpp-template-default/CMakeLists.txt @@ -36,9 +36,9 @@ if(NOT DEFINED BUILD_ENGINE_DONE) # to test HelloCpp into root project endif() if(NOT (ENGINEX_ROOT STREQUAL "")) - message(STATUS "Using system env var ENGINEX_ROOT=${ENGINEX_ROOT}") set(COCOS2DX_ROOT_PATH "${ENGINEX_ROOT}") - string(REPLACE "\\" "/" COCOS2DX_ROOT_PATH ${COCOS2DX_ROOT_PATH}) + file(TO_CMAKE_PATH ${COCOS2DX_ROOT_PATH} COCOS2DX_ROOT_PATH) # string(REPLACE "\\" "/" COCOS2DX_ROOT_PATH ${COCOS2DX_ROOT_PATH}) + message(STATUS "Using system env var ENGINEX_ROOT=${ENGINEX_ROOT}") else() message(FATAL_ERROR "Please run setup.py add system env var 'ENGINEX_ROOT' to specific the engine root") endif() diff --git a/templates/lua-template-default/CMakeLists.txt b/templates/lua-template-default/CMakeLists.txt index 72063c231a..692186d22a 100644 --- a/templates/lua-template-default/CMakeLists.txt +++ b/templates/lua-template-default/CMakeLists.txt @@ -33,9 +33,9 @@ if(ENGINEX_ROOT STREQUAL "") endif() if(NOT (ENGINEX_ROOT STREQUAL "")) - message(STATUS "Using system env var ENGINEX_ROOT=${ENGINEX_ROOT}") set(COCOS2DX_ROOT_PATH "${ENGINEX_ROOT}") - string(REPLACE "\\" "/" COCOS2DX_ROOT_PATH ${COCOS2DX_ROOT_PATH}) + file(TO_CMAKE_PATH ${COCOS2DX_ROOT_PATH} COCOS2DX_ROOT_PATH) # string(REPLACE "\\" "/" COCOS2DX_ROOT_PATH ${COCOS2DX_ROOT_PATH}) + message(STATUS "Using system env var ENGINEX_ROOT=${ENGINEX_ROOT}") else() message(FATAL_ERROR "Please run setup.py add system env var 'ENGINEX_ROOT' to specific the engine root") endif() diff --git a/tests/cpp-tests/CMakeLists.txt b/tests/cpp-tests/CMakeLists.txt index cc078d3fdc..188ac9db4c 100644 --- a/tests/cpp-tests/CMakeLists.txt +++ b/tests/cpp-tests/CMakeLists.txt @@ -11,9 +11,9 @@ if(NOT DEFINED BUILD_ENGINE_DONE) endif() if(NOT (ENGINEX_ROOT STREQUAL "")) - message(STATUS "Using system env var ENGINEX_ROOT=${ENGINEX_ROOT}") set(COCOS2DX_ROOT_PATH "${ENGINEX_ROOT}") - string(REPLACE "\\" "/" COCOS2DX_ROOT_PATH ${COCOS2DX_ROOT_PATH}) + file(TO_CMAKE_PATH ${COCOS2DX_ROOT_PATH} COCOS2DX_ROOT_PATH) # string(REPLACE "\\" "/" COCOS2DX_ROOT_PATH ${COCOS2DX_ROOT_PATH}) + message(STATUS "Using system env var ENGINEX_ROOT=${ENGINEX_ROOT}") else() set(COCOS2DX_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../..) endif() diff --git a/tests/fairygui-tests/CMakeLists.txt b/tests/fairygui-tests/CMakeLists.txt index bae98d2f17..bfb1e963b8 100644 --- a/tests/fairygui-tests/CMakeLists.txt +++ b/tests/fairygui-tests/CMakeLists.txt @@ -34,9 +34,9 @@ if(NOT DEFINED BUILD_ENGINE_DONE) endif() if(NOT (ENGINEX_ROOT STREQUAL "")) - message(STATUS "Using system env var ENGINEX_ROOT=${ENGINEX_ROOT}") set(COCOS2DX_ROOT_PATH "$ENV{COCOS2DX_ROOT}") - string(REPLACE "\\" "/" COCOS2DX_ROOT_PATH ${COCOS2DX_ROOT_PATH}) + file(TO_CMAKE_PATH ${COCOS2DX_ROOT_PATH} COCOS2DX_ROOT_PATH) # string(REPLACE "\\" "/" COCOS2DX_ROOT_PATH ${COCOS2DX_ROOT_PATH}) + message(STATUS "Using system env var ENGINEX_ROOT=${ENGINEX_ROOT}") else() set(COCOS2DX_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../..) endif() diff --git a/tests/lua-tests/project/CMakeLists.txt b/tests/lua-tests/project/CMakeLists.txt index b921143522..153ce7d15a 100644 --- a/tests/lua-tests/project/CMakeLists.txt +++ b/tests/lua-tests/project/CMakeLists.txt @@ -11,9 +11,9 @@ if(NOT DEFINED BUILD_ENGINE_DONE) endif() if(NOT (ENGINEX_ROOT STREQUAL "")) - message(STATUS "Using system env var ENGINEX_ROOT=${ENGINEX_ROOT}") set(COCOS2DX_ROOT_PATH "$ENV{COCOS2DX_ROOT}") - string(REPLACE "\\" "/" COCOS2DX_ROOT_PATH ${COCOS2DX_ROOT_PATH}) + file(TO_CMAKE_PATH ${COCOS2DX_ROOT_PATH} COCOS2DX_ROOT_PATH) # string(REPLACE "\\" "/" COCOS2DX_ROOT_PATH ${COCOS2DX_ROOT_PATH}) + message(STATUS "Using system env var ENGINEX_ROOT=${ENGINEX_ROOT}") else() set(COCOS2DX_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../..) endif()