From 411bb5ed9735470140d67399a193be481ae58f6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Thu, 8 Jul 2010 22:58:01 +0200 Subject: [PATCH] Added CMake options to build examples and playground tools, disabled by default. --- CMakeLists.txt | 2 ++ tools/examples/CMakeLists.txt | 7 ++++++- tools/playground/CMakeLists.txt | 5 +++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f8458cb97..6b314b94b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,6 +22,8 @@ SET( LIBRARY_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/output CACHE PATH "Output directory SET( EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/output CACHE PATH "Output directory for the dfhack tools" ) OPTION(BUILD_DFHACK_DOCUMENTATION "Create doxygen documentation for developers" OFF) +OPTION(BUILD_DFHACK_EXAMPLES "Build example tools" OFF) +OPTION(BUILD_DFHACK_PLAYGROUND "Build tools from the playground folder" OFF) include_directories (${CMAKE_SOURCE_DIR}/library/include/) include_directories (${CMAKE_SOURCE_DIR}/library/shm/) diff --git a/tools/examples/CMakeLists.txt b/tools/examples/CMakeLists.txt index 190dff3cc..3bc534ca7 100644 --- a/tools/examples/CMakeLists.txt +++ b/tools/examples/CMakeLists.txt @@ -1,5 +1,8 @@ # don't use this file directly. use the one in the root folder of the project +# only build this stuff when BUILD_DFHACK_EXAMPLES is set to ON +IF (BUILD_DFHACK_EXAMPLES) + # this is required to ensure we use the right configuration for the system. IF(UNIX) add_definitions(-DLINUX_BUILD) @@ -85,4 +88,6 @@ IF(UNIX) ELSE(CURSES_FOUND) MESSAGE(STATUS "Wide-character ncurses library not found - veinlook can't be built") ENDIF(CURSES_FOUND) -ENDIF(UNIX) \ No newline at end of file +ENDIF(UNIX) + +ENDIF (BUILD_DFHACK_EXAMPLES) \ No newline at end of file diff --git a/tools/playground/CMakeLists.txt b/tools/playground/CMakeLists.txt index eff712d97..ff4b97640 100644 --- a/tools/playground/CMakeLists.txt +++ b/tools/playground/CMakeLists.txt @@ -1,5 +1,8 @@ # don't use this file directly. use the one in the root folder of the project +# only build this stuff when BUILD_DFHACK_PLAYGROUND is set to ON +IF (BUILD_DFHACK_PLAYGROUND) + # this is required to ensure we use the right configuration for the system. IF(UNIX) add_definitions(-DLINUX_BUILD) @@ -60,3 +63,5 @@ TARGET_LINK_LIBRARIES(dfcatsplosion dfhack) # Author: belal #ADD_EXECUTABLE(dfrenamer renamer.cpp) #TARGET_LINK_LIBRARIES(dfrenamer dfhack) + +ENDIF (BUILD_DFHACK_PLAYGROUND) \ No newline at end of file