summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt1
-rw-r--r--cmake/FindZIP.cmake2
-rw-r--r--cmake/MacroAddSources.cmake9
-rw-r--r--src/audio/CMakeLists.txt7
-rw-r--r--src/base/CMakeLists.txt7
-rw-r--r--src/client/CMakeLists.txt7
-rw-r--r--src/net/CMakeLists.txt7
-rw-r--r--src/screen/CMakeLists.txt7
-rw-r--r--src/server/CMakeLists.txt7
-rw-r--r--src/widget/CMakeLists.txt7
10 files changed, 18 insertions, 43 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8334e6d..db1f028 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -58,6 +58,7 @@ MESSAGE ( "Configure for ${APPNAME} Started" )
MESSAGE ( "<******************************>" )
CMAKE_MINIMUM_REQUIRED ( VERSION 2.6.0 )
CMAKE_MINIMUM_REQUIRED ( VERSION 2.6.0 FATAL_ERROR )
+INCLUDE (cmake/MacroAddSources.cmake)
IF ( COMMAND cmake_policy )
cmake_policy( SET CMP0003 NEW )
ENDIF ( COMMAND cmake_policy )
diff --git a/cmake/FindZIP.cmake b/cmake/FindZIP.cmake
index 1286da1..e50aedf 100644
--- a/cmake/FindZIP.cmake
+++ b/cmake/FindZIP.cmake
@@ -39,4 +39,4 @@ ELSE(ZIP_LIBRARIES AND ZIP_INCLUDE_DIR)
ENDIF(NOT ZIP_FOUND)
ENDIF(ZIP_LIBRARIES AND ZIP_INCLUDE_DIR)
-MARK_AS_ADVANCED( ZIP_LIBRARY ZIP_INCLUDE_DIR )
+MARK_AS_ADVANCED( ZIP_LIBRARIES ZIP_INCLUDE_DIR )
diff --git a/cmake/MacroAddSources.cmake b/cmake/MacroAddSources.cmake
new file mode 100644
index 0000000..62c1381
--- /dev/null
+++ b/cmake/MacroAddSources.cmake
@@ -0,0 +1,9 @@
+# This macro is for generating the sources list from in-folder files.
+MACRO(MacroAddSources)
+ FILE ( GLOB src ${fn}/*.c )
+ FOREACH ( fle ${src} )
+ GET_FILENAME_COMPONENT ( fnp ${fle} NAME_WE )
+ GET_FILENAME_COMPONENT ( pth ${fle} PATH )
+ SET ( SRC_${fn} ${SRC_${fn}} ${pth}/${fnp} )
+ ENDFOREACH ( fle )
+ENDMACRO(MacroAddSources)
diff --git a/src/audio/CMakeLists.txt b/src/audio/CMakeLists.txt
index 6c8c7a1..2e93cef 100644
--- a/src/audio/CMakeLists.txt
+++ b/src/audio/CMakeLists.txt
@@ -3,10 +3,5 @@
###############################################################################
# Generate source_code files from .c files we find in directory
###############################################################################
-FILE ( GLOB src ${fn}/*.c )
-FOREACH ( fle ${src} )
- GET_FILENAME_COMPONENT ( fnp ${fle} NAME_WE )
- GET_FILENAME_COMPONENT ( pth ${fle} PATH )
- SET ( SRC_${fn} ${SRC_${fn}} ${pth}/${fnp} )
-ENDFOREACH ( fle )
+MacroAddSources()
###############################################################################
diff --git a/src/base/CMakeLists.txt b/src/base/CMakeLists.txt
index 6c8c7a1..2e93cef 100644
--- a/src/base/CMakeLists.txt
+++ b/src/base/CMakeLists.txt
@@ -3,10 +3,5 @@
###############################################################################
# Generate source_code files from .c files we find in directory
###############################################################################
-FILE ( GLOB src ${fn}/*.c )
-FOREACH ( fle ${src} )
- GET_FILENAME_COMPONENT ( fnp ${fle} NAME_WE )
- GET_FILENAME_COMPONENT ( pth ${fle} PATH )
- SET ( SRC_${fn} ${SRC_${fn}} ${pth}/${fnp} )
-ENDFOREACH ( fle )
+MacroAddSources()
###############################################################################
diff --git a/src/client/CMakeLists.txt b/src/client/CMakeLists.txt
index 6c8c7a1..2e93cef 100644
--- a/src/client/CMakeLists.txt
+++ b/src/client/CMakeLists.txt
@@ -3,10 +3,5 @@
###############################################################################
# Generate source_code files from .c files we find in directory
###############################################################################
-FILE ( GLOB src ${fn}/*.c )
-FOREACH ( fle ${src} )
- GET_FILENAME_COMPONENT ( fnp ${fle} NAME_WE )
- GET_FILENAME_COMPONENT ( pth ${fle} PATH )
- SET ( SRC_${fn} ${SRC_${fn}} ${pth}/${fnp} )
-ENDFOREACH ( fle )
+MacroAddSources()
###############################################################################
diff --git a/src/net/CMakeLists.txt b/src/net/CMakeLists.txt
index 6c8c7a1..2e93cef 100644
--- a/src/net/CMakeLists.txt
+++ b/src/net/CMakeLists.txt
@@ -3,10 +3,5 @@
###############################################################################
# Generate source_code files from .c files we find in directory
###############################################################################
-FILE ( GLOB src ${fn}/*.c )
-FOREACH ( fle ${src} )
- GET_FILENAME_COMPONENT ( fnp ${fle} NAME_WE )
- GET_FILENAME_COMPONENT ( pth ${fle} PATH )
- SET ( SRC_${fn} ${SRC_${fn}} ${pth}/${fnp} )
-ENDFOREACH ( fle )
+MacroAddSources()
###############################################################################
diff --git a/src/screen/CMakeLists.txt b/src/screen/CMakeLists.txt
index 6c8c7a1..2e93cef 100644
--- a/src/screen/CMakeLists.txt
+++ b/src/screen/CMakeLists.txt
@@ -3,10 +3,5 @@
###############################################################################
# Generate source_code files from .c files we find in directory
###############################################################################
-FILE ( GLOB src ${fn}/*.c )
-FOREACH ( fle ${src} )
- GET_FILENAME_COMPONENT ( fnp ${fle} NAME_WE )
- GET_FILENAME_COMPONENT ( pth ${fle} PATH )
- SET ( SRC_${fn} ${SRC_${fn}} ${pth}/${fnp} )
-ENDFOREACH ( fle )
+MacroAddSources()
###############################################################################
diff --git a/src/server/CMakeLists.txt b/src/server/CMakeLists.txt
index 6c8c7a1..2e93cef 100644
--- a/src/server/CMakeLists.txt
+++ b/src/server/CMakeLists.txt
@@ -3,10 +3,5 @@
###############################################################################
# Generate source_code files from .c files we find in directory
###############################################################################
-FILE ( GLOB src ${fn}/*.c )
-FOREACH ( fle ${src} )
- GET_FILENAME_COMPONENT ( fnp ${fle} NAME_WE )
- GET_FILENAME_COMPONENT ( pth ${fle} PATH )
- SET ( SRC_${fn} ${SRC_${fn}} ${pth}/${fnp} )
-ENDFOREACH ( fle )
+MacroAddSources()
###############################################################################
diff --git a/src/widget/CMakeLists.txt b/src/widget/CMakeLists.txt
index 6c8c7a1..2e93cef 100644
--- a/src/widget/CMakeLists.txt
+++ b/src/widget/CMakeLists.txt
@@ -3,10 +3,5 @@
###############################################################################
# Generate source_code files from .c files we find in directory
###############################################################################
-FILE ( GLOB src ${fn}/*.c )
-FOREACH ( fle ${src} )
- GET_FILENAME_COMPONENT ( fnp ${fle} NAME_WE )
- GET_FILENAME_COMPONENT ( pth ${fle} PATH )
- SET ( SRC_${fn} ${SRC_${fn}} ${pth}/${fnp} )
-ENDFOREACH ( fle )
+MacroAddSources()
###############################################################################