summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorPetr Mrázek2011-08-14 08:42:21 +0200
committerPetr Mrázek2011-08-14 08:42:21 +0200
commita0f99ef7079bb741dcfa44b7365e3b13f3ec9016 (patch)
tree6c2cb7419868999914e8514a3e7bc8f5f755f447 /CMakeLists.txt
parent02ea81c0b32a50f18497e2c4d99c005ae6f0e5d0 (diff)
downloaddfhack-a0f99ef7079bb741dcfa44b7365e3b13f3ec9016.tar.gz
dfhack-a0f99ef7079bb741dcfa44b7365e3b13f3ec9016.tar.bz2
dfhack-a0f99ef7079bb741dcfa44b7365e3b13f3ec9016.tar.xz
Many tweaks to plugins, reorganized the build system and removed more cruft.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt86
1 files changed, 33 insertions, 53 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8de2f517..3ed283e3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -9,79 +9,65 @@ ${dfhack_SOURCE_DIR}/CMake/Modules
${CMAKE_MODULE_PATH}
)
+# mixing the build system with the source code is ugly and stupid. enforce the opposite :)
if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
message(FATAL_ERROR "In-source builds are not allowed.")
endif()
-set(DF_VERSION_MAJOR "0")
-set(DF_VERSION_MINOR "31")
-set(DF_VERSION_PATCH "25")
-set(DFHACK_RELEASE "1")
-
-set(DF_VERSION "${DF_VERSION_MAJOR}.${DF_VERSION_MINOR}.${DF_VERSION_PATCH}")
-
-## setting the build type
+## setting the build type.
IF(NOT DEFINED CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE STREQUAL "")
SET(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: Release RelWithDebInfo.")
ENDIF()
-SET(DFHACK_OUTPUT_DIR "${dfhack_BINARY_DIR}/bin" CACHE STRING "Where should be the produced libraries and binaries stored.")
-SET(DFHACK_PLUGIN_OUTPUT_DIR "${DFHACK_OUTPUT_DIR}/plugins")
+# set up versioning.
+set(DF_VERSION_MAJOR "0")
+set(DF_VERSION_MINOR "31")
+set(DF_VERSION_PATCH "25")
+set(DF_VERSION "${DF_VERSION_MAJOR}.${DF_VERSION_MINOR}.${DF_VERSION_PATCH}")
-## where to put things during the build (force MSVC to behave)
-SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${DFHACK_OUTPUT_DIR})
-SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${DFHACK_OUTPUT_DIR})
-SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${DFHACK_OUTPUT_DIR})
-SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${DFHACK_OUTPUT_DIR})
-SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE ${DFHACK_OUTPUT_DIR})
-SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${DFHACK_OUTPUT_DIR})
-SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL ${DFHACK_OUTPUT_DIR})
-SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY_MINSIZEREL ${DFHACK_OUTPUT_DIR})
-SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_MINSIZEREL ${DFHACK_OUTPUT_DIR})
-SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO ${DFHACK_OUTPUT_DIR})
-SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELWITHDEBINFO ${DFHACK_OUTPUT_DIR})
-SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELWITHDEBINFO ${DFHACK_OUTPUT_DIR})
+set(DFHACK_RELEASE "1")
## where to install things (after the build is done, classic 'make install' or package structure)
# the dfhack libraries will be installed here:
-SET(DFHACK_LIBRARY_DESTINATION .)
-# the dfhack tools will be installed here:
-SET(DFHACK_BINARY_DESTINATION .)
-# Memory.xml goes here:
-SET(DFHACK_DATA_DESTINATION .)
-# Plugins go here
-SET(DFHACK_PLUGIN_DESTINATION plugins)
-# Includes go here:
-SET(DFHACK_INCLUDES_DESTINATION dev/include)
-# the Windows .lib files go here:
-IF(WIN32)
- SET(DFHACK_DEVLIB_DESTINATION dev)
- SET(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION .)
-ENDIF()
IF(UNIX)
- SET(CMAKE_INSTALL_RPATH "$ORIGIN")
+ # put the lib into DF/hack
+ SET(DFHACK_LIBRARY_DESTINATION hack)
+ELSE()
+ # windows is crap, therefore we can't do nice things with it. leave the libs on a nasty pile...
+ SET(DFHACK_LIBRARY_DESTINATION .)
ENDIF()
-
-# documentation goes here:
-SET(DFHACK_USERDOC_DESTINATION .)
-SET(DFHACK_DEVDOC_DESTINATION dev)
-SET(DFHACK_DOXYGEN_DESTINATION dev/doxygen)
+# external tools will be installed here:
+SET(DFHACK_BINARY_DESTINATION .)
+# dfhack data goes here:
+SET(DFHACK_DATA_DESTINATION hack)
+# plugin libs go here:
+SET(DFHACK_PLUGIN_DESTINATION hack/plugins)
+# dfhack header files go here:
+SET(DFHACK_INCLUDES_DESTINATION hack/include)
+# the windows .lib file goes here:
+SET(DFHACK_DEVLIB_DESTINATION hack)
+
+# user documentation goes here:
+SET(DFHACK_USERDOC_DESTINATION hack)
+# developer documentation goes here:
+SET(DFHACK_DEVDOC_DESTINATION hack)
## some options for the user/developer to play with
OPTION(BUILD_LIBRARY "Build the library that goes into DF." ON)
OPTION(BUILD_PLUGINS "Build the plugins." ON)
-# build the static lua
+# build the static lua for dfusion
INCLUDE_DIRECTORIES ( lua/include )
add_subdirectory (lua)
+# build the lib itself
IF(BUILD_LIBRARY)
- #add_subdirectory (dlib)
add_subdirectory (library)
## install the default documentation files
- install(FILES LICENSE Readme.html DESTINATION ${DFHACK_USERDOC_DESTINATION})
+ install(FILES LICENSE Readme.html Compile.html DESTINATION ${DFHACK_USERDOC_DESTINATION})
endif()
+#build the plugins
IF(BUILD_PLUGINS)
add_subdirectory (plugins)
endif()
@@ -89,14 +75,8 @@ endif()
# Packaging with CPack!
IF(UNIX)
SET(CPACK_GENERATOR "TGZ")
-ENDIF()
-IF(WIN32)
+ELSEIF(WIN32)
SET(CPACK_GENERATOR "ZIP")
- # this includes the MSVC C++ DLLs in the package. Doesn't work with Express versions in general.
- # we should be fine with the stuff DF already has packaged... so, commenting out
- # INCLUDE(InstallRequiredSystemLibraries)
ENDIF()
set(CPACK_PACKAGE_FILE_NAME "dfhack-${DF_VERSION}-r${DFHACK_RELEASE}-${CMAKE_SYSTEM_NAME}")
INCLUDE(CPack)
-
-