Permalink
Browse files

* New experimental way to build things automagically as well as new …

  • Loading branch information...
1 parent 2538d72 commit 0845bc27576816f92b76e3a7943dc820893517fc @mickem committed Aug 14, 2012
Showing with 48 additions and 7 deletions.
  1. +14 −7 build/python/fetchdeps.py
  2. +4 −0 changelog
  3. +30 −0 check_deps.cmake
@@ -194,7 +194,7 @@ def exec_build(self, folder, source, pre, task, post):
os.chdir(cwd)
def build_w32(self, folder, source):
- self.exec_build(folder, source self.common_pre, self.specific_w32, self.common_post)
+ self.exec_build(folder, source, self.common_pre, self.specific_w32, self.common_post)
def build_x64(self, folder, source):
self.exec_build(folder, source, self.common_pre, self.specific_x64, self.common_post)
@@ -322,16 +322,17 @@ def write_config(root, target, defines):
with open(os.path.join(target, 'build.cmake'), "w") as conf:
conf.write(config)
- for define in defines:
- (key, value) = define.split('=')
- conf.write('SET(%s "%s")'%(key, value))
+ if defines:
+ for define in defines:
+ (key, value) = define.split('=')
+ conf.write('SET(%s "%s")'%(key, value))
print 'OK CMake config written to: %s'%target
def post_build_source(root, target, source):
data = {}
data['root'] = root.replace('\\', '/')
data['target'] = target.replace('\\', '/')
- data['source'] = target.replace('\\', '/')
+ data['source'] = source.replace('\\', '/')
for t in targets:
if t in sources:
data[t] = sources[t].find_rel_path(root)
@@ -349,16 +350,22 @@ def post_build_source(root, target, source):
parser.add_option("-t", "--target", help="Which target architecture to build (win32 or x64)")
parser.add_option("-c", "--cmake-config", help="Folder to place cmake configuration file in")
parser.add_option("-D", "--cmake-define", action="append", help="Set other variables in the cmake config file")
-parser.add_option("-s", "--source", default=nscp, help="Location of the nscp source folder")
+parser.add_option("-s", "--source", default='nscp', help="Location of the nscp source folder")
(options, args) = parser.parse_args()
if not options.directory:
options.directory = os.getcwd()
+if not os.path.exists(options.source):
+ print 'ERR NSCP source folder was not found (strange, thats where this script should be right?) --source=%s'%options.source
+ sys.exit(1)
+
fetch_sources(options.directory)
decompress_sources(options.directory)
build_source(options.directory, options.target, options.source)
if options.cmake_config:
write_config(options.directory, options.cmake_config, options.cmake_define)
- post_build_source(options.directory, options.cmake_config, options.source)
+ post_build_source(options.directory, options.cmake_config, options.source)
+else:
+ print 'WARN Since you did not specify --cmake-config we will not write the cmake config file so most likely this was not very usefull...'
View
@@ -4,6 +4,10 @@ TODO:
* Fix dependonservice LanManWorkStation (old win)
* Fix RtlStringFromGUID problem on NT4
+2012-08-14 MickeM
+ * New experimental way to build things automagically as well as new cleanedup build scripts.
+ http://nsclient.org/nscp/wiki/build/04x#Automatic
+
2012-08-07 MickeM
* Fixed issue with perfoamnce data overflowing 32-bit integers (#550)
* Fixed issue with CheckUptime and time rendering beein wrong (#549)
View
@@ -0,0 +1,30 @@
+cmake_minimum_required(VERSION 2.6)
+
+IF(COMMAND CMAKE_POLICY)
+CMAKE_POLICY(SET CMP0011 NEW)
+ENDIF(COMMAND CMAKE_POLICY)
+
+set(CMAKE_FIND_LIBRARY_PREFIXES "lib" "")
+set (CMAKE_FIND_LIBRARY_SUFFIXES .lib)
+#############################################################################
+#
+# Setup cmake enviornment and include custom config overrides
+#
+#############################################################################
+IF(EXISTS ${TARGET}/build.cmake)
+ MESSAGE(STATUS "Reading custom variables from: ${TARGET}/build.cmake")
+ INCLUDE(${TARGET}/build.cmake)
+ENDIF(EXISTS ${TARGET}/build.cmake)
+SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON)
+SET(CMAKE_MODULE_PATH "${SOURCE}/build/cmake;${CMAKE_MODULE_PATH}")
+
+SET(BUILD_PYTHON_FOLDER "${SOURCE}/build/python")
+SET(BUILD_CMAKE_FOLDER "${SOURCE}/build/cmake")
+SET(NSCP_PROJECT_BINARY_DIR ${TARGET})
+
+#############################################################################
+#
+# Find all dependencies and report anything missing.
+#
+#############################################################################
+INCLUDE(${BUILD_CMAKE_FOLDER}/dependencies.cmake)

0 comments on commit 0845bc2

Please sign in to comment.