summaryrefslogtreecommitdiff
path: root/Utilities/KWIML/CMakeLists.txt
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2011-06-27 14:08:31 -0400
committerBrad King <brad.king@kitware.com>2011-06-27 14:09:09 -0400
commitb2975adb31b891d87bb9828097a10167b811e96b (patch)
tree603e995eb053b4542225d31b3eb6513c8a64310a /Utilities/KWIML/CMakeLists.txt
parentea1a519a356cb8b6a54ca3858f20aa9560be9ccf (diff)
parent831badeca25a8eca9e92dbbb181ea69b58112b2c (diff)
downloadcmake-b2975adb31b891d87bb9828097a10167b811e96b.tar.gz
Merge branch 'upstream-kwiml' into import-KWIML
Introduce KWIML as a subtree at Utilities/KWIML.
Diffstat (limited to 'Utilities/KWIML/CMakeLists.txt')
-rw-r--r--Utilities/KWIML/CMakeLists.txt79
1 files changed, 79 insertions, 0 deletions
diff --git a/Utilities/KWIML/CMakeLists.txt b/Utilities/KWIML/CMakeLists.txt
new file mode 100644
index 0000000000..6a8641adcf
--- /dev/null
+++ b/Utilities/KWIML/CMakeLists.txt
@@ -0,0 +1,79 @@
+#=============================================================================
+# Kitware Information Macro Library
+# Copyright 2010-2011 Kitware, Inc.
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+
+# Import the KWIML directory tree into a subdirectory under a parent
+# project and configure the library as follows:
+#
+# SET(KWIML myIML)
+# SUBDIRS(KWIML)
+#
+# Optional settings are as follows:
+#
+# KWIML_HEADER_ROOT = build tree directory to hold KWIML headers.
+# Headers will go in a directory called "${KWIML}" under this root.
+# For example:
+#
+# SET(KWIML_HEADER_ROOT ${PROJECT_BINARY_DIR})
+# INCLUDE_DIRECTORIES(${PROJECT_BINARY_DIR})
+#
+# KWIML_INSTALL_INCLUDE_DIR = install KWIML with "make install"
+# Specify a value relative to the install prefix and do NOT start with '/'.
+# KWIML_INSTALL_INCLUDE_OPTIONS = extra header installation options
+# Specify options for the install(FILES) command.
+#
+# KWIML_LABELS_TEST = list of labels for KWIML tests
+
+cmake_minimum_required(VERSION 2.6.3 FATAL_ERROR)
+
+#-----------------------------------------------------------------------------
+if(NOT DEFINED KWIML)
+ if(NOT "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
+ message(FATAL_ERROR "Set KWIML namespace in parent directory!")
+ endif()
+ set(KWIML KWIML)
+ set(KWIML_STANDALONE 1)
+ project(KWIML)
+ include(CTest)
+ mark_as_advanced(BUILD_TESTING)
+endif()
+
+#-----------------------------------------------------------------------------
+get_property(KWIML_LANGUAGES GLOBAL PROPERTY ENABLED_LANGUAGES)
+foreach(lang ${KWIML_LANGUAGES})
+ set(KWIML_LANGUAGE_${lang} 1)
+endforeach()
+if(NOT KWIML_LANGUAGE_C AND NOT KWIML_LANGUAGE_CXX)
+ set(BUILD_TESTING OFF)
+endif()
+
+#-----------------------------------------------------------------------------
+if(NOT KWIML_HEADER_ROOT)
+ set(KWIML_HEADER_ROOT "${PROJECT_BINARY_DIR}")
+endif()
+set(KWIML_HEADER_DIR "${KWIML_HEADER_ROOT}/${KWIML}")
+include_directories(${KWIML_HEADER_ROOT})
+
+#-----------------------------------------------------------------------------
+foreach(h ABI INT)
+ set(header ${KWIML_HEADER_DIR}/${h}.h)
+ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${h}.h.in ${header} @ONLY)
+ if(KWIML_INSTALL_INCLUDE_DIR)
+ install(FILES ${header}
+ DESTINATION ${KWIML_INSTALL_INCLUDE_DIR}/${KWIML}
+ ${KWIML_INSTALL_INCLUDE_OPTIONS})
+ endif()
+endforeach()
+
+#-----------------------------------------------------------------------------
+if(BUILD_TESTING)
+ add_subdirectory(test)
+endif()