# HG changeset patch # User koda # Date 1352498194 -3600 # Node ID da4c6db6ea6be3d568f72708898026688ac630a2 # Parent 37906395882177e3a9679473901fb450c59cfef0 correct includes and clang detection diff -r 379063958821 -r da4c6db6ea6b project_files/hwc/CMakeLists.txt --- 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) diff -r 379063958821 -r da4c6db6ea6b project_files/hwc/rtl/CMakeLists.txt --- 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)