]> rtime.felk.cvut.cz Git - orte.git/commitdiff
meson build: Properly handle generation of orte_config.h
authorMichal Sojka <michal.sojka@cvut.cz>
Mon, 12 Nov 2018 09:10:31 +0000 (10:10 +0100)
committerMichal Sojka <michal.sojka@cvut.cz>
Mon, 12 Nov 2018 09:10:31 +0000 (10:10 +0100)
By properly we mean copying the existing template for now. Later, we may
generate the config by letting meson detect the needed features and
generate the whole config automatically.

orte/include/meson.build
orte/include/orte/meson.build [new file with mode: 0644]
orte/liborte/meson.build

index d92381e7cf89d9161d8ff4b9d7604d000ffbc62c..10e5571f88d36fb93ab821da9b7e1290b4ace4c1 100644 (file)
@@ -2,13 +2,5 @@
 install_headers(
   'orte.h',
 )
-install_headers(
-  'orte/basic_types.h',
-  'orte/cdr.h',
-  'orte/defines_api.h',
-  'orte/protos_api.h',
-  'orte/typedefs_api.h',
-  'orte/typedefs_defines_rtps.h',
-  subdir: 'orte',
-)
-# TODO: rename config and install it to orte/orte_config.h
+
+subdir('orte')
diff --git a/orte/include/orte/meson.build b/orte/include/orte/meson.build
new file mode 100644 (file)
index 0000000..3881fff
--- /dev/null
@@ -0,0 +1,26 @@
+install_headers(
+  'basic_types.h',
+  'cdr.h',
+  'defines_api.h',
+  'protos_api.h',
+  'typedefs_api.h',
+  'typedefs_defines_rtps.h',
+  subdir: 'orte',
+)
+
+if (host_machine.system() == 'windows')
+  orte_config_src = 'orte_config_omk_win32.h'
+elif (host_machine.system() == 'linux')
+  orte_config_src = 'orte_config_omk_linux.h'
+else
+  orte_config_src = 'orte_config_omk_linux.h'
+endif
+
+orte_config_h = custom_target(
+  'orte_config.h',
+  input : orte_config_src,
+  output : 'orte_config.h',
+  command : ['cp', '@INPUT@', '@OUTPUT@'],
+  install: true,
+  install_dir: 'include/orte',
+)
index be371b75eb7524de28b299c4c907d33514eef22e..adb66756015e418c387d800987a56a883c2caaf7 100644 (file)
@@ -1,18 +1,9 @@
 liborte_args = []
 
-if (host_machine.system() == 'windows')
-  liborte_args += ['-include', 'orte/orte_config_omk_win32.h']
-elif (host_machine.system() == 'linux')
-  liborte_args += ['-include', 'orte/orte_config_omk_linux.h']
-else
-  liborte_args += ['-include', 'orte/orte_config_omk_linux.h']
-endif
-
-
-
 liborte = library(
   'orte',
   [
+    orte_config_h,
     'conv.c',
     'debug.c',
     'event.c',