[Cmake-commits] CMake branch, next, updated. v2.8.11-2164-g062da10
Stephen Kelly
steveire at gmail.com
Thu May 23 01:45:05 EDT 2013
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via 062da10acf393916ff1c7a59f763914accab2ed9 (commit)
via 1f9e3a48358dee852d428a070855acbcdfc10c7c (commit)
from 078780a7c3ffbac2b9217792faa814b8814ed5fa (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=062da10acf393916ff1c7a59f763914accab2ed9
commit 062da10acf393916ff1c7a59f763914accab2ed9
Merge: 078780a 1f9e3a4
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu May 23 01:45:01 2013 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu May 23 01:45:01 2013 -0400
Merge topic 'geh-cleanup-identifiers' into next
1f9e3a4 GenerateExportHeader: Generate only C indentifiers as defines
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1f9e3a48358dee852d428a070855acbcdfc10c7c
commit 1f9e3a48358dee852d428a070855acbcdfc10c7c
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu May 23 07:44:04 2013 +0200
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Thu May 23 07:44:04 2013 +0200
GenerateExportHeader: Generate only C indentifiers as defines
The variables in this module are used to configure a header file
with defines whose name depends on the name of the target.
As valid names of targets may be invalid for use as defines, convert
the names of the defines used to C identifiers first. This is already
done in C++ code for the DEFINE_SYMBOL property.
This is not as simple as ensuring that the BASE_NAME is a C identifier,
because most of the define names are configurable, and because use of
a BASE_NAME which is not a C identifier, such as 4square can become a
C identifier by specifying a prefix in the generate_export_header
macro.
diff --git a/Modules/GenerateExportHeader.cmake b/Modules/GenerateExportHeader.cmake
index 892ebc6..d9b7083 100644
--- a/Modules/GenerateExportHeader.cmake
+++ b/Modules/GenerateExportHeader.cmake
@@ -267,6 +267,7 @@ macro(_DO_GENERATE_EXPORT_HEADER TARGET_LIBRARY)
if(_GEH_EXPORT_MACRO_NAME)
set(EXPORT_MACRO_NAME ${_GEH_PREFIX_NAME}${_GEH_EXPORT_MACRO_NAME})
endif()
+ string(MAKE_C_IDENTIFIER ${EXPORT_MACRO_NAME} EXPORT_MACRO_NAME)
if(_GEH_EXPORT_FILE_NAME)
if(IS_ABSOLUTE ${_GEH_EXPORT_FILE_NAME})
set(EXPORT_FILE_NAME ${_GEH_EXPORT_FILE_NAME})
@@ -277,12 +278,15 @@ macro(_DO_GENERATE_EXPORT_HEADER TARGET_LIBRARY)
if(_GEH_DEPRECATED_MACRO_NAME)
set(DEPRECATED_MACRO_NAME ${_GEH_PREFIX_NAME}${_GEH_DEPRECATED_MACRO_NAME})
endif()
+ string(MAKE_C_IDENTIFIER ${DEPRECATED_MACRO_NAME} DEPRECATED_MACRO_NAME)
if(_GEH_NO_EXPORT_MACRO_NAME)
set(NO_EXPORT_MACRO_NAME ${_GEH_PREFIX_NAME}${_GEH_NO_EXPORT_MACRO_NAME})
endif()
+ string(MAKE_C_IDENTIFIER ${NO_EXPORT_MACRO_NAME} NO_EXPORT_MACRO_NAME)
if(_GEH_STATIC_DEFINE)
set(STATIC_DEFINE ${_GEH_PREFIX_NAME}${_GEH_STATIC_DEFINE})
endif()
+ string(MAKE_C_IDENTIFIER ${STATIC_DEFINE} STATIC_DEFINE)
if(_GEH_DEFINE_NO_DEPRECATED)
set(DEFINE_NO_DEPRECATED TRUE)
@@ -292,6 +296,7 @@ macro(_DO_GENERATE_EXPORT_HEADER TARGET_LIBRARY)
set(NO_DEPRECATED_MACRO_NAME
${_GEH_PREFIX_NAME}${_GEH_NO_DEPRECATED_MACRO_NAME})
endif()
+ string(MAKE_C_IDENTIFIER ${NO_DEPRECATED_MACRO_NAME} NO_DEPRECATED_MACRO_NAME)
set(INCLUDE_GUARD_NAME "${EXPORT_MACRO_NAME}_H")
@@ -300,6 +305,7 @@ macro(_DO_GENERATE_EXPORT_HEADER TARGET_LIBRARY)
if(NOT EXPORT_IMPORT_CONDITION)
set(EXPORT_IMPORT_CONDITION ${TARGET_LIBRARY}_EXPORTS)
endif()
+ string(MAKE_C_IDENTIFIER ${EXPORT_IMPORT_CONDITION} EXPORT_IMPORT_CONDITION)
configure_file("${_GENERATE_EXPORT_HEADER_MODULE_DIR}/exportheader.cmake.in"
"${EXPORT_FILE_NAME}" @ONLY)
diff --git a/Tests/Module/GenerateExportHeader/CMakeLists.txt b/Tests/Module/GenerateExportHeader/CMakeLists.txt
index 4a5b1cb..1e229e0 100644
--- a/Tests/Module/GenerateExportHeader/CMakeLists.txt
+++ b/Tests/Module/GenerateExportHeader/CMakeLists.txt
@@ -168,6 +168,7 @@ add_subdirectory(lib_shared_and_statictest)
add_subdirectory(override_symbol)
add_subdirectory(nodeprecated)
add_subdirectory(prefix)
+add_subdirectory(c_identifier)
if (CMAKE_COMPILER_IS_GNUCXX OR (${CMAKE_CXX_COMPILER_ID} MATCHES Clang))
# We deliberately call deprecated methods, and test for that elsewhere.
diff --git a/Tests/Module/GenerateExportHeader/c_identifier/CMakeLists.txt b/Tests/Module/GenerateExportHeader/c_identifier/CMakeLists.txt
new file mode 100644
index 0000000..9f8c8ef
--- /dev/null
+++ b/Tests/Module/GenerateExportHeader/c_identifier/CMakeLists.txt
@@ -0,0 +1,13 @@
+project(c_identifier)
+
+set(c_identifier_lib_SRCS
+ c_identifier_class.cpp
+)
+
+add_library(7c-identifier-lib++ SHARED c_identifier_class.cpp)
+
+generate_export_header(7c-identifier-lib++)
+
+add_executable(c_identifier_exe main.cpp)
+
+target_link_libraries(c_identifier_exe 7c-identifier-lib++)
diff --git a/Tests/Module/GenerateExportHeader/c_identifier/c_identifier_class.cpp b/Tests/Module/GenerateExportHeader/c_identifier/c_identifier_class.cpp
new file mode 100644
index 0000000..d252c8e
--- /dev/null
+++ b/Tests/Module/GenerateExportHeader/c_identifier/c_identifier_class.cpp
@@ -0,0 +1,7 @@
+
+#include "c_identifier_class.h"
+
+int CIdentifierClass::someMethod() const
+{
+ return 0;
+}
diff --git a/Tests/Module/GenerateExportHeader/c_identifier/c_identifier_class.h b/Tests/Module/GenerateExportHeader/c_identifier/c_identifier_class.h
new file mode 100644
index 0000000..741efdc
--- /dev/null
+++ b/Tests/Module/GenerateExportHeader/c_identifier/c_identifier_class.h
@@ -0,0 +1,13 @@
+
+#ifndef C_IDENTIFIER_CLASS_H
+#define C_IDENTIFIER_CLASS_H
+
+#include "7c-identifier-lib++_export.h"
+
+class _7C_IDENTIFIER_LIB___EXPORT CIdentifierClass
+{
+public:
+ int someMethod() const;
+};
+
+#endif
diff --git a/Tests/Module/GenerateExportHeader/c_identifier/main.cpp b/Tests/Module/GenerateExportHeader/c_identifier/main.cpp
new file mode 100644
index 0000000..68beebb
--- /dev/null
+++ b/Tests/Module/GenerateExportHeader/c_identifier/main.cpp
@@ -0,0 +1,8 @@
+
+#include "c_identifier_class.h"
+
+int main(int argc, char **argv)
+{
+ CIdentifierClass cic;
+ return cic.someMethod();
+}
-----------------------------------------------------------------------
Summary of changes:
Modules/GenerateExportHeader.cmake | 6 ++++++
Tests/Module/GenerateExportHeader/CMakeLists.txt | 1 +
.../c_identifier/CMakeLists.txt | 13 +++++++++++++
.../c_identifier/c_identifier_class.cpp | 7 +++++++
.../c_identifier/c_identifier_class.h | 13 +++++++++++++
.../GenerateExportHeader/c_identifier/main.cpp | 8 ++++++++
6 files changed, 48 insertions(+), 0 deletions(-)
create mode 100644 Tests/Module/GenerateExportHeader/c_identifier/CMakeLists.txt
create mode 100644 Tests/Module/GenerateExportHeader/c_identifier/c_identifier_class.cpp
create mode 100644 Tests/Module/GenerateExportHeader/c_identifier/c_identifier_class.h
create mode 100644 Tests/Module/GenerateExportHeader/c_identifier/main.cpp
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list