[Cmake-commits] [cmake-commits] king committed CMakeLists.txt 1.6 1.7 zot.cxx 1.2 1.3 zot_macro_dir.cxx NONE 1.1 zot_macro_tgt.cxx NONE 1.1
cmake-commits at cmake.org
cmake-commits at cmake.org
Wed May 14 11:55:14 EDT 2008
Update of /cvsroot/CMake/CMake/Tests/BuildDepends/Project
In directory public:/mounts/ram/cvs-serv17377/Tests/BuildDepends/Project
Modified Files:
CMakeLists.txt zot.cxx
Added Files:
zot_macro_dir.cxx zot_macro_tgt.cxx
Log Message:
ENH: Update BuildDepends test to check #include lines with macros.
- Tests IMPLICIT_DEPENDS_INCLUDE_TRANSFORM properties.
- See issue #6648.
- Works without help in VS IDEs due to native dependency handling.
- Xcode needs help to rebuild correctly.
--- NEW FILE: zot_macro_dir.cxx ---
#define ZOT_DIR(x) <zot_##x##_dir.hxx>
#include ZOT_DIR(macro)
const char* zot_macro_dir_f()
{
return zot_macro_dir;
}
Index: CMakeLists.txt
===================================================================
RCS file: /cvsroot/CMake/CMake/Tests/BuildDepends/Project/CMakeLists.txt,v
retrieving revision 1.6
retrieving revision 1.7
diff -C 2 -d -r1.6 -r1.7
*** CMakeLists.txt 21 Dec 2007 17:22:12 -0000 1.6
--- CMakeLists.txt 14 May 2008 15:55:12 -0000 1.7
***************
*** 1,2 ****
--- 1,3 ----
+ cmake_minimum_required(VERSION 2.6)
project(testRebuild)
add_library(foo STATIC ${testRebuild_BINARY_DIR}/foo.cxx)
***************
*** 58,61 ****
${CMAKE_CURRENT_BINARY_DIR}/zot_custom.hxx)
! add_executable(zot zot.cxx ${CMAKE_CURRENT_BINARY_DIR}/zot.hxx)
add_dependencies(zot zot_custom)
--- 59,74 ----
${CMAKE_CURRENT_BINARY_DIR}/zot_custom.hxx)
! add_executable(zot zot.cxx ${CMAKE_CURRENT_BINARY_DIR}/zot.hxx
! zot_macro_dir.cxx zot_macro_tgt.cxx)
add_dependencies(zot zot_custom)
+
+ # Test the #include line macro transformation rule support.
+ set_property(
+ TARGET zot
+ PROPERTY IMPLICIT_DEPENDS_INCLUDE_TRANSFORM "ZOT_TGT(%)=<zot_%_tgt.hxx>"
+ )
+
+ set_property(
+ DIRECTORY
+ PROPERTY IMPLICIT_DEPENDS_INCLUDE_TRANSFORM "ZOT_DIR(%)=<zot_%_dir.hxx>"
+ )
Index: zot.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Tests/BuildDepends/Project/zot.cxx,v
retrieving revision 1.2
retrieving revision 1.3
diff -C 2 -d -r1.2 -r1.3
*** zot.cxx 21 Dec 2007 17:22:12 -0000 1.2
--- zot.cxx 14 May 2008 15:55:12 -0000 1.3
***************
*** 3,9 ****
#include <stdio.h>
int main()
{
! printf("[%s] [%s]\n", zot, zot_custom);
fflush(stdout);
return 0;
--- 3,13 ----
#include <stdio.h>
+ const char* zot_macro_dir_f();
+ const char* zot_macro_tgt_f();
+
int main()
{
! printf("[%s] [%s] [%s] [%s]\n", zot, zot_custom,
! zot_macro_dir_f(), zot_macro_tgt_f());
fflush(stdout);
return 0;
--- NEW FILE: zot_macro_tgt.cxx ---
#define ZOT_TGT(x) <zot_##x##_tgt.hxx>
#include ZOT_TGT(macro)
const char* zot_macro_tgt_f()
{
return zot_macro_tgt;
}
More information about the Cmake-commits
mailing list