Skip to content

Commit

Permalink
cmake_minimum_required() before project()
Browse files Browse the repository at this point in the history
 * Without this CMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded (MT) Windows builds still produced incompatible MultiThreadedDLL (MD) output.

 * Resolves following warning:

CMake Warning (dev) at CMakeLists.txt:2 (project):
  cmake_minimum_required() should be called prior to this top-level project()
  call.

 * Use ${CMAKE_HOST_SYSTEM_NAME} as ${CMAKE_SYSTEM_NAME} not set before project().
  • Loading branch information
rp42 authored and bluca committed Dec 30, 2024
1 parent a23330d commit 34f7fa2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# CMake build script for ZeroMQ
project(ZeroMQ)

if(${CMAKE_SYSTEM_NAME} STREQUAL Darwin)
if(${CMAKE_HOST_SYSTEM_NAME} STREQUAL Darwin)
cmake_minimum_required(VERSION 3.0.2)
else()
cmake_minimum_required(VERSION 2.8.12)
endif()

project(ZeroMQ)

include(CheckIncludeFiles)
include(CheckCCompilerFlag)
include(CheckCXXCompilerFlag)
Expand Down

0 comments on commit 34f7fa2

Please sign in to comment.