From: Manuel Nickschas Date: Sun, 8 Jun 2008 15:08:48 +0000 (+0200) Subject: Fixing parallel makes. X-Git-Tag: 0.3.0~371^2~16 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=372749c1b0b02600cce9ccf37881ea0b2b191e20 Fixing parallel makes. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 6963dfc7..bec08c9c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -56,6 +56,19 @@ endif(SPUTDEV) # Now that we have the correct $PATH, lets find Qt! find_package(Qt4 REQUIRED) +set(QT_DONT_USE_QTGUI 1) +include(${QT_USE_FILE}) +include_directories(${QT_INCLUDES}) + +# We need to create a version.gen +# For this, we create our genversion binary and make sure it is run every time. +add_executable(genversion ${CMAKE_SOURCE_DIR}/src/common/genversion.cpp) +target_link_libraries(genversion ${QT_LIBRARIES}) + +add_custom_target(genversion_run ALL ${CMAKE_BINARY_DIR}/genversion + ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR}/src/common/version.gen) +add_dependencies(genversion_run genversion) + # Add needed subdirs add_subdirectory(src/common) include_directories(src/common) @@ -72,6 +85,9 @@ if(BUILD_QTCLIENT OR BUILD_MONO) include_directories(src/qtui) endif(BUILD_QTCLIENT OR BUILD_MONO) +# Make sure version.gen exists before building mod_common +add_dependencies(mod_common genversion_run) + # Add resources qt4_add_resources(RES_I18N ${CMAKE_SOURCE_DIR}/i18n/i18n.qrc) qt4_add_resources(RES_ICONS ${CMAKE_SOURCE_DIR}/src/icons/icons.qrc) @@ -85,20 +101,7 @@ endif(DEFINED STATIC) # Here comes the dirty part. Our targets need different Qt4 modules, i.e. different libs # and defines. We can't simply include UseQt4 several times, since definitions add up. -# We workaround this by only setting up QtCore first, and adding additional stuff later. -set(QT_DONT_USE_QTGUI 1) -include(${QT_USE_FILE}) -include_directories(${QT_INCLUDES}) - -# We need to create a version.gen -# For this, we create our genversion binary and make sure it is run every time. -add_executable(genversion ${CMAKE_SOURCE_DIR}/src/common/genversion.cpp) -target_link_libraries(genversion ${QT_LIBRARIES}) - -add_custom_target(genversion_run ALL ${CMAKE_BINARY_DIR}/genversion - ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR}/src/common/version.gen) -add_dependencies(genversion_run genversion) -set_source_files_properties(src/common/global.cpp PROPERTIES OBJECT_DEPENDS genversion_run) +# We workaround this by using our own macro to figure out what to add. # This macro sets variables for additional Qt modules. macro(setup_qt4_variables) diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 2239e77f..58e35c0b 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -37,7 +37,8 @@ set(HEADERS qt4_wrap_cpp(MOC ${HEADERS}) -include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_SOURCE_DIR}) # for version.inc and version.gen -add_definitions(-DHAVE_VERSION_GEN) # we ensure that by deps in the main CMakeLists.txt +include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_SOURCE_DIR}) # for version.inc and version.gen +add_definitions(-DHAVE_VERSION_GEN) # we ensure that by deps in the main CMakeLists.txt +set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES version.gen) add_library(mod_common STATIC ${SOURCES} ${MOC}) diff --git a/src/qtui/CMakeLists.txt b/src/qtui/CMakeLists.txt index f6187479..3a17781f 100644 --- a/src/qtui/CMakeLists.txt +++ b/src/qtui/CMakeLists.txt @@ -1,5 +1,6 @@ # Builds the qtui module +set(QT_DONT_USE_QTGUI 0) set(QT_USE_QTNETWORK 1) include(${QT_USE_FILE}) diff --git a/src/uisupport/CMakeLists.txt b/src/uisupport/CMakeLists.txt index 7e30d1d9..32664cf8 100644 --- a/src/uisupport/CMakeLists.txt +++ b/src/uisupport/CMakeLists.txt @@ -1,5 +1,6 @@ # Builds the uisupport module +set(QT_DONT_USE_QTGUI 0) set(QT_USE_QTNETWORK 1) include(${QT_USE_FILE})