Skip to content

Commit

Permalink
fix: correctly quote expanded variables (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
threeal authored May 2, 2024
1 parent 1eeaa78 commit 2a44298
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ endif()

list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
if(SUBPROJECT)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} PARENT_SCOPE)
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" PARENT_SCOPE)
endif()

if(NOT SUBPROJECT)
Expand Down
2 changes: 1 addition & 1 deletion cmake/MkdirRecursive.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
include_guard(GLOBAL)

function(mkdir_recursive DIR_PATH)
file(MAKE_DIRECTORY ${DIR_PATH})
file(MAKE_DIRECTORY "${DIR_PATH}")
endfunction()
2 changes: 1 addition & 1 deletion cmake/MyMkdirConfig.cmake
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
if(NOT CMAKE_CURRENT_LIST_DIR IN_LIST CMAKE_MODULE_PATH)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}")
endif()
8 changes: 4 additions & 4 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
function(add_cmake_test FILE)
foreach(NAME ${ARGN})
string(TOLOWER ${NAME} TEST_COMMAND)
string(REPLACE " " "_" TEST_COMMAND ${TEST_COMMAND})
string(TOLOWER "${NAME}" TEST_COMMAND)
string(REPLACE " " "_" TEST_COMMAND "${TEST_COMMAND}")
add_test(
NAME ${NAME}
COMMAND ${CMAKE_COMMAND}
NAME "${NAME}"
COMMAND "${CMAKE_COMMAND}"
-D CMAKE_MODULE_PATH=${CMAKE_MODULE_PATH}
-D TEST_COMMAND=${TEST_COMMAND}
-P ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}
Expand Down

0 comments on commit 2a44298

Please sign in to comment.