From b87752a954a9e8fa6cbc78809806701ed68e4902 Mon Sep 17 00:00:00 2001 From: Mikko Juola Date: Mon, 16 Aug 2010 10:09:33 +0300 Subject: [PATCH] Some changes to make CMake behave when dfhack is used as a submodule. Doesn't still quite make it behave but at least a bit. --- CMakeLists.txt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a03f7d6cc..ff96265da 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,6 +4,16 @@ cmake_minimum_required(VERSION 2.6) SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMake/Modules) SET ( DFHACK_VERSION "0.4.1.0-dev" ) +# Set this to project source dir. When dfhack is used +# as a submodule, CMAKE_SOURCE_DIR is not pointing to +# the root where this particular CMakeLists.txt file sits. +SET(CMAKE_SOURCE_DIR ${PROJECT_SOURCE_DIR}) + +# Reset compiler flags. +# (Dfterm2 uses -D_UNICODE but dfhack doesn't compile with it, +# breaking dfhack when used as a submodule) +SET(COMPILE_DEFINITIONS "") + # disable warning, autosearch if(COMMAND cmake_policy) cmake_policy(SET CMP0003 NEW) @@ -43,4 +53,4 @@ add_subdirectory (library/shm) add_subdirectory (tools/examples) add_subdirectory (tools/playground) add_subdirectory (tools/supported) -add_subdirectory (doc) \ No newline at end of file +add_subdirectory (doc)