CMake, use file TO_CMAKE_PATH instead string replace [ci build]

This commit is contained in:
halx99 2020-11-12 22:47:35 +08:00
parent b8a3de050f
commit db2e468e91
5 changed files with 10 additions and 10 deletions

View File

@ -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()

View File

@ -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()

View File

@ -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()

View File

@ -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()

View File

@ -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()