# Set some random things default to not being visible in the GUI
mark_as_advanced(EXECUTABLE_OUTPUT_PATH LIBRARY_OUTPUT_PATH)
-mark_as_advanced(JTHREAD_INCLUDE_DIR JTHREAD_LIBRARY)
mark_as_advanced(SQLITE3_INCLUDE_DIR SQLITE3_LIBRARY)
mark_as_advanced(JSON_INCLUDE_DIR JSON_LIBRARY)
set(CLIENT_PLATFORM_LIBS ${CLIENT_PLATFORM_LIBS} ${XXF86VM_LIBRARY})
endif()
-find_package(Jthread REQUIRED)
find_package(Sqlite3 REQUIRED)
find_package(Json REQUIRED)
find_package(OpenGLES2)
-SET(LEVELDB_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/leveldb/include)
-SET(LEVELDB_LIBRARY leveldb)
-
if(USE_FREETYPE)
find_package(Freetype REQUIRED)
set(CGUITTFONT_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/cguittfont")
message (STATUS "LuaJIT library: ${LUA_LIBRARY}")
message (STATUS "LuaJIT headers: ${LUA_INCLUDE_DIR}")
+set(USE_LUAJIT 0)
if(LUA_LIBRARY AND LUA_INCLUDE_DIR)
message (STATUS "LuaJIT found.")
+ set(USE_LUAJIT 1)
else(LUA_LIBRARY AND LUA_INCLUDE_DIR)
message (STATUS "LuaJIT not found, using bundled Lua.")
set(LUA_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/lua/src")
OPTION(ENABLE_LEVELDB "Enable LevelDB backend")
if(ENABLE_LEVELDB)
- set(USE_LEVELDB 1)
- message(STATUS "LevelDB backend enabled")
- include_directories(${LEVELDB_INCLUDE_DIR})
+ find_library(LEVELDB_LIBRARY leveldb)
+ find_path(LEVELDB_INCLUDE_DIR db.h PATH_SUFFIXES leveldb)
+ message (STATUS "LevelDB library: ${LEVELDB_LIBRARY}")
+ message (STATUS "LevelDB headers: ${LEVELDB_INCLUDE_DIR}")
+ if(LEVELDB_LIBRARY AND LEVELDB_INCLUDE_DIR)
+ set(USE_LEVELDB 1)
+ message(STATUS "LevelDB backend enabled")
+ include_directories(${LEVELDB_INCLUDE_DIR})
+ else(LEVELDB_LIBRARY AND LEVELDB_INCLUDE_DIR)
+ set(USE_LEVELDB 0)
+ message(STATUS "LevelDB not found!")
+ endif(LEVELDB_LIBRARY AND LEVELDB_INCLUDE_DIR)
endif(ENABLE_LEVELDB)
configure_file(
"${PROJECT_BINARY_DIR}/cmake_config.h"
)
+add_subdirectory(jthread)
add_subdirectory(script)
add_subdirectory(util)
serverlist.cpp
pathfinder.cpp
convert_json.cpp
+ ${JTHREAD_SRCS}
${common_SCRIPT_SRCS}
${UTIL_SRCS}
)
${PNG_INCLUDE_DIR}
${GETTEXT_INCLUDE_DIR}
${SOUND_INCLUDE_DIRS}
- ${JTHREAD_INCLUDE_DIR}
${SQLITE3_INCLUDE_DIR}
${LUA_INCLUDE_DIR}
${JSON_INCLUDE_DIR}
${X11_LIBRARIES}
${GETTEXT_LIBRARY}
${SOUND_LIBRARIES}
- ${JTHREAD_LIBRARY}
${SQLITE3_LIBRARY}
${LUA_LIBRARY}
${JSON_LIBRARY}
target_link_libraries(
${PROJECT_NAME}server
${ZLIB_LIBRARIES}
- ${JTHREAD_LIBRARY}
${SQLITE3_LIBRARY}
${JSON_LIBRARY}
${GETTEXT_LIBRARY}
# Subdirectories
-if (JTHREAD_FOUND)
-else (JTHREAD_FOUND)
- add_subdirectory(jthread)
-endif (JTHREAD_FOUND)
-
if (SQLITE3_FOUND)
else (SQLITE3_FOUND)
add_subdirectory(sqlite)
add_subdirectory(json)
endif (JSON_FOUND)
-if (USE_LEVELDB)
- add_subdirectory(leveldb)
-endif (USE_LEVELDB)
#end