CMakeLists.txt
changeset 7223 b554726ff468
parent 7220 dfe678f129e4
child 7226 c3b4fc19fcd4
equal deleted inserted replaced
7220:dfe678f129e4 7223:b554726ff468
    45 set(HEDGEWARS_PROTO_VER 42)
    45 set(HEDGEWARS_PROTO_VER 42)
    46 set(HEDGEWARS_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
    46 set(HEDGEWARS_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
    47 
    47 
    48 
    48 
    49 #set some safe values
    49 #set some safe values
    50 IF(NOT WITH_SERVER)
       
    51     SET(WITH_SERVER 0)
       
    52 ENDIF(NOT WITH_SERVER)
       
    53 IF(NOT BUILD_ENGINE_LIBRARY)
    50 IF(NOT BUILD_ENGINE_LIBRARY)
    54     SET(BUILD_ENGINE_LIBRARY 0)
    51     SET(BUILD_ENGINE_LIBRARY 0)
    55 ENDIF(NOT BUILD_ENGINE_LIBRARY)
    52 ENDIF(NOT BUILD_ENGINE_LIBRARY)
    56 set(target_dir "bin")
    53 set(target_dir "bin")
    57 
    54 
   181     set(SHAREPATH share/hedgewars/)
   178     set(SHAREPATH share/hedgewars/)
   182 endif()
   179 endif()
   183 set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
   180 set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
   184 
   181 
   185 
   182 
   186 if(WITH_SERVER)
   183 if(NOT NOSERVER)
   187     if(GHC)
   184     if(GHC)
   188         set(ghc_executable ${GHC})
   185         set(ghc_executable ${GHC})
   189     else()
   186     else()
   190         find_program(ghc_executable ghc)
   187         find_program(ghc_executable ghc)
   191     endif()
   188     endif()
   192 
   189 
   193     if(ghc_executable)
   190     if(ghc_executable)
   194         set(HAVE_NETSERVER true)
   191         set(HAVE_NETSERVER true)
   195         add_subdirectory(gameServer)
   192         add_subdirectory(gameServer)
   196     else()
   193     else()
   197         message(STATUS "No GHC executable found, server will *not* be built")
   194         message(STATUS "No GHC executable found, server will not be built")
   198         set(HAVE_NETSERVER false)
   195         set(HAVE_NETSERVER false)
   199     endif()
   196     endif()
   200 else(WITH_SERVER)
   197 else()
       
   198     message(STATUS "Server will not be built per user request")
   201     set(HAVE_NETSERVER false)
   199     set(HAVE_NETSERVER false)
   202 endif(WITH_SERVER)
   200 endif()
   203 
   201 
   204 find_package(Lua)
   202 find_package(Lua)
   205 if(NOT ${LUA_FOUND})
   203 if(${LUA_FOUND})
   206         message(STATUS "Lua library not found, building bundled dependency")
   204     message(STATUS "Lua library is present on your system (${LUA_DEFAULT})")
       
   205 else()
       
   206     message(STATUS "Lua library not found, building bundled dependency")
   207     add_subdirectory(misc/liblua)
   207     add_subdirectory(misc/liblua)
   208     #link with liblua.a (which requires system readline)
   208     #linking with liblua.a requires system readline -- this works everywhere, right?
   209     set(pascal_flags "-k${CMAKE_BINARY_DIR}/bin/liblua.a" "-k-lreadline" ${pascal_flags})
   209     set(pascal_flags "-k${CMAKE_BINARY_DIR}/bin/liblua.a" "-k-lreadline" ${pascal_flags})
   210 endif()
   210 endif()
       
   211 
   211 add_subdirectory(hedgewars)
   212 add_subdirectory(hedgewars)
       
   213 
   212 
   214 
   213 #run cmake -DANDROID=1 to enable this
   215 #run cmake -DANDROID=1 to enable this
   214 if(ANDROID)
   216 if(ANDROID)
   215     add_subdirectory(project_files/Android-build)
   217     add_subdirectory(project_files/Android-build)
   216 endif()
   218 endif()
       
   219 
   217 
   220 
   218 if(NOT (BUILD_ENGINE_LIBRARY OR ANDROID))
   221 if(NOT (BUILD_ENGINE_LIBRARY OR ANDROID))
   219     add_subdirectory(bin)
   222     add_subdirectory(bin)
   220     add_subdirectory(misc/quazip)
   223     add_subdirectory(misc/quazip)
   221     add_subdirectory(QTfrontend)
   224     add_subdirectory(QTfrontend)