CMake: moved DefaultSettings to separate file
authorTimo Lotterbach <timo.lotterbach@bmw-carit.de>
Thu, 3 Jan 2013 09:19:17 +0000 (01:19 -0800)
committerTimo Lotterbach <timo.lotterbach@bmw-carit.de>
Mon, 14 Jan 2013 08:34:17 +0000 (00:34 -0800)
Signed-off-by: Timo Lotterbach <timo.lotterbach@bmw-carit.de>
CMakeLists.txt
cmake/modules/DefaultSettings.txt [new file with mode: 0644]

index 39dff4d..318e7bb 100644 (file)
@@ -25,18 +25,10 @@ project (LayerManager)
 # cmake configuration
 #==============================================================================
 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/")
+include(${CMAKE_MODULE_PATH}/DefaultSettings.txt)
 include(${CMAKE_MODULE_PATH}/CMakeVersions.txt)
 include(${CMAKE_MODULE_PATH}/CustomMacros.txt)
-
-#==============================================================================
-# set default build type, if not defined by user
-#==============================================================================
-if (NOT CMAKE_BUILD_TYPE)
-    set(CMAKE_BUILD_TYPE Release CACHE STRING
-                         "Choose build type: Debug, Release, RelWithDebInfo, MinSizeRel."
-                         FORCE)
-    message(STATUS "Build type not defined. Using default build type 'Release'.")
-endif (NOT CMAKE_BUILD_TYPE)
+add_subdirectory(cmake/optionalFeatures)
 
 #==============================================================================
 # Platforms / A set of indiviual options at once
@@ -68,21 +60,6 @@ option (WITH_STATIC_LIBRARIES       "Link all libraries statically"
 option (WITH_TEXT_RENDERER          "Build text renderer (only logging)"                  OFF)
 
 #==============================================================================
-# Internal global settings not available to user
-#==============================================================================
-set (STATICALLY_LINKED_PLUGINS "" CACHE INTERNAL "list of static plugins" FORCE)
-
-#==============================================================================
-# set default build parameters
-#==============================================================================
-add_subdirectory(cmake/optionalFeatures)
-
-include_directories ("${PROJECT_SOURCE_DIR}/config")
-include_directories ("${PROJECT_SOURCE_DIR}/3rdParty/")
-# ilm_types are used internally to LM, so we can include them by default
-include_directories ("${PROJECT_SOURCE_DIR}/LayerManagerClient/ilmClient/include")
-
-#==============================================================================
 # enable ctest if building with tests
 # run 'make test' after build to run all tests
 # be aware that some tests require a running layermanager
diff --git a/cmake/modules/DefaultSettings.txt b/cmake/modules/DefaultSettings.txt
new file mode 100644 (file)
index 0000000..5720299
--- /dev/null
@@ -0,0 +1,53 @@
+############################################################################
+#
+# Copyright 2012 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.
+#
+############################################################################
+
+#==============================================================================
+# set default build type, if not defined by user
+#==============================================================================
+if (NOT CMAKE_BUILD_TYPE)
+    set(CMAKE_BUILD_TYPE Release CACHE STRING
+                         "Choose build type: Debug, Release, RelWithDebInfo, MinSizeRel."
+                         FORCE)
+    message(STATUS "Build type not defined. Using default build type 'Release'.")
+endif (NOT CMAKE_BUILD_TYPE)
+
+#==============================================================================
+# define shared library build mode
+#==============================================================================
+if (WITH_STATIC_LIBRARIES)
+    set (LIBRARY_BUILDMODE "STATIC")
+else (WITH_STATIC_LIBRARIES)
+    set (LIBRARY_BUILDMODE "SHARED")
+endif (WITH_STATIC_LIBRARIES)
+
+
+#==============================================================================
+# set default build parameters
+#==============================================================================
+include_directories(
+    ${CMAKE_SOURCE_DIR}/config
+    ${CMAKE_SOURCE_DIR}/3rdParty
+    ${CMAKE_SOURCE_DIR}/LayerManagerClient/ilmClient/include
+)
+
+
+#==============================================================================
+# Internal global settings not available to user
+#==============================================================================
+set (STATICALLY_LINKED_PLUGINS "" CACHE INTERNAL "list of static plugins")
+