diff --git a/CMakeLists.txt b/CMakeLists.txt index 677137b89..f4f69acfd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -64,7 +64,7 @@ endif() set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/src/proto/nanopb/extra") - + find_package(Nanopb 0.4.5...<1.0.0 REQUIRED) find_package(SDL2 REQUIRED) message("SDL2 include dir: ${SDL2_INCLUDE_DIRS}") diff --git a/src/cdogs/enet/CMakeLists.txt b/src/cdogs/enet/CMakeLists.txt index ff6b420a3..26e171f4f 100644 --- a/src/cdogs/enet/CMakeLists.txt +++ b/src/cdogs/enet/CMakeLists.txt @@ -1,4 +1,3 @@ -cmake_minimum_required(VERSION 3.1) cmake_policy(SET CMP0054 NEW) project(enet) @@ -24,7 +23,7 @@ if(MSVC) else() add_definitions(-Wno-error) endif() - + if(HAS_FCNTL) add_definitions(-DHAS_FCNTL=1) endif() @@ -55,9 +54,9 @@ endif() if(HAS_SOCKLEN_T) add_definitions(-DHAS_SOCKLEN_T=1) endif() - + include_directories(${PROJECT_SOURCE_DIR}/include) - + add_library(enet STATIC callbacks.c compress.c diff --git a/src/cdogs/yajl/CMakeLists.txt b/src/cdogs/yajl/CMakeLists.txt index 97af2fd18..266decaae 100644 --- a/src/cdogs/yajl/CMakeLists.txt +++ b/src/cdogs/yajl/CMakeLists.txt @@ -70,7 +70,7 @@ configure_file(yajl.pc.cmake ${shareDir}/yajl.pc) foreach (header ${PUB_HDRS}) set (header ${CMAKE_CURRENT_SOURCE_DIR}/${header}) - exec_program(${CMAKE_COMMAND} ARGS -E copy_if_different ${header} ${incDir}) + execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${header} ${incDir}) add_custom_command(TARGET yajl_s POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different ${header} ${incDir}) diff --git a/src/proto/nanopb/CMakeLists.txt b/src/proto/nanopb/CMakeLists.txt index e7a168ce8..0960003c0 100644 --- a/src/proto/nanopb/CMakeLists.txt +++ b/src/proto/nanopb/CMakeLists.txt @@ -1,5 +1,3 @@ -cmake_minimum_required(VERSION 2.8.12) - project(nanopb C) set(nanopb_VERSION_STRING nanopb-0.4.4) diff --git a/src/proto/nanopb/conan-wrapper/CMakeLists.txt b/src/proto/nanopb/conan-wrapper/CMakeLists.txt index 5f11fd9dc..842694700 100644 --- a/src/proto/nanopb/conan-wrapper/CMakeLists.txt +++ b/src/proto/nanopb/conan-wrapper/CMakeLists.txt @@ -1,4 +1,3 @@ -cmake_minimum_required(VERSION 2.8.12) project(cmake_wrapper) include(${CMAKE_CURRENT_BINARY_DIR}/conanbuildinfo.cmake) diff --git a/src/proto/nanopb/extra/FindNanopb.cmake b/src/proto/nanopb/extra/FindNanopb.cmake index a6c34fa9b..be3d798a1 100644 --- a/src/proto/nanopb/extra/FindNanopb.cmake +++ b/src/proto/nanopb/extra/FindNanopb.cmake @@ -362,9 +362,7 @@ find_path(NANOPB_GENERATOR_SOURCE_DIR mark_as_advanced(NANOPB_GENERATOR_SOURCE_DIR) include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(Nanopb DEFAULT_MSG - NANOPB_INCLUDE_DIRS - NANOPB_SRCS NANOPB_HDRS - NANOPB_GENERATOR_SOURCE_DIR - PROTOBUF_PROTOC_EXECUTABLE +find_package_handle_standard_args(Nanopb + REQUIRED_VARS NANOPB_INCLUDE_DIRS NANOPB_SRCS NANOPB_HDRS NANOPB_GENERATOR_SOURCE_DIR PROTOBUF_PROTOC_EXECUTABLE + HANDLE_VERSION_RANGE ) diff --git a/src/tests/cbehave/CMakeLists.txt b/src/tests/cbehave/CMakeLists.txt index 2daf61171..cb48c96b6 100644 --- a/src/tests/cbehave/CMakeLists.txt +++ b/src/tests/cbehave/CMakeLists.txt @@ -1,4 +1,3 @@ -cmake_minimum_required(VERSION 3.0) project(cbehave C) include_directories(.)