[GDI32_APITEST] Remove broken EngDeleteSemaphore.c (#655)
[reactos.git] / CMakeLists.txt
index 489bdbb..44e8566 100644 (file)
@@ -2,12 +2,13 @@
 cmake_minimum_required(VERSION 3.2.1)
 cmake_policy(VERSION 3.2.1)
 
+if(NOT CMAKE_VERSION MATCHES "ReactOS")
+    message(WARNING "Building with \"${CMAKE_COMMAND}\", which is not the custom CMake included in RosBE, might cause build issues...")
+endif()
+
 # Don't escape preprocessor definition values added via add_definitions
 cmake_policy(SET CMP0005 OLD)
 
-# Shadow cmake provided modules
-cmake_policy(SET CMP0017 OLD)
-
 # Honor CMAKE_SHARED_LIBRARY_<Lang>_FLAGS variable.
 cmake_policy(SET CMP0018 OLD)
 
@@ -56,17 +57,14 @@ endif()
 include(sdk/cmake/compilerflags.cmake)
 
 add_definitions(-D__REACTOS__)
+add_definitions(-DREACTOS_SOURCE_DIR="\\"${REACTOS_SOURCE_DIR}\\"")
+add_definitions(-DREACTOS_BINARY_DIR="\\"${REACTOS_BINARY_DIR}\\"")
+add_compile_flags(-D__RELFILE__="&__FILE__[sizeof REACTOS_SOURCE_DIR]")
 
 if(MSVC_IDE)
     add_compile_flags("/MP")
 endif()
 
-# We don't need CMake importlib handling.
-# FIXME: Remove the MSVC_IDE condition when the upcoming RosBE lands.
-if(NOT MSVC_IDE)
-    unset(CMAKE_IMPORT_LIBRARY_SUFFIX)
-endif()
-
 # Bison and Flex support
 # include(sdk/cmake/bison-flex.cmake)
 
@@ -108,6 +106,11 @@ if(NOT CMAKE_CROSSCOMPILING)
     endif()
 
 else()
+       # We don't need CMake importlib handling.
+       # FIXME: Remove the MSVC_IDE condition when the upcoming RosBE lands.
+       if(NOT MSVC_IDE)
+               unset(CMAKE_IMPORT_LIBRARY_SUFFIX)
+       endif()
 
     if(NEW_STYLE_BUILD)
         include(sdk/cmake/host-tools.cmake)