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.
develop
Mikko Juola 2010-08-16 10:09:33 +03:00
parent 891c454256
commit b87752a954
1 changed files with 11 additions and 1 deletions

@ -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)