Ver código fonte

HPCC-27136 Clean up CMake warnings and errors

Signed-off-by: Gordon Smith <GordonJSmith@gmail.com>
Gordon Smith 3 anos atrás
pai
commit
de2939e222

+ 8 - 6
CMakeLists.txt

@@ -67,15 +67,20 @@
 #
 #########################################################
 
-project(hpccsystems-platform LANGUAGES C CXX)
+cmake_minimum_required(VERSION 3.16.0)
+
+set(HPCC_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
+include(${HPCC_SOURCE_DIR}/version.cmake)
+
+project(hpccsystems-platform LANGUAGES C CXX
+    VERSION ${HPCC_MAJOR}.${HPCC_MINOR}.${HPCC_POINT}.${HPCC_SEQUENCE}
+)
 
 # Stupid workaround. See https://gitlab.kitware.com/cmake/cmake/-/issues/21378
 # If cmake runs twice, cmake might not correctly set the compiler version variables
 unset ( ENV{CC} )
 unset ( ENV{CXX} )
 
-cmake_minimum_required(VERSION 3.13.0)
-
 set(TOP_LEVEL_PROJECT ON)
 if(NOT CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
     set(TOP_LEVEL_PROJECT OFF)
@@ -84,11 +89,8 @@ endif(NOT CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
 include(CTest)
 enable_testing()
 
-set(HPCC_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
 set(CMAKE_MODULE_PATH "${HPCC_SOURCE_DIR}/cmake_modules/")
 
-include(${HPCC_SOURCE_DIR}/version.cmake)
-
 ###
 ## Build Level
 ###

+ 1 - 8
cmake_modules/commonSetup.cmake

@@ -37,13 +37,6 @@ IF ("${COMMONSETUP_DONE}" STREQUAL "")
     and the file ${CMAKE_BINARY_DIR}/CMakeCache.txt,
     then create a separate build directory and run 'cmake path_to_source [options]' there.")
 
-  cmake_policy ( SET CMP0011 NEW )
-  if (NOT (CMAKE_MAJOR_VERSION LESS 3))
-    cmake_policy ( SET CMP0026 OLD )
-    if (NOT (CMAKE_MINOR_VERSION LESS 1))
-      cmake_policy ( SET CMP0054 NEW )
-    endif()
-  endif()
   option(CONTAINERIZED "Build for container images." OFF)
   option(CLIENTTOOLS "Enable the building/inclusion of a Client Tools component." ON)
   option(PLATFORM "Enable the building/inclusion of a Platform component." ON)
@@ -680,7 +673,7 @@ endif ()
   ###########################################################################
 
     if(USE_OPTIONAL)
-        message(WARNING "USE_OPTIONAL set - missing dependencies for optional features will automatically disable them")
+        message(AUTHOR_WARNING "USE_OPTIONAL set - missing dependencies for optional features will automatically disable them")
     endif()
 
     if(NOT "${EXTERNALS_DIRECTORY}" STREQUAL "")

+ 3 - 2
docs/CMakeLists.txt

@@ -14,8 +14,9 @@
 #    limitations under the License.
 ################################################################################
 
-cmake_minimum_required(VERSION 2.8)
-PROJECT(docs)
+PROJECT(docs 
+  VERSION ${HPCC_MAJOR}.${HPCC_MINOR}.${HPCC_POINT}.${HPCC_SEQUENCE}
+)
 
 define_property(GLOBAL PROPERTY DOC_TARGETS BRIEF_DOCS "docs" FULL_DOCS "docs")
 mark_as_advanced(DOC_TARGETS)

+ 3 - 2
docs/EN_US/CMakeLists.txt

@@ -27,8 +27,9 @@
 #
 
 
-cmake_minimum_required(VERSION 2.8)
-PROJECT(docs_en_us)
+PROJECT(docs
+  VERSION ${HPCC_MAJOR}.${HPCC_MINOR}.${HPCC_POINT}.${HPCC_SEQUENCE}
+)
 
 #define_property(GLOBAL PROPERTY DOC_TARGETS BRIEF_DOCS "docs_en_us" FULL_DOCS "docs_en_us")
 #mark_as_advanced(DOC_TARGETS)

+ 3 - 2
initfiles/CMakeLists.txt

@@ -14,8 +14,9 @@
 #    limitations under the License.
 ################################################################################
 
-cmake_minimum_required(VERSION 2.8)
-PROJECT(initfiles)
+PROJECT(initfiles
+  VERSION ${HPCC_MAJOR}.${HPCC_MINOR}.${HPCC_POINT}.${HPCC_SEQUENCE}
+)
 
 if ( PLATFORM AND UNIX )
     HPCC_ADD_EXECUTABLE(processor processor.cpp)

+ 3 - 2
lib2/CMakeLists.txt

@@ -14,8 +14,9 @@
 #    limitations under the License.
 ################################################################################
 
-cmake_minimum_required(VERSION 2.8)
-PROJECT(lib2)
+PROJECT(lib2
+  VERSION ${HPCC_MAJOR}.${HPCC_MINOR}.${HPCC_POINT}.${HPCC_SEQUENCE}
+)
 
 if (APPLE)
     if ("${BOOST_REGEX_LIBRARIES}" STREQUAL "Boost::regex")

+ 1 - 1
plugins/eclblas/CMakeLists.txt

@@ -56,7 +56,7 @@ if(USE_CBLAS)
         eclrtl
         ${CBLAS_LIBRARIES})
 else()
-    message(WARNING "Not building eclblas library for standard library due to lacking libcblas")
+    message(AUTHOR_WARNING "Not building eclblas library for standard library due to lacking libcblas")
 endif(USE_CBLAS)
 
 if(PLATFORM OR CLIENTTOOLS_ONLY)

+ 3 - 5
plugins/sqs/CMakeLists.txt

@@ -1,8 +1,6 @@
-# minimal CMakeLists.txt for the AWS SDK for C++
-cmake_minimum_required(VERSION 2.8)
-
-# "my-example" is just an example value.
-project(sqs)
+PROJECT(sqs
+  VERSION ${HPCC_MAJOR}.${HPCC_MINOR}.${HPCC_POINT}.${HPCC_SEQUENCE}
+)
 
 if(SQS AND USE_AWS)
     ADD_PLUGIN(sqs)

+ 3 - 2
system/security/plugins/singleuserSecurity/initfiles/CMakeLists.txt

@@ -14,7 +14,8 @@
 #    limitations under the License.
 ################################################################################
 
-cmake_minimum_required(VERSION 2.8)
-PROJECT(initfiles)
+PROJECT(initfiles
+  VERSION ${HPCC_MAJOR}.${HPCC_MINOR}.${HPCC_POINT}.${HPCC_SEQUENCE}
+)
 
 ADD_SUBDIRECTORY(componentfiles)