diff --git a/CMakeLists.txt b/CMakeLists.txt index e205975..f652713 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,6 +16,21 @@ project(husky) cmake_minimum_required(VERSION 3.0.2) +# Check building system +if(WIN32) + set(WINDOWS TRUE) +elseif(UNIX AND NOT APPLE) + if(CMAKE_SYSTEM_NAME MATCHES ".*Linux") + set(LINUX TRUE) + endif() +elseif(APPLE) + if(CMAKE_SYSTEM_NAME MATCHES ".*Darwin.*") + set(DARWIN TRUE) + elseif(CMAKE_SYSTEM_NAME MATCHES ".*MacOS.*") + set(MACOSX TRUE) + endif() +endif() + # CMake Options set(CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD 14) diff --git a/cmake/dep.cmake b/cmake/dep.cmake index 1321d9b..4119e42 100644 --- a/cmake/dep.cmake +++ b/cmake/dep.cmake @@ -96,12 +96,13 @@ else(MONGOCLIENT_FOUND) message (STATUS "Could NOT find MongoClient") endif(MONGOCLIENT_FOUND) if(WITHOUT_MONGODB) - unset(MONGOCLIENT_FOUND) + set(MONGOCLIENT_FOUND false) message(STATUS "Not using MongoClient due to WITHOUT_MONGODB option") endif(WITHOUT_MONGODB) ### RT ### +if(MONGOCLIENT_FOUND AND NOT MACOSX) # Mac OS X does not have librt find_library(RT_LIBRARY NAMES rt) if(RT_LIBRARY) set(RT_FOUND true) @@ -114,6 +115,7 @@ if (RT_FOUND) else(RT_FOUND) message (STATUS "Could NOT find RT") endif(RT_FOUND) +endif(MONGOCLIENT_FOUND AND NOT MACOSX) ### Thrift ###