Skip to content

Commit

Permalink
cmake: Use correct message modes
Browse files Browse the repository at this point in the history
INFO is not a valid cmake message mode, this commit cleans up a few messages to
use the correct cmake modes

Signed-off-by: Brendan Le Foll <[email protected]>
  • Loading branch information
arfoll committed Mar 7, 2016
1 parent 82cfa32 commit f7ff327
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 32 deletions.
14 changes: 7 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ if ("x_${VERSION}" STREQUAL "x_GIT-NOTFOUND" OR "x_${VERSION}" STREQUAL "x_HEAD-
set (VERSION "v0.9.5-dirty")
endif ()

message (INFO " - libmraa Version ${VERSION}")
message (INFO " - cmake Version ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}")
message (STATUS " - libmraa Version ${VERSION}")
message (STATUS " - cmake Version ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}")

#parse the version information into pieces.
string (REGEX REPLACE "^v([0-9]+)\\..*" "\\1" VERSION_MAJOR "${VERSION}")
Expand Down Expand Up @@ -84,10 +84,10 @@ endif()
if (NOT BUILDARCH)
include (TargetArch)
target_architecture (DETECTED_ARCH)
message( INFO " - Target arch is ${DETECTED_ARCH}")
message (STATUS " - Target arch is ${DETECTED_ARCH}")
else ()
set (DETECTED_ARCH ${BUILDARCH})
message( INFO " - Override arch is ${DETECTED_ARCH}")
message (STATUS " - Override arch is ${DETECTED_ARCH}")
endif()

if (DETECTED_ARCH STREQUAL "i586" OR DETECTED_ARCH STREQUAL "x86_64"
Expand All @@ -96,7 +96,7 @@ if (DETECTED_ARCH STREQUAL "i586" OR DETECTED_ARCH STREQUAL "x86_64"
elseif (DETECTED_ARCH MATCHES "arm.*")
set (ARMPLAT ON)
else ()
message(FATAL_ERROR "Only x86 and arm platforms currently supported")
message (FATAL_ERROR "Only x86 and arm platforms currently supported")
endif()

if (BUILDSWIGPYTHON OR BUILDTESTS)
Expand Down Expand Up @@ -137,7 +137,7 @@ if (IPK)
set (TARGET_ARCH ${DETECTED_ARCH})
endif ()
endif ()
message (INFO " - Package arch is ${TARGET_ARCH}")
message (STATUS " - Package arch is ${TARGET_ARCH}")

set(CPACK_GENERATOR "DEB" "TGZ")
set(OPKG_ARCH ${TARGET_ARCH})
Expand All @@ -161,7 +161,7 @@ if (IPK)
endif()

if (RPM)
message (INFO " - Enabled RPM packaging for ${DETECTED_ARCH}")
message (STATUS " - Enabled RPM packaging for ${DETECTED_ARCH}")
set(CMAKE_INSTALL_PREFIX "/usr")
set(CPACK_PACKAGE_VERSION ${VERSION})
set(CPACK_GENERATOR "RPM")
Expand Down
14 changes: 7 additions & 7 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ set (mraa_LIB_X86_SRCS_NOAUTO
${PROJECT_SOURCE_DIR}/src/x86/up.c
)

message (INFO " - Adding support for platform ${MRAAPLATFORMFORCE}")
message (STATUS " - Adding support for platform ${MRAAPLATFORMFORCE}")

#keywords in if statements are case sensitive
if (NOT ${MRAAPLATFORMFORCE} STREQUAL "ALL")
Expand All @@ -56,10 +56,10 @@ if (NOT ${MRAAPLATFORMFORCE} STREQUAL "ALL")
elseif (${MRAAPLATFORMFORCE} STREQUAL "MRAA_UP")
set (mraa_LIB_X86_SRCS_NOAUTO ${PROJECT_SOURCE_DIR}/src/x86/x86.c ${PROJECT_SOURCE_DIR}/src/x86/up.c)
else ()
message (ERROR " - Unknown x86 platform enabled!")
message (FATAL_ERROR " - Unknown x86 platform enabled!")
endif ()
else ()
message (INFO " - Adding support for all platforms")
message (STATUS " - Adding support for all platforms")
endif ()

set (mraa_LIB_ARM_SRCS_NOAUTO
Expand All @@ -83,15 +83,15 @@ if (ARMPLAT)
endif()

if (USBPLAT)
message (INFO " - Adding USB platforms")
message (STATUS " - Adding USB platforms")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DUSBPLAT=1")
if (FTDID2xx)
find_package (Ftd2xx)
if (${LIBFTD2XX_FOUND})
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DFTDID2XX=1")
set (mraa_LIBS ${mraa_LIBS} ${LIBFTD2XX_LIBRARIES})
else ()
message (WARNING " - Enabled FTDID2xx support but library not found")
message (SEND_ERROR " - Enabled FTDID2xx support but library not found")
endif ()
endif ()
if (FTDI4222)
Expand All @@ -100,7 +100,7 @@ if (USBPLAT)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DFTDI4222=1")
set (mraa_LIBS ${mraa_LIBS} ${LIBFT4222_LIBRARIES})
else ()
message (WARNING " - Enabled FTDI4222 support but library not found")
message (SEND_ERROR " - Enabled FTDI4222 support but library not found")
endif ()
endif ()
add_subdirectory(usb)
Expand Down Expand Up @@ -193,7 +193,7 @@ if (BUILDSWIG)
if (SWIG_VERSION VERSION_GREATER 3.0.4)
add_subdirectory (javascript)
else ()
message ("WARN - SWIG is ${SWIG_VERSION}. Please upgrade to 3.0.5+ to build nodejs addon")
message (SEND_ERROR " - SWIG is ${SWIG_VERSION}. Please upgrade to 3.0.5+ to build nodejs addon")
endif ()
endif ()
endif ()
Expand Down
36 changes: 18 additions & 18 deletions src/javascript/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ set (V8_VERSION_HEX 0x0${V8_VERSION_MAJOR}${V8_VERSION_MINOR}${V8_VERSION_PATCH}
string (LENGTH "${V8_VERSION_HEX}" V8_VERSION_HEX_length)
while (V8_VERSION_HEX_length LESS 8)
set (V8_VERSION_HEX "${V8_VERSION_HEX}0")
message (DEBUG " - Padded V8 version to match SWIG format")
message (STATUS " - Padded V8 version to match SWIG format")
string (LENGTH "${V8_VERSION_HEX}" V8_VERSION_HEX_length)
endwhile ()

Expand All @@ -31,28 +31,28 @@ set_target_properties (mraajs PROPERTIES
SUFFIX ".node"
)

message (INFO " - swig Version ${SWIG_VERSION}")
message (INFO " - CXX compiler Version ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}")
message (STATUS " - swig Version ${SWIG_VERSION}")
message (STATUS " - CXX compiler Version ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}")

if (${V8_VERSION_MAJOR} GREATER 3)
message (INFO " - Using V8 version > 3 so requiring C++11 compiler")
message (STATUS " - Using V8 version > 3 so requiring C++11 compiler")
# Node 0.12.x V8 engine major version is '3'.
# Node 2.1.0 V8 engine major version is '4'.
set_property (TARGET mraajs PROPERTY CXX_STANDARD 11)
set_property (TARGET mraajs PROPERTY CXX_STANDARD_REQUIRED ON)
if(CMAKE_VERSION VERSION_LESS "3.1")
message(INFO " - **WARNING** Need to use CMAKE version 3.1+, but it is ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}")
message(INFO " - So a workaround will be used.")
if(CMAKE_COMPILER_IS_GNUCXX)
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.7")
message(FATAL_ERROR " FATAL ERROR: GNU gcc compiler is also too old (need 4.7+, but ${CMAKE_CXX_COMPILER_VERSION}) and does not support C++11 standard.")
endif()
set(MRAA_CXX11_WORKAROUND_OPTION "-std=gnu++11")
else()
set(MRAA_CXX11_WORKAROUND_OPTION "-std=c++11")
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MRAA_CXX11_WORKAROUND_OPTION} ")
endif()
if (CMAKE_VERSION VERSION_LESS "3.1")
message (SEND_ERROR " - Need to use CMAKE version 3.1+, but it is ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}")
message (STATUS " - So a workaround will be used.")
if (CMAKE_COMPILER_IS_GNUCXX)
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.7")
message (FATAL_ERROR " - GNU gcc compiler is also too old (need 4.7+, but ${CMAKE_CXX_COMPILER_VERSION}) and does not support C++11 standard.")
endif ()
set (MRAA_CXX11_WORKAROUND_OPTION "-std=gnu++11")
else ()
set (MRAA_CXX11_WORKAROUND_OPTION "-std=c++11")
endif ()
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MRAA_CXX11_WORKAROUND_OPTION} ")
endif ()
endif ()

macro (mraa_CREATE_INSTALL_PACKAGE_JSON generated_file install_location)
Expand Down Expand Up @@ -106,7 +106,7 @@ if (BUILDDOC)
COMMENT "Generating API documentation with Yuidoc" VERBATIM
)
else ()
message (INFO " - Failed to find Yuidoc. node.js API doc will not be generated")
message (STATUS " - Failed to find Yuidoc. node.js API doc will not be generated")
endif ()
endif ()

Expand Down

0 comments on commit f7ff327

Please sign in to comment.