Fix building when some database libraries are not installed.

This commit is contained in:
Rogier 2015-10-24 16:48:47 +02:00
parent 333e6b22fc
commit 5e7f7c74c0

View File

@ -236,32 +236,34 @@ set(mapper_SRCS
mapper.cpp mapper.cpp
) )
set(LINK_LIBRARIES
minetestmapper
${LIBGD_LIBRARY}
${ZLIB_LIBRARY}
)
if(USE_SQLITE3) if(USE_SQLITE3)
set(mapper_SRCS ${mapper_SRCS} db-sqlite3.cpp) set(mapper_SRCS ${mapper_SRCS} db-sqlite3.cpp)
set(LINK_LIBRARIES ${LINK_LIBRARIES} ${SQLITE3_LIBRARY})
endif(USE_SQLITE3) endif(USE_SQLITE3)
if(USE_LEVELDB) if(USE_LEVELDB)
set(mapper_SRCS ${mapper_SRCS} db-leveldb.cpp) set(mapper_SRCS ${mapper_SRCS} db-leveldb.cpp)
set(LINK_LIBRARIES ${LINK_LIBRARIES} ${LEVELDB_LIBRARY})
endif(USE_LEVELDB) endif(USE_LEVELDB)
if(USE_REDIS) if(USE_REDIS)
set(mapper_SRCS ${mapper_SRCS} db-redis.cpp) set(mapper_SRCS ${mapper_SRCS} db-redis.cpp)
set(LINK_LIBRARIES ${LINK_LIBRARIES} ${REDIS_LIBRARY})
endif(USE_REDIS) endif(USE_REDIS)
add_executable(minetestmapper add_executable(minetestmapper
${mapper_SRCS} ${mapper_SRCS}
) )
target_link_libraries( target_link_libraries(
minetestmapper ${LINK_LIBRARIES}
${SQLITE3_LIBRARY}
${LEVELDB_LIBRARY}
${REDIS_LIBRARY}
${LIBGD_LIBRARY}
${ZLIB_LIBRARY}
) )
# CPack # CPack
file(GLOB META_FILES RELATIVE "${CMAKE_HOME_DIRECTORY}" AUTHORS COPYING LICENSE.* README.rst) file(GLOB META_FILES RELATIVE "${CMAKE_HOME_DIRECTORY}" AUTHORS COPYING LICENSE.* README.rst)