CMakeLists.txt
branchwebgl
changeset 9238 84e591af6c29
parent 9236 ddd675825672
child 9244 bb95e351270c
equal deleted inserted replaced
9236:ddd675825672 9238:84e591af6c29
   128 else()
   128 else()
   129     list(APPEND haskell_flags "-w" # no warnings
   129     list(APPEND haskell_flags "-w" # no warnings
   130                               )
   130                               )
   131 endif()
   131 endif()
   132 
   132 
   133 if (${NOPASCAL})
   133 
       
   134 #build engine without freepascal
       
   135 if(${NOPASCAL})
   134     find_package(Clang)
   136     find_package(Clang)
   135     # Check LLVM/Clang version
   137     # Check LLVM/Clang version
   136 	if (CLANG_VERSION VERSION_LESS required_clang_version)
   138     if(CLANG_VERSION VERSION_LESS required_clang_version)
   137 		message(FATAL_ERROR "LLVM/Clang compiler required version is ${required_clang_version} but version ${CLANG_VERSION} was found!")
   139 	message(FATAL_ERROR "LLVM/Clang compiler required version is ${required_clang_version} but version ${CLANG_VERSION} was found!")
   138 	else()
   140     else()
   139 		message(STATUS "Found CLANG: ${CLANG_EXECUTABLE} (version ${CLANG_VERSION})")
   141         message(STATUS "Found CLANG: ${CLANG_EXECUTABLE} (version ${CLANG_VERSION})")
   140 	endif()
   142     endif()
   141 endif(${NOPASCAL})
   143 endif(${NOPASCAL})
   142 
   144 
   143 
   145 
   144 #Haskell compiler discovery (for server and engine in c)
   146 #server
   145 if((NOT NOSERVER) OR NOPASCAL)
   147 if(NOT NOSERVER)
   146     if(GHC)
       
   147         set(ghc_executable ${GHC})
       
   148     else()
       
   149         find_program(ghc_executable ghc)
       
   150     endif()
       
   151 
       
   152     if(ghc_executable)
       
   153         exec_program(${ghc_executable} ARGS "-V" OUTPUT_VARIABLE ghc_version_long)
       
   154         string(REGEX REPLACE ".*([0-9]+\\.[0-9]+\\.[0-9]+)" "\\1" ghc_version "${ghc_version_long}")
       
   155         message(STATUS "Found GHC: ${ghc_executable} (version ${ghc_version})")
       
   156     else()
       
   157         message(STATUS "Could NOT find GHC, needed by gameServer and pas2c")
       
   158     endif()
       
   159 endif()
       
   160 
       
   161 
       
   162 #check gameServer
       
   163 if((ghc_executable) AND (NOT NOSERVER) AND (NOT WEBGL))
       
   164     set(HAVE_NETSERVER true)
       
   165     add_subdirectory(gameServer)
   148     add_subdirectory(gameServer)
   166 else()
       
   167     message(STATUS "Skipping gameServer target")
       
   168     set(HAVE_NETSERVER false)
       
   169 endif()
   149 endif()
   170 
   150 
   171 
   151 
   172 #lua discovery
   152 #lua discovery
   173 if (${LUA_SYSTEM})
   153 if (${LUA_SYSTEM})
   232 find_package_or_disable_msg(FFMPEG NOVIDEOREC "Video recording will not be built")
   212 find_package_or_disable_msg(FFMPEG NOVIDEOREC "Video recording will not be built")
   233 
   213 
   234 #physfs helper library
   214 #physfs helper library
   235 add_subdirectory(misc/libphyslayer)
   215 add_subdirectory(misc/libphyslayer)
   236 
   216 
       
   217 #TODO: nowadays this could be merged inside hedgewars/CMakeLists.txt
   237 if(NOPASCAL)
   218 if(NOPASCAL)
   238     if (NOT ghc_executable)
   219     add_subdirectory(hedgewars/sdlmain)
   239         message(FATAL_ERROR "A Haskell compiler is required to build engine in C")
       
   240     endif()
       
   241     add_subdirectory(hedgewars/sdlmain_osx)
       
   242     #pascal to c converter
   220     #pascal to c converter
   243     add_subdirectory(tools/pas2c)
   221     add_subdirectory(tools/pas2c)
   244     add_subdirectory(project_files/hwc)
   222     add_subdirectory(project_files/hwc)
   245 else()
   223 else()
   246     #main pascal engine
   224     #main pascal engine