Skip to content

Commit

Permalink
Add CMAKE_MODULE_PATH for tests #8
Browse files Browse the repository at this point in the history
  • Loading branch information
Zerg1996 committed Jul 10, 2018
1 parent abb6269 commit f692654
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
cmake_minimum_required (VERSION 3.5)

set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/share/modules/cmake")

install(DIRECTORY share DESTINATION .)

enable_testing()
Expand Down
2 changes: 1 addition & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ endif()
function(create_test NAME TEST)
set(CONTEXT)
# get_cmake_property(VARS VARIABLES)
foreach(VAR_NAME CMAKE_TOOLCHAIN_FILE CMAKE_CROSSCOMPILING)
foreach(VAR_NAME CMAKE_TOOLCHAIN_FILE CMAKE_CROSSCOMPILING CMAKE_MODULE_PATH)
list(APPEND CONTEXT -D${VAR_NAME}=${${VAR_NAME}})
endforeach()
add_custom_target(${NAME} COMMAND ${CMAKE_COMMAND} ${CONTEXT} -P ${CMAKE_CURRENT_SOURCE_DIR}/test.cmake ${TEST} ${CMAKE_CURRENT_BINARY_DIR}/tmp/${NAME})
Expand Down
1 change: 1 addition & 0 deletions test/libbasicnamespace/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ include(CMInstallTargets)
include(CMDeploy)
include(CMTest)
include(CMSetupVersion)
include(CMFuture)

cm_setup_version(VERSION 1.0)

Expand Down
1 change: 1 addition & 0 deletions test/test.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ function(install_dir DIR)
set(TOOLCHAIN_ARG "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}")
endif()
test_exec(COMMAND ${CMAKE_COMMAND}
-DCMAKE_MODULE_PATH=${CMAKE_MODULE_PATH}
-DCMAKE_PREFIX_PATH=${PREFIX}
-DCMAKE_INSTALL_PREFIX=${PREFIX}
-DTHREADS_PREFER_PTHREAD_FLAG=1
Expand Down

0 comments on commit f692654

Please sign in to comment.