aboutsummaryrefslogtreecommitdiff
path: root/cmake/Platform
diff options
context:
space:
mode:
authorJukka Jylänki <jujjyl@gmail.com>2012-11-12 22:46:30 +0200
committerJukka Jylänki <jujjyl@gmail.com>2012-11-12 22:46:30 +0200
commit5e76172841bd1833c6289efb6723aa9fef26b516 (patch)
tree518e68396981e8a02944af46185e15067a93f6ca /cmake/Platform
parent098a94a5785067effa7214c20ef5312d103a35f8 (diff)
Update cmake scripts.
Diffstat (limited to 'cmake/Platform')
-rw-r--r--cmake/Platform/Emscripten.cmake10
-rw-r--r--cmake/Platform/Emscripten_unix.cmake12
2 files changed, 16 insertions, 6 deletions
diff --git a/cmake/Platform/Emscripten.cmake b/cmake/Platform/Emscripten.cmake
index 63b8da78..e050d8a6 100644
--- a/cmake/Platform/Emscripten.cmake
+++ b/cmake/Platform/Emscripten.cmake
@@ -23,10 +23,12 @@ endif()
set(CMAKE_FIND_ROOT_PATH $ENV{EMSCRIPTEN})
# Specify the compilers to use for C and C++
-set(CMAKE_C_COMPILER "${EMCC_PATH}emcc")
-set(CMAKE_CXX_COMPILER "${EMCC_PATH}em++")
-set(CMAKE_AR "${EMCC_PATH}emar")
-set(CMAKE_RANLIB "${EMCC_PATH}emranlib")
+if ("${CMAKE_C_COMPILER}" STREQUAL "")
+ set(CMAKE_C_COMPILER "emcc")
+ set(CMAKE_CXX_COMPILER "em++")
+ set(CMAKE_AR "emar")
+ set(CMAKE_RANLIB "emranlib")
+endif()
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
diff --git a/cmake/Platform/Emscripten_unix.cmake b/cmake/Platform/Emscripten_unix.cmake
index 1e1d7fa9..5358138f 100644
--- a/cmake/Platform/Emscripten_unix.cmake
+++ b/cmake/Platform/Emscripten_unix.cmake
@@ -1,5 +1,13 @@
# On Unix platforms, we must specify the absolute path to emcc for cmake, having emcc in PATH will cause cmake to fail finding it.
# The user must set the EMSCRIPTEN variable to point to the Emscripten root folder.
-file(TO_CMAKE_PATH "$ENV{EMSCRIPTEN/}" EMCC_PATH)
-include(Emscripten.cmake)
+if ("$ENV{EMSCRIPTEN}" STREQUAL "")
+ message(ERROR "Environment variable EMSCRIPTEN has not been set! Please point it to Emscripten root directory!")
+endif()
+
+set(CMAKE_C_COMPILER "$ENV{EMSCRIPTEN}/emcc")
+set(CMAKE_CXX_COMPILER "$ENV{EMSCRIPTEN}/em++")
+set(CMAKE_AR "$ENV{EMSCRIPTEN}/emar")
+set(CMAKE_RANLIB "$ENV{EMSCRIPTEN}/emranlib")
+
+include($ENV{EMSCRIPTEN}/cmake/Platform/Emscripten.cmake)