aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJukka Jylänki <jujjyl@gmail.com>2013-09-03 16:08:54 +0300
committerJukka Jylänki <jujjyl@gmail.com>2013-09-04 10:42:05 +0300
commitc51c5308b9d3243fec791fb39ca7691706b037e7 (patch)
tree5cb1fdd83071947ace7de1626c873c8fecb35bb4
parent3b170ade86c57f3f073438d9c91d59ec56b9ae73 (diff)
Remove the need to pass CMAKE_MODULE_PATH to CMake by weakly setting it in the toolchain file.
-rw-r--r--cmake/Platform/Emscripten.cmake7
-rw-r--r--tests/test_other.py1
2 files changed, 5 insertions, 3 deletions
diff --git a/cmake/Platform/Emscripten.cmake b/cmake/Platform/Emscripten.cmake
index c1da7e5b..082296f2 100644
--- a/cmake/Platform/Emscripten.cmake
+++ b/cmake/Platform/Emscripten.cmake
@@ -4,7 +4,6 @@
# To use this toolchain file with CMake, invoke CMake with the following command line parameters
# cmake -DCMAKE_TOOLCHAIN_FILE=<EmscriptenRoot>/cmake/Platform/Emscripten.cmake
-# -DCMAKE_MODULE_PATH=<EmscriptenRoot>/cmake
# -DCMAKE_BUILD_TYPE=<Debug|RelWithDebInfo|Release|MinSizeRel>
# -G "Unix Makefiles" (Linux and OSX)
# -G "MinGW Makefiles" (Windows)
@@ -43,7 +42,11 @@ endif()
# Normalize, convert Windows backslashes to forward slashes or CMake will crash.
get_filename_component(EMSCRIPTEN_ROOT_PATH "${EMSCRIPTEN_ROOT_PATH}" ABSOLUTE)
-set(CMAKE_FIND_ROOT_PATH "${EMSCRIPTEN_ROOT_PATH}")
+if ("${CMAKE_MODULE_PATH}" STREQUAL "")
+ set(CMAKE_MODULE_PATH "${EMSCRIPTEN_ROOT_PATH}/cmake")
+endif()
+
+set(CMAKE_FIND_ROOT_PATH "${EMSCRIPTEN_ROOT_PATH}/cmake")
if (CMAKE_HOST_WIN32)
set(EMCC_SUFFIX ".bat")
diff --git a/tests/test_other.py b/tests/test_other.py
index dbaabd84..c3efb051 100644
--- a/tests/test_other.py
+++ b/tests/test_other.py
@@ -301,7 +301,6 @@ f.close()
# Run Cmake
cmd = ['cmake', '-DCMAKE_TOOLCHAIN_FILE='+path_from_root('cmake', 'Platform', 'Emscripten.cmake'),
'-DCMAKE_BUILD_TYPE=' + configuration,
- '-DCMAKE_MODULE_PATH=' + path_from_root('cmake').replace('\\', '/'),
'-G', generator, cmakelistsdir]
ret = Popen(cmd, stdout=None if verbose else PIPE, stderr=None if verbose else PIPE).communicate()
if len(ret) > 1 and ret[1] != None and len(ret[1].strip()) > 0: