CMake: updated compiler settings
authorTimo Lotterbach <timo.lotterbach@bmw-carit.de>
Tue, 15 Jan 2013 11:45:02 +0000 (03:45 -0800)
committerTimo Lotterbach <timo.lotterbach@bmw-carit.de>
Tue, 15 Jan 2013 12:35:43 +0000 (04:35 -0800)
expected compiler settings have been overwritten in several components,
so no project specific compiler flags have been used during build.
This resulted e.g. in linker errors on 64bit platforms which require
the -fPIC flag for successful builds.

new compiler flag presets have been added for 3rdParty and Test code.

Signed-off-by: Timo Lotterbach <timo.lotterbach@bmw-carit.de>
13 files changed:
3rdParty/gmock/CMakeLists.txt
3rdParty/gtest/CMakeLists.txt
3rdParty/systemd/CMakeLists.txt
LayerManagerBase/CMakeLists.txt
LayerManagerClient/ilmClient/CMakeLists.txt
LayerManagerControl/CMakeLists.txt
LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicGLESv2/CMakeLists.txt
LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicGLX/CMakeLists.txt
LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicWaylandDrmGLESv2/CMakeLists.txt
LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicWaylandFbdevGLESv2/CMakeLists.txt
LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicWaylandX11GLESv2/CMakeLists.txt
LayerManagerUtils/CMakeLists.txt
cmake/modules/DefaultSettings.txt

index 32d51d9..8303b61 100644 (file)
 #
 ############################################################################
 
-# set default compiler flags for 3rdParty code
-set (CMAKE_C_FLAGS "")
-set (CMAKE_CXX_FLAGS "")
+project(gmock)
+project_Type(3RDPARTY)
 
 # include base path to 3rdParty code
 include_directories ("..")
 
 # build unit test frameworks, if tests are enabled
-add_library(gmock STATIC gmock-gtest-all.cc gmock_main.cc)
+add_library(${PROJECT_NAME} STATIC gmock-gtest-all.cc gmock_main.cc)
index 2e5e675..22bff5c 100644 (file)
 #
 ############################################################################
 
-# set default compiler flags for 3rdParty code
-set (CMAKE_C_FLAGS "")
-set (CMAKE_CXX_FLAGS "")
+project(gtest)
+project_Type(3RDPARTY)
 
 # include base path to 3rdParty code
 include_directories ("..")
 
 # build unit test frameworks, if tests are enabled
-add_library(gtest STATIC gtest-all.cc gtest_main.cc)
+add_library(${PROJECT_NAME} STATIC gtest-all.cc gtest_main.cc)
index 63c196c..d2693e4 100644 (file)
@@ -17,9 +17,8 @@
 #
 ############################################################################
 
-# set default compiler flags for 3rdParty code
-set (CMAKE_C_FLAGS "")
-set (CMAKE_CXX_FLAGS "")
+project(systemd)
+project_Type(3RDPARTY)
 
 # build systemd reference client library
-add_library(systemd STATIC sd-daemon.c)
+add_library(${PROJECT_NAME} STATIC sd-daemon.c)
index e4f0d0e..7b797d3 100644 (file)
@@ -80,8 +80,6 @@ if (WITH_TESTS)
 
     enable_testing()
 
-    set (CMAKE_CXX_FLAGS "")
-
     add_executable(${PROJECT_NAME}_Test
         tests/SceneTest.cpp
         tests/LayermanagerTest.cpp
index cca1aaa..c50b14d 100644 (file)
@@ -62,8 +62,6 @@ install (
 
 if (WITH_TESTS)
 
-    set (CMAKE_CXX_FLAGS "")
-
     enable_testing()
     
     add_executable(${PROJECT_NAME}_Test tests/IlmCommandTest.cpp tests/IlmNotificationTest.cpp src/generic_ilm_client.c)
index 786d2a2..5f3e6be 100644 (file)
@@ -20,9 +20,6 @@
 project (LayerManagerControl)
 project_type(CORE)
 
-# use default compiler settings here
-set (CMAKE_CXX_FLAGS "")
-
 include_directories(
     include
     "../../LayerManagerClient/ilmClient/include"
index c367c5d..a2be736 100644 (file)
@@ -101,12 +101,3 @@ install(FILES       ${GRAPHIC_LIB_DIR}/include/WindowSystems/BaseWindowSystem.h
 install(FILES       ${RENDERERBASE_DIR}/include/BaseRenderer.h
                     ${RENDERERBASE_DIR}/include/RenderUtil.h
         DESTINATION include/layermanager/graphic/Base)
-
-#===========================================================================
-# test
-#===========================================================================
-if (WITH_TESTS)
-    set (CMAKE_CXX_FLAGS "")
-    enable_testing()
-    #add_subdirectory_once (${GRAPHIC_LIB_DIR}/tests)
-endif(WITH_TESTS)
\ No newline at end of file
index 83f9907..efead22 100644 (file)
@@ -99,11 +99,3 @@ install(FILES       ${RENDERERBASE_DIR}/include/BaseRenderer.h
                     ${RENDERERBASE_DIR}/include/RenderUtil.h
         DESTINATION include/layermanager/graphic/Base)
 
-#===========================================================================
-# test
-#===========================================================================
-if (WITH_TESTS)
-    set (CMAKE_CXX_FLAGS "")
-    enable_testing()
-    #add_subdirectory_once (${GRAPHIC_LIB_DIR}/tests)
-endif(WITH_TESTS)
\ No newline at end of file
index b89b6b5..3a20299 100644 (file)
@@ -106,12 +106,3 @@ install(FILES       ${GRAPHIC_LIB_DIR}/include/WindowSystems/BaseWindowSystem.h
 install(FILES       ${RENDERERBASE_DIR}/include/BaseRenderer.h
                     ${RENDERERBASE_DIR}/include/RenderUtil.h
         DESTINATION include/layermanager/graphic/Base)
-
-#===========================================================================
-# test
-#===========================================================================
-if (WITH_TESTS)
-    set (CMAKE_CXX_FLAGS "")
-    enable_testing()
-    #add_subdirectory_once (${GRAPHIC_LIB_DIR}/tests)
-endif(WITH_TESTS)
\ No newline at end of file
index de48975..ab1da6b 100644 (file)
@@ -101,11 +101,3 @@ install(FILES       ${RENDERERBASE_DIR}/include/BaseRenderer.h
                     ${RENDERERBASE_DIR}/include/RenderUtil.h
         DESTINATION include/layermanager/graphic/Base)
 
-#===========================================================================
-# test
-#===========================================================================
-if (WITH_TESTS)
-    set (CMAKE_CXX_FLAGS "")
-    enable_testing()
-    #add_subdirectory_once (${GRAPHIC_LIB_DIR}/tests)
-endif(WITH_TESTS)
index 7991d93..d489e6e 100644 (file)
@@ -101,12 +101,3 @@ install(FILES       ${GRAPHIC_LIB_DIR}/include/WindowSystems/BaseWindowSystem.h
 install(FILES       ${RENDERERBASE_DIR}/include/BaseRenderer.h
                     ${RENDERERBASE_DIR}/include/RenderUtil.h
         DESTINATION include/layermanager/graphic/Base)
-
-#===========================================================================
-# test
-#===========================================================================
-if (WITH_TESTS)
-    set (CMAKE_CXX_FLAGS "")
-    enable_testing()
-    #add_subdirectory_once (${GRAPHIC_LIB_DIR}/tests)
-endif(WITH_TESTS)
\ No newline at end of file
index 7372d40..1ef38ca 100644 (file)
@@ -62,26 +62,22 @@ endif (WITH_DLT)
 
 include_directories(${INCLUDE_DIRS})
 
-if (INSTALL_UTILS_LIB)
-        install(FILES
-                    include/Log.h
-                    include/LogMessageBuffer.h
-                    include/IlmMatrix.h
-                    include/Bitmap.h
-                DESTINATION
-                    include/layermanager
-        )
-
-        install(TARGETS
-                    ${PROJECT_NAME}
-                DESTINATION
-                    lib/layermanager/static
-        )
-endif (INSTALL_UTILS_LIB)
+install(FILES
+            include/Log.h
+            include/LogMessageBuffer.h
+            include/IlmMatrix.h
+            include/Bitmap.h
+        DESTINATION
+            include/layermanager
+)
 
-if (WITH_TESTS)
+install(TARGETS
+            ${PROJECT_NAME}
+        DESTINATION
+            lib/layermanager/static
+)
 
-    set (CMAKE_CXX_FLAGS "")
+if (WITH_TESTS)
 
     add_executable(${PROJECT_NAME}_Test
         tests/BitmapTest.cpp
index 358448b..a393939 100644 (file)
@@ -39,9 +39,11 @@ endif (WITH_STATIC_LIBRARIES)
 #==============================================================================
 # default compiler flags
 #==============================================================================
-set (COMPILER_FLAGS_EXAMPLE "-Wall -Wextra -fPIC")
-set (COMPILER_FLAGS_PLUGIN  "-Wall -Wextra -fPIC -pedantic -Wno-long-long")
-set (COMPILER_FLAGS_CORE    "-Wall -Wextra -fPIC -pedantic -Wno-long-long -Wno-unused-function")
+set (COMPILER_FLAGS_3RDPARTY "-fPIC")
+set (COMPILER_FLAGS_TEST     "-fPIC")
+set (COMPILER_FLAGS_EXAMPLE  "-fPIC -Wall -Wextra")
+set (COMPILER_FLAGS_PLUGIN   "-fPIC -Wall -Wextra -pedantic -Wno-long-long")
+set (COMPILER_FLAGS_CORE     "-fPIC -Wall -Wextra -pedantic -Wno-long-long -Wno-unused-function")
 
 
 #==============================================================================