diff options
author | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-02-29 00:33:33 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-13 10:53:30 -0300 |
commit | 323a511f4920a2001ae353b584f47f2aa30534c5 (patch) | |
tree | 96274d56f1b6957461557f4aac49fff8ff180de0 /ApiExtractor | |
parent | 037696b4cfc6fe172f3d3200c6737813b054faa1 (diff) |
ApiExtractor merged into Shiboken as a static library.
Diffstat (limited to 'ApiExtractor')
-rw-r--r-- | ApiExtractor/CMakeLists.txt | 82 | ||||
-rw-r--r-- | ApiExtractor/apiextractor.cpp | 4 | ||||
-rw-r--r-- | ApiExtractor/apiextractorversion.h.in | 4 |
3 files changed, 4 insertions, 86 deletions
diff --git a/ApiExtractor/CMakeLists.txt b/ApiExtractor/CMakeLists.txt index a7280d114..3f9fe0a0e 100644 --- a/ApiExtractor/CMakeLists.txt +++ b/ApiExtractor/CMakeLists.txt @@ -1,17 +1,9 @@ -include(icecc.cmake) project(apiextractor) -cmake_minimum_required(VERSION 2.6) - -find_package(Qt4 4.5.0 REQUIRED) - find_package(LibXml2 2.6.32) find_package(LibXslt 1.1.19) option(DISABLE_DOCSTRINGS "Disable documentation extraction." FALSE) -option(BUILD_TESTS "Build tests." TRUE) -option(INSTALL_TESTS "Install tests" FALSE) -option(ENABLE_VERSION_SUFFIX "Used to use current version in suffix to generated files. This is used to allow multiples versions installed simultaneous." FALSE) if (NOT DISABLE_DOCSTRINGS) if (NOT LIBXSLT_FOUND OR NOT LIBXML2_FOUND) @@ -20,26 +12,6 @@ if (NOT DISABLE_DOCSTRINGS) endif() endif() -if(MSVC) - set(CMAKE_CXX_FLAGS "/Zc:wchar_t- /GR /EHsc /DWIN32 /D_WINDOWS /D_SCL_SECURE_NO_WARNINGS") -elseif(CMAKE_HOST_UNIX) - option(ENABLE_GCC_OPTIMIZATION "Enable specific GCC flags to optimize library size and performance. Only available on Release Mode" 0) - if(NOT CYGWIN) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fvisibility=hidden") - endif() - set(CMAKE_CXX_FLAGS_DEBUG "-g") - if(ENABLE_GCC_OPTIMIZATION) - set(CMAKE_BUILD_TYPE Release) - set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG -Os -Wno-strict-aliasing -Wl,-O1") - if (NOT CMAKE_HOST_APPLE) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--hash-style=gnu") - endif() - endif() - if(NOT CMAKE_HOST_APPLE) - set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--version-script,${CMAKE_CURRENT_SOURCE_DIR}/symbols.filter") - endif() -endif() - if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Release) endif() @@ -48,12 +20,6 @@ if(BUILD_TESTS) set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/tests) endif () -set(apiextractor_MAJOR_VERSION 0) -set(apiextractor_MINOR_VERSION 10) -set(apiextractor_MICRO_VERSION 11) -set(apiextractor_VERSION "${apiextractor_MAJOR_VERSION}.${apiextractor_MINOR_VERSION}.${apiextractor_MICRO_VERSION}") -configure_file(apiextractorversion.h.in ${CMAKE_CURRENT_BINARY_DIR}/apiextractorversion.h @ONLY) -set(apiextractor_SOVERSION ${apiextractor_MAJOR_VERSION}.${apiextractor_MINOR_VERSION}) set(QT_USE_QTCORE 1) set(QT_USE_QTXML 1) include(${QT_USE_FILE}) @@ -62,12 +28,6 @@ add_definitions(-DQT_PLUGIN) add_definitions(-DQT_SHARED) add_definitions(-DRXX_ALLOCATOR_INIT_0) -if(ENABLE_VERSION_SUFFIX) - set(apiextractor_SUFFIX "-${apiextractor_MAJOR_VERSION}.${apiextractor_MINOR_VERSION}") -else() - set(apiextractor_SUFFIX "") -endif() - set(apiextractor_SRC apiextractor.cpp abstractmetabuilder.cpp @@ -129,51 +89,11 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${APIEXTRACTOR_EXTRA_INCLUDES} ) -add_library(apiextractor SHARED ${apiextractor_SRC} ${apiextractor_RCCS_SRC}) +add_library(apiextractor STATIC ${apiextractor_SRC} ${apiextractor_RCCS_SRC}) target_link_libraries(apiextractor ${APIEXTRACTOR_EXTRA_LIBRARIES} ${QT_QTCORE_LIBRARY} ${QT_QTXMLPATTERNS_LIBRARY} ${QT_QTXML_LIBRARY}) -set_target_properties(apiextractor PROPERTIES VERSION ${apiextractor_VERSION} - SOVERSION ${apiextractor_SOVERSION} - OUTPUT_NAME "apiextractor${apiextractor_SUFFIX}" - DEFINE_SYMBOL APIEXTRACTOR_EXPORTS) - -# uninstall target -configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake" "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" IMMEDIATE @ONLY) -add_custom_target(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake") - -set(ARCHIVE_NAME ${CMAKE_PROJECT_NAME}-${apiextractor_VERSION}) -add_custom_target(dist - COMMAND mkdir -p "${CMAKE_BINARY_DIR}/${ARCHIVE_NAME}" && - git log > "${CMAKE_BINARY_DIR}/${ARCHIVE_NAME}/ChangeLog" && - git archive --prefix=${ARCHIVE_NAME}/ HEAD --format=tar --output="${CMAKE_BINARY_DIR}/${ARCHIVE_NAME}.tar" && - tar -C "${CMAKE_BINARY_DIR}" --owner=root --group=root -r "${ARCHIVE_NAME}/ChangeLog" -f "${CMAKE_BINARY_DIR}/${ARCHIVE_NAME}.tar" && - bzip2 -f9 "${CMAKE_BINARY_DIR}/${ARCHIVE_NAME}.tar" && - echo "Source package created at ${CMAKE_BINARY_DIR}/${ARCHIVE_NAME}.tar.bz2.\n" - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) - -set(root_HEADERS -apiextractormacros.h -abstractmetalang.h -apiextractor.h -graph.h -reporthandler.h -typesystem.h -fileout.h -docparser.h -qtdocparser.h -include.h -typedatabase.h -doxygenparser.h -) if (BUILD_TESTS) enable_testing() add_subdirectory(tests) endif() add_subdirectory(data) -add_subdirectory(doc) - -install(FILES ${root_HEADERS} DESTINATION include/apiextractor${apiextractor_SUFFIX}) -install(TARGETS apiextractor EXPORT apiextractor - LIBRARY DESTINATION "${LIB_INSTALL_DIR}" - ARCHIVE DESTINATION "${LIB_INSTALL_DIR}" - RUNTIME DESTINATION bin) diff --git a/ApiExtractor/apiextractor.cpp b/ApiExtractor/apiextractor.cpp index c26e6f690..3bd1d0826 100644 --- a/ApiExtractor/apiextractor.cpp +++ b/ApiExtractor/apiextractor.cpp @@ -32,7 +32,6 @@ #include "fileout.h" #include "parser/rpp/pp.h" #include "abstractmetabuilder.h" -#include "apiextractorversion.h" #include "typedatabase.h" static bool preprocess(const QString& sourceFile, @@ -41,6 +40,9 @@ static bool preprocess(const QString& sourceFile, ApiExtractor::ApiExtractor() : m_builder(0) { + static bool qrcInitialized = false; + if (!qrcInitialized) + Q_INIT_RESOURCE(generator); // Environment TYPESYSTEMPATH QString envTypesystemPaths = getenv("TYPESYSTEMPATH"); if (!envTypesystemPaths.isEmpty()) diff --git a/ApiExtractor/apiextractorversion.h.in b/ApiExtractor/apiextractorversion.h.in deleted file mode 100644 index 45ce51e83..000000000 --- a/ApiExtractor/apiextractorversion.h.in +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef APIEXTRACTORVERSION_H -#define APIEXTRACTORVERSION_H -#define APIEXTRACTOR_VERSION "@apiextractor_VERSION@" -#endif |