summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--generator/CMakeLists.txt3
-rw-r--r--generator/main.cpp14
-rw-r--r--generator/shibokenconfig.h.in7
-rw-r--r--tests/otherbinding/CMakeLists.txt3
-rw-r--r--tests/samplebinding/CMakeLists.txt3
5 files changed, 25 insertions, 5 deletions
diff --git a/generator/CMakeLists.txt b/generator/CMakeLists.txt
index 1a2eb1f0..f3cbe084 100644
--- a/generator/CMakeLists.txt
+++ b/generator/CMakeLists.txt
@@ -10,6 +10,7 @@ shibokennormalize.cpp
)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_BINARY_DIR}
${APIEXTRACTOR_INCLUDE_DIR}
${GENERATORRUNNER_INCLUDE_DIR}
${QT_INCLUDE_DIR}
@@ -23,6 +24,8 @@ target_link_libraries(shiboken_generator
${GENERATORRUNNER_LIBRARY}
${QT_QTCORE_LIBRARY})
+configure_file(shibokenconfig.h.in "${CMAKE_CURRENT_BINARY_DIR}/shibokenconfig.h" @ONLY)
+
add_executable(shiboken main.cpp)
set_target_properties(shiboken PROPERTIES OUTPUT_NAME shiboken${shiboken_SUFFIX})
target_link_libraries(shiboken ${QT_QTCORE_LIBRARY})
diff --git a/generator/main.cpp b/generator/main.cpp
index b2f2d37e..8545bcc9 100644
--- a/generator/main.cpp
+++ b/generator/main.cpp
@@ -21,14 +21,22 @@
*
*/
+#include "shibokenconfig.h"
+#include <iostream>
#include <QtCore>
-int main(int argc, char *argv[])
+int main(int argc, char* argv[])
{
QStringList args;
args.append("--generator-set=shiboken");
- for (int i = 1; i < argc; i++)
+ for (int i = 1; i < argc; i++) {
+ if (QString("--version") == argv[i]) {
+ std::cout << "shiboken v" SHIBOKEN_VERSION << std::endl;
+ std::cout << "Copyright (C) 2009-2011 Nokia Corporation and/or its subsidiary(-ies)" << std::endl;
+ return EXIT_SUCCESS;
+ }
args.append(argv[i]);
- return QProcess::execute("generatorrunner", args);
+ }
+ return QProcess::execute(GENERATOR_BINARY, args);
}
diff --git a/generator/shibokenconfig.h.in b/generator/shibokenconfig.h.in
new file mode 100644
index 00000000..7d844a94
--- /dev/null
+++ b/generator/shibokenconfig.h.in
@@ -0,0 +1,7 @@
+#ifndef SHIBOKENCONFIG_H
+#define SHIBOKENCONFIG_H
+
+#define GENERATOR_BINARY "@GENERATORRUNNER_BINARY@"
+#define SHIBOKEN_VERSION "@shiboken_VERSION@"
+
+#endif
diff --git a/tests/otherbinding/CMakeLists.txt b/tests/otherbinding/CMakeLists.txt
index 66e655c3..9b14fae4 100644
--- a/tests/otherbinding/CMakeLists.txt
+++ b/tests/otherbinding/CMakeLists.txt
@@ -14,7 +14,8 @@ ${CMAKE_CURRENT_BINARY_DIR}/other/other_module_wrapper.cpp
)
add_custom_command(OUTPUT ${other_SRC}
-COMMAND ${GENERATORRUNNER_BINARY} --generator-set=${generators_BINARY_DIR}/shiboken_generator${CMAKE_RELEASE_POSTFIX}${CMAKE_DEBUG_POSTFIX}
+COMMAND ${GENERATORRUNNER_BINARY}
+ --generator-set=${generators_BINARY_DIR}/shiboken_generator${CMAKE_RELEASE_POSTFIX}${CMAKE_DEBUG_POSTFIX}${CMAKE_SHARED_LIBRARY_SUFFIX}
--enable-parent-ctor-heuristic
${CMAKE_CURRENT_SOURCE_DIR}/global.h
--include-paths=${libother_SOURCE_DIR}${PATH_SEP}${libsample_SOURCE_DIR}${PATH_SEP}${libsample_SOURCE_DIR}/..
diff --git a/tests/samplebinding/CMakeLists.txt b/tests/samplebinding/CMakeLists.txt
index 75069626..2c2623d6 100644
--- a/tests/samplebinding/CMakeLists.txt
+++ b/tests/samplebinding/CMakeLists.txt
@@ -88,7 +88,8 @@ ${CMAKE_CURRENT_BINARY_DIR}/sample/valueandvirtual_wrapper.cpp
)
add_custom_command(OUTPUT ${sample_SRC}
-COMMAND ${GENERATORRUNNER_BINARY} --generator-set=${generators_BINARY_DIR}/shiboken_generator${CMAKE_RELEASE_POSTFIX}${CMAKE_DEBUG_POSTFIX}
+COMMAND ${GENERATORRUNNER_BINARY}
+ --generator-set=${generators_BINARY_DIR}/shiboken_generator${CMAKE_RELEASE_POSTFIX}${CMAKE_DEBUG_POSTFIX}${CMAKE_SHARED_LIBRARY_SUFFIX}
--enable-parent-ctor-heuristic
--use-isnull-as-nb_nonzero
${CMAKE_CURRENT_SOURCE_DIR}/global.h