From c48be0494fd528e99f8225cb829b12daa8252fa8 Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Sat, 29 Mar 2014 02:51:07 +0000 Subject: [PATCH] Reducing the number of files dependent on svnversion.h without compromising qmake builds. Now it is required to directly include svnversion.h to get the SVNVERSION macro defined. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@3955 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- CMakeLists.txt | 16 ++++++++-------- ConfigTest.cpp | 2 ++ TestConfiguration.cpp | 2 ++ main.cpp | 2 ++ mainwindow.cpp | 2 ++ svnversion.h | 2 ++ 6 files changed, 18 insertions(+), 8 deletions(-) create mode 100644 svnversion.h diff --git a/CMakeLists.txt b/CMakeLists.txt index f920c843d..575d146de 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,14 +8,6 @@ set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/CMake/Modules) include (${PROJECT_SOURCE_DIR}/CMake/VersionCompute.cmake) -# creates svnversion.h using cmake script -add_custom_target (revisiontag - COMMAND ${CMAKE_COMMAND} -D SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR} -D OUTPUT_DIR=${PROJECT_BINARY_DIR} -P ${CMAKE_CURRENT_SOURCE_DIR}/CMake/getsvn.cmake - COMMENT "Generating Subversion revision information" - VERBATIM - ) -include_directories ("${PROJECT_BINARY_DIR}") - # # Options & features @@ -645,10 +637,17 @@ add_custom_target (uninstall "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake") +# creates svnversion.h using cmake script +add_custom_target (revisiontag + COMMAND ${CMAKE_COMMAND} -D SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR} -D OUTPUT_DIR=${PROJECT_BINARY_DIR} -P ${CMAKE_CURRENT_SOURCE_DIR}/CMake/getsvn.cmake + COMMENT "Generating Subversion revision information" + VERBATIM + ) # explicitly say that the executable depends on custom target, this is # done indirectly so that the revisiontag target gets built exactly # once per build add_dependencies(wsjt revisiontag) +add_dependencies(wsjt_qt revisiontag) add_dependencies(jt9 revisiontag) add_dependencies(wsjtx revisiontag) @@ -660,6 +659,7 @@ configure_file ( "${PROJECT_SOURCE_DIR}/wsjtx_config.h.in" "${PROJECT_BINARY_DIR}/wsjtx_config.h" ) +include_directories ("${PROJECT_BINARY_DIR}") if (NOT WIN32 AND NOT APPLE) diff --git a/ConfigTest.cpp b/ConfigTest.cpp index 1d596c861..ea3fbedb5 100644 --- a/ConfigTest.cpp +++ b/ConfigTest.cpp @@ -8,6 +8,8 @@ #include #include +#include "svnversion.h" + #include "GetUserId.hpp" #include "TraceFile.hpp" #include "TestConfiguration.hpp" diff --git a/TestConfiguration.cpp b/TestConfiguration.cpp index da41cbd27..150f289bd 100644 --- a/TestConfiguration.cpp +++ b/TestConfiguration.cpp @@ -12,6 +12,8 @@ #include #include +#include "svnversion.h" + #include "Bands.hpp" #include "FrequencyList.hpp" #include "Configuration.hpp" diff --git a/main.cpp b/main.cpp index 6e5c2cb70..5eaa1f5bd 100644 --- a/main.cpp +++ b/main.cpp @@ -19,6 +19,8 @@ #include #include +#include "svnversion.h" + #include "SettingsGroup.hpp" #include "TraceFile.hpp" #include "mainwindow.h" diff --git a/mainwindow.cpp b/mainwindow.cpp index ba6a362e2..630e77472 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -12,6 +12,8 @@ #include #endif +#include "svnversion.h" + #include "soundout.h" #include "plotter.h" #include "about.h" diff --git a/svnversion.h b/svnversion.h new file mode 100644 index 000000000..c68c6b102 --- /dev/null +++ b/svnversion.h @@ -0,0 +1,2 @@ +/* empty file for qmake compatibility with CMake which generates one + of these in the build tree that gets picked up in preference */