Using WIN32 and UNIX variables

WIN32 is true when the target system is Microsoft Windows, 32 and
64 bits.

UNIX is true when the target system is Unix or Unix-like (i.e. Apple,
BSD and CYGWIN).
Signed-off-by: 's avatarGuilherme Maciel Ferreira <guilherme.maciel.ferreira@gmail.com>
parent d2ae4377
......@@ -43,9 +43,9 @@ IF(PAHO_BUILD_DOCUMENTATION)
ENDIF()
### packaging settings
IF (CMAKE_SYSTEM_NAME MATCHES "Windows")
IF (WIN32)
SET(CPACK_GENERATOR "ZIP")
ELSE()
ELSEIF(UNIX)
SET(CPACK_GENERATOR "TGZ")
ENDIF()
......
......@@ -47,10 +47,14 @@ SET(common_src
LinkedList.c
)
IF (CMAKE_SYSTEM_NAME MATCHES "Windows")
IF (WIN32)
SET(LIBS_SYSTEM ws2_32)
ELSEIF (CMAKE_SYSTEM_NAME MATCHES "Linux")
SET(LIBS_SYSTEM dl)
ELSEIF (UNIX)
IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
SET(LIBS_SYSTEM c dl)
ELSE()
SET(LIBS_SYSTEM c)
ENDIF()
ENDIF()
ADD_EXECUTABLE(MQTTVersion MQTTVersion.c)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment