comparison CMakeLists.txt @ 1266:a548dd9a5dbe

Fix c++ build with CLANG The c++ include directories were not picked up automatically and had to be added manually.
author Andre Heinecke <andre.heinecke@intevation.de>
date Fri, 26 Sep 2014 18:44:41 +0200
parents 3cd8dd706aaa
children 05d4b2b8f22a
comparison
equal deleted inserted replaced
1265:b18f08034c24 1266:a548dd9a5dbe
22 cmake_policy(SET CMP0020 OLD) 22 cmake_policy(SET CMP0020 OLD)
23 endif() 23 endif()
24 24
25 if (USE_CLANG) 25 if (USE_CLANG)
26 message (STATUS "Using clang options to build trustbridge.") 26 message (STATUS "Using clang options to build trustbridge.")
27 # This is a bit of a hack but necessary on Ubuntu 14.4
28 include_directories(/usr/include/c++/4.8 /usr/include/x86_64-linux-gnu/c++/4.8/)
27 endif() 29 endif()
28 30
29 include(CTest) 31 include(CTest)
30 include(GenerateCppcheck) 32 include(GenerateCppcheck)
31 include(HGVersion) 33 include(HGVersion)
136 add_subdirectory(nss-cmake-static) 138 add_subdirectory(nss-cmake-static)
137 add_definitions(-D_WIN32_WINNT=0x0600) # Windows vista. NSS defines its own winver. 139 add_definitions(-D_WIN32_WINNT=0x0600) # Windows vista. NSS defines its own winver.
138 endif() 140 endif()
139 141
140 # No chance to compile nss with -Werror 142 # No chance to compile nss with -Werror
141 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror") 143 if (NOT USE_CLANG)
142 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror") 144 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
145 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")
146 endif()
143 147
144 # Cmake does not correctly identify gcc windres when cross compiling 148 # Cmake does not correctly identify gcc windres when cross compiling
145 # making this line neccessary to set the correct flags for it. 149 # making this line neccessary to set the correct flags for it.
146 # See: http://public.kitware.com/Bug/view.php?id=11773 150 # See: http://public.kitware.com/Bug/view.php?id=11773
147 SET(CMAKE_RC_COMPILE_OBJECT 151 SET(CMAKE_RC_COMPILE_OBJECT

http://wald.intevation.org/projects/trustbridge/