Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit c12861a

Browse files
committedMar 29, 2021
Fix CMake version warning
1 parent fa5c63c commit c12861a

File tree

1 file changed

+6
-20
lines changed

1 file changed

+6
-20
lines changed
 

‎CMakeLists.txt

+6-20
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
cmake_minimum_required(VERSION 3.5)
2+
13
project(minetestmapper CXX)
2-
cmake_minimum_required(VERSION 2.6)
3-
cmake_policy(SET CMP0003 NEW)
44

55
set(VERSION_MAJOR 1)
66
set(VERSION_MINOR 0)
@@ -46,8 +46,6 @@ if(NOT CUSTOM_DOCDIR STREQUAL "")
4646
endif()
4747

4848
#set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
49-
find_package(PkgConfig)
50-
include(FindPackageHandleStandardArgs)
5149

5250
# Libraries: gd
5351

@@ -61,23 +59,11 @@ endif(NOT LIBGD_LIBRARY OR NOT LIBGD_INCLUDE_DIR)
6159

6260
# Libraries: zlib
6361

64-
find_library(ZLIB_LIBRARY z)
65-
find_path(ZLIB_INCLUDE_DIR zlib.h)
66-
message (STATUS "zlib library: ${ZLIB_LIBRARY}")
67-
message (STATUS "zlib headers: ${ZLIB_INCLUDE_DIR}")
68-
if(NOT ZLIB_LIBRARY OR NOT ZLIB_INCLUDE_DIR)
69-
message(FATAL_ERROR "zlib not found!")
70-
endif(NOT ZLIB_LIBRARY OR NOT ZLIB_INCLUDE_DIR)
62+
find_package(ZLIB REQUIRED)
7163

7264
# Libraries: sqlite3
7365

74-
find_library(SQLITE3_LIBRARY sqlite3)
75-
find_path(SQLITE3_INCLUDE_DIR zlib.h)
76-
message (STATUS "sqlite3 library: ${SQLITE3_LIBRARY}")
77-
message (STATUS "sqlite3 headers: ${SQLITE3_INCLUDE_DIR}")
78-
if(NOT SQLITE3_LIBRARY OR NOT SQLITE3_INCLUDE_DIR)
79-
message(FATAL_ERROR "sqlite3 not found!")
80-
endif(NOT SQLITE3_LIBRARY OR NOT SQLITE3_INCLUDE_DIR)
66+
find_package(SQLite3 REQUIRED)
8167

8268
# Libraries: postgresql
8369

@@ -145,7 +131,7 @@ include_directories(
145131
"${PROJECT_BINARY_DIR}"
146132
"${CMAKE_CURRENT_SOURCE_DIR}/include"
147133
"${CMAKE_CURRENT_BINARY_DIR}"
148-
${SQLITE3_INCLUDE_DIR}
134+
${SQLite3_INCLUDE_DIR}
149135
${LIBGD_INCLUDE_DIR}
150136
${ZLIB_INCLUDE_DIR}
151137
)
@@ -186,7 +172,7 @@ add_executable(minetestmapper
186172

187173
target_link_libraries(
188174
minetestmapper
189-
${SQLITE3_LIBRARY}
175+
${SQLite3_LIBRARY}
190176
${PostgreSQL_LIBRARIES}
191177
${LEVELDB_LIBRARY}
192178
${REDIS_LIBRARY}

0 commit comments

Comments
 (0)
Please sign in to comment.