From 6071001b5cd0789caf3ea4300115c2789cf89948 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yao=20Wei=20Tjong=20=E5=A7=9A=E4=BC=9F=E5=BF=A0?= Date: Wed, 30 Oct 2013 18:06:24 +0800 Subject: [PATCH] Refactor define_source_files macro. Change the argument names to indicate their intent usage better. Add option to pass in directly globbing patterns. --- Source/CMake/Modules/Urho3D-CMake-magic.cmake | 38 +++++++++++-------- Source/Engine/CMakeLists.txt | 2 +- Source/Engine/Graphics/CMakeLists.txt | 4 +- Source/Engine/IO/CMakeLists.txt | 4 +- Source/Engine/LuaScript/CMakeLists.txt | 2 +- Source/Samples/01_HelloWorld/CMakeLists.txt | 2 +- Source/Samples/02_HelloGUI/CMakeLists.txt | 2 +- Source/Samples/03_Sprites/CMakeLists.txt | 2 +- Source/Samples/04_StaticScene/CMakeLists.txt | 2 +- .../Samples/05_AnimatingScene/CMakeLists.txt | 2 +- .../06_SkeletalAnimation/CMakeLists.txt | 2 +- Source/Samples/07_Billboards/CMakeLists.txt | 2 +- Source/Samples/08_Decals/CMakeLists.txt | 2 +- .../09_MultipleViewports/CMakeLists.txt | 2 +- .../Samples/10_RenderToTexture/CMakeLists.txt | 2 +- Source/Samples/11_Physics/CMakeLists.txt | 2 +- .../12_PhysicsStressTest/CMakeLists.txt | 2 +- Source/Samples/13_Ragdolls/CMakeLists.txt | 2 +- Source/Samples/14_SoundEffects/CMakeLists.txt | 2 +- Source/Samples/15_Navigation/CMakeLists.txt | 2 +- Source/Samples/16_Chat/CMakeLists.txt | 2 +- .../17_SceneReplication/CMakeLists.txt | 2 +- .../Samples/18_CharacterDemo/CMakeLists.txt | 2 +- Source/Samples/19_VehicleDemo/CMakeLists.txt | 2 +- .../Samples/20_HugeObjectCount/CMakeLists.txt | 2 +- .../21_AngelScriptIntegration/CMakeLists.txt | 2 +- .../Samples/22_LuaIntegration/CMakeLists.txt | 2 +- 27 files changed, 49 insertions(+), 45 deletions(-) diff --git a/Source/CMake/Modules/Urho3D-CMake-magic.cmake b/Source/CMake/Modules/Urho3D-CMake-magic.cmake index 712e1f5a8..61e1ceb45 100644 --- a/Source/CMake/Modules/Urho3D-CMake-magic.cmake +++ b/Source/CMake/Modules/Urho3D-CMake-magic.cmake @@ -262,25 +262,25 @@ function (add_compiler_export_flags) return () endif () - set (EXTRA_FLAGS "-fvisibility=hidden") + set (p_FLAGS "-fvisibility=hidden") # Either return the extra flags needed in the supplied argument, or to the # CMAKE_C_FLAGS if no argument is supplied. if (ARGV1) - set (${ARGV1} "${EXTRA_FLAGS}" PARENT_SCOPE) + set (${ARGV1} "${p_FLAGS}" PARENT_SCOPE) else () - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_FLAGS}" PARENT_SCOPE) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${p_FLAGS}" PARENT_SCOPE) endif () if (COMPILER_HAS_HIDDEN_INLINE_VISIBILITY) - set (EXTRA_FLAGS "${EXTRA_FLAGS} -fvisibility-inlines-hidden") + set (p_FLAGS "${p_FLAGS} -fvisibility-inlines-hidden") endif () # Either return the extra flags needed in the supplied argument, or to the # CMAKE_CXX_FLAGS if no argument is supplied. if (ARGV0) - set (${ARGV0} "${EXTRA_FLAGS}" PARENT_SCOPE) + set (${ARGV0} "${p_FLAGS}" PARENT_SCOPE) else () - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_FLAGS}" PARENT_SCOPE) + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${p_FLAGS}" PARENT_SCOPE) endif () endfunction () @@ -563,28 +563,34 @@ endmacro () # Macro for defining source files macro (define_source_files) # Parse extra arguments - cmake_parse_arguments (EXTRA "PCH;PARENT_SCOPE" "GROUP" "CPP_FILES;H_FILES" ${ARGN}) + cmake_parse_arguments (ARG "PCH;PARENT_SCOPE" "GROUP" "EXTRA_CPP_FILES;EXTRA_H_FILES;GLOB_CPP_PATTERNS;GLOB_H_PATTERNS" ${ARGN}) # Source files are defined by globbing source files in current source directory and also by including the extra source files if provided - file (GLOB CPP_FILES *.cpp) - file (GLOB H_FILES *.h) - list (APPEND CPP_FILES ${EXTRA_CPP_FILES}) - list (APPEND H_FILES ${EXTRA_H_FILES}) + if (NOT ARG_GLOB_CPP_PATTERNS) + set (ARG_GLOB_CPP_PATTERNS *.cpp) # Default glob pattern + endif () + if (NOT ARG_GLOB_H_PATTERNS) + set (ARG_GLOB_H_PATTERNS *.h) + endif () + file (GLOB CPP_FILES ${ARG_GLOB_CPP_PATTERNS}) + file (GLOB H_FILES ${ARG_GLOB_H_PATTERNS}) + list (APPEND CPP_FILES ${ARG_EXTRA_CPP_FILES}) + list (APPEND H_FILES ${ARG_EXTRA_H_FILES}) set (SOURCE_FILES ${CPP_FILES} ${H_FILES}) # Optionally enable PCH - if (EXTRA_PCH) + if (ARG_PCH) enable_pch () endif () # Optionally accumulate source files at parent scope - if (EXTRA_PARENT_SCOPE) + if (ARG_PARENT_SCOPE) get_filename_component (DIR_NAME ${CMAKE_CURRENT_SOURCE_DIR} NAME) set (${DIR_NAME}_CPP_FILES ${CPP_FILES} PARENT_SCOPE) set (${DIR_NAME}_H_FILES ${H_FILES} PARENT_SCOPE) # Optionally put source files into further sub-group (only works for current scope due to CMake limitation) - elseif (EXTRA_GROUP) - source_group ("Source Files\\${EXTRA_GROUP}" FILES ${CPP_FILES}) - source_group ("Header Files\\${EXTRA_GROUP}" FILES ${H_FILES}) + elseif (ARG_GROUP) + source_group ("Source Files\\${ARG_GROUP}" FILES ${CPP_FILES}) + source_group ("Header Files\\${ARG_GROUP}" FILES ${H_FILES}) endif () endmacro () diff --git a/Source/Engine/CMakeLists.txt b/Source/Engine/CMakeLists.txt index 8033cbdc0..72d9a0fae 100644 --- a/Source/Engine/CMakeLists.txt +++ b/Source/Engine/CMakeLists.txt @@ -108,7 +108,7 @@ foreach (SOURCE Audio Container Core Engine Graphics Input IO Math Navigation Ne list (APPEND ENGINE_SOURCE_FILES ${${SOURCE}_CPP_FILES} ${${SOURCE}_H_FILES}) list (APPEND ENGINE_INCLUDE_DIRS_ONLY ${SOURCE}) endforeach () -define_source_files (CPP_FILES ${ENGINE_SOURCE_FILES} H_FILES gitversion.h PCH) +define_source_files (EXTRA_CPP_FILES ${ENGINE_SOURCE_FILES} EXTRA_H_FILES gitversion.h PCH) list (APPEND SOURCE_FILES ${ALL_OBJ_FILES}) set_source_files_properties (${ALL_OBJ_FILES} PROPERTIES GENERATED TRUE) diff --git a/Source/Engine/Graphics/CMakeLists.txt b/Source/Engine/Graphics/CMakeLists.txt index 44be3e5fb..ee131be07 100644 --- a/Source/Engine/Graphics/CMakeLists.txt +++ b/Source/Engine/Graphics/CMakeLists.txt @@ -26,9 +26,7 @@ if (USE_OPENGL) else () set (GRAPHICS_SYS_DIR Direct3D9) endif () -file (GLOB SYS_CPP_FILES ${GRAPHICS_SYS_DIR}/*.cpp) -file (GLOB SYS_H_FILES ${GRAPHICS_SYS_DIR}/*.h) -define_source_files (CPP_FILES ${SYS_CPP_FILES} H_FILES ${SYS_H_FILES} PARENT_SCOPE) +define_source_files (GLOB_CPP_PATTERNS *.cpp ${GRAPHICS_SYS_DIR}/*.cpp GLOB_H_PATTERNS *.h ${GRAPHICS_SYS_DIR}/*.h PARENT_SCOPE) # Define dependency libs set (ENGINE_LINK_LIBS_ONLY ${ENGINE_LINK_LIBS_ONLY} SDL PARENT_SCOPE) diff --git a/Source/Engine/IO/CMakeLists.txt b/Source/Engine/IO/CMakeLists.txt index 154d38e16..ce70fc8ca 100644 --- a/Source/Engine/IO/CMakeLists.txt +++ b/Source/Engine/IO/CMakeLists.txt @@ -22,9 +22,9 @@ # Define source files if (APPLE AND NOT IOS) - file (GLOB C_FILES *.m) + set (GLOB_OBJC_PATTERN *.m) endif() -define_source_files (CPP_FILES ${C_FILES} PARENT_SCOPE) +define_source_files (GLOB_CPP_PATTERNS *.cpp ${GLOB_OBJC_PATTERN} PARENT_SCOPE) # Define dependency libs set (ENGINE_LIBS ${ENGINE_LIBS} ../ThirdParty/LZ4 PARENT_SCOPE) diff --git a/Source/Engine/LuaScript/CMakeLists.txt b/Source/Engine/LuaScript/CMakeLists.txt index c66eed1ce..3a63c8294 100644 --- a/Source/Engine/LuaScript/CMakeLists.txt +++ b/Source/Engine/LuaScript/CMakeLists.txt @@ -56,7 +56,7 @@ foreach (API_PKG_FILE ${API_PKG_FILES}) endforeach () # Define source files -define_source_files (CPP_FILES ${GEN_CPP_FILES}) +define_source_files (EXTRA_CPP_FILES ${GEN_CPP_FILES}) # Define dependency libs set (LIBS ../../ThirdParty/Lua${JIT}/src) diff --git a/Source/Samples/01_HelloWorld/CMakeLists.txt b/Source/Samples/01_HelloWorld/CMakeLists.txt index d71510906..ec896a131 100644 --- a/Source/Samples/01_HelloWorld/CMakeLists.txt +++ b/Source/Samples/01_HelloWorld/CMakeLists.txt @@ -24,7 +24,7 @@ set (TARGET_NAME 01_HelloWorld) # Define source files -define_source_files (H_FILES ${COMMON_SAMPLE_H_FILES}) +define_source_files (EXTRA_H_FILES ${COMMON_SAMPLE_H_FILES}) # Setup target with resource copying setup_main_executable () diff --git a/Source/Samples/02_HelloGUI/CMakeLists.txt b/Source/Samples/02_HelloGUI/CMakeLists.txt index 2b6a4cefa..c00c54a53 100644 --- a/Source/Samples/02_HelloGUI/CMakeLists.txt +++ b/Source/Samples/02_HelloGUI/CMakeLists.txt @@ -24,7 +24,7 @@ set (TARGET_NAME 02_HelloGUI) # Define source files -define_source_files (H_FILES ${COMMON_SAMPLE_H_FILES}) +define_source_files (EXTRA_H_FILES ${COMMON_SAMPLE_H_FILES}) # Setup target with resource copying setup_main_executable () diff --git a/Source/Samples/03_Sprites/CMakeLists.txt b/Source/Samples/03_Sprites/CMakeLists.txt index 78714fd3a..2a1ad30ea 100644 --- a/Source/Samples/03_Sprites/CMakeLists.txt +++ b/Source/Samples/03_Sprites/CMakeLists.txt @@ -24,7 +24,7 @@ set (TARGET_NAME 03_Sprites) # Define source files -define_source_files (H_FILES ${COMMON_SAMPLE_H_FILES}) +define_source_files (EXTRA_H_FILES ${COMMON_SAMPLE_H_FILES}) # Setup target with resource copying setup_main_executable () diff --git a/Source/Samples/04_StaticScene/CMakeLists.txt b/Source/Samples/04_StaticScene/CMakeLists.txt index 4d290155a..b69e18a9e 100644 --- a/Source/Samples/04_StaticScene/CMakeLists.txt +++ b/Source/Samples/04_StaticScene/CMakeLists.txt @@ -24,7 +24,7 @@ set (TARGET_NAME 04_StaticScene) # Define source files -define_source_files (H_FILES ${COMMON_SAMPLE_H_FILES}) +define_source_files (EXTRA_H_FILES ${COMMON_SAMPLE_H_FILES}) # Setup target with resource copying setup_main_executable () diff --git a/Source/Samples/05_AnimatingScene/CMakeLists.txt b/Source/Samples/05_AnimatingScene/CMakeLists.txt index 1e7df9f45..4833139d5 100644 --- a/Source/Samples/05_AnimatingScene/CMakeLists.txt +++ b/Source/Samples/05_AnimatingScene/CMakeLists.txt @@ -24,7 +24,7 @@ set (TARGET_NAME 05_AnimatingScene) # Define source files -define_source_files (H_FILES ${COMMON_SAMPLE_H_FILES}) +define_source_files (EXTRA_H_FILES ${COMMON_SAMPLE_H_FILES}) # Setup target with resource copying setup_main_executable () diff --git a/Source/Samples/06_SkeletalAnimation/CMakeLists.txt b/Source/Samples/06_SkeletalAnimation/CMakeLists.txt index 8ed36fc13..483eb571a 100644 --- a/Source/Samples/06_SkeletalAnimation/CMakeLists.txt +++ b/Source/Samples/06_SkeletalAnimation/CMakeLists.txt @@ -24,7 +24,7 @@ set (TARGET_NAME 06_SkeletalAnimation) # Define source files -define_source_files (H_FILES ${COMMON_SAMPLE_H_FILES}) +define_source_files (EXTRA_H_FILES ${COMMON_SAMPLE_H_FILES}) # Setup target with resource copying setup_main_executable () diff --git a/Source/Samples/07_Billboards/CMakeLists.txt b/Source/Samples/07_Billboards/CMakeLists.txt index f3c1f52d7..ede2bc9d0 100644 --- a/Source/Samples/07_Billboards/CMakeLists.txt +++ b/Source/Samples/07_Billboards/CMakeLists.txt @@ -24,7 +24,7 @@ set (TARGET_NAME 07_Billboards) # Define source files -define_source_files (H_FILES ${COMMON_SAMPLE_H_FILES}) +define_source_files (EXTRA_H_FILES ${COMMON_SAMPLE_H_FILES}) # Setup target with resource copying setup_main_executable () diff --git a/Source/Samples/08_Decals/CMakeLists.txt b/Source/Samples/08_Decals/CMakeLists.txt index 0d865a4a5..e8cf4df18 100644 --- a/Source/Samples/08_Decals/CMakeLists.txt +++ b/Source/Samples/08_Decals/CMakeLists.txt @@ -24,7 +24,7 @@ set (TARGET_NAME 08_Decals) # Define source files -define_source_files (H_FILES ${COMMON_SAMPLE_H_FILES}) +define_source_files (EXTRA_H_FILES ${COMMON_SAMPLE_H_FILES}) # Setup target with resource copying setup_main_executable () diff --git a/Source/Samples/09_MultipleViewports/CMakeLists.txt b/Source/Samples/09_MultipleViewports/CMakeLists.txt index 62eeb53fc..dcfb3bc8e 100644 --- a/Source/Samples/09_MultipleViewports/CMakeLists.txt +++ b/Source/Samples/09_MultipleViewports/CMakeLists.txt @@ -24,7 +24,7 @@ set (TARGET_NAME 09_MultipleViewports) # Define source files -define_source_files (H_FILES ${COMMON_SAMPLE_H_FILES}) +define_source_files (EXTRA_H_FILES ${COMMON_SAMPLE_H_FILES}) # Setup target with resource copying setup_main_executable () diff --git a/Source/Samples/10_RenderToTexture/CMakeLists.txt b/Source/Samples/10_RenderToTexture/CMakeLists.txt index bfb0ba960..333cfda5a 100644 --- a/Source/Samples/10_RenderToTexture/CMakeLists.txt +++ b/Source/Samples/10_RenderToTexture/CMakeLists.txt @@ -24,7 +24,7 @@ set (TARGET_NAME 10_RenderToTexture) # Define source files -define_source_files (H_FILES ${COMMON_SAMPLE_H_FILES}) +define_source_files (EXTRA_H_FILES ${COMMON_SAMPLE_H_FILES}) # Setup target with resource copying setup_main_executable () diff --git a/Source/Samples/11_Physics/CMakeLists.txt b/Source/Samples/11_Physics/CMakeLists.txt index fbd69a6dc..88e4286c2 100644 --- a/Source/Samples/11_Physics/CMakeLists.txt +++ b/Source/Samples/11_Physics/CMakeLists.txt @@ -24,7 +24,7 @@ set (TARGET_NAME 11_Physics) # Define source files -define_source_files (H_FILES ${COMMON_SAMPLE_H_FILES}) +define_source_files (EXTRA_H_FILES ${COMMON_SAMPLE_H_FILES}) # Setup target with resource copying setup_main_executable () diff --git a/Source/Samples/12_PhysicsStressTest/CMakeLists.txt b/Source/Samples/12_PhysicsStressTest/CMakeLists.txt index de6ba1103..a592c4e64 100644 --- a/Source/Samples/12_PhysicsStressTest/CMakeLists.txt +++ b/Source/Samples/12_PhysicsStressTest/CMakeLists.txt @@ -24,7 +24,7 @@ set (TARGET_NAME 12_PhysicsStressTest) # Define source files -define_source_files (H_FILES ${COMMON_SAMPLE_H_FILES}) +define_source_files (EXTRA_H_FILES ${COMMON_SAMPLE_H_FILES}) # Setup target with resource copying setup_main_executable () diff --git a/Source/Samples/13_Ragdolls/CMakeLists.txt b/Source/Samples/13_Ragdolls/CMakeLists.txt index cad1899bd..85c5f9a6d 100644 --- a/Source/Samples/13_Ragdolls/CMakeLists.txt +++ b/Source/Samples/13_Ragdolls/CMakeLists.txt @@ -24,7 +24,7 @@ set (TARGET_NAME 13_Ragdolls) # Define source files -define_source_files (H_FILES ${COMMON_SAMPLE_H_FILES}) +define_source_files (EXTRA_H_FILES ${COMMON_SAMPLE_H_FILES}) # Setup target with resource copying setup_main_executable () diff --git a/Source/Samples/14_SoundEffects/CMakeLists.txt b/Source/Samples/14_SoundEffects/CMakeLists.txt index 09257d809..7164eccb5 100644 --- a/Source/Samples/14_SoundEffects/CMakeLists.txt +++ b/Source/Samples/14_SoundEffects/CMakeLists.txt @@ -24,7 +24,7 @@ set (TARGET_NAME 14_SoundEffects) # Define source files -define_source_files (H_FILES ${COMMON_SAMPLE_H_FILES}) +define_source_files (EXTRA_H_FILES ${COMMON_SAMPLE_H_FILES}) # Setup target with resource copying setup_main_executable () diff --git a/Source/Samples/15_Navigation/CMakeLists.txt b/Source/Samples/15_Navigation/CMakeLists.txt index f242e9e1d..942fd9f65 100644 --- a/Source/Samples/15_Navigation/CMakeLists.txt +++ b/Source/Samples/15_Navigation/CMakeLists.txt @@ -24,7 +24,7 @@ set (TARGET_NAME 15_Navigation) # Define source files -define_source_files (H_FILES ${COMMON_SAMPLE_H_FILES}) +define_source_files (EXTRA_H_FILES ${COMMON_SAMPLE_H_FILES}) # Setup target with resource copying setup_main_executable () diff --git a/Source/Samples/16_Chat/CMakeLists.txt b/Source/Samples/16_Chat/CMakeLists.txt index 37ef1119e..555ed31bf 100644 --- a/Source/Samples/16_Chat/CMakeLists.txt +++ b/Source/Samples/16_Chat/CMakeLists.txt @@ -24,7 +24,7 @@ set (TARGET_NAME 16_Chat) # Define source files -define_source_files (H_FILES ${COMMON_SAMPLE_H_FILES}) +define_source_files (EXTRA_H_FILES ${COMMON_SAMPLE_H_FILES}) # Setup target with resource copying setup_main_executable () diff --git a/Source/Samples/17_SceneReplication/CMakeLists.txt b/Source/Samples/17_SceneReplication/CMakeLists.txt index 42b94bfcf..87223ac63 100644 --- a/Source/Samples/17_SceneReplication/CMakeLists.txt +++ b/Source/Samples/17_SceneReplication/CMakeLists.txt @@ -24,7 +24,7 @@ set (TARGET_NAME 17_SceneReplication) # Define source files -define_source_files (H_FILES ${COMMON_SAMPLE_H_FILES}) +define_source_files (EXTRA_H_FILES ${COMMON_SAMPLE_H_FILES}) # Setup target with resource copying setup_main_executable () diff --git a/Source/Samples/18_CharacterDemo/CMakeLists.txt b/Source/Samples/18_CharacterDemo/CMakeLists.txt index ff5f351eb..287f436ae 100644 --- a/Source/Samples/18_CharacterDemo/CMakeLists.txt +++ b/Source/Samples/18_CharacterDemo/CMakeLists.txt @@ -24,7 +24,7 @@ set (TARGET_NAME 18_CharacterDemo) # Define source files -define_source_files (H_FILES ${COMMON_SAMPLE_H_FILES}) +define_source_files (EXTRA_H_FILES ${COMMON_SAMPLE_H_FILES}) # Setup target with resource copying setup_main_executable () diff --git a/Source/Samples/19_VehicleDemo/CMakeLists.txt b/Source/Samples/19_VehicleDemo/CMakeLists.txt index 042a5c9db..de61fc279 100644 --- a/Source/Samples/19_VehicleDemo/CMakeLists.txt +++ b/Source/Samples/19_VehicleDemo/CMakeLists.txt @@ -24,7 +24,7 @@ set (TARGET_NAME 19_VehicleDemo) # Define source files -define_source_files (H_FILES ${COMMON_SAMPLE_H_FILES}) +define_source_files (EXTRA_H_FILES ${COMMON_SAMPLE_H_FILES}) # Setup target with resource copying setup_main_executable () diff --git a/Source/Samples/20_HugeObjectCount/CMakeLists.txt b/Source/Samples/20_HugeObjectCount/CMakeLists.txt index 857838095..694735c49 100644 --- a/Source/Samples/20_HugeObjectCount/CMakeLists.txt +++ b/Source/Samples/20_HugeObjectCount/CMakeLists.txt @@ -24,7 +24,7 @@ set (TARGET_NAME 20_HugeObjectCount) # Define source files -define_source_files (H_FILES ${COMMON_SAMPLE_H_FILES}) +define_source_files (EXTRA_H_FILES ${COMMON_SAMPLE_H_FILES}) # Setup target with resource copying setup_main_executable () diff --git a/Source/Samples/21_AngelScriptIntegration/CMakeLists.txt b/Source/Samples/21_AngelScriptIntegration/CMakeLists.txt index 3c48b9c8f..1c91efcae 100644 --- a/Source/Samples/21_AngelScriptIntegration/CMakeLists.txt +++ b/Source/Samples/21_AngelScriptIntegration/CMakeLists.txt @@ -24,7 +24,7 @@ set (TARGET_NAME 21_AngelScriptIntegration) # Define source files -define_source_files (H_FILES ${COMMON_SAMPLE_H_FILES}) +define_source_files (EXTRA_H_FILES ${COMMON_SAMPLE_H_FILES}) # Setup target with resource copying setup_main_executable () diff --git a/Source/Samples/22_LuaIntegration/CMakeLists.txt b/Source/Samples/22_LuaIntegration/CMakeLists.txt index 60fae0eb4..d326dc96b 100644 --- a/Source/Samples/22_LuaIntegration/CMakeLists.txt +++ b/Source/Samples/22_LuaIntegration/CMakeLists.txt @@ -24,7 +24,7 @@ set (TARGET_NAME 22_LuaIntegration) # Define source files -define_source_files (H_FILES ${COMMON_SAMPLE_H_FILES}) +define_source_files (EXTRA_H_FILES ${COMMON_SAMPLE_H_FILES}) # Setup target with resource copying setup_main_executable ()