Fix build issues related to 'missing' version.cpp

Change-Id: Id44de09b8ed27edb98c53f73ca0d0ce05d4cc7ec
diff --git a/wscript b/wscript
index 01f7faa..09725c6 100644
--- a/wscript
+++ b/wscript
@@ -10,6 +10,8 @@
                        'system', 'random', 'date_time', 'iostreams', 'regex',
                        'program_options', 'chrono', 'filesystem']
 
+top = '../..'
+
 def required_boost_libs(conf):
     conf.env.REQUIRED_BOOST_LIBS += REQUIRED_BOOST_LIBS
 
@@ -87,13 +89,20 @@
 
     bld(features="subst",
         name="versioncpp-NFD",
-        source='NFD/core/version.cpp.in', target='NFD/core/version.cpp',
+        source='NFD/core/version.cpp.in', target=bld.path.find_or_declare('NFD/core/version.cpp'),
         install_path=None,
         VERSION_STRING=base,
         VERSION_BUILD="%s-ndnSIM" % build,
         VERSION=int(split[0]) * 1000000 + int(split[1]) * 1000 + int(split[2]),
         VERSION_MAJOR=split[0], VERSION_MINOR=split[1], VERSION_PATCH=split[2])
 
+    bld.objects(
+        features="cxx",
+        target='version-NFD-objects',
+        source='NFD/core/version.cpp',
+        includes='../../ns3/ndnSIM/NFD',
+        use='version-NFD versioncpp-NFD')
+
     (base, build, split) = bld.getVersion('ndn-cxx')
     bld(features="subst",
         name="version-ndn-cxx",
@@ -104,12 +113,6 @@
         VERSION=int(split[0]) * 1000000 + int(split[1]) * 1000 + int(split[2]),
         VERSION_MAJOR=split[0], VERSION_MINOR=split[1], VERSION_PATCH=split[2])
 
-    bld.objects(
-        target='version-NFD-objects',
-        source='NFD/core/version.cpp',
-        includes='../../ns3/ndnSIM/NFD',
-        use='version-NFD versioncpp-NFD')
-
     deps = ['core', 'network', 'point-to-point', 'topology-read', 'mobility', 'internet']
     if 'ns3-visualizer' in bld.env['NS3_ENABLED_MODULES']:
         deps.append('visualizer')