config: created separate CMakeLists.txt file for project
authorTimo Lotterbach <timo.lotterbach@bmw-carit.de>
Tue, 27 Mar 2012 12:28:40 +0000 (14:28 +0200)
committerTimo Lotterbach <timo.lotterbach@bmw-carit.de>
Tue, 27 Mar 2012 12:34:21 +0000 (14:34 +0200)
- Handles creation of config.h file with build configuration options.
  This reduces complexity of main CMakeLists.txt file.
- Internally moved config.h.cmake to res subfolder.

CMakeLists.txt
config/CMakeLists.txt [new file with mode: 0644]
config/res/config.h.cmake [moved from config/config.h.cmake with 100% similarity]

index dc1b7b7..ec6bc3b 100644 (file)
@@ -52,13 +52,7 @@ option (WITH_DLT            "Build with DLT support "
 
 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
 
-# generate cmake configuration header file, includes information on the
-# project configuration, compiler settings, ...
-message(STATUS "Generating config.h header file with build system configuration.")
-configure_file(
-    ${CMAKE_CURRENT_SOURCE_DIR}/config/config.h.cmake
-    ${CMAKE_CURRENT_SOURCE_DIR}/config/config.h
-)
+add_subdirectory(config)
 
 if (WITH_DESKTOP)
     set (WITH_GLX_LIB ON CACHE STRING "" FORCE)
diff --git a/config/CMakeLists.txt b/config/CMakeLists.txt
new file mode 100644 (file)
index 0000000..c45ccdf
--- /dev/null
@@ -0,0 +1,35 @@
+############################################################################
+# 
+# Copyright 2010, 2011 BMW Car IT GmbH
+# 
+# 
+# Licensed under the Apache License, Version 2.0 (the "License"); 
+# you may not use this file except in compliance with the License. 
+# You may obtain a copy of the License at 
+#
+#              http://www.apache.org/licenses/LICENSE-2.0 
+#
+# Unless required by applicable law or agreed to in writing, software 
+# distributed under the License is distributed on an "AS IS" BASIS, 
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+# See the License for the specific language governing permissions and 
+# limitations under the License.
+#
+############################################################################
+
+cmake_minimum_required (VERSION 2.6)
+
+# generate cmake configuration header file, includes information on the
+# project configuration, compiler settings, ...
+
+message(STATUS "Generating config.h header file with build system configuration.")
+
+configure_file(
+    ${CMAKE_SOURCE_DIR}/config/res/config.h.cmake
+    ${CMAKE_SOURCE_DIR}/config/config.h
+)
+
+install (
+    FILES       config.h
+    DESTINATION include/ilm
+)