aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-06-26 18:08:40 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2017-06-27 15:36:00 +0200
commiteac26543ab123eeb46fc66dfc02178e7772b8ac1 (patch)
treee399b6c2b13ea62215ebcac68236913440af39aa
parentb61499ae447607b1a200e0092ace3ad20b67db4c (diff)
Add wrapper to 4 most commons macros
1 macros to call in the right orders 4 following macros: - project_subdirs_add - project_targets_populate - project_package_build - project_closing_msg Could take 1 argument passed to project_subdirs_add Change-Id: I4ae7e24f1a865413156c5c70b77098c3a20349b0 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
-rw-r--r--README.md2
-rw-r--r--cmake/common.cmake15
2 files changed, 16 insertions, 1 deletions
diff --git a/README.md b/README.md
index 010f4f7..b28b90a 100644
--- a/README.md
+++ b/README.md
@@ -238,4 +238,4 @@ project_package_build()
### project_closing_message
Will display the closing message configured in `config.cmake` file. Put it at
-the end of your project CMake file.
+the end of your project CMake file. \ No newline at end of file
diff --git a/cmake/common.cmake b/cmake/common.cmake
index ec0ffcf..4aa7578 100644
--- a/cmake/common.cmake
+++ b/cmake/common.cmake
@@ -123,3 +123,18 @@ INCLUDE_DIRECTORIES(${EXTRA_INCLUDE_DIRS})
if(NOT BINDINGS_LINK_FLAG)
set(BINDINGS_LINK_FLAG "-Wl,--version-script=${PKG_TEMPLATE_PREFIX}/cmake/export.map")
endif()
+
+macro(project_build)
+ set (ARGSLIST ${ARGN})
+ list(LENGTH ARGSLIST ARGSNUM)
+ if(${ARGSNUM} GREATER 0)
+ set(pattern "${ARGV0}")
+ else()
+ set(pattern "*")
+ endif()
+
+ project_subdirs_add(${pattern})
+ project_targets_populate()
+ project_package_build()
+ project_closing_msg()
+endmacro(project_build) \ No newline at end of file