--- a/project_files/hwc/CMakeLists.txt Fri Nov 09 12:29:24 2012 -0500
+++ b/project_files/hwc/CMakeLists.txt Fri Nov 09 22:56:34 2012 +0100
@@ -1,3 +1,24 @@
+
+if(CLANG)
+ set(clang_executable ${CLANG})
+else()
+ find_program(clang_executable clang)
+endif()
+
+if (clang_executable)
+ exec_program(${clang_executable} ARGS "-v" OUTPUT_VARIABLE clang_version_full)
+ string(REGEX MATCH "[0-9]+\\.[0-9]+" clang_version_long "${clang_version_full}")
+ string(REGEX REPLACE "([0-9]+\\.[0-9]+)" "\\1" clang_version "${clang_version_long}")
+ message(STATUS "Found CLANG: ${clang_executable} (version ${clang_version})")
+else()
+ message(FATAL_ERROR "No LLVM/Clang compiler found (required for engine_c target)")
+endif()
+
+
+find_package(GLEW REQUIRED)
+
+
+set(CMAKE_C_COMPILER ${clang_executable})
configure_file(${hedgewars_SOURCE_DIR}/hedgewars/config.inc.in ${CMAKE_CURRENT_BINARY_DIR}/config.inc)
@@ -11,10 +32,9 @@
add_subdirectory(rtl)
-find_package(GLEW REQUIRED)
-message("${GLEW_INCLUDE_PATH}")
+include_directories("${GLEW_INCLUDE_PATH}")
+include_directories(rtl)
-include_directories(rtl)
file(GLOB engine_src *.c)
add_executable(hwengine WIN32 ${engine_src})
add_dependencies(hwengine engine_c fpcrtl)
--- a/project_files/hwc/rtl/CMakeLists.txt Fri Nov 09 12:29:24 2012 -0500
+++ b/project_files/hwc/rtl/CMakeLists.txt Fri Nov 09 22:56:34 2012 +0100
@@ -6,6 +6,8 @@
sysutils.c
)
+include_directories(${GLEW_INCLUDE_PATH})
+
add_library(fpcrtl ${fpcrtl_src})
if(WEBGL)