CMakeLists.txt
branchwebgl
changeset 9980 a666e4eefd27
parent 9950 2759212a27de
child 10015 4feced261c68
equal deleted inserted replaced
9978:6199f64d3f8a 9980:a666e4eefd27
    31 option(ANDROID "Enable Android build (off)" OFF)
    31 option(ANDROID "Enable Android build (off)" OFF)
    32 
    32 
    33 option(MINIMAL_FLAGS "Respect system flags as much as possible (off)" OFF)
    33 option(MINIMAL_FLAGS "Respect system flags as much as possible (off)" OFF)
    34 option(NOAUTOUPDATE "Disable OS X Sparkle update checking (off)" OFF)
    34 option(NOAUTOUPDATE "Disable OS X Sparkle update checking (off)" OFF)
    35 
    35 
    36 option(WEBGL "Enable WebGL build (implies NOPASCAL) [default: off]" OFF)
    36 option(WEBGL "Enable WebGL build (implies BUILD_ENGINE_C) [default: off]" OFF)
    37 option(NOPASCAL "Compile hwengine as native C [default: off]" ${WEBGL})
    37 option(BUILD_ENGINE_C "Compile hwengine as native C [default: off]" ${WEBGL})
    38 option(GL2 "Enable OpenGL 2 rendering [default: off]" OFF)
    38 option(GL2 "Enable OpenGL 2 rendering [default: off]" OFF)
    39 
    39 
    40 set(GHFLAGS "" CACHE STRING "Additional Haskell flags")
    40 set(GHFLAGS "" CACHE STRING "Additional Haskell flags")
    41 if(UNIX AND NOT APPLE)
    41 if(UNIX AND NOT APPLE)
    42     set(DATA_INSTALL_DIR "share/hedgewars" CACHE STRING "Resource folder path")
    42     set(DATA_INSTALL_DIR "share/hedgewars" CACHE STRING "Resource folder path")
   117                               )
   117                               )
   118 endif()
   118 endif()
   119 
   119 
   120 
   120 
   121 #build engine without freepascal
   121 #build engine without freepascal
   122 if(${NOPASCAL})
   122 if(BUILD_ENGINE_C)
   123     find_package(Clang REQUIRED)
   123     find_package(Clang REQUIRED)
   124 
   124 
   125     if(CLANG_VERSION VERSION_LESS "3.0")
   125     if(CLANG_VERSION VERSION_LESS "3.0")
   126         message(FATAL_ERROR "LLVM/Clang compiler required version is 3.0 but version ${CLANG_VERSION} was found!")
   126         message(FATAL_ERROR "LLVM/Clang compiler required version is 3.0 but version ${CLANG_VERSION} was found!")
   127     endif()
   127     endif()
   128 
   128 
   129     set(CMAKE_C_COMPILER ${CLANG_EXECUTABLE})
   129     set(CMAKE_C_COMPILER ${CLANG_EXECUTABLE})
   130     set(CMAKE_CXX_COMPILER ${CLANG_EXECUTABLE})
   130     set(CMAKE_CXX_COMPILER ${CLANG_EXECUTABLE})
   131 endif(${NOPASCAL})
   131 endif()
   132 
   132 
   133 
   133 
   134 #server
   134 #server
   135 if(NOT NOSERVER)
   135 if(NOT NOSERVER)
   136     add_subdirectory(gameServer)
   136     add_subdirectory(gameServer)
   205 if(NOT BUILD_ENGINE_LIBRARY AND APPLE)
   205 if(NOT BUILD_ENGINE_LIBRARY AND APPLE)
   206     add_subdirectory(hedgewars/sdlmain)
   206     add_subdirectory(hedgewars/sdlmain)
   207 endif()
   207 endif()
   208 
   208 
   209 #TODO: nowadays this could be merged inside hedgewars/CMakeLists.txt
   209 #TODO: nowadays this could be merged inside hedgewars/CMakeLists.txt
   210 if(NOPASCAL)
   210 if(BUILD_ENGINE_C)
   211     #pascal to c converter
   211     #pascal to c converter
   212     add_subdirectory(tools/pas2c)
   212     add_subdirectory(tools/pas2c)
   213     add_subdirectory(project_files/hwc)
   213     add_subdirectory(project_files/hwc)
   214 else()
   214 else()
   215     #main pascal engine
   215     #main pascal engine