diff options
author | sleske <sleske@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2012-05-20 16:32:09 +0000 |
---|---|---|
committer | sleske <sleske@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2012-05-20 16:32:09 +0000 |
commit | b40fc72bd8ea08c55f6dcd69eaec3eba44284b12 (patch) | |
tree | ef19f35597ff1a6271733b92261f68faf1ee284a /CMakeLists.txt | |
parent | 9b5560a5196de351a4da852cf151ffd0b01a359a (diff) | |
download | navit-svn-b40fc72bd8ea08c55f6dcd69eaec3eba44284b12.tar.gz |
Fix:core:Fix CMake build of support/ code on Ubuntu | Problem with --as-needed, see https://wiki.ubuntu.com/NattyNarwhal/ToolchainTransition
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@5110 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'CMakeLists.txt')
-rwxr-xr-x | CMakeLists.txt | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 5a5077d0..1f2768e5 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,7 @@ set(MACOSX_BUNDLE_GUI_IDENTIFIER "org.navitproject.navit") set(MACOSX_BUNDLE_BUNDLE_NAME "Navit") project(navit C) +# Workaround for CMake issue 8345 / 9220, see http://trac.navit-project.org/ticket/1041 if(DEFINED CMAKE_CXX_COMPILER AND CMAKE_CXX_COMPILER MATCHES "^$") set(CMAKE_CXX_COMPILER CMAKE_CXX_COMPILER-NOTFOUND) endif(DEFINED CMAKE_CXX_COMPILER AND CMAKE_CXX_COMPILER MATCHES "^$") @@ -115,6 +116,12 @@ find_package(PNG) find_package(DBusGLib) find_package(OpenSSL) find_package(Threads) +if (NOT CMAKE_USE_PTHREADS_INIT) + # We use Pthreads in several places, no point in continuing without. + MESSAGE(FATAL_ERROR "PThreads not found. Navit cannot be built without Pthreads.") +endif(NOT CMAKE_USE_PTHREADS_INIT) +list(APPEND NAVIT_LIBS "pthread") + libfind_pkg_check_modules(FONTCONFIG fontconfig) #Qt detection if (NOT DISABLE_QT) @@ -169,12 +176,6 @@ else() endif(NEEDS_LIBINTL) endif(NOT HAVE_LIBINTL) - -if (CMAKE_USE_PTHREADS_INIT) - set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${CMAKE_THREAD_LIBS_INIT}") - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_THREAD_LIBS_INIT}") - set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${CMAKE_THREAD_LIBS_INIT}") -endif(CMAKE_USE_PTHREADS_INIT) if (Glib_FOUND) set(HAVE_GLIB 1) include_directories(${Glib_INCLUDE_DIRS}) |