diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000000..b12c3537a8 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,504 @@ +#SET($ENV{BOOST_INCLUDE} +# /home/saebjornsen1/REPOSITORY-BUILD/gcc-4.1.1/boost_1_35/include/boost-1_35/) +#SET($ENV{BOOST_LIBRARYDIR} +# /home/saebjornsen1/REPOSITORY-BUILD/gcc-4.1.1/boost_1_35/lib) +#SET($ENV{BOOST_ROOT} +# /home/saebjornsen1/REPOSITORY-BUILD/gcc-4.1.1/boost_1_35/) + +set( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake" "${CMAKE_SOURCE_DIR}/cmake/modules" ${CMAKE_MODULE_PATH}) + +#include( FindKDE4Internal ) +#find_package(KDE4 REQUIRED) +set( INCLUDE_INSTALL_DIR "/usr/include") +set(BIN_INSTALL_DIR "bin" ) # The install dir for executables +set(LIB_INSTALL_DIR "lib" ) + +set(INSTALL_TARGETS_DEFAULT_ARGS RUNTIME DESTINATION "${BIN_INSTALL_DIR}" + LIBRARY DESTINATION "${LIB_INSTALL_DIR}" + ARCHIVE + DESTINATION + "${LIB_INSTALL_DIR}" + COMPONENT + Devel + ) + + + +cmake_minimum_required(VERSION 2.6) +add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS}) +enable_language(Fortran) + +set( CMAKE_CXX_FLAGS " -fexceptions -DHAVE_CONFIG_H -g " ) +#set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions -DHAVE_CONFIG_H" ) +#set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fexceptions -DHAVE_CONFIG_H" ) +set( CMAKE_C_FLAGS " -fexceptions -DHAVE_CONFIG_H -g " ) + +#set( CMAKE_VERBOSE_MAKEFILE true ) + +set(ROSE_TOP_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}) +set(ROSE_TOP_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}) + +#Generate our configure file + +#taken from LyX +include(ConfigureChecks) +#include(KDE4Defaults) + +include(MacroLibrary) +include(FindMySQL) +include(FindOpenSSL) +#include(FindSQLITE3) +include(FindJava) + +include(FindFlex) +if(NOT FLEX_FOUND) + message(FATAL_ERROR "Could not find flex command") +endif(NOT FLEX_FOUND) + +include(FindBison) +FIND_BISON() +if(NOT BISON_FOUND) + message(FATAL_ERROR "Could not find BISON command") +endif(NOT BISON_FOUND) + +include(ConvenienceLibs) + +#Ensure that Boost is found +find_package( Boost 1.35.0 COMPONENTS date_time filesystem program_options regex system wave ) +if(NOT Boost_FOUND) + message(FATAL_ERROR "Could not find Boost version 1.35.0 or newer command") +endif(NOT Boost_FOUND) + + +find_library(M_LIB m) +find_library(RT_LIB rt) + + +set( link_with_libraries ${Boost_LIBRARIES} ${M_LIB} ${RT_LIB} ${OPENSSL_LIBRARIES} ) + + +configure_file(${ROSE_TOP_SRC_DIR}/rose_config.h.in.cmake ${ROSE_TOP_BINARY_DIR}/rose_config.h) + +#include(ManualStuff.cmake) + +#include(ConfigureChecks.cmake) + + set( LIBHARU_SOURCE_DIR ${ROSE_TOP_SRC_DIR}/src/3rdPartyLibraries/libharu-200910170404 ) + set( LIBHARU_BINARY_DIR ${ROSE_TOP_BINARY_DIR}/src/3rdPartyLibraries/libharu-200910170404 ) + set( ROSE_INCLUDES + ${ROSE_TOP_BINARY_DIR} + ${ROSE_TOP_BINARY_DIR}/src/frontend/SageIII/ + ${ROSE_TOP_BINARY_DIR}/src/frontend/SageIII/astFileIO + ${ROSE_TOP_SRC_DIR} + ${ROSE_TOP_SRC_DIR}/src/frontend/SageIII + ${ROSE_TOP_SRC_DIR}/src/ROSETTA/src/ + ${ROSE_TOP_SRC_DIR}/src + ${ROSE_TOP_SRC_DIR}/src/frontend/CxxFrontend/EDG_SAGE_Connection/ + ${ROSE_TOP_SRC_DIR}/src/frontend/CxxFrontend/EDG_3.3/src + ${ROSE_TOP_SRC_DIR}/src/frontend/SageIII + ${ROSE_TOP_SRC_DIR}/src/frontend/SageIII/astFixup + ${ROSE_TOP_SRC_DIR}/src/frontend/SageIII/astPostProcessing + ${ROSE_TOP_SRC_DIR}/src/frontend/SageIII/astMerge + ${ROSE_TOP_SRC_DIR}/src/frontend/SageIII/astVisualization + ${ROSE_TOP_SRC_DIR}/src/frontend/SageIII/astFileIO + ${ROSE_TOP_SRC_DIR}/src/frontend/SageIII/sageInterface + ${ROSE_TOP_SRC_DIR}/src/frontend/SageIII/virtualCFG + ${ROSE_TOP_SRC_DIR}/src/frontend/SageIII/astTokenStream + ${ROSE_TOP_SRC_DIR}/src/frontend/SageIII/astHiddenTypeAndDeclarationLists + ${ROSE_TOP_SRC_DIR}/src/frontend/SageIII/astFileIO + ${ROSE_TOP_SRC_DIR}/src/frontend/OpenFortranParser_SAGE_Connection + ${ROSE_TOP_SRC_DIR}/src/frontend/PHPFrontend + ${ROSE_TOP_SRC_DIR}/src/frontend/BinaryDisassembly + ${ROSE_TOP_SRC_DIR}/src/frontend/Disassemblers + ${ROSE_TOP_SRC_DIR}/src/frontend/ExecFormats + ${ROSE_TOP_SRC_DIR}/src/backend/unparser + ${ROSE_TOP_SRC_DIR}/src/backend/unparser/formatSupport + ${ROSE_TOP_SRC_DIR}/src/backend/unparser/languageIndependenceSupport + ${ROSE_TOP_SRC_DIR}/src/backend/unparser/CxxCodeGeneration + ${ROSE_TOP_SRC_DIR}/src/backend/unparser/FortranCodeGeneration + ${ROSE_TOP_SRC_DIR}/src/backend/unparser/PHPCodeGeneration + ${ROSE_TOP_SRC_DIR}/src/backend/asmUnparser + ${ROSE_TOP_SRC_DIR}/src/util + ${ROSE_TOP_SRC_DIR}/src/util/support + ${ROSE_TOP_SRC_DIR}/src/util/graphs + ${ROSE_TOP_SRC_DIR}/src/util/stringSupport + ${ROSE_TOP_SRC_DIR}/src/util/commandlineProcessing + ${ROSE_TOP_SRC_DIR}/src/midend/abstractHandle + ${ROSE_TOP_SRC_DIR}/src/midend/astDiagnostics + ${ROSE_TOP_SRC_DIR}/src/midend/astInlining + ${ROSE_TOP_SRC_DIR}/src/midend/astOutlining + ${ROSE_TOP_SRC_DIR}/src/midend/astProcessing + ${ROSE_TOP_SRC_DIR}/src/midend/astQuery + ${ROSE_TOP_SRC_DIR}/src/midend/astRewriteMechanism + ${ROSE_TOP_SRC_DIR}/src/midend/astUtil/annotation + ${ROSE_TOP_SRC_DIR}/src/midend/astUtil/astInterface + ${ROSE_TOP_SRC_DIR}/src/midend/astUtil/astSupport + ${ROSE_TOP_SRC_DIR}/src/midend/astUtil/symbolicVal + ${ROSE_TOP_SRC_DIR}/src/midend/binaryAnalyses + ${ROSE_TOP_SRC_DIR}/src/midend/binaryAnalyses/dataflowanalyses + ${ROSE_TOP_SRC_DIR}/src/midend/binaryAnalyses/graph + ${ROSE_TOP_SRC_DIR}/src/midend/binaryAnalyses/instructionSemantics + ${ROSE_TOP_SRC_DIR}/src/midend/loopProcessing/computation + ${ROSE_TOP_SRC_DIR}/src/midend/loopProcessing/depGraph + ${ROSE_TOP_SRC_DIR}/src/midend/loopProcessing/depInfo + ${ROSE_TOP_SRC_DIR}/src/midend/loopProcessing/driver + ${ROSE_TOP_SRC_DIR}/src/midend/loopProcessing/outsideInterface + ${ROSE_TOP_SRC_DIR}/src/midend/loopProcessing/prepostTransformation + ${ROSE_TOP_SRC_DIR}/src/midend/loopProcessing/slicing + ${ROSE_TOP_SRC_DIR}/src/midend/ompLowering + ${ROSE_TOP_SRC_DIR}/src/midend/programAnalysis + ${ROSE_TOP_SRC_DIR}/src/midend/programAnalysis/CFG + ${ROSE_TOP_SRC_DIR}/src/midend/programAnalysis/CallGraphAnalysis + ${ROSE_TOP_SRC_DIR}/src/midend/programAnalysis/OAWrap + ${ROSE_TOP_SRC_DIR}/src/midend/programAnalysis/dataflowAnalysis + ${ROSE_TOP_SRC_DIR}/src/midend/programAnalysis/defUseAnalysis + ${ROSE_TOP_SRC_DIR}/src/midend/programAnalysis/distributedMemoryAnalysis + ${ROSE_TOP_SRC_DIR}/src/midend/programAnalysis/dominanceAnalysis + ${ROSE_TOP_SRC_DIR}/src/midend/programAnalysis/graphAnalysis + ${ROSE_TOP_SRC_DIR}/src/midend/programAnalysis/pointerAnal + ${ROSE_TOP_SRC_DIR}/src/midend/programAnalysis/staticInterproceduralSlicing + ${ROSE_TOP_SRC_DIR}/src/midend/programAnalysis/valuePropagation + ${ROSE_TOP_SRC_DIR}/src/midend/programTransformation/partialRedundancyElimination + ${ROSE_TOP_SRC_DIR}/src/midend/programTransformation/finiteDifferencing + ${ROSE_TOP_SRC_DIR}/src/midend/programTransformation/functionCallNormalization + ${ROSE_TOP_SRC_DIR}/src/midend/programTransformation/constantFolding + ${ROSE_TOP_SRC_DIR}/src/midend/programTransformation/implicitCodeGeneration + ${ROSE_TOP_SRC_DIR}/src/midend/programTransformation/runtimeTransformation + ${ROSE_TOP_SRC_DIR}/src/roseSupport + ${ROSE_TOP_SRC_DIR}/src/3rdPartyLibraries/MSTL + ${ROSE_TOP_SRC_DIR}/src/3rdPartyLibraries/libharu-2.1.0/include + ${ROSE_TOP_SRC_DIR}/src/3rdPartyLibraries/libharu-2.1.0/include + ${ROSE_TOP_SRC_DIR}/src/3rdPartyLibraries/qrose/Framework + ${ROSE_TOP_SRC_DIR}/src/3rdPartyLibraries/qrose/Widgets + ${ROSE_TOP_SRC_DIR}/projects/dataBase + ${ROSE_TOP_SRC_DIR}/src/util/graphs + ${ROSE_TOP_SRC_DIR}/src/3rdPartyLibraries/libharu-2.1.0/win32/include/ + ${ROSE_TOP_SRC_DIR}/src/midend/astUtil/astInterface ) + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) +#include_directories( ${ROSE_INCLUDES} ) + + + + + +set(QT_INCLUDES ${ROSE_INCLUDES} ${Boost_INCLUDE_DIRS} ) + +add_subdirectory(config) +add_subdirectory(src) +add_subdirectory(tests) +########### install files ############### + +#install(FILES rose_config.h DESTINATION ${INCLUDE_INSTALL_DIR} ) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +#include $(top_srcdir)/projects/compass/src/compassSupport/compass_dirs.inc +# +## Use automake conditional to build Public and Developer distributions +## Public: includes all of ROSE and binary of EDG work and parts that +## are more restricted. +## Developer: This version includes all EDG source code and some parts that +## might be more restricted. +## This next line will be removed for binary distributions, leaving the variable empty +#DEVELOPER_DISTRIBUTION_DIRECTORY = developersScratchSpace proposals +# +## DQ (1/18/2009): Added demo directory to support showoffs :-). +## DQ "config" and "src" must preceed any other directories, and +## "tutorial" and "exampleTranslators" must preceed "docs" since +## they generate data that is subsequently used in the generated +## ROSE documentation (examples, input codes, and generated output). +## SUBDIRS = config src projects tests tutorial exampleTranslators docs developersScratchSpace tools proposals scripts +#SUBDIRS = libltdl config src projects tests tutorial exampleTranslators docs tools scripts demo binaries $(DEVELOPER_DISTRIBUTION_DIRECTORY) +# +# +#ACLOCAL_AMFLAGS = -I ./config -I ./acmacros -I ./libltdl -I /usr/share/aclocal +# +## Force rose.docs to be make by default +## (if rose.docs.in is modified) +#all-local: rose.docs +# +## DQ (3/21/2009): This takes several minutes under Cygwin, so skip these test there. +#if ROSE_BUILD_OS_IS_CYGWIN +# PROJECT_SOURCE_CODE_TESTS = +#else +# +## Liao, 6/27/2009 skip the test if PCH is not used +#if ROSE_PCH +#PROJECT_SOURCE_CODE_TESTS = detect_roseh detect_rosec +#else +#PROJECT_SOURCE_CODE_TESTS = +#endif +# +#endif +# +## all: detect_roseh detect_rosec +#all: $(PROJECT_SOURCE_CODE_TESTS) +# +## tps: script that checks that no header file includes rose.h +## rpm: exclude build directories (they contain "include-staging") since ROSE itself creates some source files. +#detect_roseh: +# touch $(top_builddir)/src/frontend/SageIII/rose.h.pch +# rm $(top_builddir)/src/frontend/SageIII/rose.h.pch +# @echo "***************************************************************************************" +# @echo "***** ROSE uses pre-compiled headers and needs to check integrity. ********************" +# @echo "***** ROSE ensures that no header files includes rose.h and that ********************" +# @echo "***** the first header file in a source file is rose.h (if used) ********************" +# @echo "***************************************************************************************" +# @echo Testing for rose.h in header files... +# @if test `find $(top_srcdir) \( -type d -exec test -d "{}/include-staging" \; -prune \) -o -type f \( -name "*.h" -o -name "*.hh" \) -exec grep -H "#include \"rose.h\"\|#include " {} \; | grep -v "//#include \"rose.h\"\|//#include " | grep -v "// #include \"rose.h\"\|// #include " | wc | awk '{print \$$1}'` -eq 0; then echo "rose.h header check passed."; else echo "header files exist that include rose.h"; find $(top_srcdir) \( -type d -exec test -d "{}/include-staging" \; -prune \) -o -type f \( -name "*.h" -o -name "*.hh" \) -exec grep -H "#include \"rose.h\"\|#include " {} \; | grep -v "//#include \"rose.h\"\|//#include " | grep -v "// #include \"rose.h\"\|// #include " ; exit 1; fi +# +## tps: added script from Andreas with small modifications - find all C files that dont include rose in the top of the file +## rpm: exclude build directories (they contain "include-staging") since ROSE itself creates some source files. +#detect_rosec: +# @echo Testing for rose.h in source files... +# @if test `find $(top_srcdir) \( -type d -exec test -d "{}/include-staging" \; -prune \) -o -type f \( -name "*.C" -o -name "*.cpp" -o -name "*.cc" \) -exec grep -H "#include" {} \; | grep "\"rose.h\"\|" | grep -v "\/\/" | cut -d ':' -f 1 | grep -v "preproc-fortran.cc" | grep -v "preproc-fortran-fixed.cc" | uniq | xargs -n 1 grep -m 1 -HP "^#include" | grep -v "rose.h\|mpi.h" | wc | awk '{print \$$1}'` -eq 0; then echo "rose.h source file check passed."; else echo "There are source files that dont include rose.h as the first header file."; find $(top_srcdir) \( -type d -exec test -d "{}/include-staging" \; -prune \) -o -type f \( -name "*.C" -o -name "*.cpp" -o -name "*.cc" \) -exec grep -H "#include" {} \; | grep "\"rose.h\"\|" | grep -v "\/\/" | cut -d ':' -f 1 | grep -v "preproc-fortran.cc" | grep -v "preproc-fortran-fixed.cc" | uniq | xargs -n 1 grep -m 1 -HP "^#include" | grep -v "rose.h\|mpi.h"; exit 1; fi +# +# +## DQ (3/9/2009): Additional things that we can enforce within ROSE (written by Andreas). +## Additional rules to enforce: +## 1) Finding using declarations in header files: +## find -name "*.h" -exec grep -nPH "^[ \t]*using[ \t]+namespace" {} \; +## 2) Finding link dependences in Makefile.am files: +## find -name Makefile.am -exec grep -nPH "^[ \t]*[a-zA-Z]*[_]?LDADD[ \t]*" {} \; +# +# +## DQ (6/29/2004): I don't think we need this! +## LIBS = @LIBS@ ${SAGE_LIBS} +# +## It seems that it is better to handle the config directory with its own Makefile.am +## This allows us to hide autoconf accessory files (config.guess, etc.) +## Copy the config directory to the distribution: why? +## (because it has the file: config/Makefile.for.ROSE.includes.and.libs) +## EXTRA_DIST = stamp-h.in stamp-h1.in GNU_HEADERS config +## EXTRA_DIST = stamp-h.in stamp-h1.in rose.docs.in GNU_HEADERS COPYWRITE ROSE_ResearchPapers +#EXTRA_DIST = stamp-h.in stamp-h1.in rose.docs.in COPYRIGHT LicenseInformation ROSE_ResearchPapers README.OSX README.Cygwin build ChangeLog2 +# +## At some point we want to put tals into the distribution (likely just PDF files, but not yet). +## ROSE_Talks +# +## clean-local explanation: +## Remove template repositories. No source code is compiled, but configuration +## tests may have created template repositories here. +#clean-local: +# rm -rf Templates.DB ii_files ti_files *.csv +# +## DQ (9/8/2006): Modified to remove backend specific header files +#uninstall-local: +# rm -rf $(DESTDIR)$(includedir)/*_HEADERS +# +#distclean-local: +# -rm -rf $(top_builddir)/include-staging/ +# +#nodist_include_HEADERS = rose_config.h +# +## DQ (4/5/2009): This rule is not called when compiling this directory, it is only +## called when compiling the /src/util directory (perhaps it should be located in +## that directory's Makefile.am. +## DQ (12/3/2007): Added rose_paths.h so that it would be copied to the install tree. +## JJW (8/25/2008): Changed to a .c file +#include $(top_srcdir)/config/build_rose_paths.Makefile +# +#check-local: +# @echo '************************************************************' +# @echo '****** make check rule complete (terminated normally) ******' +# @echo '************************************************************' +# +#install-exec-local: +# @echo '*****************************************************************' +# @echo '***** make install-exec rule complete (terminated normally) *****' +# @echo '*****************************************************************' +# +#install-data-local: +# -rm -rf $(DESTDIR)$(includedir)/*_HEADERS +# -mkdir $(DESTDIR)$(includedir) +# cp -R $(top_builddir)/include-staging/* $(DESTDIR)$(includedir)/ +# @echo '*****************************************************************' +# @echo '***** make install-data rule complete (terminated normally) *****' +# @echo '*****************************************************************' +# +## DQ (4/22/2005): Set this so that make distcheck will use the same +## --with-edg_source_code=true/false option as were used at configure. +## JJW (5/14/2008): Add the Boost flag the same way, using an internal +## variable from AX_BOOST_* to find the argument to --with-boost when +## this copy of ROSE was originally configured. +#DISTCHECK_CONFIGURE_FLAGS = --with-boost=$(ac_boost_path) +# +## DQ (7/25/2008): If ROSE was originallly configured with Fortran (by tuning +## on the java support) then make sure it is tested as part of the distcheck rule. +#if ROSE_USE_OPEN_FORTRAN_PARSER +# DISTCHECK_CONFIGURE_FLAGS += --with-java +#endif +# +## DQ (7/25/2008): If ROSE was originallly configured to use the HPC Toolkit +## then make sure it is tested as part of the distcheck rule. +#if ROSE_BUILD_ROSEHPCT +# DISTCHECK_CONFIGURE_FLAGS += --enable-rosehpct +#endif +# +## DQ (7/25/2008): If ROSE was originallly configured to use the javaport +## work (generation of Java interface functions for ROSE using SWIG) then +## make sure it is tested as part of the distcheck rule. +#if ENABLE_JAVAPORT +# DISTCHECK_CONFIGURE_FLAGS += --with-javaport +#endif +# +## DQ (4/22/2005): To make clear when binaries are in the distribution as +## opposed to EDG source code we rename the final generated distribution. +## JJW (8/3/2008): This is only used for source distributions now -- +## source_with_binary_edg_dist does its own renaming +#rename_distribution: +# new_name="$(distdir)-source-with-EDG-source.tar.gz"; \ +# cp $(distdir).tar.gz $$new_name +# +## We reset distdir as shown on +## http://jcalcote.wordpress.com/2008/02/23/autoconf-macros-exposed-at3/ to add the SVN +## revision number +#distdir = $(PACKAGE)-$(VERSION)$(DOT_SVNREV) +# +## Automake hook-ish rule to be run after dist rule (but hook runs before gzip so we can't use hook) +## We could build our own ROSE specific wrapper for dist and distcheck. +#dist-after: +# @echo "Running dist hook rule ..." +# @$(MAKE) rename_distribution +# +## hook rule to be run after distcheck rule +#distcheck-after: +# @echo "Running distcheck hook rule ..." +# @$(MAKE) rename_distribution +# +## CLEANFILES = rose_binary_compatibility_signature rose_binary_compatibility_signature_src +#CLEANFILES = rose_binary_compatibility_signature +# +#find_rose_lock_files: +## du -a | grep rose_performance_report_lockfile +# find . -name rose_performance_report_lockfile -print +# +## New rule to simplify generation of documentation (we want to avoid using the +## automake generated "docs" rule because the generation of documentation is +## dependent upon separate tools which the user might not have available +## (true for bothe the LaTeX and html documentation). +## DQ (7/23/2004): Since there is a "docs" subdirectory we need to force the build! +#FORCE_DOCS_TO_BE_MADE: +# +## DQ (7/25/2008): Running "make docs" introduces dependences that are inappropriate +## for a distribution. +#docs: FORCE_DOCS_TO_BE_MADE +# @if [ -f $(top_srcdir)/src/midend/midend.docs ]; then \ +# echo " Generate all possible documentation cd docs; make documentation;"; \ +# $(MAKE) -Ctutorial docs && \ +# $(MAKE) -Cprojects/haskellport docs && \ +# $(MAKE) -Ctests/roseTests/astInterfaceTests check && \ +# $(MAKE) -Ctests/roseTests/ompLoweringTests check && \ +# $(MAKE) -Ctests/CompileTests/UPC_tests check && \ +# $(MAKE) -Cprojects/UpcTranslation/tests check && \ +# $(MAKE) -Cprojects/autoParallelization/tests check && \ +# $(MAKE) -Cdocs docs && \ +# $(MAKE) -C$(compass_build_tooldir)/compass docs; \ +# else \ +# echo "Please look at the ROSE web site for documentation (www.roseCompiler.org)"; \ +# fi +# +# +#clean_binary_distribution: distdir +# rm -rf $(distdir)/src/frontend/CxxFrontend/EDG* +# rm -rf $(distdir)/src/frontend/CxxFrontend/Makefile.am # Will be replaced with another version in the binary_edg_tarball rule +# rm -rf $(distdir)/proposals +# rm -rf $(distdir)/developersScratchSpace +## Dan said this is OK 5/27/2009 +## rm -rf $(distdir)/projects/assemblyToSourceAst +# rm -rf $(distdir)/docs/testDoxygen +# +#if BINARY_EDG_TARBALL_ENABLED +# +#rose_binary_compatibility_signature: +# find $(srcdir)/src/ROSETTA $(srcdir)/src/frontend/CxxFrontend \( -name \*.C -o -name \*.c -o -name \*.h -o -name \*.code -o -name \*.macro -o -name astNodeList -o -name \*.yy \) -a -print | env LC_ALL=C sort | xargs cat -ve | \ +# @MD5@ | cut -f 1 -d \ > rose_binary_compatibility_signature +# cat rose_binary_compatibility_signature +# +#.PHONY : rose_binary_compatibility_signature # Always rebuild the file when needed +# +## 1 +## This rule generates the simple binary tarball for the directories: EDG and EDG_SAGE_Connection +#binary_edg_tarball: rose_binary_compatibility_signature +# cd src/ROSETTA/src; $(MAKE) +# cd src/frontend/CxxFrontend; $(MAKE) +## BINARY_EDG_DIRNAME=roseBinaryEDG-$(build_triplet_without_redhat)-`cat rose_binary_compatibility_signature` && +# BINARY_EDG_DIRNAME=roseBinaryEDG-$(build_triplet_without_redhat)-@GENERATED_COMPILER_NAME_AND_VERSION_SUFFIX@-`cat rose_binary_compatibility_signature` && \ +# rm -rf $${BINARY_EDG_DIRNAME} && \ +# mkdir $${BINARY_EDG_DIRNAME} && \ +# sed "s@^dependency_libs.*@dependency_libs=''@" src/frontend/CxxFrontend/libroseEDG.la > $${BINARY_EDG_DIRNAME}/libroseEDG.la && \ +# cp -Rp src/frontend/CxxFrontend/.libs $${BINARY_EDG_DIRNAME}/ && \ +# tardir=$${BINARY_EDG_DIRNAME} && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$${BINARY_EDG_DIRNAME}.tar.gz && \ +# rm -rf $${BINARY_EDG_DIRNAME} +# +## 2 +## This rule will insert the binary compatability signature into the filename for the generated binary. +#copy_binary_edg_tarball_to_source_tree: binary_edg_tarball rose_binary_compatibility_signature +## BINARY_EDG_DIRNAME=roseBinaryEDG-$(build_triplet_without_redhat)-`cat rose_binary_compatibility_signature` +## BINARY_EDG_DIRNAME=roseBinaryEDG-$(build_triplet_without_redhat)-@GENERATED_COMPILER_NAME_AND_VERSION_SUFFIX@-`cat rose_binary_compatibility_signature` && +## $(top_srcdir)/scripts/copy_binary_edg_tarball_to_source_tree $(top_srcdir) "@build_triplet_without_redhat@" +# $(top_srcdir)/scripts/copy_binary_edg_tarball_to_source_tree $(top_srcdir) "@build_triplet_without_redhat@" "@GENERATED_COMPILER_NAME_AND_VERSION_SUFFIX@" +# +## 3 +## Commits the EDG binary into the SVN repository. +## copy_binary_edg_tarball_to_source_tree_svn: binary_edg_tarball rose_binary_compatibility_signature +#copy_binary_edg_tarball_to_source_tree_svn: copy_binary_edg_tarball_to_source_tree +## BINARY_EDG_DIRNAME=roseBinaryEDG-$(build_triplet_without_redhat)-`cat rose_binary_compatibility_signature` && +## $(top_srcdir)/scripts/copy_binary_edg_tarball_to_source_tree_svn `sed -n 5p $(top_srcdir)/.svn/entries` "@build_triplet_without_redhat@" +# $(top_srcdir)/scripts/copy_binary_edg_tarball_to_source_tree_svn `sed -n 5p $(top_srcdir)/.svn/entries` "@build_triplet_without_redhat@" "@GENERATED_COMPILER_NAME_AND_VERSION_SUFFIX@" `sed -n 4p $(top_srcdir)/.svn/entries` +# +## 4 +## Builds source release containing the EDG binary. +## source_with_binary_edg_dist: rose_binary_compatibility_signature +## source_with_binary_edg_dist: copy_binary_edg_tarball_to_source_tree +# +## DQ (9/16/2009): I think it is an error to call the copy_binary_edg_tarball_to_source_tree_svn rule, +## call copy_binary_edg_tarball_to_source_tree (as it used to be). It fails to work on a distribution +## because there in no ".svn/entries" file. +## ../sourcetree/scripts/copy_binary_edg_tarball_to_source_tree_svn `sed -n 5p ../sourcetree/.svn/entries` "i686-apple-darwin" "GNU-4.0" +## sed: ../sourcetree/.svn/entries: No such file or directory +## source_with_binary_edg_dist: copy_binary_edg_tarball_to_source_tree_svn +#source_with_binary_edg_dist: copy_binary_edg_tarball_to_source_tree +# @ROSE_BINARY_COMPATIBILITY_SIGNATURE=`cat rose_binary_compatibility_signature` && \ +# if test `ls -1 $(srcdir)/src/frontend/CxxFrontend/roseBinaryEDG-*-$${ROSE_BINARY_COMPATIBILITY_SIGNATURE}.tar.gz | wc -l` -eq 0; then echo "Error: Could not find any binary versions of EDG with signature $${ROSE_BINARY_COMPATIBILITY_SIGNATURE} in $(srcdir)/src/frontend/CxxFrontend. This distribution cannot be made because it would not be usable on any platform." >&2; exit 1; fi && \ +# if test `ls -1 $(srcdir)/src/frontend/CxxFrontend/roseBinaryEDG-*-*.tar.gz | grep -v $${ROSE_BINARY_COMPATIBILITY_SIGNATURE} | wc -l` -ne 0; then echo "Error: The following obsolete binary versions of EDG were found in $(srcdir)/src/frontend/CxxFrontend." >&2; ls -1 $(srcdir)/src/frontend/CxxFrontend/roseBinaryEDG-*-*.tar.gz | grep -v $${ROSE_BINARY_COMPATIBILITY_SIGNATURE} >&2; exit 1; fi && \ +# $(MAKE) clean_binary_distribution && \ +# cp $(srcdir)/src/frontend/CxxFrontend/roseBinaryEDG-*-$${ROSE_BINARY_COMPATIBILITY_SIGNATURE}.tar.gz $(distdir)/src/frontend/CxxFrontend && \ +# cat $(top_srcdir)/configure.in | \ +# grep -v '^developersScratchSpace/' | \ +# grep -v '^proposals/' | \ +# grep -v '^src/frontend/CxxFrontend/EDG' | \ +# grep -v '^docs/testDoxygen/' | \ +# sed s/RELEASE_BINARY_COMPATIBILITY_SIGNATURE/$${ROSE_BINARY_COMPATIBILITY_SIGNATURE}/g > \ +# $(distdir)/configure.in +# cat $(top_srcdir)/Makefile.am | \ +# grep -v 'DEVELOPER_DISTRIBUTION_DIRECTORY *=' > \ +# $(distdir)/Makefile.am # Remove SUBDIRS references to developersScratchSpace and proposals +# cat $(top_srcdir)/docs/Makefile.am | \ +# grep -v 'DEVELOPER_DISTRIBUTION_DIRECTORY *=' > \ +# $(distdir)/docs/Makefile.am # Remove SUBDIRS reference to testDoxygen +# cp $(top_srcdir)/src/frontend/CxxFrontend/Makefile.am.forBinaryEDG $(distdir)/src/frontend/CxxFrontend/Makefile.am +# echo "" >> $(distdir)/src/frontend/CxxFrontend/Makefile.am +# cd $(distdir)/src/frontend/CxxFrontend; echo "EXTRA_DIST = `echo *.tar.gz`" >> Makefile.am +# cd $(distdir) && ./build +# find $(distdir)/ -name Makefile.in~ | xargs rm -rf +# find $(distdir)/ -depth -name .svn -exec rm -rf {} \; +# find $(distdir)/ -depth -name autom4te.cache -exec rm -rf {} \; +# tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(PACKAGE)-$(VERSION)-source-with-EDG-binary$(DOT_SVNREV).tar.gz +# $(am__remove_distdir) +# +## DQ (9/10/2009): Build a tarball for testing at NMI (ROSE without EDG source) +## Some of the names of these makefile rules should be changed to be more specific. +#$(PACKAGE)-$(VERSION)-source-with-EDG-binary.tar.gz: source_with_binary_edg_dist +## $(MAKE) copy_binary_edg_tarball_to_source_tree +## $(MAKE) copy_binary_edg_tarball_to_source_tree_svn +## $(MAKE) source_with_binary_edg_dist +# +## DQ (9/14/2009): this can fail if the most recent binaries are not available. +#binary_tarball: $(PACKAGE)-$(VERSION)-source-with-EDG-binary.tar.gz +# +#endif diff --git a/acmacros/CMakeLists.txt b/acmacros/CMakeLists.txt new file mode 100644 index 0000000000..1dc52482b2 --- /dev/null +++ b/acmacros/CMakeLists.txt @@ -0,0 +1,85 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +## This is just a makefile for testing acmacros. +## $Id: Makefile.am,v 1.2 2008/01/10 18:14:20 dquinlan Exp $ +# +#ACLOCAL = @ACLOCAL@ -I . +#AUTOMAKE = @AUTOMAKE@ -a +# +#show: show-acsubst show-config +# +# +## Rule to show configure substitutions +#show-acsubst: Makefile +# @echo "========== Configure substitutions =========="; \ +# pattern=`echo $(SUBST_SHOW) | @SED@ 's/[ ]\{1,\}/\|/g'`; \ +# : echo "pattern is '$$pattern'"; \ +# @EGREP@ "^($$pattern)[ ]+=" Makefile | sort +# +# +## Rule to show configure macros +#show-config: config.h +# @echo "========== config.h macros =========="; \ +# pattern=`echo $(CONFIG_SHOW) | @SED@ 's/[ ]\{1,\}/\|/g'`; \ +# : echo "pattern is '$$pattern'"; \ +# @EGREP@ "[[:space:]]*#(define|undef)[ ]+($$pattern)" config.h +# +## Rule to force rerunning aclocal. +#acloc: +# cd $(top_srcdir) && $(ACLOCAL) +# +## Rule to rerun preconf +#pre: +# cd $(top_srcdir) && ./preconf +# +## Rule to reconfigure. +#reconf: +# cd $(top_builddir) && ./config.status --recheck +# +## Remove .psrc links files. +#distclean-local: +# $(btng_remove_auto_psrc_links) +# +#EXTRA_DIST = \ +#aux/.psrc.in t4/parallel-serial-runner.in \ +#arg-with-environment.m4 \ +#check-typename.m4 \ +#choose-mp-interface.m4 \ +#compiler-ar.m4 \ +#compiler-id.m4 \ +#compiling-boolean.m4 \ +#compiling-namespace.m4 \ +#compiling-stl.m4 \ +#configure-log.m4 \ +#find-all-progs.m4 \ +#link-to-source.m4 \ +#specify-ar.m4 \ +#support-blaslapack.m4 \ +#support-dl.m4 \ +#support-fortran.m4 \ +#support-hdf5.m4 \ +#support-hypre.m4 \ +#support-ieee-float.m4 \ +#support-insure.m4 \ +#support-lam.m4 \ +#support-libz.m4 \ +#support-mpich.m4 \ +#support-mpi.m4 \ +#support-nsl.m4 \ +#support-petsc.m4 \ +#support-restrict.m4 \ +#support-rpath.m4 \ +#support-samrai.m4 \ +#support-serpa-run.m4 \ +#support-socket.m4 \ +#variable-header-filenames.m4 +# diff --git a/binaries/CMakeLists.txt b/binaries/CMakeLists.txt new file mode 100644 index 0000000000..88a8b8f16c --- /dev/null +++ b/binaries/CMakeLists.txt @@ -0,0 +1,15 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + +add_subdirectory(samples) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +#SUBDIRS = samples diff --git a/binaries/samples/CMakeLists.txt b/binaries/samples/CMakeLists.txt new file mode 100644 index 0000000000..a6107f1e17 --- /dev/null +++ b/binaries/samples/CMakeLists.txt @@ -0,0 +1,48 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#EXTRA_DIST = \ +# ARPPRODUCTICON.exe \ +# PFE32.EXE \ +# arm-ctrlaltdel \ +# arm-nologin \ +# arm-pivot_root \ +# arm-poweroff \ +# asm_code_samples_gcc.exe \ +# bgl-helloworld-mpicc \ +# bgl-helloworld-mpixlc \ +# buffer2.bin \ +# exefmt.exe \ +# fnord.i386 \ +# fnord.ppc \ +# gcc-4.0.x-test1.o \ +# i386-ctrlaltdel \ +# i386-fsck.cramfs \ +# i386-nologin \ +# i386-pivot_root \ +# i386-poweroff \ +# i686-test1.O0.bin \ +# i686-test1.O3.bin \ +# libm-2.3.6.so \ +# pocketputty.exe \ +# pocketputty2.exe \ +# proxycfg.exe \ +# puttytel.exe \ +# schulz-sample1-p.so \ +# schulz-sample1.so \ +# schulz-sample2-p.so \ +# schulz-sample2.so \ +# x86-64-ctrlaltdel \ +# x86-64-nologin \ +# x86-64-pivot_root \ +# x86-64-poweroff diff --git a/cmake/CheckIfTypeExists.cmake b/cmake/CheckIfTypeExists.cmake new file mode 100644 index 0000000000..6118276d61 --- /dev/null +++ b/cmake/CheckIfTypeExists.cmake @@ -0,0 +1,28 @@ +# - Check if the given struct or class has the specified member variable +# CHECK_STRUCT_MEMBER (STRUCT MEMBER HEADER VARIABLE) +# +# STRUCT - the name of the struct or class you are interested in +# MEMBER - the member which existence you want to check +# HEADER - the header(s) where the prototype should be declared +# VARIABLE - variable to store the result +# +# The following variables may be set before calling this macro to +# modify the way the check is run: +# +# CMAKE_REQUIRED_FLAGS = string of compile command line flags +# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar) +# CMAKE_REQUIRED_INCLUDES = list of include directories + +# Copyright (c) 2006, Alexander Neundorf, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + + +INCLUDE(CheckTypeSize) + +MACRO (CHECK_TYPE_EXISTS _TYPE _HEADER _RESULT) + SET(CMAKE_EXTRA_INCLUDE_FILES ${_HEADER}) + CHECK_TYPE_SIZE(${_TYPE} ${_RESULT}) +ENDMACRO (CHECK_TYPE_EXISTS) + diff --git a/cmake/CheckTypeExists.cmake b/cmake/CheckTypeExists.cmake new file mode 100644 index 0000000000..6118276d61 --- /dev/null +++ b/cmake/CheckTypeExists.cmake @@ -0,0 +1,28 @@ +# - Check if the given struct or class has the specified member variable +# CHECK_STRUCT_MEMBER (STRUCT MEMBER HEADER VARIABLE) +# +# STRUCT - the name of the struct or class you are interested in +# MEMBER - the member which existence you want to check +# HEADER - the header(s) where the prototype should be declared +# VARIABLE - variable to store the result +# +# The following variables may be set before calling this macro to +# modify the way the check is run: +# +# CMAKE_REQUIRED_FLAGS = string of compile command line flags +# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar) +# CMAKE_REQUIRED_INCLUDES = list of include directories + +# Copyright (c) 2006, Alexander Neundorf, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + + +INCLUDE(CheckTypeSize) + +MACRO (CHECK_TYPE_EXISTS _TYPE _HEADER _RESULT) + SET(CMAKE_EXTRA_INCLUDE_FILES ${_HEADER}) + CHECK_TYPE_SIZE(${_TYPE} ${_RESULT}) +ENDMACRO (CHECK_TYPE_EXISTS) + diff --git a/cmake/ConfigureChecks.cmake b/cmake/ConfigureChecks.cmake new file mode 100644 index 0000000000..36d0a62da7 --- /dev/null +++ b/cmake/ConfigureChecks.cmake @@ -0,0 +1,277 @@ +# This file is part of LyX, the document processor. +# Licence details can be found in the file COPYING. +# +# Copyright (c) 2006, Peter Kümmel, +# + +include(CheckIncludeFile) +include(CheckIncludeFileCXX) +include(CheckIncludeFiles) +include(CheckSymbolExists) +include(CheckFunctionExists) +include(CheckLibraryExists) +include(CheckPrototypeExists) +include(CheckTypeExists) +include(CheckTypeSize) +include(CheckCXXSourceCompiles) +include(MacroBoolTo01) +include(TestBigEndian) + +test_big_endian(WORDS_BIGENDIAN) + +check_include_file(argz.h HAVE_ARGZ_H) +check_function_exists(argz_append HAVE_ARGZ_APPEND) +check_function_exists(argz_create_sep HAVE_ARGZ_CREATE_SEP ) +check_function_exists(argz_insert HAVE_ARGZ_INSERT ) +check_function_exists(argz_next HAVE_ARGZ_NEXT) +check_function_exists(argz_stringify HAVE_ARGZ_STRINGIFY ) + +check_include_file(byteswap.h HAVE_BYTESWAP_H) +check_function_exists(closedir HAVE_CLOSEDIR) + +check_include_file(ctype.h HAVE_CTYPE_H) +check_include_file(c_asm.h HAVE_C_ASM_H) +check_include_file(dlfcn.h HAVE_DLFCN_H) +check_function_exists(dladdr HAVE_DLADDR) + +check_include_file(dlfcn.h HAVE_DLADDR ) +check_function_exists(dlerror HAVE_DLERROR) + +check_include_file(dl.h HAVE_DL_H) +check_function_exists(vprintf HAVE_VPRINTF ) + +if(!HAVE_VPRINTF) +check_function_exists(_doprnt HAVE_DOPRNT) +endif() + +check_function_exists(_dyld_func_lookup HAVE_DYLD) + +check_include_file(dirent.h HAVE_DIRENT_H) + +check_include_file(errno.h HAVE_ERRNO_H) + +check_include_file(ffi.h HAVE_FFI_H) +check_function_exists(getcwd HAVE_GETCWD) +check_function_exists(gethrtime HAVE_GETHRTIME) +check_function_exists(getpagesize HAVE_GETPAGESIZE) +check_function_exists(getwd HAVE_GETWD) +check_include_file(sys/time.h have_hrtime_t) +check_function_exists(index HAVE_INDEX) +check_include_file(intrinsics.h HAVE_INTRINSICS_H) +check_include_file(inttypes.h HAVE_INTTYPES_H) +check_function_exists(index HAVE_INDEX) + +check_include_file_cxx(aspell.h HAVE_ASPELL_H) +check_include_file_cxx(aspell/aspell.h HAVE_ASPELL_ASPELL_H) +#check_include_file_cxx(istream HAVE_ISTREAM) +#check_include_file_cxx(ostream HAVE_OSTREAM) +#check_include_file_cxx(ios HAVE_IOS) +#check_include_file_cxx(sstream HAVE_SSTREAM) +#check_include_file_cxx(locale HAVE_LOCALE) + +check_include_files(io.h HAVE_IO_H) +check_include_files(limits.h HAVE_LIMITS_H) +check_include_files(locale.h HAVE_LOCALE_H) +check_include_files(process.h HAVE_PROCESS_H) +check_include_files(stdlib.h HAVE_STDLIB_H) +check_include_files(sys/stat.h HAVE_SYS_STAT_H) +check_include_files(sys/time.h HAVE_SYS_TIME_H) +check_include_files(sys/types.h HAVE_SYS_TYPES_H) +check_include_files(sys/utime.h HAVE_SYS_UTIME_H) +check_include_files(sys/socket.h HAVE_SYS_SOCKET_H) +check_include_files(unistd.h HAVE_UNISTD_H) +check_include_files(inttypes.h HAVE_INTTYPES_H) +check_include_files(utime.h HAVE_UTIME_H) +check_include_files(string.h HAVE_STRING_H) +check_include_files(strings.h HAVE_STRINGS_H) +check_include_files(argz.h HAVE_ARGZ_H) + +check_include_files(machine/endian.h HAVE_MACHINE_ENDIAN_H) +check_function_exists(mach_absolute_time HAVE_MACH_ABSOLUTE_TIME) +check_include_files( mach/mach_time.h HAVE_MACH_MACH_TIME_H) +check_include_files( mach-o/dyld.h HAVE_MACH_O_DYLD_H ) +check_include_files(memory.h HAVE_MEMORY_H) +check_function_exists(mktime HAVE_MKTIME) +check_function_exists(mmap HAVE_MMAP) + +check_function_exists(open HAVE_OPEN) +check_function_exists(chmod HAVE_CHMOD) +check_function_exists(close HAVE_CLOSE) +check_function_exists(dcgettext HAVE_DCGETTEXT) +check_function_exists(popen HAVE_POPEN) +check_function_exists(pclose HAVE_PCLOSE) +check_function_exists(_open HAVE__OPEN) +check_function_exists(_close HAVE__CLOSE) +check_function_exists(_popen HAVE__POPEN) +check_function_exists(_pclose HAVE__PCLOSE) +check_function_exists(getpid HAVE_GETPID) +check_function_exists(gettext HAVE_GETTEXT) +check_function_exists(_getpid HAVE__GETPID) +check_function_exists(mkdir HAVE_MKDIR) +check_function_exists(_mkdir HAVE__MKDIR) +check_function_exists(putenv HAVE_PUTENV) +check_function_exists(mktemp HAVE_MKTEMP) +check_function_exists(mkstemp HAVE_MKSTEMP) +check_function_exists(fcntl HAVE_FCNTL) +check_function_exists(strerror HAVE_STRERROR) +check_function_exists(getcwd HAVE_GETCWD) +check_function_exists(stpcpy HAVE_STPCPY) +check_function_exists(strcasecmp HAVE_STRCASECMP) +check_function_exists(strdup HAVE_STRDUP) +check_function_exists(strtoul HAVE_STRTOUL) +check_function_exists(alloca HAVE_ALLOCA) +check_function_exists(__fsetlocking HAVE___FSETLOCKING) +check_function_exists(mempcpy HAVE_MEMPCPY) +check_function_exists(__argz_count HAVE___ARGZ_COUNT) +check_function_exists(__argz_next HAVE___ARGZ_NEXT) +check_function_exists(__argz_stringify HAVE___ARGZ_STRINGIFY) +check_function_exists(setlocale HAVE_SETLOCALE) +check_function_exists(tsearch HAVE_TSEARCH) +check_function_exists(getegid HAVE_GETEGID) +check_function_exists(getgid HAVE_GETGID) +check_function_exists(getuid HAVE_GETUID) +check_function_exists(wcslen HAVE_WCSLEN) +check_function_exists(mkfifo HAVE_MKFIFO) + +check_symbol_exists(alloca "malloc.h" HAVE_SYMBOL_ALLOCA) +check_symbol_exists(asprintf "stdio.h" HAVE_ASPRINTF) +check_symbol_exists(wprintf "stdio.h" HAVE_WPRINTF) +check_symbol_exists(snprintf "stdio.h" HAVE_SNPRINTF) +check_symbol_exists(printf "stdio.h" HAVE_POSIX_PRINTF) +check_symbol_exists(pid_t "sys/types.h" HAVE_PID_T) +check_symbol_exists(intmax_t "inttypes.h" HAVE_INTTYPES_H_WITH_UINTMAX) +check_symbol_exists(uintmax_t "stdint.h" HAVE_STDINT_H_WITH_UINTMAX) +check_symbol_exists(LC_MESSAGES "locale.h" HAVE_LC_MESSAGES) + +check_type_size(intmax_t HAVE_INTMAX_T) +macro_bool_to_01(HAVE_UINTMAX_T HAVE_STDINT_H_WITH_UINTMAX) + +check_type_size("long double" HAVE_LONG_DOUBLE) +check_type_size("long long" HAVE_LONG_LONG) +check_type_size(wchar_t HAVE_WCHAR_T) +check_type_size(wint_t HAVE_WINT_T) + +check_include_files(ndir.h HAVE_NDIR_H) +check_function_exists(opendir HAVE_OPENDIR) +check_function_exists(readdir HAVE_READDIR) +check_function_exists(read_real_time HAVE_READ_REAL_TIME) +check_function_exists(shl_load HAVE_SHL_LOAD) + + +check_include_files(stdint.h HAVE_STDINT_H) +check_include_files(stdlib.h HAVE_STDLIB_H) +check_function_exists(strcoll HAVE_STRCOLL) +check_function_exists(strcspn HAVE_STRCSPN) +check_function_exists(strcspn HAVE_STRERROR) +check_function_exists(strftime HAVE_STRFTIME) +check_include_files(strings.h HAVE_STRINGS_H) +check_include_files(string.h HAVE_STRING_H) +check_function_exists(strlcat HAVE_STRLCAT) +check_function_exists(strlcpy HAVE_STRLCPY) +check_function_exists(strspn HAVE_STRSPN) +check_function_exists(strstr HAVE_STRSTR) +check_function_exists(strtod HAVE_STRTOD) +check_function_exists(strtol HAVE_STRTOL) +check_function_exists(strtoul HAVE_STRTOUL) +check_include_files(sys/dir.h HAVE_SYS_DIR_H) +check_include_files(sys/dl.h HAVE_SYS_DL_H ) +check_include_files(sys/stat.h HAVE_SYS_STAT_H ) +check_include_files(sys/time.h HAVE_SYS_TIME_H ) +check_include_files(sys/types.h HAVE_SYS_TYPES_H ) +check_function_exists(time_base_to_time HAVE_TIME_BASE_TO_TIME) +check_include_files(unistd.h HAVE_UNISTD_H ) +check_function_exists(clock_gettime HAVE_CLOCK_GETTIME) +check_library_exists(dl dl "/lib;/usr/lib;/usr/local/lib;/usr/pkg/lib" HAVE_LIBDL) +CHECK_TYPE_SIZE(char SIZEOF_CHAR) +check_type_size(double SIZEOF_DOUBLE) +check_type_size(float SIZEOF_FLOAT) +check_type_size("long double" SIZEOF_LONG_DOUBLE) +check_type_size("long long" SIZEOF_LONG_LONG) +check_type_size("void*" SIZEOF_VOID_P) +CHECK_TYPE_SIZE(short SIZEOF_SHORT) +CHECK_TYPE_SIZE(int SIZEOF_INT) +CHECK_TYPE_SIZE(long SIZEOF_LONG) + +message(STATUS "Checking whether system has ANSI C header files") +check_include_files("stdlib.h;stdarg.h;string.h;float.h" StandardHeadersExist) +if(StandardHeadersExist) + check_prototype_exists(memchr string.h memchrExists) + if(memchrExists) + check_prototype_exists(free stdlib.h freeExists) + if(freeExists) +# include(TestForHighBitCharacters) +# if(CMAKE_HIGH_BIT_CHARACTERS) + message(STATUS "ANSI C header files - found") + set(STDC_HEADERS 1 CACHE INTERNAL "System has ANSI C header files") +# endif(CMAKE_HIGH_BIT_CHARACTERS) + endif(freeExists) + endif(memchrExists) +endif(StandardHeadersExist) +if(NOT STDC_HEADERS) + message(STATUS "ANSI C header files - not found") + set(STDC_HEADERS 0 CACHE INTERNAL "System has ANSI C header files") +endif(NOT STDC_HEADERS) + +# Define to 1 if you can safely include both and +if(HAVE_SYS_TIME_H) + check_include_files("sys/time.h;time.h" TIME_WITH_SYS_TIME) +else(HAVE_SYS_TIME_H) + set(TIME_WITH_SYS_TIME 0) +endif(HAVE_SYS_TIME_H) + +# Define to 1 if your declares `struct tm'. */ +check_type_exists("struct tm" sys/time.h TM_IN_SYS_TIME) + +#check_cxx_source_compiles( +# " +# #include +# using std::count; +# int countChar(char * b, char * e, char const c) +# { +# return count(b, e, c); +# } +# int main(){return 0;} +# " +#HAVE_STD_COUNT) + +check_cxx_source_compiles( + " + #include + #include + typedef std::istreambuf_iterator type; + int main(){return 0;} + " +HAVE_DECL_ISTREAMBUF_ITERATOR) + +#check_cxx_source_compiles( +# " +# #include +# using std::tolower; +# int main(){return 0;} +# " +#CXX_GLOBAL_CSTD) + +check_cxx_source_compiles( + " + #include + // this declaration will fail when there already exists a non const char** version which returns size_t + double iconv(iconv_t cd, char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft); + int main() { return 0; } + " +HAVE_ICONV_CONST) + +check_cxx_source_compiles( + " + int i[ ( sizeof(wchar_t)==2 ? 1 : -1 ) ]; + int main(){return 0;} + " +SIZEOF_WCHAR_T_IS_2) + +check_cxx_source_compiles( + " + int i[ ( sizeof(wchar_t)==4 ? 1 : -1 ) ]; + int main(){return 0;} + " +SIZEOF_WCHAR_T_IS_4) + + diff --git a/cmake/ConvenienceLibs.cmake b/cmake/ConvenienceLibs.cmake new file mode 100644 index 0000000000..0352d13ca4 --- /dev/null +++ b/cmake/ConvenienceLibs.cmake @@ -0,0 +1,256 @@ + +#former libtool convenience libraries: + +# src/roseSupport/Makefile.am: roseSupport + +# src/backend/asmUnparser/Makefile.am: roseAsmUnparser + +# src/backend/unparser/Makefile.am: unparse + +# src/backend/unparser/FortranCodeGeneration/Makefile.am: unparseFortran + +# src/backend/unparser/CxxCodeGeneration/Makefile.am: unparseCxx + +# src/backend/unparser/formatSupport/Makefile.am: unparseFormatSupport + +# src/backend/unparser/PHPCodeGeneration/Makefile.am: unparsePHP + +# src/backend/unparser/languageIndependenceSupport/Makefile.am: unparseLanguageIndependenceSupport + +# src/roseExtensions/roseHPCToolkit/src/xml2profir/Makefile.am: xml2profir + +# src/roseExtensions/roseHPCToolkit/src/profir2sage/Makefile.am: profir2sage + +# src/roseExtensions/roseHPCToolkit/src/xml/Makefile.am: xml + +# src/roseExtensions/roseHPCToolkit/src/sage/Makefile.am: sage + +# src/roseExtensions/roseHPCToolkit/src/util/Makefile.am: util + +# src/roseExtensions/roseHPCToolkit/src/profir/Makefile.am: profir + +# src/roseExtensions/roseHPCToolkit/src/gprof/Makefile.am: gprof + +# src/roseExtensions/SQLiteConnection/Makefile.am: RoseSQLiteDatabase + +# src/roseExtensions/databaseConnection/Makefile.am: rosedatabase + +# src/roseExtensions/qtWidgets/NodeInfoWidget/Makefile.am: NodeInfoWidget + +# src/roseExtensions/qtWidgets/QCodeEditWidget/QCodeEdit/document/Makefile.am: document + +# src/roseExtensions/qtWidgets/QCodeEditWidget/QCodeEdit/Makefile.am: QCodeEdit + +# src/roseExtensions/qtWidgets/QCodeEditWidget/QCodeEdit/qnfa/Makefile.am: qnfa + +# src/roseExtensions/qtWidgets/QCodeEditWidget/QCodeEdit/widgets/Makefile.am: widgets + +# src/roseExtensions/qtWidgets/QCodeEditWidget/Makefile.am: QCodeEditWidget + +# src/roseExtensions/qtWidgets/AstGraphWidget/Makefile.am: AstGraphWidget + +# src/roseExtensions/qtWidgets/AsmView/Makefile.am: AsmView + +# src/roseExtensions/qtWidgets/AstBrowserWidget/Makefile.am: AstBrowserWidget + +# src/roseExtensions/qtWidgets/Makefile.am: RoseQtWidgets + +# src/roseExtensions/qtWidgets/KiviatView/Makefile.am: KiviatView + +# src/roseExtensions/qtWidgets/FlopCounter/Makefile.am: FlopCounter + +# src/roseExtensions/qtWidgets/AstProcessing/Makefile.am: AstProcessing + +# src/roseExtensions/qtWidgets/RoseCodeEdit/Makefile.am: RoseCodeEdit + +# src/roseExtensions/qtWidgets/MetricsKiviat/Makefile.am: MetricsKiviat + +# src/roseExtensions/qtWidgets/TreeModel/Makefile.am: TreeModel + +# src/roseExtensions/qtWidgets/MetricsConfig/Makefile.am: MetricsConfig + +# src/roseExtensions/qtWidgets/SrcBinView/Makefile.am: SrcBinView + +# src/roseExtensions/qtWidgets/ProjectManager/Makefile.am: ProjectManager + +# src/roseExtensions/qtWidgets/BeautifiedAst/Makefile.am: BeautifiedAst + +# src/roseExtensions/qtWidgets/AsmInstructionBar/Makefile.am: AsmInstructionBar + +# src/roseExtensions/qtWidgets/PropertyTreeWidget/Makefile.am: PropertyTreeWidget + +# src/roseExtensions/qtWidgets/WidgetCreator/Makefile.am: WidgetCreator + +# src/roseExtensions/qtWidgets/QtGradientEditor/Makefile.am: QtGradientEditor + +# src/roseExtensions/qtWidgets/InstructionCountAnnotator/Makefile.am: InstructionCountAnnotator + +# src/roseExtensions/qtWidgets/util/Makefile.am: util + +# src/roseExtensions/qtWidgets/TaskSystem/Makefile.am: TaskSystem + +# src/roseExtensions/qtWidgets/MetricFilter/Makefile.am: MetricFilter + +# src/roseExtensions/qtWidgets/RoseFileSelector/Makefile.am: RoseFileSelector + +# src/roseExtensions/sqlite3x/Makefile.am: RoseSQLite3xDatabase + +# src/midend/abstractHandle/Makefile.am: abstractHandle + +# src/midend/astUtil/annotation/Makefile.am: annotation + +# src/midend/astUtil/astInterface/Makefile.am: astInterface + +# src/midend/astUtil/astSupport/Makefile.am: astSupport + +# src/midend/astUtil/symbolicVal/Makefile.am: symbolicVal + +# src/midend/binaryAnalyses/Makefile.am: binaryMidend + +# src/midend/loopProcessing/slicing/Makefile.am: slicing + +# src/midend/loopProcessing/depGraph/Makefile.am: depGraph + +# src/midend/loopProcessing/computation/Makefile.am: computation + +# src/midend/loopProcessing/outsideInterface/Makefile.am: arrayOptimization + +# src/midend/loopProcessing/depInfo/Makefile.am: depInfo + +# src/midend/loopProcessing/prepostTransformation/Makefile.am: prepostloop + +# src/midend/loopProcessing/driver/Makefile.am: driver + +# src/midend/astDiagnostics/Makefile.am: astDiagnostics + +# src/midend/programAnalysis/dataflowAnalysis/Makefile.am: dataflowAnalysis + +# src/midend/programAnalysis/valuePropagation/Makefile.am: valuePropagation + +# src/midend/programAnalysis/distributedMemoryAnalysis/Makefile.am: distributedMemoryAnalysis + +# src/midend/programAnalysis/graphAnalysis/Makefile.am: SB_GraphAnalysis + +# src/midend/programAnalysis/pointerAnal/Makefile.am: pointerAnal + +# src/midend/programAnalysis/proceduralSlicing/Makefile.am: alternativeProgramSlicing + +set(alternativeProgramSlicing_STAT_SRCS +) + +# src/midend/programAnalysis/defUseAnalysis/Makefile.am: DefUseAnalysis + +# src/midend/programAnalysis/staticInterproceduralSlicing/Makefile.am: StaticSlicing + +# src/midend/programAnalysis/sideEffectAnalysis/Makefile.am: sideEffect + +# src/midend/programAnalysis/CFG/Makefile.am: CFG + +# src/midend/programAnalysis/CallGraphAnalysis/Makefile.am: CallGraph + +# src/midend/programAnalysis/OAWrap/Makefile.am: OAWrap + +# src/midend/programAnalysis/annotationLanguageParser/Makefile.am: annotationLanguageParser + +# src/midend/programAnalysis/dominatorTreesAndDominanceFrontiers/Makefile.am: dominance + +set(dominance_STAT_SRCS +) + +# src/midend/astRewriteMechanism/Makefile.am: rewrite + +# src/midend/astQuery/Makefile.am: query + +# src/midend/programTransformation/constantFolding/Makefile.am: constantFolding + +# src/midend/programTransformation/partialRedundancyElimination/Makefile.am: pre + +# src/midend/programTransformation/implicitCodeGeneration/Makefile.am: implicitCodeGeneration + +# src/midend/programTransformation/functionCallNormalization/Makefile.am: functionCallNormalization + +# src/midend/programTransformation/finiteDifferencing/Makefile.am: finiteDifferencing + +# src/midend/astProcessing/Makefile.am: astprocessing + +# src/midend/astOutlining/Makefile.am: astOutliner + +# src/midend/astInlining/Makefile.am: astinlining + +# src/midend/ompLowering/Makefile.am: ompLowering + +# src/frontend/BinaryDisassembly/Makefile.am: binaryFrontend + +# src/frontend/SageIII/astMerge/Makefile.am: astMerge + +# src/frontend/SageIII/astHiddenTypeAndDeclarationLists/Makefile.am: astHiddenTypeAndDeclarationLists + +# src/frontend/SageIII/astFixup/Makefile.am: astFixup + +# src/frontend/SageIII/astPostProcessing/Makefile.am: astPostProcessing + +# src/frontend/SageIII/sageInterface/Makefile.am: sageInterface + +# src/frontend/SageIII/Makefile.am: sage3 + +# src/frontend/SageIII/astVisualization/Makefile.am: astVisualization + +# src/frontend/SageIII/astTokenStream/Makefile.am: astTokenStream + +# src/frontend/SageIII/virtualCFG/Makefile.am: virtualCFG + +# src/frontend/PHPFrontend/Makefile.am: rosePHPFrontend + +# src/frontend/Disassemblers/Makefile.am: roseDisassemblers + +# src/frontend/OpenFortranParser_SAGE_Connection/Makefile.am: roseFortran + +# src/frontend/CxxFrontend/Makefile.am: roseEDG + +# src/frontend/CxxFrontend/EDG_3.3/edgFrontEndWithoutSage/Makefile.am: edg33WithoutSage + +set(edg33WithoutSage_STAT_SRCS +) + +# src/frontend/CxxFrontend/EDG_3.3/src/Makefile.am: edg33 + +# src/frontend/CxxFrontend/EDG_3.3/util/Makefile.am: edgutil + +set(edgutil_STAT_SRCS +) + +# src/frontend/CxxFrontend/EDG_SAGE_Connection/Makefile.am: sage + +# src/frontend/CxxFrontend/EDG_SAGE_Connection/Makefile.am: sage + +set(sage_STAT_SRCS +) + +# src/frontend/CxxFrontend/EDG_SAGE_Connection/Makefile.am: newsage + +# src/frontend/ExecFormats/Makefile.am: roseExecFormats + +# src/3rdPartyLibraries/qrose/Framework/Makefile.am: qrframework + +# src/3rdPartyLibraries/qrose/Components/SourceBox/Makefile.am: qrsourcebox + +# src/3rdPartyLibraries/qrose/Components/QueryBox/Makefile.am: qrquerybox + +# src/3rdPartyLibraries/qrose/Components/TreeBox/Makefile.am: qrtreebox + +# src/3rdPartyLibraries/qrose/Components/Common/Makefile.am: qrcommon + +# src/3rdPartyLibraries/qrose/Widgets/Makefile.am: qrwidgets + +# src/3rdPartyLibraries/MSTL/Makefile.am: mstl + +# src/util/stringSupport/Makefile.am: RoseStringSupport + +# src/util/graphs/Makefile.am: graphs + +# src/util/Makefile.am: roseutil + +# src/util/commandlineProcessing/Makefile.am: RoseCommandlineUtil + +# src/util/support/Makefile.am: support + diff --git a/cmake/FindBison.cmake b/cmake/FindBison.cmake new file mode 100755 index 0000000000..0320ae3ce1 --- /dev/null +++ b/cmake/FindBison.cmake @@ -0,0 +1,52 @@ +# - Try to find Bison +# Once done this will define +# +# BISON_FOUND - system has Bison +# BISON_EXECUTABLE - path of the bison executable +# BISON_VERSION - the version string, like "2.5.31" +# + +MACRO(FIND_BISON) + FIND_PROGRAM(BISON_EXECUTABLE NAMES bison) + + IF(BISON_EXECUTABLE) + SET(BISON_FOUND TRUE) + + EXECUTE_PROCESS(COMMAND ${BISON_EXECUTABLE} --version + OUTPUT_VARIABLE _BISON_VERSION + ) + string (REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" BISON_VERSION "${_bison_VERSION}") + ENDIF(BISON_EXECUTABLE) + + IF(BISON_FOUND) + IF(NOT Bison_FIND_QUIETLY) + MESSAGE(STATUS "Found Bison: ${BISON_EXECUTABLE}") + ENDIF(NOT Bison_FIND_QUIETLY) + ELSE(BISON_FOUND) + IF(Bison_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "Could not find Bison") + ENDIF(Bison_FIND_REQUIRED) + ENDIF(BISON_FOUND) +ENDMACRO(FIND_BISON) + +MACRO(BISON_GENERATOR _PREFIX _Y_INPUT _H_OUTPUT _CPP_OUTPUT) + IF(BISON_EXECUTABLE) + GET_FILENAME_COMPONENT(_Y_DIR ${_Y_INPUT} PATH) + ADD_CUSTOM_COMMAND( + OUTPUT ${_CPP_OUTPUT} + OUTPUT ${_H_OUTPUT} + DEPENDS ${_Y_INPUT} + COMMAND ${BISON_EXECUTABLE} + ARGS + -p ${_PREFIX} -o"${_CPP_OUTPUT}" + --defines="${_H_OUTPUT}" ${_Y_INPUT} + WORKING_DIRECTORY ${_Y_DIR} + ) + SET_SOURCE_FILES_PROPERTIES( + ${_CPP_OUTPUT} ${_H_OUTPUT} + GENERATED + ) + ELSE(BISON_EXECUTABLE) + MESSAGE(SEND_ERROR "Can't find bison program, and it's required") + ENDIF(BISON_EXECUTABLE) +ENDMACRO(BISON_GENERATOR) diff --git a/cmake/FindSQLITE3.cmake b/cmake/FindSQLITE3.cmake new file mode 100644 index 0000000000..328984e53b --- /dev/null +++ b/cmake/FindSQLITE3.cmake @@ -0,0 +1,42 @@ +# - Try to find SQLITE3 +# Once done this will define +# +# SQLITE3_FOUND - system has SQLITE3 +# SQLITE3_INCLUDE_DIR - the SQLITE3 include directory +# SQLITE3_LIBRARIES - Link these to use SQLITE3 +# SQLITE3_DEFINITIONS - Compiler switches required for using SQLITE3 +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. +# + + +if ( SQLITE3_INCLUDE_DIR AND SQLITE3_LIBRARIES ) + # in cache already + SET(SQLITE3_FIND_QUIETLY TRUE) +endif ( SQLITE3_INCLUDE_DIR AND SQLITE3_LIBRARIES ) + +# use pkg-config to get the directories and then use these values +# in the FIND_PATH() and FIND_LIBRARY() calls +if( NOT WIN32 ) + INCLUDE(FindPkgConfig) + + pkg_check_modules(SQLITE3 REQUIRED sqlite3 ) + +endif( NOT WIN32 ) + +#FIND_PATH(SQLITE3_INCLUDE_DIR NAMES sqlite3.h +# PATHS +# ${_SQLITE3IncDir} +#) + +#FIND_LIBRARY(SQLITE3_LIBRARIES NAMES sqlite3 +# PATHS +# ${_SQLITE3LinkDir} +#) + +#include(FindPackageHandleStandardArgs) +#FIND_PACKAGE_HANDLE_STANDARD_ARGS(SQLITE3 DEFAULT_MSG SQLITE3_INCLUDE_DIR SQLITE3_LIBRARIES ) + +# show the SQLITE3_INCLUDE_DIR and SQLITE3_LIBRARIES variables only in the advanced view +MARK_AS_ADVANCED(SQLITE3_INCLUDE_DIR SQLITE3_LIBRARIES ) + diff --git a/cmake/copy_files.cmake b/cmake/copy_files.cmake new file mode 100644 index 0000000000..f0635570d3 --- /dev/null +++ b/cmake/copy_files.cmake @@ -0,0 +1,46 @@ +set(GENERATED_HEADERS + ${ROSE_TOP_BINARY_DIR}/src/ROSETTA/src/grammar.h + ${ROSE_TOP_BINARY_DIR}/src/ROSETTA/src/grammarString.h + ${ROSE_TOP_BINARY_DIR}/src/ROSETTA/src/ROSETTA_macros.h + ${ROSE_TOP_BINARY_DIR}/src/ROSETTA/src/terminal.h + ${ROSE_TOP_BINARY_DIR}/src/ROSETTA/src/AST_FILE_IO.h + ${ROSE_TOP_BINARY_DIR}/src/ROSETTA/src/AstSpecificDataManagingClass.h + ${ROSE_TOP_BINARY_DIR}/src/ROSETTA/src/Cxx_GrammarMemoryPoolSupport.h + ${ROSE_TOP_BINARY_DIR}/src/ROSETTA/src/StorageClasses.h + ${ROSE_TOP_BINARY_DIR}/src/ROSETTA/src/AstQueryMemoryPool.h + ${ROSE_TOP_BINARY_DIR}/src/ROSETTA/src/Cxx_Grammar.h + ${ROSE_TOP_BINARY_DIR}/src/ROSETTA/src/Cxx_GrammarTreeTraversalAccessEnums.h + ) + +#temporaries of source files generated by ROSETTA +set(GENERATED_SRC + ${ROSE_TOP_BINARY_DIR}/src/ROSETTA/src/AST_FILE_IO.C + ${ROSE_TOP_BINARY_DIR}/src/ROSETTA/src/Cxx_GrammarNewAndDeleteOperators.C + ${ROSE_TOP_BINARY_DIR}/src/ROSETTA/src/Cxx_GrammarTraverseMemoryPool.C + ${ROSE_TOP_BINARY_DIR}/src/ROSETTA/src/Cxx_Grammar.C + ${ROSE_TOP_BINARY_DIR}/src/ROSETTA/src/Cxx_GrammarNewConstructors.C + ${ROSE_TOP_BINARY_DIR}/src/ROSETTA/src/Cxx_GrammarTreeTraversalSuccessorContainer.C + ${ROSE_TOP_BINARY_DIR}/src/ROSETTA/src/Cxx_GrammarCheckingIfDataMembersAreInMemoryPool.C + ${ROSE_TOP_BINARY_DIR}/src/ROSETTA/src/Cxx_GrammarProcessDataMemberReferenceToPointers.C + ${ROSE_TOP_BINARY_DIR}/src/ROSETTA/src/Cxx_GrammarVariantEnumNames.C + ${ROSE_TOP_BINARY_DIR}/src/ROSETTA/src/Cxx_GrammarCopyMemberFunctions.C + ${ROSE_TOP_BINARY_DIR}/src/ROSETTA/src/Cxx_GrammarReturnClassHierarchySubTree.C + ${ROSE_TOP_BINARY_DIR}/src/ROSETTA/src/SourcesOfIRNodesAstFileIOSupport.C + ${ROSE_TOP_BINARY_DIR}/src/ROSETTA/src/Cxx_GrammarGetChildIndex.C + ${ROSE_TOP_BINARY_DIR}/src/ROSETTA/src/Cxx_GrammarReturnDataMemberPointers.C + ${ROSE_TOP_BINARY_DIR}/src/ROSETTA/src/StorageClasses.C + ${ROSE_TOP_BINARY_DIR}/src/ROSETTA/src/Cxx_GrammarMemoryPoolSupport.C + ${ROSE_TOP_BINARY_DIR}/src/ROSETTA/src/Cxx_GrammarRTI.C + ) +#Copy the generated files to ${BUILD_DIR}/src/frontend/SageIII +foreach (src ${GENERATED_HEADERS} ${GENERATED_SRC}) + get_filename_component (FILE_BASE ${src} NAME_WE) + + add_custom_command( + OUTPUT ${CMAKE_BINARY_DIR}/src/frontend/SageIII/${FILE_BASE} + COMMAND + ${CMAKE_COMMAND} -E copy ${FILE_BASE} ${ROSE_TOP_BINARY_DIR}/src/frontend/SageIII/${FILE_BASE} + DEPENDS ${FILE_BASE} + ) +endforeach(src) + diff --git a/cmake/haru.cmake b/cmake/haru.cmake new file mode 100644 index 0000000000..bf41a82f4f --- /dev/null +++ b/cmake/haru.cmake @@ -0,0 +1,37 @@ +# cmake/modules/haru.cmake +# +# Copyright (C) 2008 Werner Smekal +# +# check if headers exist +# Need these modules to do subsequent checks. +include(CheckIncludeFiles) + +# ======================================================================= +# check header availability +# ======================================================================= +# check if header file exists +check_include_files(dlfcn.h HAVE_DLFCN_H) +check_include_files(inttypes.h HAVE_INTTYPES_H) +check_include_files(memory.h HAVE_MEMORY_H) +check_include_files(stdint.h HAVE_STDINT_H) +check_include_files(stdlib.h HAVE_STDLIB_H) +check_include_files(strings.h HAVE_STRINGS_H) +check_include_files(string.h HAVE_STRING_H) +check_include_files(sys/stat.h HAVE_SYS_STAT_H) +check_include_files(sys/types.h HAVE_SYS_TYPES_H) +check_include_files(unistd.h HAVE_UNISTD_H) + + +# ======================================================================= +# additional library support +# ======================================================================= +# On windows systems the math library is not separated so do not specify +# it unless you are on a non-windows system. +if(NOT WIN32) + find_library(MATH_LIB NAMES m PATHS /usr/local/lib /usr/lib) + if(NOT MATH_LIB) + message(FATAL_ERROR "Cannot find required math library") + endif(NOT MATH_LIB) +else(NOT WIN32) + set(MATH_LIB) +endif(NOT WIN32) diff --git a/cmake/hpdf_config.h.cmake b/cmake/hpdf_config.h.cmake new file mode 100644 index 0000000000..75f458ec1d --- /dev/null +++ b/cmake/hpdf_config.h.cmake @@ -0,0 +1,70 @@ +/* include/hpdf_config.h.in. Generated from configure.in by autoheader. */ + +/* Define to 1 if you have the header file. */ +#cmakedefine LIBHPDF_HAVE_DLFCN_H + +/* Define to 1 if you have the header file. */ +#cmakedefine LIBHPDF_HAVE_INTTYPES_H + +/* Define to 1 if you have the `png' library (-lpng). */ +#cmakedefine LIBHPDF_HAVE_LIBPNG + +/* Define to 1 if you have the `z' library (-lz). */ +#cmakedefine LIBHPDF_HAVE_LIBZ + +/* Define to 1 if you have the header file. */ +#cmakedefine LIBHPDF_HAVE_MEMORY_H + +/* Define to 1 if you have the header file. */ +#cmakedefine LIBHPDF_HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#cmakedefine LIBHPDF_HAVE_STDLIB_H + +/* Define to 1 if you have the header file. */ +#cmakedefine LIBHPDF_HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#cmakedefine LIBHPDF_HAVE_STRING_H + +/* Define to 1 if you have the header file. */ +#cmakedefine LIBHPDF_HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#cmakedefine LIBHPDF_HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#cmakedefine LIBHPDF_HAVE_UNISTD_H + +/* debug build */ +#cmakedefine LIBHPDF_DEBUG + +/* debug trace enabled */ +#cmakedefine LIBHPDF_DEBUG_TRACE + +/* libpng is not available */ +#cmakedefine LIBHPDF_HAVE_NOPNGLIB + +/* zlib is not available */ +#cmakedefine LIBHPDF_HAVE_NOZLIB + +/* Define to the address where bug reports for this package should be sent. */ +#cmakedefine LIBHPDF_PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#cmakedefine LIBHPDF_PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#cmakedefine LIBHPDF_PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#cmakedefine LIBHPDF_PACKAGE_TARNAME + +/* Define to the version of this package. */ +#cmakedefine LIBHPDF_PACKAGE_VERSION + +/* Define to 1 if you have the ANSI C header files. */ +#cmakedefine LIBHPDF_STDC_HEADERS + +/* Define to `unsigned int' if does not define. */ +#cmakedefine LIBHPDF_size_t diff --git a/cmake/libharu.DevPackage.cmake b/cmake/libharu.DevPackage.cmake new file mode 100644 index 0000000000..6eb12e0cde --- /dev/null +++ b/cmake/libharu.DevPackage.cmake @@ -0,0 +1,19 @@ +[Setup] +Version=2 +AppName=libHaru +AppVerName=libHaru Version ${LIBHARU_VERSION} +AppVersion=${LIBHARU_VERSION} +MenuName=libHaru ${LIBHARU_VERSION} +Description=${LIBHARU_DESCRIPTION} +Url=http://www.libharu.org +Readme=README +Dependencies=zlib libpng +Reboot=0 + +[Files] +lib=\lib\ +include=\include\ +bin=\bin\ + +[Icons] +libharu Website=http://www.libharu.org diff --git a/cmake/modules/BasicFindPackageVersion.cmake.in b/cmake/modules/BasicFindPackageVersion.cmake.in new file mode 100644 index 0000000000..ae5d3125f1 --- /dev/null +++ b/cmake/modules/BasicFindPackageVersion.cmake.in @@ -0,0 +1,30 @@ +# This is a very basic file for the new style find_package() search mode, +# i.e. Config-mode. It is used by MACRO_WRITE_BASIC_CMAKE_VERSION_FILE() from +# MacroWriteBasicCMakeVersionFile.cmake. +# In this mode find_package() searches for a Config.cmake +# file and an associated Version.cmake file, which it loads to check +# the version number. +# This file can be used with configure_file() to generate such a file for a project +# with very basic logic. +# It sets PACKAGE_VERSION_EXACT if the current version string and the requested +# version string are exactly the same and it sets PACKAGE_VERSION_COMPATIBLE +# if the current version is >= requested version. +# If this is not good enough for your project, you need to write your own +# improved Version.cmake file. +# This file requires the following three variables to be set: +# PROJECT_VERSION_MAJOR +# PROJECT_VERSION_MINOR +# PROJECT_VERSION_PATCH + + +set(PACKAGE_VERSION @PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_PATCH@) + +if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}" ) + set(PACKAGE_VERSION_COMPATIBLE FALSE) +else("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}" ) + set(PACKAGE_VERSION_COMPATIBLE TRUE) + if( "${PACKAGE_FIND_VERSION}" STREQUAL "${PACKAGE_VERSION}") + set(PACKAGE_VERSION_EXACT TRUE) + endif( "${PACKAGE_FIND_VERSION}" STREQUAL "${PACKAGE_VERSION}") +endif("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}" ) + diff --git a/cmake/modules/CheckPointerMember.cmake b/cmake/modules/CheckPointerMember.cmake new file mode 100644 index 0000000000..b6ea5441b8 --- /dev/null +++ b/cmake/modules/CheckPointerMember.cmake @@ -0,0 +1,42 @@ +# - Check if the given struct or class has the specified member variable +# CHECK_POINTER_MEMBER (POINTER MEMBER HEADER VARIABLE) +# +# POINTER - the name of the struct or class you are interested in +# MEMBER - the member which existence you want to check +# HEADER - the header(s) where the prototype should be declared +# VARIABLE - variable to store the result +# +# The following variables may be set before calling this macro to +# modify the way the check is run: +# +# CMAKE_REQUIRED_FLAGS = string of compile command line flags +# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar) +# CMAKE_REQUIRED_INCLUDES = list of include directories + +# Copyright (c) 2006, Alexander Neundorf, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + + +INCLUDE(CheckCXXSourceCompiles) + +MACRO (CHECK_POINTER_MEMBER _STRUCT _MEMBER _HEADER _RESULT) + SET(_INCLUDE_FILES) + FOREACH (it ${_HEADER}) + SET(_INCLUDE_FILES "${_INCLUDE_FILES}#include <${it}>\n") + ENDFOREACH (it) + + SET(_CHECK_POINTER_MEMBER_SOURCE_CODE " +${_INCLUDE_FILES} +int main() +{ + ${_STRUCT} tmp; + tmp->${_MEMBER}; + return 0; +} +") + CHECK_CXX_SOURCE_COMPILES("${_CHECK_POINTER_MEMBER_SOURCE_CODE}" ${_RESULT}) + +ENDMACRO (CHECK_POINTER_MEMBER) + diff --git a/cmake/modules/CheckPrototypeExists.cmake b/cmake/modules/CheckPrototypeExists.cmake new file mode 100644 index 0000000000..811d648958 --- /dev/null +++ b/cmake/modules/CheckPrototypeExists.cmake @@ -0,0 +1,41 @@ +# - Check if the prototype for a function exists. +# CHECK_PROTOTYPE_EXISTS (FUNCTION HEADER VARIABLE) +# +# FUNCTION - the name of the function you are looking for +# HEADER - the header(s) where the prototype should be declared +# VARIABLE - variable to store the result +# +# The following variables may be set before calling this macro to +# modify the way the check is run: +# +# CMAKE_REQUIRED_FLAGS = string of compile command line flags +# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar) +# CMAKE_REQUIRED_INCLUDES = list of include directories + +# Copyright (c) 2006, Alexander Neundorf, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + + +INCLUDE(CheckCXXSourceCompiles) + +MACRO (CHECK_PROTOTYPE_EXISTS _SYMBOL _HEADER _RESULT) + SET(_INCLUDE_FILES) + FOREACH (it ${_HEADER}) + SET(_INCLUDE_FILES "${_INCLUDE_FILES}#include <${it}>\n") + ENDFOREACH (it) + + SET(_CHECK_PROTO_EXISTS_SOURCE_CODE " +${_INCLUDE_FILES} +int main() +{ +#ifndef ${_SYMBOL} + int i = sizeof(&${_SYMBOL}); +#endif + return 0; +} +") + CHECK_CXX_SOURCE_COMPILES("${_CHECK_PROTO_EXISTS_SOURCE_CODE}" ${_RESULT}) +ENDMACRO (CHECK_PROTOTYPE_EXISTS _SYMBOL _HEADER _RESULT) + diff --git a/cmake/modules/CheckStructMember.cmake b/cmake/modules/CheckStructMember.cmake new file mode 100644 index 0000000000..eeb1b65cf5 --- /dev/null +++ b/cmake/modules/CheckStructMember.cmake @@ -0,0 +1,42 @@ +# - Check if the given struct or class has the specified member variable +# CHECK_STRUCT_MEMBER (STRUCT MEMBER HEADER VARIABLE) +# +# STRUCT - the name of the struct or class you are interested in +# MEMBER - the member which existence you want to check +# HEADER - the header(s) where the prototype should be declared +# VARIABLE - variable to store the result +# +# The following variables may be set before calling this macro to +# modify the way the check is run: +# +# CMAKE_REQUIRED_FLAGS = string of compile command line flags +# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar) +# CMAKE_REQUIRED_INCLUDES = list of include directories + +# Copyright (c) 2006, Alexander Neundorf, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + + +INCLUDE(CheckCXXSourceCompiles) + +MACRO (CHECK_STRUCT_MEMBER _STRUCT _MEMBER _HEADER _RESULT) + SET(_INCLUDE_FILES) + FOREACH (it ${_HEADER}) + SET(_INCLUDE_FILES "${_INCLUDE_FILES}#include <${it}>\n") + ENDFOREACH (it) + + SET(_CHECK_STRUCT_MEMBER_SOURCE_CODE " +${_INCLUDE_FILES} +int main() +{ + ${_STRUCT}* tmp; + tmp->${_MEMBER}; + return 0; +} +") + CHECK_CXX_SOURCE_COMPILES("${_CHECK_STRUCT_MEMBER_SOURCE_CODE}" ${_RESULT}) + +ENDMACRO (CHECK_STRUCT_MEMBER) + diff --git a/cmake/modules/FindACL.cmake b/cmake/modules/FindACL.cmake new file mode 100644 index 0000000000..7d3fa14fef --- /dev/null +++ b/cmake/modules/FindACL.cmake @@ -0,0 +1,36 @@ +# - Try to find the ACL library +# Once done this will define +# +# ACL_FOUND - system has the ACL library +# ACL_LIBS - The libraries needed to use ACL + +# Copyright (c) 2006, Pino Toscano, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +include(CheckIncludeFiles) + +check_include_files(attr/libattr.h HAVE_ATTR_LIBATTR_H) +check_include_files(sys/xattr.h HAVE_SYS_XATTR_H) +check_include_files(sys/acl.h HAVE_SYS_ACL_H) +check_include_files(acl/libacl.h HAVE_ACL_LIBACL_H) + +if (HAVE_ATTR_LIBATTR_H AND HAVE_SYS_XATTR_H AND HAVE_SYS_ACL_H AND HAVE_ACL_LIBACL_H) + set(ACL_HEADERS_FOUND TRUE) +endif (HAVE_ATTR_LIBATTR_H AND HAVE_SYS_XATTR_H AND HAVE_SYS_ACL_H AND HAVE_ACL_LIBACL_H) + +if (ACL_HEADERS_FOUND) + find_library(ACL_LIBS NAMES acl ) + + find_library(ATTR_LIBS NAMES attr ) +endif (ACL_HEADERS_FOUND) + +if (ACL_HEADERS_FOUND AND ACL_LIBS AND ATTR_LIBS) + set(ACL_FOUND TRUE) + set(ACL_LIBS ${ACL_LIBS} ${ATTR_LIBS}) + message(STATUS "Found ACL support: ${ACL_LIBS}") +endif (ACL_HEADERS_FOUND AND ACL_LIBS AND ATTR_LIBS) + +mark_as_advanced(ACL_LIBS ATTR_LIBS) + diff --git a/cmake/modules/FindAGG.cmake b/cmake/modules/FindAGG.cmake new file mode 100644 index 0000000000..94d68da41e --- /dev/null +++ b/cmake/modules/FindAGG.cmake @@ -0,0 +1,53 @@ +# - Try to find the AGG graphics library +# Once done this will define +# +# AGG_FOUND - system has AGG +# AGG_INCLUDE_DIR - the AGG include directory +# AGG_LIBRARIES - Link these to use AGG +# AGG_DEFINITIONS - Compiler switches required for using AGG + +# Copyright (c) 2006, Alexander Neundorf, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +if (AGG_INCLUDE_DIR AND AGG_LIBRARIES) + + # in cache already + set(AGG_FOUND TRUE) + +else (AGG_INCLUDE_DIR AND AGG_LIBRARIES) + if (NOT WIN32) + # use pkg-config to get the directories and then use these values + # in the FIND_PATH() and FIND_LIBRARY() calls + find_package(PkgConfig) + pkg_check_modules(PC_AGG libagg) + + set(AGG_DEFINITIONS ${PC_AGG_CFLAGS_OTHER}) + endif (NOT WIN32) + + find_path(AGG_INCLUDE_DIR agg2/agg_pixfmt_gray.h + PATHS ${PC_AGG_INCLUDEDIR} ${PC_AGG_INCLUDE_DIRS} + ) + + find_library(AGG_LIBRARIES NAMES agg + PATHS ${PC_AGG_LIBDIR} ${PC_AGG_LIBRARY_DIRS} + ) + + if (AGG_INCLUDE_DIR AND AGG_LIBRARIES) + set(AGG_FOUND TRUE) + endif (AGG_INCLUDE_DIR AND AGG_LIBRARIES) + + if (AGG_FOUND) + if (NOT AGG_FIND_QUIETLY) + message(STATUS "Found AGG: ${AGG_LIBRARIES}") + endif (NOT AGG_FIND_QUIETLY) + else (AGG_FOUND) + if (AGG_FIND_REQUIRED) + message(FATAL_ERROR "Could NOT find AGG") + endif (AGG_FIND_REQUIRED) + endif (AGG_FOUND) + + mark_as_advanced(AGG_INCLUDE_DIR AGG_LIBRARIES) + +endif (AGG_INCLUDE_DIR AND AGG_LIBRARIES) diff --git a/cmake/modules/FindAkode.cmake b/cmake/modules/FindAkode.cmake new file mode 100644 index 0000000000..9df503cc54 --- /dev/null +++ b/cmake/modules/FindAkode.cmake @@ -0,0 +1,52 @@ +# - Try to find the aKode library +# Once done this will define +# +# AKODE_FOUND - system has the aKode library +# AKODE_INCLUDE_DIR - the aKode include directory +# AKODE_LIBRARIES - The libraries needed to use aKode + +# Copyright (c) 2006, Pino Toscano, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + + +IF (AKODE_LIBRARIES AND AKODE_INCLUDE_DIR) + + # in cache already + SET(AKODE_FOUND TRUE) + +ELSE (AKODE_LIBRARIES AND AKODE_INCLUDE_DIR) + + FIND_PROGRAM(AKODECONFIG_EXECUTABLE NAMES akode-config) + + # if akode-config has been found + IF (AKODECONFIG_EXECUTABLE) + + EXEC_PROGRAM(${AKODECONFIG_EXECUTABLE} ARGS --libs RETURN_VALUE _return_VALUE OUTPUT_VARIABLE AKODE_LIBRARIES) + + EXEC_PROGRAM(${AKODECONFIG_EXECUTABLE} ARGS --cflags RETURN_VALUE _return_VALUE OUTPUT_VARIABLE AKODE_INCLUDE_DIR) + + IF (AKODE_LIBRARIES AND AKODE_INCLUDE_DIR) + SET(AKODE_FOUND TRUE) + STRING(REGEX REPLACE "-I(.+)" "\\1" AKODE_INCLUDE_DIR "${AKODE_INCLUDE_DIR}") + message(STATUS "Found aKode: ${AKODE_LIBRARIES}") + ENDIF (AKODE_LIBRARIES AND AKODE_INCLUDE_DIR) + + # ensure that they are cached + set(AKODE_INCLUDE_DIR ${AKODE_INCLUDE_DIR}) + set(AKODE_LIBRARIES ${AKODE_LIBRARIES}) + + ENDIF (AKODECONFIG_EXECUTABLE) + IF(AKODE_FOUND) + IF(NOT Akode_FIND_QUIETLY) + MESSAGE(STATUS "Akode found: ${AKODE_LIBRARIES}") + ENDIF(NOT Akode_FIND_QUIETLY) + ELSE(AKODE_FOUND) + IF(Akode_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "Could not find Akode") + ENDIF(Akode_FIND_REQUIRED) + ENDIF(AKODE_FOUND) + +ENDIF (AKODE_LIBRARIES AND AKODE_INCLUDE_DIR) + diff --git a/cmake/modules/FindAlsa.cmake b/cmake/modules/FindAlsa.cmake new file mode 100644 index 0000000000..23003b39cd --- /dev/null +++ b/cmake/modules/FindAlsa.cmake @@ -0,0 +1,69 @@ +# Alsa check, based on libkmid/configure.in.in. +# Only the support for Alsa >= 0.9.x was included; 0.5.x was dropped (but feel free to re-add it if you need it) +# It defines ... +# It offers the following macros: +# ALSA_CONFIGURE_FILE(config_header) - generate a config.h, typical usage: +# ALSA_CONFIGURE_FILE(${CMAKE_BINARY_DIR}/config-alsa.h) +# ALSA_VERSION_STRING(version_string) looks for alsa/version.h and reads the version string into +# the first argument passed to the macro + +# Copyright (c) 2006, David Faure, +# Copyright (c) 2007, Matthias Kretz +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +include(CheckIncludeFiles) +include(CheckIncludeFileCXX) +include(CheckLibraryExists) + +# Already done by toplevel +find_library(ASOUND_LIBRARY asound) +set(ASOUND_LIBRARY_DIR "") +if(ASOUND_LIBRARY) + get_filename_component(ASOUND_LIBRARY_DIR ${ASOUND_LIBRARY} PATH) +endif(ASOUND_LIBRARY) + +check_library_exists(asound snd_seq_create_simple_port "${ASOUND_LIBRARY_DIR}" HAVE_LIBASOUND2) +if(HAVE_LIBASOUND2) + message(STATUS "Found ALSA: ${ASOUND_LIBRARY}") +else(HAVE_LIBASOUND2) + message(STATUS "ALSA not found") +endif(HAVE_LIBASOUND2) +set(ALSA_FOUND ${HAVE_LIBASOUND2}) + +find_path(ALSA_INCLUDES alsa/version.h) + +macro(ALSA_VERSION_STRING _result) + # check for version in alsa/version.h + if(ALSA_INCLUDES) + file(READ "${ALSA_INCLUDES}/alsa/version.h" _ALSA_VERSION_CONTENT) + string(REGEX REPLACE ".*SND_LIB_VERSION_STR.*\"(.*)\".*" "\\1" ${_result} ${_ALSA_VERSION_CONTENT}) + else(ALSA_INCLUDES) + message(STATUS "ALSA version not known. ALSA output will probably not work correctly.") + endif(ALSA_INCLUDES) +endmacro(ALSA_VERSION_STRING _result) + + +get_filename_component(_FIND_ALSA_MODULE_DIR ${CMAKE_CURRENT_LIST_FILE} PATH) +macro(ALSA_CONFIGURE_FILE _destFile) + check_include_files(sys/soundcard.h HAVE_SYS_SOUNDCARD_H) + check_include_files(machine/soundcard.h HAVE_MACHINE_SOUNDCARD_H) + + check_include_files(linux/awe_voice.h HAVE_LINUX_AWE_VOICE_H) + check_include_files(awe_voice.h HAVE_AWE_VOICE_H) + check_include_files(/usr/src/sys/i386/isa/sound/awe_voice.h HAVE__USR_SRC_SYS_I386_ISA_SOUND_AWE_VOICE_H) + check_include_files(/usr/src/sys/gnu/i386/isa/sound/awe_voice.h HAVE__USR_SRC_SYS_GNU_I386_ISA_SOUND_AWE_VOICE_H) + + check_include_file_cxx(sys/asoundlib.h HAVE_SYS_ASOUNDLIB_H) + check_include_file_cxx(alsa/asoundlib.h HAVE_ALSA_ASOUNDLIB_H) + + check_library_exists(asound snd_pcm_resume "${ASOUND_LIBRARY_DIR}" ASOUND_HAS_SND_PCM_RESUME) + if(ASOUND_HAS_SND_PCM_RESUME) + set(HAVE_SND_PCM_RESUME 1) + endif(ASOUND_HAS_SND_PCM_RESUME) + + configure_file(${_FIND_ALSA_MODULE_DIR}/config-alsa.h.cmake ${_destFile}) +endmacro(ALSA_CONFIGURE_FILE _destFile) + +mark_as_advanced(ALSA_INCLUDES ASOUND_LIBRARY) diff --git a/cmake/modules/FindAutomoc4.cmake b/cmake/modules/FindAutomoc4.cmake new file mode 100644 index 0000000000..cbe7ad1e05 --- /dev/null +++ b/cmake/modules/FindAutomoc4.cmake @@ -0,0 +1,56 @@ +# - Try to find automoc4 +# Once done this will define +# +# AUTOMOC4_FOUND - automoc4 has been found +# AUTOMOC4_EXECUTABLE - the automoc4 tool +# AUTOMOC4_VERSION - the full version of automoc4 +# AUTOMOC4_VERSION_MAJOR, AUTOMOC4_VERSION_MINOR, AUTOMOC4_VERSION_PATCH - AUTOMOC4_VERSION +# broken into its components +# +# It also adds the following macros +# AUTOMOC4( ) +# Use this to run automoc4 on all files contained in the list . +# +# AUTOMOC4_MOC_HEADERS( header1.h header2.h ...) +# Use this to add more header files to be processed with automoc4. +# +# AUTOMOC4_ADD_EXECUTABLE( src1 src2 ...) +# This macro does the same as ADD_EXECUTABLE, but additionally +# adds automoc4 handling for all source files. +# +# AUTOMOC4_ADD_LIBRARY( src1 src2 ...) +# This macro does the same as ADD_LIBRARY, but additionally +# adds automoc4 handling for all source files. + +# Internal helper macro, may change or be removed anytime: +# _ADD_AUTOMOC4_TARGET( ) +# +# Since version 0.9.88: +# The following two macros are only to be used for KDE4 projects +# and do something which makes sure automoc4 works for KDE. Don't +# use them anywhere else. +# _AUTOMOC4_KDE4_PRE_TARGET_HANDLING( ) +# _AUTOMOC4_KDE4_POST_TARGET_HANDLING() + + +# Copyright (c) 2008-2009, Alexander Neundorf, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + + +# check if we are inside KDESupport and automoc is enabled +if("${KDESupport_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}") + # when building this project as part of kdesupport + include("${KDESupport_SOURCE_DIR}/automoc/Automoc4Config.cmake") +else("${KDESupport_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}") + # when building this project outside kdesupport + # use the new "config-mode" of cmake 2.6, which searches the installed Automoc4Config.cmake file + # see the man page for details + set(_Automoc4_FIND_QUIETLY ${Automoc4_FIND_QUIETLY}) + find_package(Automoc4 QUIET NO_MODULE) + set(Automoc4_FIND_QUIETLY ${_Automoc4_FIND_QUIETLY}) +endif("${KDESupport_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}") + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Automoc4 "Did not find automoc4 (part of kdesupport). Searched for Automoc4Config.cmake in ${AUTOMOC4_SEARCH_PATHS} using suffixes automoc4 lib/automoc4 lib64/automoc4." AUTOMOC4_EXECUTABLE) diff --git a/cmake/modules/FindAvahi.cmake b/cmake/modules/FindAvahi.cmake new file mode 100644 index 0000000000..129e68a62e --- /dev/null +++ b/cmake/modules/FindAvahi.cmake @@ -0,0 +1,22 @@ +# Find Avahi. Only avahi-common/defs.h is really needed + +# Copyright (c) 2007, Jakub Stachowski, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + + +if (AVAHI_INCLUDE_DIR) + # Already in cache, be silent + set(Avahi_FIND_QUIETLY TRUE) +endif (AVAHI_INCLUDE_DIR) + + +FIND_PATH(AVAHI_INCLUDE_DIR avahi-common/defs.h) +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Avahi DEFAULT_MSG + AVAHI_INCLUDE_DIR) + + +MARK_AS_ADVANCED(AVAHI_INCLUDE_DIR) + diff --git a/cmake/modules/FindBerkeleyDB.cmake b/cmake/modules/FindBerkeleyDB.cmake new file mode 100644 index 0000000000..749f166413 --- /dev/null +++ b/cmake/modules/FindBerkeleyDB.cmake @@ -0,0 +1,25 @@ +# - Try to find Berkeley DB +# Once done this will define +# +# BERKELEY_DB_FOUND - system has Berkeley DB +# BERKELEY_DB_INCLUDE_DIR - the Berkeley DB include directory +# BERKELEY_DB_LIBRARIES - Link these to use Berkeley DB +# BERKELEY_DB_DEFINITIONS - Compiler switches required for using Berkeley DB + +# Copyright (c) 2006, Alexander Dymo, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +FIND_PATH(BERKELEY_DB_INCLUDE_DIR db.h + /usr/include/db4 + /usr/local/include/db4 +) + +FIND_LIBRARY(BERKELEY_DB_LIBRARIES NAMES db ) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Berkeley "Could not find Berkeley DB >= 4.1" BERKELEY_DB_INCLUDE_DIR BERKELEY_DB_LIBRARIES) +# show the BERKELEY_DB_INCLUDE_DIR and BERKELEY_DB_LIBRARIES variables only in the advanced view +MARK_AS_ADVANCED(BERKELEY_DB_INCLUDE_DIR BERKELEY_DB_LIBRARIES ) + diff --git a/cmake/modules/FindBlitz.cmake b/cmake/modules/FindBlitz.cmake new file mode 100644 index 0000000000..2427999e95 --- /dev/null +++ b/cmake/modules/FindBlitz.cmake @@ -0,0 +1,55 @@ +################################################################ +########## DEPRECATED, use FindQImageBlitz instead ############# +################################################################ +# - Try to find blitz lib +# Once done this will define +# +# BLITZ_FOUND - system has blitz lib +# BLITZ_INCLUDES - the blitz include directory +# BLITZ_LIBRARIES - The libraries needed to use blitz + +# Copyright (c) 2006, Montel Laurent, +# Copyright (c) 2007, Allen Winter, +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +include(FindLibraryWithDebug) + +if (BLITZ_INCLUDES AND BLITZ_LIBRARIES) + set(Blitz_FIND_QUIETLY TRUE) +endif (BLITZ_INCLUDES AND BLITZ_LIBRARIES) + +if (NOT WIN32) + # use pkg-config to get the directories and then use these values + # in the FIND_PATH() and FIND_LIBRARY() calls + find_package(PkgConfig) + pkg_check_modules(PC_BLITZ qimageblitz) +endif (NOT WIN32) + +find_path(BLITZ_INCLUDES + NAMES + qimageblitz.h + PATH_SUFFIXES qimageblitz + PATHS + $ENV{QIMAGEBLITZDIR}/include + ${PC_BLITZ_INCLUDEDIR} + ${PC_BLITZ_INCLUDE_DIRS} + ${KDE4_INCLUDE_DIR} + ${INCLUDE_INSTALL_DIR} +) + +find_library_with_debug(BLITZ_LIBRARIES + WIN32_DEBUG_POSTFIX d + qimageblitz + PATHS + $ENV{QIMAGEBLITZDIR}/lib + ${PC_BLITZ_LIBRARY_DIRS} + ${PC_BLITZ_LIBDIR} + ${KDE4_LIB_DIR} + ${LIB_INSTALL_DIR} +) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Blitz DEFAULT_MSG + BLITZ_INCLUDES BLITZ_LIBRARIES) +mark_as_advanced(BLITZ_INCLUDES BLITZ_LIBRARIES) diff --git a/cmake/modules/FindBlueZ.cmake b/cmake/modules/FindBlueZ.cmake new file mode 100644 index 0000000000..8601b935e9 --- /dev/null +++ b/cmake/modules/FindBlueZ.cmake @@ -0,0 +1,51 @@ +# - Try to find BlueZ +# Once done this will define +# +# BLUEZ_FOUND - system has BlueZ +# BLUEZ_INCLUDE_DIR - the BlueZ include directory +# BLUEZ_LIBRARIES - Link these to use BlueZ +# BLUEZ_DEFINITIONS - Compiler switches required for using BlueZ +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. +# + +# Copyright (c) 2008, Daniel Gollub, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + + +if ( BLUEZ_INCLUDE_DIR AND BLUEZ_LIBRARIES ) + # in cache already + SET(BlueZ_FIND_QUIETLY TRUE) +endif ( BLUEZ_INCLUDE_DIR AND BLUEZ_LIBRARIES ) + +# use pkg-config to get the directories and then use these values +# in the FIND_PATH() and FIND_LIBRARY() calls +if( NOT WIN32 ) + find_package(PkgConfig) + + pkg_check_modules(PC_BLUEZ bluez) + + set(BLUEZ_DEFINITIONS ${PC_BLUEZ_CFLAGS_OTHER}) +endif( NOT WIN32 ) + +FIND_PATH(BLUEZ_INCLUDE_DIR NAMES bluetooth/bluetooth.h + PATHS + ${PC_BLUEZ_INCLUDEDIR} + ${PC_BLUEZ_INCLUDE_DIRS} + /usr/X11/include +) + +FIND_LIBRARY(BLUEZ_LIBRARIES NAMES bluetooth + PATHS + ${PC_BLUEZ_LIBDIR} + ${PC_BLUEZ_LIBRARY_DIRS} +) + +include(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(BlueZ DEFAULT_MSG BLUEZ_INCLUDE_DIR BLUEZ_LIBRARIES ) + +# show the BLUEZ_INCLUDE_DIR and BLUEZ_LIBRARIES variables only in the advanced view +MARK_AS_ADVANCED(BLUEZ_INCLUDE_DIR BLUEZ_LIBRARIES ) + diff --git a/cmake/modules/FindBoost.cmake b/cmake/modules/FindBoost.cmake new file mode 100644 index 0000000000..04f5d528c4 --- /dev/null +++ b/cmake/modules/FindBoost.cmake @@ -0,0 +1,914 @@ +# - Try to find Boost include dirs and libraries +# Usage of this module as follows: +# +# NOTE: Take note of the Boost_ADDITIONAL_VERSIONS variable below. +# Due to Boost naming conventions and limitations in CMake this find +# module is NOT future safe with respect to Boost version numbers, +# and may break. +# +# == Using Header-Only libraries from within Boost: == +# +# find_package( Boost 1.36.0 ) +# if(Boost_FOUND) +# include_directories(${Boost_INCLUDE_DIRS}) +# add_executable(foo foo.cc) +# endif() +# +# +# == Using actual libraries from within Boost: == +# +# set(Boost_USE_STATIC_LIBS ON) +# set(Boost_USE_MULTITHREADED ON) +# find_package( Boost 1.36.0 COMPONENTS date_time filesystem system ... ) +# +# if(Boost_FOUND) +# include_directories(${Boost_INCLUDE_DIRS}) +# add_executable(foo foo.cc) +# target_link_libraries(foo ${Boost_LIBRARIES}) +# endif() +# +# +# The components list needs to contain actual names of boost libraries only, +# such as "date_time" for "libboost_date_time". If you're using parts of +# Boost that contain header files only (e.g. foreach) you do not need to +# specify COMPONENTS. +# +# You should provide a minimum version number that should be used. If you provide this +# version number and specify the REQUIRED attribute, this module will fail if it +# can't find the specified or a later version. If you specify a version number this is +# automatically put into the considered list of version numbers and thus doesn't need +# to be specified in the Boost_ADDITIONAL_VERSIONS variable (see below). +# +# NOTE for Visual Studio Users: +# Automatic linking is used on MSVC & Borland compilers by default when +# #including things in Boost. It's important to note that setting +# Boost_USE_STATIC_LIBS to OFF is NOT enough to get you dynamic linking, +# should you need this feature. Automatic linking typically uses static +# libraries with a few exceptions (Boost.Python is one). +# +# Please see the section below near Boost_LIB_DIAGNOSTIC_DEFINITIONS for +# more details. Adding a TARGET_LINK_LIBRARIES() as shown in the example +# above appears to cause VS to link dynamically if Boost_USE_STATIC_LIBS +# gets set to OFF. It is suggested you avoid automatic linking since it +# will make your application less portable. +# +# =========== The mess that is Boost_ADDITIONAL_VERSIONS (sorry?) ============ +# +# OK, so the Boost_ADDITIONAL_VERSIONS variable can be used to specify a list of +# boost version numbers that should be taken into account when searching +# for Boost. Unfortunately boost puts the version number into the +# actual filename for the libraries, so this variable will certainly be needed +# in the future when new Boost versions are released. +# +# Currently this module searches for the following version numbers: +# 1.33, 1.33.0, 1.33.1, 1.34, 1.34.0, 1.34.1, 1.35, 1.35.0, 1.35.1, +# 1.36, 1.36.0, 1.36.1, 1.37, 1.37.0, 1.38, 1.38.0, 1.39, 1.39.0, +# 1.40, 1.40.0 +# +# NOTE: If you add a new major 1.x version in Boost_ADDITIONAL_VERSIONS you should +# add both 1.x and 1.x.0 as shown above. Official Boost include directories +# omit the 3rd version number from include paths if it is 0 although not all +# binary Boost releases do so. +# +# SET(Boost_ADDITIONAL_VERSIONS "1.78" "1.78.0" "1.79" "1.79.0") +# +# ===================================== ============= ======================== +# +# Variables used by this module, they can change the default behaviour and +# need to be set before calling find_package: +# +# Boost_USE_MULTITHREADED Can be set to OFF to use the non-multithreaded +# boost libraries. If not specified, defaults +# to ON. +# +# Boost_USE_STATIC_LIBS Can be set to ON to force the use of the static +# boost libraries. Defaults to OFF. +# +# Other Variables used by this module which you may want to set. +# +# Boost_ADDITIONAL_VERSIONS A list of version numbers to use for searching +# the boost include directory. Please see +# the documentation above regarding this +# annoying, but necessary variable :( +# +# Boost_DEBUG Set this to TRUE to enable debugging output +# of FindBoost.cmake if you are having problems. +# Please enable this before filing any bug +# reports. +# +# Boost_DETAILED_FAILURE_MSG FindBoost doesn't output detailed information +# about why it failed or how to fix the problem +# unless this is set to TRUE or the REQUIRED +# keyword is specified in find_package(). +# [Since CMake 2.8.0] +# +# Boost_COMPILER Set this to the compiler suffix used by Boost +# (e.g. "-gcc43") if FindBoost has problems finding +# the proper Boost installation +# +# These last three variables are available also as environment variables: +# +# BOOST_ROOT or BOOSTROOT The preferred installation prefix for searching for +# Boost. Set this if the module has problems finding +# the proper Boost installation. +# +# BOOST_INCLUDEDIR Set this to the include directory of Boost, if the +# module has problems finding the proper Boost installation +# +# BOOST_LIBRARYDIR Set this to the lib directory of Boost, if the +# module has problems finding the proper Boost installation +# +# Variables defined by this module: +# +# Boost_FOUND System has Boost, this means the include dir was +# found, as well as all the libraries specified in +# the COMPONENTS list. +# +# Boost_INCLUDE_DIRS Boost include directories: not cached +# +# Boost_INCLUDE_DIR This is almost the same as above, but this one is +# cached and may be modified by advanced users +# +# Boost_LIBRARIES Link to these to use the Boost libraries that you +# specified: not cached +# +# Boost_LIBRARY_DIRS The path to where the Boost library files are. +# +# Boost_VERSION The version number of the boost libraries that +# have been found, same as in version.hpp from Boost +# +# Boost_LIB_VERSION The version number in filename form as +# it's appended to the library filenames +# +# Boost_MAJOR_VERSION major version number of boost +# Boost_MINOR_VERSION minor version number of boost +# Boost_SUBMINOR_VERSION subminor version number of boost +# +# Boost_LIB_DIAGNOSTIC_DEFINITIONS [WIN32 Only] You can call +# add_definitions(${Boost_LIB_DIAGNOSTIC_DEFINITIONS}) +# to have diagnostic information about Boost's +# automatic linking outputted during compilation time. +# +# For each component you specify in find_package(), the following (UPPER-CASE) +# variables are set. You can use these variables if you would like to pick and +# choose components for your targets instead of just using Boost_LIBRARIES. +# +# Boost_${COMPONENT}_FOUND True IF the Boost library "component" was found. +# +# Boost_${COMPONENT}_LIBRARY Contains the libraries for the specified Boost +# "component" (includes debug and optimized keywords +# when needed). + +#============================================================================= +# Copyright 2006-2009 Kitware, Inc. +# Copyright 2006-2008 Andreas Schneider +# Copyright 2007 Wengo +# Copyright 2007 Mike Jackson +# Copyright 2008 Andreas Pakulat +# Copyright 2008-2009 Philip Lowman +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#============================================================================= +# (To distributed this file outside of CMake, substitute the full +# License text for the above reference.) + +#------------------------------------------------------------------------------- +# FindBoost functions & macros +# +############################################ +# +# Check the existence of the libraries. +# +############################################ +# This macro was taken directly from the FindQt4.cmake file that is included +# with the CMake distribution. This is NOT my work. All work was done by the +# original authors of the FindQt4.cmake file. Only minor modifications were +# made to remove references to Qt and make this file more generally applicable +# And ELSE/ENDIF pairs were removed for readability. +######################################################################### + +MACRO (_Boost_ADJUST_LIB_VARS basename) + IF (Boost_INCLUDE_DIR ) + IF (Boost_${basename}_LIBRARY_DEBUG AND Boost_${basename}_LIBRARY_RELEASE) + # if the generator supports configuration types then set + # optimized and debug libraries, or if the CMAKE_BUILD_TYPE has a value + IF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) + SET(Boost_${basename}_LIBRARY optimized ${Boost_${basename}_LIBRARY_RELEASE} debug ${Boost_${basename}_LIBRARY_DEBUG}) + ELSE() + # if there are no configuration types and CMAKE_BUILD_TYPE has no value + # then just use the release libraries + SET(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY_RELEASE} ) + ENDIF() + # FIXME: This probably should be set for both cases + SET(Boost_${basename}_LIBRARIES optimized ${Boost_${basename}_LIBRARY_RELEASE} debug ${Boost_${basename}_LIBRARY_DEBUG}) + ENDIF() + + # if only the release version was found, set the debug variable also to the release version + IF (Boost_${basename}_LIBRARY_RELEASE AND NOT Boost_${basename}_LIBRARY_DEBUG) + SET(Boost_${basename}_LIBRARY_DEBUG ${Boost_${basename}_LIBRARY_RELEASE}) + SET(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY_RELEASE}) + SET(Boost_${basename}_LIBRARIES ${Boost_${basename}_LIBRARY_RELEASE}) + ENDIF() + + # if only the debug version was found, set the release variable also to the debug version + IF (Boost_${basename}_LIBRARY_DEBUG AND NOT Boost_${basename}_LIBRARY_RELEASE) + SET(Boost_${basename}_LIBRARY_RELEASE ${Boost_${basename}_LIBRARY_DEBUG}) + SET(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY_DEBUG}) + SET(Boost_${basename}_LIBRARIES ${Boost_${basename}_LIBRARY_DEBUG}) + ENDIF() + + IF (Boost_${basename}_LIBRARY) + set(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY} CACHE FILEPATH "The Boost ${basename} library") + + # Remove superfluous "debug" / "optimized" keywords from + # Boost_LIBRARY_DIRS + FOREACH(_boost_my_lib ${Boost_${basename}_LIBRARY}) + GET_FILENAME_COMPONENT(_boost_my_lib_path "${_boost_my_lib}" PATH) + LIST(APPEND Boost_LIBRARY_DIRS ${_boost_my_lib_path}) + ENDFOREACH() + LIST(REMOVE_DUPLICATES Boost_LIBRARY_DIRS) + + set(Boost_LIBRARY_DIRS ${Boost_LIBRARY_DIRS} CACHE FILEPATH "Boost library directory") + SET(Boost_${basename}_FOUND ON CACHE INTERNAL "Whether the Boost ${basename} library found") + ENDIF(Boost_${basename}_LIBRARY) + + ENDIF (Boost_INCLUDE_DIR ) + # Make variables changeble to the advanced user + MARK_AS_ADVANCED( + Boost_${basename}_LIBRARY + Boost_${basename}_LIBRARY_RELEASE + Boost_${basename}_LIBRARY_DEBUG + ) +ENDMACRO (_Boost_ADJUST_LIB_VARS) + +#------------------------------------------------------------------------------- + +# +# Runs compiler with "-dumpversion" and parses major/minor +# version with a regex. +# +FUNCTION(_Boost_COMPILER_DUMPVERSION _OUTPUT_VERSION) + + EXEC_PROGRAM(${CMAKE_CXX_COMPILER} + ARGS ${CMAKE_CXX_COMPILER_ARG1} -dumpversion + OUTPUT_VARIABLE _boost_COMPILER_VERSION + ) + STRING(REGEX REPLACE "([0-9])\\.([0-9])(\\.[0-9])?" "\\1\\2" + _boost_COMPILER_VERSION ${_boost_COMPILER_VERSION}) + + SET(${_OUTPUT_VERSION} ${_boost_COMPILER_VERSION} PARENT_SCOPE) +ENDFUNCTION() + +# +# End functions/macros +# +#------------------------------------------------------------------------------- + + + + +IF(NOT DEFINED Boost_USE_MULTITHREADED) + SET(Boost_USE_MULTITHREADED TRUE) +ENDIF() + +if(Boost_FIND_VERSION_EXACT) + # The version may appear in a directory with or without the patch + # level, even when the patch level is non-zero. + set(_boost_TEST_VERSIONS + "${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}.${Boost_FIND_VERSION_PATCH}" + "${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}") +else(Boost_FIND_VERSION_EXACT) + # The user has not requested an exact version. Among known + # versions, find those that are acceptable to the user request. + set(_Boost_KNOWN_VERSIONS ${Boost_ADDITIONAL_VERSIONS} + "1.40.0" "1.40" "1.39.0" "1.39" "1.38.0" "1.38" "1.37.0" "1.37" + "1.36.1" "1.36.0" "1.36" "1.35.1" "1.35.0" "1.35" "1.34.1" "1.34.0" + "1.34" "1.33.1" "1.33.0" "1.33") + set(_boost_TEST_VERSIONS) + if(Boost_FIND_VERSION) + set(_Boost_FIND_VERSION_SHORT "${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}") + # Select acceptable versions. + foreach(version ${_Boost_KNOWN_VERSIONS}) + if(NOT "${version}" VERSION_LESS "${Boost_FIND_VERSION}") + # This version is high enough. + list(APPEND _boost_TEST_VERSIONS "${version}") + elseif("${version}.99" VERSION_EQUAL "${_Boost_FIND_VERSION_SHORT}.99") + # This version is a short-form for the requested version with + # the patch level dropped. + list(APPEND _boost_TEST_VERSIONS "${version}") + endif() + endforeach(version) + else(Boost_FIND_VERSION) + # Any version is acceptable. + set(_boost_TEST_VERSIONS "${_Boost_KNOWN_VERSIONS}") + endif(Boost_FIND_VERSION) +endif(Boost_FIND_VERSION_EXACT) + +# The reason that we failed to find Boost. This will be set to a +# user-friendly message when we fail to find some necessary piece of +# Boost. +set(Boost_ERROR_REASON) + +SET( _boost_IN_CACHE TRUE) +IF(Boost_INCLUDE_DIR) + + # On versions < 1.35, remove the System library from the considered list + # since it wasn't added until 1.35. + if(Boost_VERSION AND Boost_FIND_COMPONENTS) + math(EXPR _boost_maj "${Boost_VERSION} / 100000") + math(EXPR _boost_min "${Boost_VERSION} / 100 % 1000") + if(${_boost_maj}.${_boost_min} VERSION_LESS 1.35) + list(REMOVE_ITEM Boost_FIND_COMPONENTS system) + endif() + endif() + + FOREACH(COMPONENT ${Boost_FIND_COMPONENTS}) + STRING(TOUPPER ${COMPONENT} COMPONENT) + IF(NOT Boost_${COMPONENT}_FOUND) + SET( _boost_IN_CACHE FALSE) + ENDIF(NOT Boost_${COMPONENT}_FOUND) + ENDFOREACH(COMPONENT) +ELSE(Boost_INCLUDE_DIR) + SET( _boost_IN_CACHE FALSE) +ENDIF(Boost_INCLUDE_DIR) + +IF (_boost_IN_CACHE) + # in cache already + SET(Boost_FOUND TRUE) + FOREACH(COMPONENT ${Boost_FIND_COMPONENTS}) + STRING(TOUPPER ${COMPONENT} COMPONENT) + _Boost_ADJUST_LIB_VARS( ${COMPONENT} ) + SET(Boost_LIBRARIES ${Boost_LIBRARIES} ${Boost_${COMPONENT}_LIBRARY}) + ENDFOREACH(COMPONENT) + SET(Boost_INCLUDE_DIRS ${Boost_INCLUDE_DIR}) + IF(Boost_VERSION AND NOT "${Boost_VERSION}" STREQUAL "0") + MATH(EXPR Boost_MAJOR_VERSION "${Boost_VERSION} / 100000") + MATH(EXPR Boost_MINOR_VERSION "${Boost_VERSION} / 100 % 1000") + MATH(EXPR Boost_SUBMINOR_VERSION "${Boost_VERSION} % 100") + ENDIF(Boost_VERSION AND NOT "${Boost_VERSION}" STREQUAL "0") + if(Boost_DEBUG) + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + "boost ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION} " + "is already in the cache. For debugging messages, please clear the cache.") + endif() +ELSE (_boost_IN_CACHE) + # Need to search for boost + if(Boost_DEBUG) + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + "Boost not in cache") + # Output some of their choices + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + "_boost_TEST_VERSIONS = ${_boost_TEST_VERSIONS}") + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + "Boost_USE_MULTITHREADED = ${Boost_USE_MULTITHREADED}") + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + "Boost_USE_STATIC_LIBS = ${Boost_USE_STATIC_LIBS}") + endif() + + IF(WIN32) + # In windows, automatic linking is performed, so you do not have + # to specify the libraries. If you are linking to a dynamic + # runtime, then you can choose to link to either a static or a + # dynamic Boost library, the default is to do a static link. You + # can alter this for a specific library "whatever" by defining + # BOOST_WHATEVER_DYN_LINK to force Boost library "whatever" to be + # linked dynamically. Alternatively you can force all Boost + # libraries to dynamic link by defining BOOST_ALL_DYN_LINK. + + # This feature can be disabled for Boost library "whatever" by + # defining BOOST_WHATEVER_NO_LIB, or for all of Boost by defining + # BOOST_ALL_NO_LIB. + + # If you want to observe which libraries are being linked against + # then defining BOOST_LIB_DIAGNOSTIC will cause the auto-linking + # code to emit a #pragma message each time a library is selected + # for linking. + SET(Boost_LIB_DIAGNOSTIC_DEFINITIONS + "-DBOOST_LIB_DIAGNOSTIC" CACHE STRING "Boost diagnostic define") + ENDIF(WIN32) + + SET(_boost_INCLUDE_SEARCH_DIRS + C:/boost/include + C:/boost + "$ENV{ProgramFiles}/boost/include" + "$ENV{ProgramFiles}/boost" + /sw/local/include + ) + + # If BOOST_ROOT was defined in the environment, use it. + if (NOT BOOST_ROOT AND NOT $ENV{BOOST_ROOT} STREQUAL "") + set(BOOST_ROOT $ENV{BOOST_ROOT}) + endif(NOT BOOST_ROOT AND NOT $ENV{BOOST_ROOT} STREQUAL "") + + # If BOOSTROOT was defined in the environment, use it. + if (NOT BOOST_ROOT AND NOT $ENV{BOOSTROOT} STREQUAL "") + set(BOOST_ROOT $ENV{BOOSTROOT}) + endif(NOT BOOST_ROOT AND NOT $ENV{BOOSTROOT} STREQUAL "") + + # If BOOST_INCLUDEDIR was defined in the environment, use it. + IF( NOT $ENV{BOOST_INCLUDEDIR} STREQUAL "" ) + set(BOOST_INCLUDEDIR $ENV{BOOST_INCLUDEDIR}) + ENDIF( NOT $ENV{BOOST_INCLUDEDIR} STREQUAL "" ) + + # If BOOST_LIBRARYDIR was defined in the environment, use it. + IF( NOT $ENV{BOOST_LIBRARYDIR} STREQUAL "" ) + set(BOOST_LIBRARYDIR $ENV{BOOST_LIBRARYDIR}) + ENDIF( NOT $ENV{BOOST_LIBRARYDIR} STREQUAL "" ) + + IF( BOOST_ROOT ) + file(TO_CMAKE_PATH ${BOOST_ROOT} BOOST_ROOT) + ENDIF( BOOST_ROOT ) + + if(Boost_DEBUG) + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + "Declared as CMake or Environmental Variables:") + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + " BOOST_ROOT = ${BOOST_ROOT}") + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + " BOOST_INCLUDEDIR = ${BOOST_INCLUDEDIR}") + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + " BOOST_LIBRARYDIR = ${BOOST_LIBRARYDIR}") + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + "_boost_TEST_VERSIONS = ${_boost_TEST_VERSIONS}") + endif() + + IF( BOOST_ROOT ) + SET(_boost_INCLUDE_SEARCH_DIRS + ${BOOST_ROOT}/include + ${BOOST_ROOT} + ${_boost_INCLUDE_SEARCH_DIRS}) + ENDIF( BOOST_ROOT ) + + IF( BOOST_INCLUDEDIR ) + file(TO_CMAKE_PATH ${BOOST_INCLUDEDIR} BOOST_INCLUDEDIR) + SET(_boost_INCLUDE_SEARCH_DIRS + ${BOOST_INCLUDEDIR} ${_boost_INCLUDE_SEARCH_DIRS}) + ENDIF( BOOST_INCLUDEDIR ) + + # ------------------------------------------------------------------------ + # Search for Boost include DIR + # ------------------------------------------------------------------------ + # Try to find Boost by stepping backwards through the Boost versions + # we know about. + IF( NOT Boost_INCLUDE_DIR ) + # Build a list of path suffixes for each version. + SET(_boost_PATH_SUFFIXES) + FOREACH(_boost_VER ${_boost_TEST_VERSIONS}) + # Add in a path suffix, based on the required version, ideally + # we could read this from version.hpp, but for that to work we'd + # need to know the include dir already + set(_boost_BOOSTIFIED_VERSION) + + # Transform 1.35 => 1_35 and 1.36.0 => 1_36_0 + IF(_boost_VER MATCHES "[0-9]+\\.[0-9]+\\.[0-9]+") + STRING(REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\1_\\2_\\3" + _boost_BOOSTIFIED_VERSION ${_boost_VER}) + ELSEIF(_boost_VER MATCHES "[0-9]+\\.[0-9]+") + STRING(REGEX REPLACE "([0-9]+)\\.([0-9]+)" "\\1_\\2" + _boost_BOOSTIFIED_VERSION ${_boost_VER}) + ENDIF() + + list(APPEND _boost_PATH_SUFFIXES "boost-${_boost_BOOSTIFIED_VERSION}") + if(WIN32) + # For BoostPro's underscores (and others?) + list(APPEND _boost_PATH_SUFFIXES "boost_${_boost_BOOSTIFIED_VERSION}") + endif() + + ENDFOREACH(_boost_VER) + + if(Boost_DEBUG) + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + "Include debugging info:") + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + " _boost_INCLUDE_SEARCH_DIRS = ${_boost_INCLUDE_SEARCH_DIRS}") + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + " _boost_PATH_SUFFIXES = ${_boost_PATH_SUFFIXES}") + endif() + + # Look for a standard boost header file. + FIND_PATH(Boost_INCLUDE_DIR + NAMES boost/config.hpp + HINTS ${_boost_INCLUDE_SEARCH_DIRS} + PATH_SUFFIXES ${_boost_PATH_SUFFIXES} + ) + ENDIF( NOT Boost_INCLUDE_DIR ) + + # ------------------------------------------------------------------------ + # Extract version information from version.hpp + # ------------------------------------------------------------------------ + + IF(Boost_INCLUDE_DIR) + # Extract Boost_VERSION and Boost_LIB_VERSION from version.hpp + # Read the whole file: + # + SET(BOOST_VERSION 0) + SET(BOOST_LIB_VERSION "") + FILE(READ "${Boost_INCLUDE_DIR}/boost/version.hpp" _boost_VERSION_HPP_CONTENTS) + if(Boost_DEBUG) + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + "location of version.hpp: ${Boost_INCLUDE_DIR}/boost/version.hpp") + endif() + + STRING(REGEX REPLACE ".*#define BOOST_VERSION ([0-9]+).*" "\\1" Boost_VERSION "${_boost_VERSION_HPP_CONTENTS}") + STRING(REGEX REPLACE ".*#define BOOST_LIB_VERSION \"([0-9_]+)\".*" "\\1" Boost_LIB_VERSION "${_boost_VERSION_HPP_CONTENTS}") + + SET(Boost_LIB_VERSION ${Boost_LIB_VERSION} CACHE INTERNAL "The library version string for boost libraries") + SET(Boost_VERSION ${Boost_VERSION} CACHE INTERNAL "The version number for boost libraries") + + IF(NOT "${Boost_VERSION}" STREQUAL "0") + MATH(EXPR Boost_MAJOR_VERSION "${Boost_VERSION} / 100000") + MATH(EXPR Boost_MINOR_VERSION "${Boost_VERSION} / 100 % 1000") + MATH(EXPR Boost_SUBMINOR_VERSION "${Boost_VERSION} % 100") + + set(Boost_ERROR_REASON + "${Boost_ERROR_REASON}Boost version: ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}\nBoost include path: ${Boost_INCLUDE_DIR}") + ENDIF(NOT "${Boost_VERSION}" STREQUAL "0") + if(Boost_DEBUG) + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + "version.hpp reveals boost " + "${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}") + endif() + ELSE(Boost_INCLUDE_DIR) + set(Boost_ERROR_REASON + "${Boost_ERROR_REASON}Unable to find the Boost header files. Please set BOOST_ROOT to the root directory containing Boost or BOOST_INCLUDEDIR to the directory containing Boost's headers.") + ENDIF(Boost_INCLUDE_DIR) + + # ------------------------------------------------------------------------ + # Suffix initialization and compiler suffix detection. + # ------------------------------------------------------------------------ + + # Setting some more suffixes for the library + SET (Boost_LIB_PREFIX "") + if ( WIN32 AND Boost_USE_STATIC_LIBS ) + SET (Boost_LIB_PREFIX "lib") + endif() + + if (Boost_COMPILER) + set(_boost_COMPILER ${Boost_COMPILER}) + if(Boost_DEBUG) + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + "using user-specified Boost_COMPILER = ${_boost_COMPILER}") + endif() + else(Boost_COMPILER) + # Attempt to guess the compiler suffix + # NOTE: this is not perfect yet, if you experience any issues + # please report them and use the Boost_COMPILER variable + # to work around the problems. + if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel" + OR "${CMAKE_CXX_COMPILER}" MATCHES "icl" + OR "${CMAKE_CXX_COMPILER}" MATCHES "icpc") + if(WIN32) + set (_boost_COMPILER "-iw") + else() + set (_boost_COMPILER "-il") + endif() + elseif (MSVC90) + SET (_boost_COMPILER "-vc90") + elseif (MSVC80) + SET (_boost_COMPILER "-vc80") + elseif (MSVC71) + SET (_boost_COMPILER "-vc71") + elseif (MSVC70) # Good luck! + SET (_boost_COMPILER "-vc7") # yes, this is correct + elseif (MSVC60) # Good luck! + SET (_boost_COMPILER "-vc6") # yes, this is correct + elseif (BORLAND) + SET (_boost_COMPILER "-bcb") + elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "SunPro") + set(_boost_COMPILER "-sw") + elseif (MINGW) + if(${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION} VERSION_LESS 1.34) + SET(_boost_COMPILER "-mgw") # no GCC version encoding prior to 1.34 + else() + _Boost_COMPILER_DUMPVERSION(_boost_COMPILER_VERSION) + SET (_boost_COMPILER "-mgw${_boost_COMPILER_VERSION}") + endif() + elseif (UNIX) + if (CMAKE_COMPILER_IS_GNUCXX) + if(${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION} VERSION_LESS 1.34) + SET(_boost_COMPILER "-gcc") # no GCC version encoding prior to 1.34 + else() + _Boost_COMPILER_DUMPVERSION(_boost_COMPILER_VERSION) + # Determine which version of GCC we have. + IF(APPLE) + IF(Boost_MINOR_VERSION) + IF(${Boost_MINOR_VERSION} GREATER 35) + # In Boost 1.36.0 and newer, the mangled compiler name used + # on Mac OS X/Darwin is "xgcc". + SET(_boost_COMPILER "-xgcc${_boost_COMPILER_VERSION}") + ELSE(${Boost_MINOR_VERSION} GREATER 35) + # In Boost <= 1.35.0, there is no mangled compiler name for + # the Mac OS X/Darwin version of GCC. + SET(_boost_COMPILER "") + ENDIF(${Boost_MINOR_VERSION} GREATER 35) + ELSE(Boost_MINOR_VERSION) + # We don't know the Boost version, so assume it's + # pre-1.36.0. + SET(_boost_COMPILER "") + ENDIF(Boost_MINOR_VERSION) + ELSE() + SET (_boost_COMPILER "-gcc${_boost_COMPILER_VERSION}") + ENDIF() + endif() + endif (CMAKE_COMPILER_IS_GNUCXX) + endif() + if(Boost_DEBUG) + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + "guessed _boost_COMPILER = ${_boost_COMPILER}") + endif() + endif(Boost_COMPILER) + + SET (_boost_MULTITHREADED "-mt") + if( NOT Boost_USE_MULTITHREADED ) + set (_boost_MULTITHREADED "") + endif() + if(Boost_DEBUG) + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + "_boost_MULTITHREADED = ${_boost_MULTITHREADED}") + endif() + + SET( _boost_STATIC_TAG "") + set( _boost_ABI_TAG "") + IF (WIN32) + IF(MSVC OR "${CMAKE_CXX_COMPILER}" MATCHES "icl" + OR "${CMAKE_CXX_COMPILER}" MATCHES "icpc") + SET (_boost_ABI_TAG "g") + ENDIF() + IF( Boost_USE_STATIC_LIBS ) + SET( _boost_STATIC_TAG "-s") + ENDIF( Boost_USE_STATIC_LIBS ) + ENDIF(WIN32) + SET (_boost_ABI_TAG "${_boost_ABI_TAG}d") + if(Boost_DEBUG) + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + "_boost_STATIC_TAG = ${_boost_STATIC_TAG}") + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + "_boost_ABI_TAG = ${_boost_ABI_TAG}") + endif() + + # ------------------------------------------------------------------------ + # Begin finding boost libraries + # ------------------------------------------------------------------------ + + SET(_boost_LIBRARIES_SEARCH_DIRS + ${Boost_INCLUDE_DIR}/lib + ${Boost_INCLUDE_DIR}/../lib + C:/boost/lib + C:/boost + "$ENV{ProgramFiles}/boost/boost_${Boost_MAJOR_VERSION}_${Boost_MINOR_VERSION}_${Boost_SUBMINOR_VERSION}/lib" + "$ENV{ProgramFiles}/boost/boost_${Boost_MAJOR_VERSION}_${Boost_MINOR_VERSION}/lib" + "$ENV{ProgramFiles}/boost/lib" + "$ENV{ProgramFiles}/boost" + /sw/local/lib + ) + IF( BOOST_ROOT ) + SET(_boost_LIBRARIES_SEARCH_DIRS + ${BOOST_ROOT}/lib + ${BOOST_ROOT}/stage/lib + ${_boost_LIBRARIES_SEARCH_DIRS}) + ENDIF( BOOST_ROOT ) + + IF( BOOST_LIBRARYDIR ) + file(TO_CMAKE_PATH ${BOOST_LIBRARYDIR} BOOST_LIBRARYDIR) + SET(_boost_LIBRARIES_SEARCH_DIRS + ${BOOST_LIBRARYDIR} ${_boost_LIBRARIES_SEARCH_DIRS}) + ENDIF( BOOST_LIBRARYDIR ) + + if(Boost_DEBUG) + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + "_boost_LIBRARIES_SEARCH_DIRS = ${_boost_LIBRARIES_SEARCH_DIRS}") + endif() + + FOREACH(COMPONENT ${Boost_FIND_COMPONENTS}) + STRING(TOUPPER ${COMPONENT} UPPERCOMPONENT) + SET( Boost_${UPPERCOMPONENT}_LIBRARY "Boost_${UPPERCOMPONENT}_LIBRARY-NOTFOUND" ) + SET( Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE "Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE-NOTFOUND" ) + SET( Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG "Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG-NOTFOUND") + + # Support preference of static libs by adjusting CMAKE_FIND_LIBRARY_SUFFIXES + IF( Boost_USE_STATIC_LIBS ) + SET( _boost_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES}) + IF(WIN32) + SET(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) + ELSE(WIN32) + SET(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) + ENDIF(WIN32) + ENDIF( Boost_USE_STATIC_LIBS ) + + FIND_LIBRARY(Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE + NAMES ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}-${Boost_LIB_VERSION} + ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_STATIC_TAG}-${Boost_LIB_VERSION} + ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}-${Boost_LIB_VERSION} + ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_STATIC_TAG}-${Boost_LIB_VERSION} + ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED} + ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_STATIC_TAG} + ${Boost_LIB_PREFIX}boost_${COMPONENT} + HINTS ${_boost_LIBRARIES_SEARCH_DIRS} + ) + + FIND_LIBRARY(Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG + NAMES ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}-${_boost_ABI_TAG}-${Boost_LIB_VERSION} + ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_STATIC_TAG}${_boost_ABI_TAG}-${Boost_LIB_VERSION} + ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}-${_boost_ABI_TAG}-${Boost_LIB_VERSION} + ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_STATIC_TAG}${_boost_ABI_TAG}-${Boost_LIB_VERSION} + ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}-${_boost_ABI_TAG} + ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_STATIC_TAG}${_boost_ABI_TAG} + ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_boost_ABI_TAG} + HINTS ${_boost_LIBRARIES_SEARCH_DIRS} + ) + + _Boost_ADJUST_LIB_VARS(${UPPERCOMPONENT}) + IF( Boost_USE_STATIC_LIBS ) + SET(CMAKE_FIND_LIBRARY_SUFFIXES ${_boost_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES}) + ENDIF( Boost_USE_STATIC_LIBS ) + ENDFOREACH(COMPONENT) + # ------------------------------------------------------------------------ + # End finding boost libraries + # ------------------------------------------------------------------------ + + SET(Boost_INCLUDE_DIRS + ${Boost_INCLUDE_DIR} + ) + + SET(Boost_FOUND FALSE) + IF(Boost_INCLUDE_DIR) + SET( Boost_FOUND TRUE ) + + # Check the version of Boost against the requested version. + if (Boost_FIND_VERSION AND NOT Boost_FIND_VERSION_MINOR) + message(SEND_ERROR "When requesting a specific version of Boost, you must provide at least the major and minor version numbers, e.g., 1.34") + endif (Boost_FIND_VERSION AND NOT Boost_FIND_VERSION_MINOR) + if(Boost_MAJOR_VERSION LESS "${Boost_FIND_VERSION_MAJOR}" ) + set( Boost_FOUND FALSE ) + set(_Boost_VERSION_AGE "old") + elseif(Boost_MAJOR_VERSION EQUAL "${Boost_FIND_VERSION_MAJOR}" ) + if(Boost_MINOR_VERSION LESS "${Boost_FIND_VERSION_MINOR}" ) + set( Boost_FOUND FALSE ) + set(_Boost_VERSION_AGE "old") + elseif(Boost_MINOR_VERSION EQUAL "${Boost_FIND_VERSION_MINOR}" ) + if( Boost_FIND_VERSION_PATCH AND Boost_SUBMINOR_VERSION LESS "${Boost_FIND_VERSION_PATCH}" ) + set( Boost_FOUND FALSE ) + set(_Boost_VERSION_AGE "old") + endif( Boost_FIND_VERSION_PATCH AND Boost_SUBMINOR_VERSION LESS "${Boost_FIND_VERSION_PATCH}" ) + endif( Boost_MINOR_VERSION LESS "${Boost_FIND_VERSION_MINOR}" ) + endif( Boost_MAJOR_VERSION LESS "${Boost_FIND_VERSION_MAJOR}" ) + + if (Boost_FOUND AND Boost_FIND_VERSION_EXACT) + # If the user requested an exact version of Boost, check + # that. We already know that the Boost version we have is >= the + # requested version. + set(_Boost_VERSION_AGE "new") + + # If the user didn't specify a patchlevel, it's 0. + if (NOT Boost_FIND_VERSION_PATCH) + set(Boost_FIND_VERSION_PATCH 0) + endif (NOT Boost_FIND_VERSION_PATCH) + + # We'll set Boost_FOUND true again if we have an exact version match. + set(Boost_FOUND FALSE) + if(Boost_MAJOR_VERSION EQUAL "${Boost_FIND_VERSION_MAJOR}" ) + if(Boost_MINOR_VERSION EQUAL "${Boost_FIND_VERSION_MINOR}" ) + if(Boost_SUBMINOR_VERSION EQUAL "${Boost_FIND_VERSION_PATCH}" ) + set( Boost_FOUND TRUE ) + endif(Boost_SUBMINOR_VERSION EQUAL "${Boost_FIND_VERSION_PATCH}" ) + endif( Boost_MINOR_VERSION EQUAL "${Boost_FIND_VERSION_MINOR}" ) + endif( Boost_MAJOR_VERSION EQUAL "${Boost_FIND_VERSION_MAJOR}" ) + endif (Boost_FOUND AND Boost_FIND_VERSION_EXACT) + + if(NOT Boost_FOUND) + # State that we found a version of Boost that is too new or too old. + set(Boost_ERROR_REASON + "${Boost_ERROR_REASON}\nDetected version of Boost is too ${_Boost_VERSION_AGE}. Requested version was ${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}") + if (Boost_FIND_VERSION_PATCH) + set(Boost_ERROR_REASON + "${Boost_ERROR_REASON}.${Boost_FIND_VERSION_PATCH}") + endif (Boost_FIND_VERSION_PATCH) + if (NOT Boost_FIND_VERSION_EXACT) + set(Boost_ERROR_REASON "${Boost_ERROR_REASON} (or newer)") + endif (NOT Boost_FIND_VERSION_EXACT) + set(Boost_ERROR_REASON "${Boost_ERROR_REASON}.") + endif (NOT Boost_FOUND) + + if (Boost_FOUND) + set(_boost_CHECKED_COMPONENT FALSE) + set(_Boost_MISSING_COMPONENTS) + foreach(COMPONENT ${Boost_FIND_COMPONENTS}) + string(TOUPPER ${COMPONENT} COMPONENT) + set(_boost_CHECKED_COMPONENT TRUE) + if(NOT Boost_${COMPONENT}_FOUND) + string(TOLOWER ${COMPONENT} COMPONENT) + list(APPEND _Boost_MISSING_COMPONENTS ${COMPONENT}) + set( Boost_FOUND FALSE) + endif(NOT Boost_${COMPONENT}_FOUND) + endforeach(COMPONENT) + endif (Boost_FOUND) + + if(Boost_DEBUG) + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] Boost_FOUND = ${Boost_FOUND}") + endif() + + if (_Boost_MISSING_COMPONENTS) + # We were unable to find some libraries, so generate a sensible + # error message that lists the libraries we were unable to find. + set(Boost_ERROR_REASON + "${Boost_ERROR_REASON}\nThe following Boost libraries could not be found:\n") + foreach(COMPONENT ${_Boost_MISSING_COMPONENTS}) + set(Boost_ERROR_REASON + "${Boost_ERROR_REASON} boost_${COMPONENT}\n") + endforeach(COMPONENT) + + list(LENGTH Boost_FIND_COMPONENTS Boost_NUM_COMPONENTS_WANTED) + list(LENGTH _Boost_MISSING_COMPONENTS Boost_NUM_MISSING_COMPONENTS) + if (${Boost_NUM_COMPONENTS_WANTED} EQUAL ${Boost_NUM_MISSING_COMPONENTS}) + set(Boost_ERROR_REASON + "${Boost_ERROR_REASON}No Boost libraries were found. You may need to set Boost_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT to the location of Boost.") + else (${Boost_NUM_COMPONENTS_WANTED} EQUAL ${Boost_NUM_MISSING_COMPONENTS}) + set(Boost_ERROR_REASON + "${Boost_ERROR_REASON}Some (but not all) of the required Boost libraries were found. You may need to install these additional Boost libraries. Alternatively, set Boost_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT to the location of Boost.") + endif (${Boost_NUM_COMPONENTS_WANTED} EQUAL ${Boost_NUM_MISSING_COMPONENTS}) + endif (_Boost_MISSING_COMPONENTS) + + IF( NOT Boost_LIBRARY_DIRS AND NOT _boost_CHECKED_COMPONENT ) + # Compatibility Code for backwards compatibility with CMake + # 2.4's FindBoost module. + + # Look for the boost library path. + # Note that the user may not have installed any libraries + # so it is quite possible the Boost_LIBRARY_PATH may not exist. + SET(_boost_LIB_DIR ${Boost_INCLUDE_DIR}) + + IF("${_boost_LIB_DIR}" MATCHES "boost-[0-9]+") + GET_FILENAME_COMPONENT(_boost_LIB_DIR ${_boost_LIB_DIR} PATH) + ENDIF ("${_boost_LIB_DIR}" MATCHES "boost-[0-9]+") + + IF("${_boost_LIB_DIR}" MATCHES "/include$") + # Strip off the trailing "/include" in the path. + GET_FILENAME_COMPONENT(_boost_LIB_DIR ${_boost_LIB_DIR} PATH) + ENDIF("${_boost_LIB_DIR}" MATCHES "/include$") + + IF(EXISTS "${_boost_LIB_DIR}/lib") + SET (_boost_LIB_DIR ${_boost_LIB_DIR}/lib) + ELSE(EXISTS "${_boost_LIB_DIR}/lib") + IF(EXISTS "${_boost_LIB_DIR}/stage/lib") + SET(_boost_LIB_DIR ${_boost_LIB_DIR}/stage/lib) + ELSE(EXISTS "${_boost_LIB_DIR}/stage/lib") + SET(_boost_LIB_DIR "") + ENDIF(EXISTS "${_boost_LIB_DIR}/stage/lib") + ENDIF(EXISTS "${_boost_LIB_DIR}/lib") + + IF(_boost_LIB_DIR AND EXISTS "${_boost_LIB_DIR}") + SET(Boost_LIBRARY_DIRS ${_boost_LIB_DIR} CACHE FILEPATH "Boost library directory") + ENDIF(_boost_LIB_DIR AND EXISTS "${_boost_LIB_DIR}") + + ENDIF( NOT Boost_LIBRARY_DIRS AND NOT _boost_CHECKED_COMPONENT ) + + ELSE(Boost_INCLUDE_DIR) + SET( Boost_FOUND FALSE) + ENDIF(Boost_INCLUDE_DIR) + + IF (Boost_FOUND) + IF (NOT Boost_FIND_QUIETLY) + MESSAGE(STATUS "Boost version: ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}") + ENDIF(NOT Boost_FIND_QUIETLY) + IF (NOT Boost_FIND_QUIETLY) + MESSAGE(STATUS "Found the following Boost libraries:") + ENDIF(NOT Boost_FIND_QUIETLY) + FOREACH ( COMPONENT ${Boost_FIND_COMPONENTS} ) + STRING( TOUPPER ${COMPONENT} UPPERCOMPONENT ) + IF ( Boost_${UPPERCOMPONENT}_FOUND ) + IF (NOT Boost_FIND_QUIETLY) + MESSAGE (STATUS " ${COMPONENT}") + ENDIF(NOT Boost_FIND_QUIETLY) + SET(Boost_LIBRARIES ${Boost_LIBRARIES} ${Boost_${UPPERCOMPONENT}_LIBRARY}) + ENDIF ( Boost_${UPPERCOMPONENT}_FOUND ) + ENDFOREACH(COMPONENT) + else() + if(Boost_FIND_REQUIRED) + message(SEND_ERROR "Unable to find the requested Boost libraries.\n${Boost_ERROR_REASON}") + else() + if(NOT Boost_FIND_QUIETLY) + # we opt not to automatically output Boost_ERROR_REASON here as + # it could be quite lengthy and somewhat imposing in it's requests + # Since Boost is not always a required dependency we'll leave this + # up to the end-user. + if(Boost_DEBUG OR Boost_DETAILED_FAILURE_MSG) + message(STATUS "Could NOT find Boost\n${Boost_ERROR_REASON}") + else() + message(STATUS "Could NOT find Boost") + endif() + endif() + endif(Boost_FIND_REQUIRED) + endif() + + # show the Boost_INCLUDE_DIRS AND Boost_LIBRARIES variables only in the advanced view + MARK_AS_ADVANCED(Boost_INCLUDE_DIR + Boost_INCLUDE_DIRS + Boost_LIBRARY_DIRS + ) +ENDIF(_boost_IN_CACHE) + diff --git a/cmake/modules/FindCLucene.cmake b/cmake/modules/FindCLucene.cmake new file mode 100644 index 0000000000..b7c0e862bc --- /dev/null +++ b/cmake/modules/FindCLucene.cmake @@ -0,0 +1,97 @@ +# +# This module looks for clucene (http://clucene.sf.net) support +# It will define the following values +# +# CLUCENE_INCLUDE_DIR = where CLucene/StdHeader.h can be found +# CLUCENE_LIBRARY_DIR = where CLucene/clucene-config.h can be found +# CLUCENE_LIBRARY = the library to link against CLucene +# CLUCENE_VERSION = The CLucene version string +# CLucene_FOUND = set to 1 if clucene is found +# + +INCLUDE(CheckSymbolExists) +INCLUDE(FindLibraryWithDebug) + +if(NOT CLUCENE_MIN_VERSION) + set(CLUCENE_MIN_VERSION "0.9.19") +endif(NOT CLUCENE_MIN_VERSION) + +IF(EXISTS ${PROJECT_CMAKE}/CLuceneConfig.cmake) + INCLUDE(${PROJECT_CMAKE}/CLuceneConfig.cmake) +ENDIF(EXISTS ${PROJECT_CMAKE}/CLuceneConfig.cmake) + +SET(TRIAL_LIBRARY_PATHS + $ENV{CLUCENE_HOME}/lib${LIB_SUFFIX} + ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX} + /usr/local/lib${LIB_SUFFIX} + /usr/lib${LIB_SUFFIX} + /sw/lib${LIB_SUFFIX} + /usr/pkg/lib${LIB_SUFFIX} + ) +SET(TRIAL_INCLUDE_PATHS + $ENV{CLUCENE_HOME}/include + ${CMAKE_INSTALL_PREFIX}/include + /usr/local/include + /usr/include + /sw/include + /usr/pkg/include + ) +FIND_LIBRARY_WITH_DEBUG(CLUCENE_LIBRARY + WIN32_DEBUG_POSTFIX d + NAMES clucene clucene-core + PATHS ${TRIAL_LIBRARY_PATHS}) +IF (CLUCENE_LIBRARY) + MESSAGE(STATUS "Found CLucene library: ${CLUCENE_LIBRARY}") +ENDIF (CLUCENE_LIBRARY) +FIND_PATH(CLUCENE_INCLUDE_DIR + NAMES CLucene.h + PATHS ${TRIAL_INCLUDE_PATHS}) + +IF (CLUCENE_INCLUDE_DIR) + MESSAGE(STATUS "Found CLucene include dir: ${CLUCENE_INCLUDE_DIR}") +ENDIF (CLUCENE_INCLUDE_DIR) + +IF(WIN32) + SET(TRIAL_LIBRARY_PATHS ${CLUCENE_INCLUDE_DIR}) +ENDIF(WIN32) + +SET(CLUCENE_GOOD_VERSION TRUE) + +FIND_PATH(CLUCENE_LIBRARY_DIR + NAMES CLucene/clucene-config.h PATHS ${TRIAL_LIBRARY_PATHS} ${TRIAL_INCLUDE_PATHS} NO_DEFAULT_PATH) +IF (CLUCENE_LIBRARY_DIR) + MESSAGE(STATUS "Found CLucene library dir: ${CLUCENE_LIBRARY_DIR}") + FILE(READ ${CLUCENE_LIBRARY_DIR}/CLucene/clucene-config.h CLCONTENT) + STRING(REGEX MATCH "_CL_VERSION +\".*\"" CLMATCH ${CLCONTENT}) + IF (CLMATCH) + STRING(REGEX REPLACE "_CL_VERSION +\"(.*)\"" "\\1" CLUCENE_VERSION ${CLMATCH}) + IF (CLUCENE_VERSION STRLESS "${CLUCENE_MIN_VERSION}") + MESSAGE(ERROR " CLucene version ${CLUCENE_VERSION} is less than the required minimum ${CLUCENE_MIN_VERSION}") + SET(CLUCENE_GOOD_VERSION FALSE) + ENDIF (CLUCENE_VERSION STRLESS "${CLUCENE_MIN_VERSION}") + IF (CLUCENE_VERSION STREQUAL "0.9.17") + MESSAGE(ERROR "CLucene version 0.9.17 is not supported.") + SET(CLUCENE_GOOD_VERSION FALSE) + ENDIF (CLUCENE_VERSION STREQUAL "0.9.17") + ENDIF (CLMATCH) +ENDIF (CLUCENE_LIBRARY_DIR) + +IF(CLUCENE_INCLUDE_DIR AND CLUCENE_LIBRARY AND CLUCENE_LIBRARY_DIR AND CLUCENE_GOOD_VERSION) + SET(CLucene_FOUND TRUE) +ENDIF(CLUCENE_INCLUDE_DIR AND CLUCENE_LIBRARY AND CLUCENE_LIBRARY_DIR AND CLUCENE_GOOD_VERSION) + +IF(CLucene_FOUND) + IF(NOT CLucene_FIND_QUIETLY) + MESSAGE(STATUS "Found CLucene: ${CLUCENE_LIBRARY} version ${CLUCENE_VERSION}") + ENDIF(NOT CLucene_FIND_QUIETLY) +ELSE(CLucene_FOUND) + IF(CLucene_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "Could not find CLucene.") + ENDIF(CLucene_FIND_REQUIRED) +ENDIF(CLucene_FOUND) + +MARK_AS_ADVANCED( + CLUCENE_INCLUDE_DIR + CLUCENE_LIBRARY_DIR + CLUCENE_LIBRARY + ) diff --git a/cmake/modules/FindCarbon.cmake b/cmake/modules/FindCarbon.cmake new file mode 100644 index 0000000000..2b0d979ea9 --- /dev/null +++ b/cmake/modules/FindCarbon.cmake @@ -0,0 +1,22 @@ +# - Find Carbon on Mac +# +# CARBON_LIBRARY - the library to use Carbon +# CARBON_FOUND - true if Carbon has been found + +# Copyright (c) 2006, Benjamin Reed, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +include(CMakeFindFrameworks) + +cmake_find_frameworks(Carbon) + +if (Carbon_FRAMEWORKS) + set(CARBON_LIBRARY "-framework Carbon" CACHE FILEPATH "Carbon framework" FORCE) + set(CARBON_FOUND 1) +endif (Carbon_FRAMEWORKS) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Carbon DEFAULT_MSG CARBON_LIBRARY) + diff --git a/cmake/modules/FindDNSSD.cmake b/cmake/modules/FindDNSSD.cmake new file mode 100644 index 0000000000..8604bd570e --- /dev/null +++ b/cmake/modules/FindDNSSD.cmake @@ -0,0 +1,48 @@ +# - Try to find DNSSD +# Once done this will define +# +# DNSSD_FOUND - system has DNSSD +# DNSSD_INCLUDE_DIR - the DNSSD include directory +# DNSSD_LIBRARIES - Link these to use dnssd +# DNSSD_DEFINITIONS - Compiler switches required for using DNSSD +# +# need more test: look at into dnssd/configure.in.in + +# Copyright (c) 2006, Laurent Montel, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +FIND_PATH(DNSSD_INCLUDE_DIR dns_sd.h + /usr/include/avahi-compat-libdns_sd/ +) + +if (DNSSD_INCLUDE_DIR) + if (APPLE) + set(DNSSD_LIBRARIES "/usr/lib/libSystem.dylib") + else (APPLE) + FIND_LIBRARY(DNSSD_LIBRARIES NAMES dns_sd ) + endif (APPLE) + + MACRO_PUSH_REQUIRED_VARS() + set(CMAKE_REQUIRED_INCLUDES ${DNSSD_INCLUDE_DIR}) + set(CMAKE_REQUIRED_LIBRARIES ${DNSSD_LIBRARIES}) + CHECK_FUNCTION_EXISTS(DNSServiceRefDeallocate DNSSD_FUNCTION_FOUND) + MACRO_POP_REQUIRED_VARS() + + if (DNSSD_INCLUDE_DIR AND DNSSD_LIBRARIES AND DNSSD_FUNCTION_FOUND) + set(DNSSD_FOUND TRUE) + endif (DNSSD_INCLUDE_DIR AND DNSSD_LIBRARIES AND DNSSD_FUNCTION_FOUND) +endif (DNSSD_INCLUDE_DIR) + +if (DNSSD_FOUND) + if (NOT DNSSD_FIND_QUIETLY) + message(STATUS "Found DNSSD: ${DNSSD_LIBRARIES}") + endif (NOT DNSSD_FIND_QUIETLY) +else (DNSSD_FOUND) + if (DNSSD_FIND_REQUIRED) + message(FATAL_ERROR "Could NOT find DNSSD") + endif (DNSSD_FIND_REQUIRED) +endif (DNSSD_FOUND) + +MARK_AS_ADVANCED(DNSSD_INCLUDE_DIR DNSSD_LIBRARIES) diff --git a/cmake/modules/FindENCHANT.cmake b/cmake/modules/FindENCHANT.cmake new file mode 100644 index 0000000000..0b30f32607 --- /dev/null +++ b/cmake/modules/FindENCHANT.cmake @@ -0,0 +1,44 @@ +# - Try to find the Enchant spell checker +# Once done this will define +# +# ENCHANT_FOUND - system has ENCHANT +# ENCHANT_INCLUDE_DIR - the ENCHANT include directory +# ENCHANT_LIBRARIES - Link these to use ENCHANT +# ENCHANT_DEFINITIONS - Compiler switches required for using ENCHANT + +# Copyright (c) 2006, Zack Rusin, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + + +if (ENCHANT_INCLUDE_DIR AND ENCHANT_LIBRARIES) + + # in cache already + set(ENCHANT_FOUND TRUE) + +else (ENCHANT_INCLUDE_DIR AND ENCHANT_LIBRARIES) + if (NOT WIN32) + # use pkg-config to get the directories and then use these values + # in the FIND_PATH() and FIND_LIBRARY() calls + find_package(PkgConfig) + pkg_check_modules(PC_ENCHANT enchant) + set(ENCHANT_DEFINITIONS ${PC_ENCHANT_CFLAGS_OTHER}) + endif (NOT WIN32) + + find_path(ENCHANT_INCLUDE_DIR + NAMES enchant++.h + HINTS ${PC_ENCHANT_INCLUDEDIR} + ${PC_ENCHANT_INCLUDE_DIRS} + PATH_SUFFIXES enchant ) + + find_library(ENCHANT_LIBRARIES NAMES enchant + HINTS ${PC_ENCHANT_LIBDIR} + ${PC_ENCHANT_LIBRARY_DIRS} ) + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(ENCHANT DEFAULT_MSG ENCHANT_INCLUDE_DIR ENCHANT_LIBRARIES ) + + mark_as_advanced(ENCHANT_INCLUDE_DIR ENCHANT_LIBRARIES) + +endif (ENCHANT_INCLUDE_DIR AND ENCHANT_LIBRARIES) diff --git a/cmake/modules/FindEigen.cmake b/cmake/modules/FindEigen.cmake new file mode 100644 index 0000000000..c65cb8dc5a --- /dev/null +++ b/cmake/modules/FindEigen.cmake @@ -0,0 +1,33 @@ +# Note that Eigen1 is deprecated in favor of Eigen2. So this file is deprecated +# in favor of FindEigen2.cmake. It is kept only for compatibility. +# +# - Try to find Eigen1 library +# Once done this will define +# +# EIGEN_FOUND - system has eigen lib +# EIGEN_INCLUDE_DIR - the eigen include directory + +# Copyright (c) 2006, 2007 Montel Laurent, +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +if (EIGEN_INCLUDE_DIR) + + # in cache already + set(EIGEN_FOUND TRUE) + +else (EIGEN_INCLUDE_DIR) + +find_path(EIGEN_INCLUDE_DIR NAMES eigen/matrix.h + PATHS + ${INCLUDE_INSTALL_DIR} + ) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Eigen DEFAULT_MSG EIGEN_INCLUDE_DIR ) + + +mark_as_advanced(EIGEN_INCLUDE_DIR) + +endif(EIGEN_INCLUDE_DIR) + diff --git a/cmake/modules/FindEigen2.cmake b/cmake/modules/FindEigen2.cmake new file mode 100644 index 0000000000..2579a6c9c0 --- /dev/null +++ b/cmake/modules/FindEigen2.cmake @@ -0,0 +1,32 @@ +# - Try to find Eigen2 lib +# Once done this will define +# +# EIGEN2_FOUND - system has eigen lib +# EIGEN2_INCLUDE_DIR - the eigen include directory + +# Copyright (c) 2006, 2007 Montel Laurent, +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +if (EIGEN2_INCLUDE_DIR) + + # in cache already + set(EIGEN2_FOUND TRUE) + +else (EIGEN2_INCLUDE_DIR) + +find_path(EIGEN2_INCLUDE_DIR NAMES Eigen/Core + PATHS + ${INCLUDE_INSTALL_DIR} + ${KDE4_INCLUDE_DIR} + PATH_SUFFIXES eigen2 + ) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Eigen2 DEFAULT_MSG EIGEN2_INCLUDE_DIR ) + + +mark_as_advanced(EIGEN2_INCLUDE_DIR) + +endif(EIGEN2_INCLUDE_DIR) + diff --git a/cmake/modules/FindExiv2.cmake b/cmake/modules/FindExiv2.cmake new file mode 100644 index 0000000000..693f5465b6 --- /dev/null +++ b/cmake/modules/FindExiv2.cmake @@ -0,0 +1,92 @@ +# - Try to find the Exiv2 library +# +# EXIV2_MIN_VERSION - You can set this variable to the minimum version you need +# before doing FIND_PACKAGE(Exiv2). The default is 0.12. +# +# Once done this will define +# +# EXIV2_FOUND - system has libexiv2 +# EXIV2_INCLUDE_DIR - the libexiv2 include directory +# EXIV2_LIBRARIES - Link these to use libexiv2 +# EXIV2_DEFINITIONS - Compiler switches required for using libexiv2 +# + +# Copyright (c) 2008, Gilles Caulier, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + + +if (EXIV2_INCLUDE_DIR AND EXIV2_LIBRARIES) + + # in cache already + set(EXIV2_FOUND TRUE) + +else (EXIV2_INCLUDE_DIR AND EXIV2_LIBRARIES) + if (NOT WIN32) + # use pkg-config to get the directories and then use these values + # in the FIND_PATH() and FIND_LIBRARY() calls + include(UsePkgConfig) + + if(NOT EXIV2_MIN_VERSION) + set(EXIV2_MIN_VERSION "0.12") + endif(NOT EXIV2_MIN_VERSION) + + pkgconfig(exiv2 _EXIV2IncDir _EXIV2LinkDir _EXIV2LinkFlags _EXIV2Cflags) + + if(_EXIV2LinkFlags) + # query pkg-config asking for a Exiv2 >= 0.12 + exec_program(${PKGCONFIG_EXECUTABLE} ARGS --atleast-version=${EXIV2_MIN_VERSION} exiv2 RETURN_VALUE _return_VALUE OUTPUT_VARIABLE _pkgconfigDevNull ) + if(_return_VALUE STREQUAL "0") + message(STATUS "Found Exiv2 release >= ${EXIV2_MIN_VERSION}") + set(EXIV2_VERSION_GOOD_FOUND TRUE) + else(_return_VALUE STREQUAL "0") + message(STATUS "Found Exiv2 release < ${EXIV2_MIN_VERSION}") + endif(_return_VALUE STREQUAL "0") + else(_EXIV2LinkFlags) + set(EXIV2_FOUND FALSE) + set(EXIV2_VERSION_GOOD_FOUND FALSE) + message(STATUS "Cannot find Exiv2 library!") + endif(_EXIV2LinkFlags) + + else(NOT WIN32) + #Better check + set(EXIV2_VERSION_GOOD_FOUND TRUE) + endif (NOT WIN32) + + if(EXIV2_VERSION_GOOD_FOUND) + set(EXIV2_DEFINITIONS ${_EXIV2Cflags}) + + find_path(EXIV2_INCLUDE_DIR exiv2/exif.hpp + ${_EXIV2IncDir} + ) + + find_library(EXIV2_LIBRARIES NAMES exiv2 libexiv2 + PATHS + ${_EXIV2LinkDir} + ) + + if (EXIV2_INCLUDE_DIR AND EXIV2_LIBRARIES) + set(EXIV2_FOUND TRUE) + # TODO version check is missing + endif (EXIV2_INCLUDE_DIR AND EXIV2_LIBRARIES) + endif(EXIV2_VERSION_GOOD_FOUND) + if (EXIV2_FOUND) + if (NOT Exiv2_FIND_QUIETLY) + message(STATUS "Found Exiv2: ${EXIV2_LIBRARIES}") + endif (NOT Exiv2_FIND_QUIETLY) + else (EXIV2_FOUND) + if (Exiv2_FIND_REQUIRED) + if (NOT EXIV2_INCLUDE_DIR) + message(FATAL_ERROR "Could NOT find Exiv2 header files") + endif (NOT EXIV2_INCLUDE_DIR) + if (NOT EXIV2_LIBRARIES) + message(FATAL_ERROR "Could NOT find Exiv2 library") + endif (NOT EXIV2_LIBRARIES) + endif (Exiv2_FIND_REQUIRED) + endif (EXIV2_FOUND) + + mark_as_advanced(EXIV2_INCLUDE_DIR EXIV2_LIBRARIES) + +endif (EXIV2_INCLUDE_DIR AND EXIV2_LIBRARIES) + diff --git a/cmake/modules/FindFAM.cmake b/cmake/modules/FindFAM.cmake new file mode 100644 index 0000000000..8ebb3ab6f3 --- /dev/null +++ b/cmake/modules/FindFAM.cmake @@ -0,0 +1,27 @@ +# - Try to find the FAM directory notification library +# Once done this will define +# +# FAM_FOUND - system has FAM +# FAM_INCLUDE_DIR - the FAM include directory +# FAM_LIBRARIES - The libraries needed to use FAM + +# Copyright (c) 2006, Alexander Neundorf, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + + +if (FAM_INCLUDE_DIR) + # Already in cache, be silent + set(FAM_FIND_QUIETLY TRUE) +endif (FAM_INCLUDE_DIR) + +FIND_PATH(FAM_INCLUDE_DIR fam.h) + +FIND_LIBRARY(FAM_LIBRARIES NAMES fam ) + +include(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(FAM DEFAULT_MSG FAM_INCLUDE_DIR FAM_LIBRARIES ) + +MARK_AS_ADVANCED(FAM_INCLUDE_DIR FAM_LIBRARIES) + diff --git a/cmake/modules/FindFFmpeg.cmake b/cmake/modules/FindFFmpeg.cmake new file mode 100644 index 0000000000..d6259b0c52 --- /dev/null +++ b/cmake/modules/FindFFmpeg.cmake @@ -0,0 +1,116 @@ +# - Try to find ffmpeg +# Once done this will define +# +# FFMPEG_FOUND - system has ffmpeg +# FFMPEG_INCLUDE_DIR - Include directory necessary for using the ffmpeg headers +# FFMPEG_LIBRARIES - Link these to use ffmpeg +# FFMPEG_DEFINITIONS - Compiler switches required for using ffmpeg + +# Copyright (c) 2006, Matthias Kretz, +# Copyright (c) 2008, Alexander Neundorf, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + + +if (FFMPEG_LIBRARIES) + + # in cache already + set(FFMPEG_FOUND TRUE) + +else (FFMPEG_LIBRARIES) + +if (NOT WIN32) + # use pkg-config to get the directories and then use these values + # in the FIND_PATH() and FIND_LIBRARY() calls + find_package(PkgConfig) + pkg_check_modules(PC_LIBAVCODEC libavcodec) + set(FFMPEG_DEFINITIONS ${PC_LIBAVCODEC_CFLAGS_OTHER}) + +endif (NOT WIN32) + + # + # #include is the new style for FFMPEG headers + # This has been verified at least since 0.4.9 + # Please do not change to the old format, since this will break for + # people who are using newer versions. Instead, upgrade your ffmpeg + # installation. + # + find_path(FFMPEG_INCLUDE_DIR libavcodec/avcodec.h + HINTS + ${PC_LIBAVCODEC_INCLUDEDIR} + ${PC_LIBAVCODEC_INCLUDE_DIRS} + ) + + # also search for the old style include dir, just for the purpose + # of giving a useful error message if an old libavcodec is installed + # and the user might wonder why it is not found + find_path(FFMPEG_INCLUDE_DIR_OLD_STYLE ffmpeg/avcodec.h + HINTS + ${PC_LIBAVCODEC_INCLUDEDIR} + ${PC_LIBAVCODEC_INCLUDE_DIRS} + ) + + find_library(AVCODEC_LIBRARIES NAMES avcodec + HINTS + ${PC_LIBAVCODEC_LIBDIR} + ${PC_LIBAVCODEC_LIBRARY_DIRS} + ) + + find_library(AVFORMAT_LIBRARIES NAMES avformat + HINTS + ${PC_LIBAVCODEC_LIBDIR} + ${PC_LIBAVCODEC_LIBRARY_DIRS} + ) + + find_library(AVUTIL_LIBRARIES NAMES avutil + HINTS + ${PC_LIBAVCODEC_LIBDIR} + ${PC_LIBAVCODEC_LIBRARY_DIRS} + ) + + + + set(FFMPEG_LIBRARIES ) + if (AVCODEC_LIBRARIES) + set(FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} ${AVCODEC_LIBRARIES}) + endif (AVCODEC_LIBRARIES) + + if (AVFORMAT_LIBRARIES) + set(FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} ${AVFORMAT_LIBRARIES}) + endif (AVFORMAT_LIBRARIES) + + if (AVUTIL_LIBRARIES) + set(FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} ${AVUTIL_LIBRARIES}) + endif (AVUTIL_LIBRARIES) + + if (FFMPEG_LIBRARIES AND FFMPEG_INCLUDE_DIR) + set(FFMPEG_FOUND TRUE) + endif (FFMPEG_LIBRARIES AND FFMPEG_INCLUDE_DIR) + + if (FFMPEG_FOUND) + if (NOT FFmpeg_FIND_QUIETLY) + message(STATUS "Found FFMPEG: ${FFMPEG_LIBRARIES} ${FFMPEG_INCLUDE_DIR}") + endif (NOT FFmpeg_FIND_QUIETLY) + else (FFMPEG_FOUND) + # only an old libavcodec was found ? + if (FFMPEG_INCLUDE_DIR_OLD_STYLE AND NOT FFMPEG_INCLUDE_DIR AND NOT FFmpeg_FIND_QUIETLY) + message(STATUS "Found old version of libavcodec, but a newer version is required.") + endif (FFMPEG_INCLUDE_DIR_OLD_STYLE AND NOT FFMPEG_INCLUDE_DIR AND NOT FFmpeg_FIND_QUIETLY) + + if (FFmpeg_FIND_REQUIRED) + message(FATAL_ERROR "Could NOT find FFMPEG") + else (FFmpeg_FIND_REQUIRED) + if (NOT FFmpeg_FIND_QUIETLY) + message(STATUS "Could NOT find FFMPEG") + endif (NOT FFmpeg_FIND_QUIETLY) + endif (FFmpeg_FIND_REQUIRED) + endif (FFMPEG_FOUND) + + mark_as_advanced(AVCODEC_LIBRARIES + AVFORMAT_LIBRARIES + AVUTIL_LIBRARIES + FFMPEG_INCLUDE_DIR + FFMPEG_INCLUDE_DIR_OLD_STYLE) + +endif (FFMPEG_LIBRARIES)# AND FFMPEG_DEFINITIONS) diff --git a/cmake/modules/FindFlac.cmake b/cmake/modules/FindFlac.cmake new file mode 100644 index 0000000000..56b3eef912 --- /dev/null +++ b/cmake/modules/FindFlac.cmake @@ -0,0 +1,55 @@ +# - Try to find Flac, the Free Lossless Audio Codec +# Once done this will define +# +# FLAC_FOUND - system has Flac +# FLAC_INCLUDE_DIR - the Flac include directory +# FLAC_LIBRARIES - Link these to use Flac +# FLAC_OGGFLAC_LIBRARIES - Link these to use OggFlac +# +# No version checking is done - use FLAC_API_VERSION_CURRENT to +# conditionally compile version-dependent code + +# Copyright (c) 2006, Laurent Montel, +# Copyright (c) 2006, Alexander Neundorf, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +if(FLAC_INCLUDE_DIR AND FLAC_LIBRARIES) + # Already in cache, be silent + set(Flac_FIND_QUIETLY TRUE) +endif(FLAC_INCLUDE_DIR AND FLAC_LIBRARIES) + +FIND_PATH(FLAC_INCLUDE_DIR FLAC/metadata.h) + +FIND_LIBRARY(FLAC_LIBRARIES NAMES FLAC ) + +FIND_LIBRARY(FLAC_OGG_LIBRARY NAMES OggFLAC) + + + +IF(FLAC_INCLUDE_DIR AND FLAC_LIBRARIES) + SET(FLAC_FOUND TRUE) + IF (FLAC_OGG_LIBRARY) + SET(FLAC_OGGFLAC_LIBRARIES ${FLAC_OGG_LIBRARY} ${FLAC_LIBRARIES}) + ENDIF (FLAC_OGG_LIBRARY) +ELSE(FLAC_INCLUDE_DIR AND FLAC_LIBRARIES) + SET(FLAC_FOUND FALSE) +ENDIF(FLAC_INCLUDE_DIR AND FLAC_LIBRARIES) + +IF(FLAC_FOUND) + IF(NOT Flac_FIND_QUIETLY) + MESSAGE(STATUS "Found Flac: ${FLAC_LIBRARIES}") + ENDIF(NOT Flac_FIND_QUIETLY) +ELSE(FLAC_FOUND) + IF(Flac_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "Could not find Flac") + ENDIF(Flac_FIND_REQUIRED) + IF(NOT Flac_FIND_QUIETLY) + MESSAGE(STATUS "Could not find Flac") + ENDIF(NOT Flac_FIND_QUIETLY) +ENDIF(FLAC_FOUND) + +# show the FLAC_INCLUDE_DIR and FLAC_LIBRARIES variables only in the advanced view +MARK_AS_ADVANCED(FLAC_INCLUDE_DIR FLAC_LIBRARIES FLAC_OGG_LIBRARY) + diff --git a/cmake/modules/FindFlex.cmake b/cmake/modules/FindFlex.cmake new file mode 100644 index 0000000000..a2db98642f --- /dev/null +++ b/cmake/modules/FindFlex.cmake @@ -0,0 +1,40 @@ +# - Try to find Flex +# Once done this will define +# +# FLEX_FOUND - system has Flex +# FLEX_EXECUTABLE - path of the flex executable +# FLEX_VERSION - the version string, like "2.5.31" + + +# Copyright (c) 2008, Jakob Petsovits, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +FIND_PROGRAM(FLEX_EXECUTABLE NAMES flex) + +INCLUDE(MacroEnsureVersion) + +IF(FLEX_EXECUTABLE) + SET(FLEX_FOUND TRUE) + + EXECUTE_PROCESS(COMMAND ${FLEX_EXECUTABLE} --version + OUTPUT_VARIABLE _FLEX_VERSION + ) + string (REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" FLEX_VERSION "${_FLEX_VERSION}") +ENDIF(FLEX_EXECUTABLE) + +FIND_PATH(FLEX_INCLUDE_DIR FlexLexer.h ) +FIND_LIBRARY(FLEX_LIBRARY fl) + +IF(FLEX_FOUND) + IF(NOT Flex_FIND_QUIETLY) + MESSAGE(STATUS "Found Flex: ${FLEX_EXECUTABLE} ${FLEX_VERSION}") + ENDIF(NOT Flex_FIND_QUIETLY) +ELSE(FLEX_FOUND) + IF(Flex_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "Could not find Flex") + ENDIF(Flex_FIND_REQUIRED) +ENDIF(FLEX_FOUND) + +MARK_AS_ADVANCED(FLEX_INCLUDE_DIR FLEX_LIBRARY FLEX_EXECUTABLE) diff --git a/cmake/modules/FindFontconfig.cmake b/cmake/modules/FindFontconfig.cmake new file mode 100644 index 0000000000..268a61aea7 --- /dev/null +++ b/cmake/modules/FindFontconfig.cmake @@ -0,0 +1,50 @@ +# - Try to find the Fontconfig +# Once done this will define +# +# FONTCONFIG_FOUND - system has Fontconfig +# FONTCONFIG_INCLUDE_DIR - The include directory to use for the fontconfig headers +# FONTCONFIG_LIBRARIES - Link these to use FONTCONFIG +# FONTCONFIG_DEFINITIONS - Compiler switches required for using FONTCONFIG + +# Copyright (c) 2006,2007 Laurent Montel, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + + +if (FONTCONFIG_LIBRARIES AND FONTCONFIG_INCLUDE_DIR) + + # in cache already + set(FONTCONFIG_FOUND TRUE) + +else (FONTCONFIG_LIBRARIES AND FONTCONFIG_INCLUDE_DIR) + + if (NOT WIN32) + # use pkg-config to get the directories and then use these values + # in the FIND_PATH() and FIND_LIBRARY() calls + find_package(PkgConfig) + pkg_check_modules(PC_FONTCONFIG fontconfig) + + set(FONTCONFIG_DEFINITIONS ${PC_FONTCONFIG_CFLAGS_OTHER}) + endif (NOT WIN32) + + find_path(FONTCONFIG_INCLUDE_DIR fontconfig/fontconfig.h + PATHS + ${PC_FONTCONFIG_INCLUDEDIR} + ${PC_FONTCONFIG_INCLUDE_DIRS} + /usr/X11/include + ) + + find_library(FONTCONFIG_LIBRARIES NAMES fontconfig + PATHS + ${PC_FONTCONFIG_LIBDIR} + ${PC_FONTCONFIG_LIBRARY_DIRS} + ) + + include(FindPackageHandleStandardArgs) + FIND_PACKAGE_HANDLE_STANDARD_ARGS(Fontconfig DEFAULT_MSG FONTCONFIG_LIBRARIES FONTCONFIG_INCLUDE_DIR ) + + mark_as_advanced(FONTCONFIG_LIBRARIES FONTCONFIG_INCLUDE_DIR) + +endif (FONTCONFIG_LIBRARIES AND FONTCONFIG_INCLUDE_DIR) + diff --git a/cmake/modules/FindFreetype.cmake b/cmake/modules/FindFreetype.cmake new file mode 100644 index 0000000000..61e44a1fbd --- /dev/null +++ b/cmake/modules/FindFreetype.cmake @@ -0,0 +1,73 @@ +# - Try to find the freetype library +# Once done this will define +# +# FREETYPE_FOUND - system has Freetype +# FREETYPE_INCLUDE_DIRS - the FREETYPE include directories +# FREETYPE_LIBRARIES - Link these to use FREETYPE +# FREETYPE_INCLUDE_DIR - internal + +# Copyright (c) 2006, Laurent Montel, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + + +if (FREETYPE_LIBRARIES AND FREETYPE_INCLUDE_DIR) + + # in cache already + set(FREETYPE_FOUND TRUE) + +else (FREETYPE_LIBRARIES AND FREETYPE_INCLUDE_DIR) + + find_program(FREETYPECONFIG_EXECUTABLE NAMES freetype-config PATHS + /opt/local/bin + ) + + #reset vars + set(FREETYPE_LIBRARIES) + set(FREETYPE_INCLUDE_DIR) + + # if freetype-config has been found + if(FREETYPECONFIG_EXECUTABLE) + + exec_program(${FREETYPECONFIG_EXECUTABLE} ARGS --libs RETURN_VALUE _return_VALUE OUTPUT_VARIABLE FREETYPE_LIBRARIES) + + exec_program(${FREETYPECONFIG_EXECUTABLE} ARGS --cflags RETURN_VALUE _return_VALUE OUTPUT_VARIABLE _freetype_pkgconfig_output) + if(FREETYPE_LIBRARIES AND _freetype_pkgconfig_output) + set(FREETYPE_FOUND TRUE) + + # freetype-config can print out more than one -I, so we need to chop it up + # into a list and process each entry separately + separate_arguments(_freetype_pkgconfig_output) + foreach(value ${_freetype_pkgconfig_output}) + string(REGEX REPLACE "-I(.+)" "\\1" value "${value}") + set(FREETYPE_INCLUDE_DIR ${FREETYPE_INCLUDE_DIR} ${value}) + endforeach(value) + endif(FREETYPE_LIBRARIES AND _freetype_pkgconfig_output) + + set( FREETYPE_LIBRARIES ${FREETYPE_LIBRARIES} ) + + mark_as_advanced(FREETYPE_LIBRARIES FREETYPE_INCLUDE_DIR) + + else(FREETYPECONFIG_EXECUTABLE) + find_path (FREETYPE_INCLUDE_DIR freetype/freetype.h PATH_SUFFIXES freetype2) + find_library(FREETYPE_LIBRARIES freetype) + if(FREETYPE_INCLUDE_DIR AND FREETYPE_LIBRARIES) + set(FREETYPE_FOUND TRUE) + endif(FREETYPE_INCLUDE_DIR AND FREETYPE_LIBRARIES) + endif(FREETYPECONFIG_EXECUTABLE) + + + if (FREETYPE_FOUND) + if (NOT Freetype_FIND_QUIETLY) + message(STATUS "Found Freetype: ${FREETYPE_LIBRARIES}") + endif (NOT Freetype_FIND_QUIETLY) + else (FREETYPE_FOUND) + if (Freetype_FIND_REQUIRED) + message(FATAL_ERROR "Could not find FreeType library") + endif (Freetype_FIND_REQUIRED) + endif (FREETYPE_FOUND) + +endif (FREETYPE_LIBRARIES AND FREETYPE_INCLUDE_DIR) + +set(FREETYPE_INCLUDE_DIRS "${FREETYPE_INCLUDE_DIR}") diff --git a/cmake/modules/FindGIF.cmake b/cmake/modules/FindGIF.cmake new file mode 100644 index 0000000000..a46194ab82 --- /dev/null +++ b/cmake/modules/FindGIF.cmake @@ -0,0 +1,39 @@ +# - Try to find GIF +# Once done this will define +# +# GIF_FOUND - system has GIF +# GIF_INCLUDE_DIR - the GIF include directory +# GIF_LIBRARIES - Libraries needed to use GIF +# GIF_DEFINITIONS - Compiler switches required for using GIF + +# Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. +# See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. + +IF (GIF_INCLUDE_DIR AND GIF_LIBRARIES) + # Already in cache, be silent + SET(GIF_FIND_QUIETLY TRUE) +ENDIF (GIF_INCLUDE_DIR AND GIF_LIBRARIES) + +FIND_PATH(GIF_INCLUDE_DIR gif_lib.h) + +SET(POTENTIAL_GIF_LIBS gif libgif ungif libungif giflib) +FIND_LIBRARY(GIF_LIBRARIES NAMES ${POTENTIAL_GIF_LIBS}) + +IF (GIF_INCLUDE_DIR AND GIF_LIBRARIES) + SET(CMAKE_REQUIRED_INCLUDES "${GIF_INCLUDE_DIR}" "${CMAKE_REQUIRED_INCLUDES}") + CHECK_STRUCT_MEMBER(GifFileType UserData gif_lib.h GIF_FOUND) +ENDIF (GIF_INCLUDE_DIR AND GIF_LIBRARIES) + +IF (GIF_FOUND) + IF (NOT GIF_FIND_QUIETLY) + MESSAGE(STATUS "Found GIF: ${GIF_LIBRARIES}") + ENDIF (NOT GIF_FIND_QUIETLY) +ELSE (GIF_FOUND) + IF (GIF_FIND_REQUIRED) + MESSAGE(STATUS "Looked for GIF libraries named ${POTENTIAL_GIF_LIBS}.") + MESSAGE(STATUS "Found no acceptable GIF library. This is fatal.") + MESSAGE(FATAL_ERROR "Could NOT find GIF") + ENDIF (GIF_FIND_REQUIRED) +ENDIF (GIF_FOUND) + +MARK_AS_ADVANCED(GIF_INCLUDE_DIR GIF_LIBRARIES) diff --git a/cmake/modules/FindGLIB2.cmake b/cmake/modules/FindGLIB2.cmake new file mode 100644 index 0000000000..431f2e5e2e --- /dev/null +++ b/cmake/modules/FindGLIB2.cmake @@ -0,0 +1,50 @@ +# - Try to find the GLIB2 libraries +# Once done this will define +# +# GLIB2_FOUND - system has glib2 +# GLIB2_INCLUDE_DIR - the glib2 include directory +# GLIB2_LIBRARIES - glib2 library + +# Copyright (c) 2008 Laurent Montel, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + + +if(GLIB2_INCLUDE_DIR AND GLIB2_LIBRARIES) + # Already in cache, be silent + set(GLIB2_FIND_QUIETLY TRUE) +endif(GLIB2_INCLUDE_DIR AND GLIB2_LIBRARIES) + +if (NOT WIN32) + include(UsePkgConfig) + pkgconfig(glib-2.0 _LibGLIB2IncDir _LibGLIB2LinkDir _LibGLIB2LinkFlags _LibGLIB2Cflags) +endif(NOT WIN32) + +find_path(GLIB2_MAIN_INCLUDE_DIR glib.h + PATH_SUFFIXES glib-2.0 + PATHS ${_LibGLIB2IncDir} ) + +# search the glibconfig.h include dir under the same root where the library is found +find_library(GLIB2_LIBRARIES + NAMES glib-2.0 + PATHS ${_LibGLIB2LinkDir} ) + +get_filename_component(glib2LibDir "${GLIB2_LIBRARIES}" PATH) + +find_path(GLIB2_INTERNAL_INCLUDE_DIR glibconfig.h + PATH_SUFFIXES glib-2.0/include + PATHS ${_LibGLIB2IncDir} "${glib2LibDir}" ${CMAKE_SYSTEM_LIBRARY_PATH}) + +set(GLIB2_INCLUDE_DIR "${GLIB2_MAIN_INCLUDE_DIR}") + +# not sure if this include dir is optional or required +# for now it is optional +if(GLIB2_INTERNAL_INCLUDE_DIR) + set(GLIB2_INCLUDE_DIR ${GLIB2_INCLUDE_DIR} "${GLIB2_INTERNAL_INCLUDE_DIR}") +endif(GLIB2_INTERNAL_INCLUDE_DIR) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(GLIB2 DEFAULT_MSG GLIB2_LIBRARIES GLIB2_MAIN_INCLUDE_DIR) + +mark_as_advanced(GLIB2_INCLUDE_DIR GLIB2_LIBRARIES) diff --git a/cmake/modules/FindGMP.cmake b/cmake/modules/FindGMP.cmake new file mode 100644 index 0000000000..17d175c6ac --- /dev/null +++ b/cmake/modules/FindGMP.cmake @@ -0,0 +1,23 @@ +# Try to find the GMP librairies +# GMP_FOUND - system has GMP lib +# GMP_INCLUDE_DIR - the GMP include directory +# GMP_LIBRARIES - Libraries needed to use GMP + +# Copyright (c) 2006, Laurent Montel, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + + +if (GMP_INCLUDE_DIR AND GMP_LIBRARIES) + # Already in cache, be silent + set(GMP_FIND_QUIETLY TRUE) +endif (GMP_INCLUDE_DIR AND GMP_LIBRARIES) + +find_path(GMP_INCLUDE_DIR NAMES gmp.h ) +find_library(GMP_LIBRARIES NAMES gmp libgmp) + +include(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(GMP DEFAULT_MSG GMP_INCLUDE_DIR GMP_LIBRARIES) + +mark_as_advanced(GMP_INCLUDE_DIR GMP_LIBRARIES) diff --git a/cmake/modules/FindGObject.cmake b/cmake/modules/FindGObject.cmake new file mode 100644 index 0000000000..d9e8df9c64 --- /dev/null +++ b/cmake/modules/FindGObject.cmake @@ -0,0 +1,80 @@ +# - Try to find GObject +# Once done this will define +# +# GOBJECT_FOUND - system has GObject +# GOBJECT_INCLUDE_DIR - the GObject include directory +# GOBJECT_LIBRARIES - the libraries needed to use GObject +# GOBJECT_DEFINITIONS - Compiler switches required for using GObject + +# Copyright (c) 2006, Tim Beaulen +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + + +IF (GOBJECT_INCLUDE_DIR AND GOBJECT_LIBRARIES) + # in cache already + SET(GObject_FIND_QUIETLY TRUE) +ELSE (GOBJECT_INCLUDE_DIR AND GOBJECT_LIBRARIES) + SET(GObject_FIND_QUIETLY FALSE) +ENDIF (GOBJECT_INCLUDE_DIR AND GOBJECT_LIBRARIES) + +IF (NOT WIN32) + # use pkg-config to get the directories and then use these values + # in the FIND_PATH() and FIND_LIBRARY() calls + FIND_PACKAGE(PkgConfig) + PKG_CHECK_MODULES(PC_GOBJECT gobject-2.0) + #MESSAGE(STATUS "DEBUG: GObject include directory = ${GOBJECT_INCLUDE_DIRS}") + #MESSAGE(STATUS "DEBUG: GObject link directory = ${GOBJECT_LIBRARY_DIRS}") + #MESSAGE(STATUS "DEBUG: GObject CFlags = ${GOBJECT_CFLAGS}") + SET(GOBJECT_DEFINITIONS ${PC_GOBJECT_CFLAGS_OTHER}) +ENDIF (NOT WIN32) + +FIND_PATH(GOBJECT_INCLUDE_DIR gobject.h + PATHS + ${PC_GOBJECT_INCLUDEDIR} + ${PC_GOBJECT_INCLUDE_DIRS} + PATH_SUFFIXES glib-2.0/gobject/ + ) + +FIND_LIBRARY(_GObjectLibs NAMES gobject-2.0 + PATHS + ${PC_GOBJECT_LIBDIR} + ${PC_GOBJECT_LIBRARY_DIRS} + ) +FIND_LIBRARY(_GModuleLibs NAMES gmodule-2.0 + PATHS + ${PC_GOBJECT_LIBDIR} + ${PC_GOBJECT_LIBRARY_DIRS} + ) +FIND_LIBRARY(_GThreadLibs NAMES gthread-2.0 + PATHS + ${PC_GOBJECT_LIBDIR} + ${PC_GOBJECT_LIBRARY_DIRS} + ) +FIND_LIBRARY(_GLibs NAMES glib-2.0 + PATHS + ${PC_GOBJECT_LIBDIR} + ${PC_GOBJECT_LIBRARY_DIRS} + ) + +SET( GOBJECT_LIBRARIES ${_GObjectLibs} ${_GModuleLibs} ${_GThreadLibs} ${_GLibs} ) + +IF (GOBJECT_INCLUDE_DIR AND GOBJECT_LIBRARIES) + SET(GOBJECT_FOUND TRUE) +ELSE (GOBJECT_INCLUDE_DIR AND GOBJECT_LIBRARIES) + SET(GOBJECT_FOUND FALSE) +ENDIF (GOBJECT_INCLUDE_DIR AND GOBJECT_LIBRARIES) + +IF (GOBJECT_FOUND) + IF (NOT GObject_FIND_QUIETLY) + MESSAGE(STATUS "Found GObject libraries: ${GOBJECT_LIBRARIES}") + MESSAGE(STATUS "Found GObject includes : ${GOBJECT_INCLUDE_DIR}") + ENDIF (NOT GObject_FIND_QUIETLY) +ELSE (GOBJECT_FOUND) + IF (GObject_FIND_REQUIRED) + MESSAGE(STATUS "Could NOT find GObject") + ENDIF(GObject_FIND_REQUIRED) +ENDIF (GOBJECT_FOUND) + +MARK_AS_ADVANCED(GOBJECT_INCLUDE_DIR _GObjectLibs _GModuleLibs _GThreadLibs _GLibs) diff --git a/cmake/modules/FindGSSAPI.cmake b/cmake/modules/FindGSSAPI.cmake new file mode 100644 index 0000000000..0951c67542 --- /dev/null +++ b/cmake/modules/FindGSSAPI.cmake @@ -0,0 +1,78 @@ +# - Try to detect the GSSAPI support +# Once done this will define +# +# GSSAPI_FOUND - system supports GSSAPI +# GSSAPI_INCS - the GSSAPI include directory +# GSSAPI_LIBS - the libraries needed to use GSSAPI +# GSSAPI_FLAVOR - the type of API - MIT or HEIMDAL + +# Copyright (c) 2006, Pino Toscano, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + + +if(GSSAPI_LIBS AND GSSAPI_FLAVOR) + + # in cache already + set(GSSAPI_FOUND TRUE) + +else(GSSAPI_LIBS AND GSSAPI_FLAVOR) + + find_program(KRB5_CONFIG NAMES krb5-config PATHS + /opt/local/bin + ONLY_CMAKE_FIND_ROOT_PATH # this is required when cross compiling with cmake 2.6 and ignored with cmake 2.4, Alex + ) + mark_as_advanced(KRB5_CONFIG) + + #reset vars + set(GSSAPI_INCS) + set(GSSAPI_LIBS) + set(GSSAPI_FLAVOR) + + if(KRB5_CONFIG) + + set(HAVE_KRB5_GSSAPI TRUE) + exec_program(${KRB5_CONFIG} ARGS --libs gssapi RETURN_VALUE _return_VALUE OUTPUT_VARIABLE GSSAPI_LIBS) + if(_return_VALUE) + message(STATUS "GSSAPI configure check failed.") + set(HAVE_KRB5_GSSAPI FALSE) + endif(_return_VALUE) + + exec_program(${KRB5_CONFIG} ARGS --cflags gssapi RETURN_VALUE _return_VALUE OUTPUT_VARIABLE GSSAPI_INCS) + string(REGEX REPLACE "(\r?\n)+$" "" GSSAPI_INCS "${GSSAPI_INCS}") + string(REGEX REPLACE " *-I" ";" GSSAPI_INCS "${GSSAPI_INCS}") + + exec_program(${KRB5_CONFIG} ARGS --vendor RETURN_VALUE _return_VALUE OUTPUT_VARIABLE gssapi_flavor_tmp) + set(GSSAPI_FLAVOR_MIT) + if(gssapi_flavor_tmp MATCHES ".*Massachusetts.*") + set(GSSAPI_FLAVOR "MIT") + else(gssapi_flavor_tmp MATCHES ".*Massachusetts.*") + set(GSSAPI_FLAVOR "HEIMDAL") + endif(gssapi_flavor_tmp MATCHES ".*Massachusetts.*") + + if(NOT HAVE_KRB5_GSSAPI) + if (gssapi_flavor_tmp MATCHES "Sun Microsystems.*") + message(STATUS "Solaris Kerberos does not have GSSAPI; this is normal.") + set(GSSAPI_LIBS) + set(GSSAPI_INCS) + else(gssapi_flavor_tmp MATCHES "Sun Microsystems.*") + message(WARNING "${KRB5_CONFIG} failed unexpectedly.") + endif(gssapi_flavor_tmp MATCHES "Sun Microsystems.*") + endif(NOT HAVE_KRB5_GSSAPI) + + if(GSSAPI_LIBS) # GSSAPI_INCS can be also empty, so don't rely on that + set(GSSAPI_FOUND TRUE) + message(STATUS "Found GSSAPI: ${GSSAPI_LIBS}") + + set(GSSAPI_INCS ${GSSAPI_INCS}) + set(GSSAPI_LIBS ${GSSAPI_LIBS}) + set(GSSAPI_FLAVOR ${GSSAPI_FLAVOR}) + + mark_as_advanced(GSSAPI_INCS GSSAPI_LIBS GSSAPI_FLAVOR) + + endif(GSSAPI_LIBS) + + endif(KRB5_CONFIG) + +endif(GSSAPI_LIBS AND GSSAPI_FLAVOR) diff --git a/cmake/modules/FindGStreamer.cmake b/cmake/modules/FindGStreamer.cmake new file mode 100644 index 0000000000..8e98b89250 --- /dev/null +++ b/cmake/modules/FindGStreamer.cmake @@ -0,0 +1,80 @@ +# - Try to find GStreamer +# Once done this will define +# +# GSTREAMER_FOUND - system has GStreamer +# GSTREAMER_INCLUDE_DIR - the GStreamer include directory +# GSTREAMER_LIBRARIES - the libraries needed to use GStreamer +# GSTREAMER_DEFINITIONS - Compiler switches required for using GStreamer + +# Copyright (c) 2006, Tim Beaulen +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +# TODO: Other versions --> GSTREAMER_X_Y_FOUND (Example: GSTREAMER_0_8_FOUND and GSTREAMER_0_10_FOUND etc) + +IF (GSTREAMER_INCLUDE_DIR AND GSTREAMER_LIBRARIES AND GSTREAMER_BASE_LIBRARY AND GSTREAMER_INTERFACE_LIBRARY) + # in cache already + SET(GStreamer_FIND_QUIETLY TRUE) +ELSE (GSTREAMER_INCLUDE_DIR AND GSTREAMER_LIBRARIES AND GSTREAMER_BASE_LIBRARY AND GSTREAMER_INTERFACE_LIBRARY) + SET(GStreamer_FIND_QUIETLY FALSE) +ENDIF (GSTREAMER_INCLUDE_DIR AND GSTREAMER_LIBRARIES AND GSTREAMER_BASE_LIBRARY AND GSTREAMER_INTERFACE_LIBRARY) + +IF (NOT WIN32) + # use pkg-config to get the directories and then use these values + # in the FIND_PATH() and FIND_LIBRARY() calls + FIND_PACKAGE(PkgConfig) + PKG_CHECK_MODULES(PC_GSTREAMER gstreamer-0.10) + #MESSAGE(STATUS "DEBUG: GStreamer include directory = ${GSTREAMER_INCLUDE_DIRS}") + #MESSAGE(STATUS "DEBUG: GStreamer link directory = ${GSTREAMER_LIBRARY_DIRS}") + #MESSAGE(STATUS "DEBUG: GStreamer CFlags = ${GSTREAMER_CFLAGS_OTHER}") + SET(GSTREAMER_DEFINITIONS ${PC_GSTREAMER_CFLAGS_OTHER}) +ENDIF (NOT WIN32) + +FIND_PATH(GSTREAMER_INCLUDE_DIR gst/gst.h + PATHS + ${PC_GSTREAMER_INCLUDEDIR} + ${PC_GSTREAMER_INCLUDE_DIRS} + #PATH_SUFFIXES gst + ) + +FIND_LIBRARY(GSTREAMER_LIBRARIES NAMES gstreamer-0.10 + PATHS + ${PC_GSTREAMER_LIBDIR} + ${PC_GSTREAMER_LIBRARY_DIRS} + ) + +FIND_LIBRARY(GSTREAMER_BASE_LIBRARY NAMES gstbase-0.10 + PATHS + ${PC_GSTREAMER_LIBDIR} + ${PC_GSTREAMER_LIBRARY_DIRS} + ) + +FIND_LIBRARY(GSTREAMER_INTERFACE_LIBRARY NAMES gstinterfaces-0.10 + PATHS + ${PC_GSTREAMER_LIBDIR} + ${PC_GSTREAMER_LIBRARY_DIRS} + ) + +IF (GSTREAMER_INCLUDE_DIR) + #MESSAGE(STATUS "DEBUG: Found GStreamer include dir: ${GSTREAMER_INCLUDE_DIR}") +ELSE (GSTREAMER_INCLUDE_DIR) + MESSAGE(STATUS "GStreamer: WARNING: include dir not found") +ENDIF (GSTREAMER_INCLUDE_DIR) + +IF (GSTREAMER_LIBRARIES) + #MESSAGE(STATUS "DEBUG: Found GStreamer library: ${GSTREAMER_LIBRARIES}") +ELSE (GSTREAMER_LIBRARIES) + MESSAGE(STATUS "GStreamer: WARNING: library not found") +ENDIF (GSTREAMER_LIBRARIES) + +IF (GSTREAMER_INTERFACE_LIBRARY) + #MESSAGE(STATUS "DEBUG: Found GStreamer interface library: ${GSTREAMER_INTERFACE_LIBRARY}") +ELSE (GSTREAMER_INTERFACE_LIBRARY) + MESSAGE(STATUS "GStreamer: WARNING: interface library not found") +ENDIF (GSTREAMER_INTERFACE_LIBRARY) + +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(GStreamer DEFAULT_MSG GSTREAMER_LIBRARIES GSTREAMER_INCLUDE_DIR GSTREAMER_BASE_LIBRARY GSTREAMER_INTERFACE_LIBRARY) + +MARK_AS_ADVANCED(GSTREAMER_INCLUDE_DIR GSTREAMER_LIBRARIES GSTREAMER_BASE_LIBRARY GSTREAMER_INTERFACE_LIBRARY) diff --git a/cmake/modules/FindGettext.cmake b/cmake/modules/FindGettext.cmake new file mode 100644 index 0000000000..e35dceda7a --- /dev/null +++ b/cmake/modules/FindGettext.cmake @@ -0,0 +1,243 @@ +# Try to find Gettext functionality +# Once done this will define +# +# GETTEXT_FOUND - system has Gettext +# GETTEXT_INCLUDE_DIR - Gettext include directory +# GETTEXT_LIBRARIES - Libraries needed to use Gettext + +# TODO: This will enable translations only if Gettext functionality is +# present in libc. Must have more robust system for release, where Gettext +# functionality can also reside in standalone Gettext library, or the one +# embedded within kdelibs (cf. gettext.m4 from Gettext source). +# +# Copyright (c) 2006, Chusslove Illich, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + + +if (LIBC_HAS_DGETTEXT OR LIBINTL_HAS_DGETTEXT) + + # in cache already + set(GETTEXT_FOUND TRUE) + +else (LIBC_HAS_DGETTEXT OR LIBINTL_HAS_DGETTEXT) + + include(CheckLibraryExists) + include(CheckFunctionExists) + + find_path(GETTEXT_INCLUDE_DIR libintl.h) + if(GETTEXT_INCLUDE_DIR) + set(HAVE_LIBINTL_H 1) + else(GETTEXT_INCLUDE_DIR) + set(HAVE_LIBINTL_H 0) + endif(GETTEXT_INCLUDE_DIR) + + set(GETTEXT_LIBRARIES) + + if (HAVE_LIBINTL_H) + check_function_exists(dgettext LIBC_HAS_DGETTEXT) + if (LIBC_HAS_DGETTEXT) + set(GETTEXT_SOURCE "built in libc") + set(GETTEXT_FOUND TRUE) + else (LIBC_HAS_DGETTEXT) + find_library(LIBINTL_LIBRARY NAMES intl libintl ) + + check_library_exists(${LIBINTL_LIBRARY} "dgettext" "" LIBINTL_HAS_DGETTEXT) + if (LIBINTL_HAS_DGETTEXT) + set(GETTEXT_SOURCE "in ${LIBINTL_LIBRARY}") + set(GETTEXT_LIBRARIES ${LIBINTL_LIBRARY}) + set(GETTEXT_FOUND TRUE) + endif (LIBINTL_HAS_DGETTEXT) + endif (LIBC_HAS_DGETTEXT) + endif (HAVE_LIBINTL_H) + + if (GETTEXT_FOUND) + if (NOT Gettext_FIND_QUIETLY) + message(STATUS "Found Gettext: ${GETTEXT_SOURCE}") + endif (NOT Gettext_FIND_QUIETLY) + else (GETTEXT_FOUND) + if (Gettext_FIND_REQUIRED) + message(FATAL_ERROR "Could NOT find Gettext") + endif (Gettext_FIND_REQUIRED) + endif (GETTEXT_FOUND) + + mark_as_advanced(GETTEXT_INCLUDE_DIR GETTEXT_LIBRARIES) + +endif (LIBC_HAS_DGETTEXT OR LIBINTL_HAS_DGETTEXT) + + +# - Find GNU gettext tools +# This module looks for the GNU gettext tools. This module defines the +# following values: +# GETTEXT_MSGMERGE_EXECUTABLE: the full path to the msgmerge tool. +# GETTEXT_MSGFMT_EXECUTABLE: the full path to the msgfmt tool. +# GETTEXT_FOUND: True if gettext has been found. +# +# Additionally it provides the following macros: +# GETTEXT_CREATE_TRANSLATIONS ( outputFile [ALL] file1 ... fileN ) +# This will create a target "translations" which will convert the +# given input po files into the binary output mo file. If the +# ALL option is used, the translations will also be created when +# building the default target. +# GETTEXT_PROCESS_POT( [ALL] [INSTALL_DESTINATION ] ... ) +# Process the given pot file to mo files. +# If INSTALL_DESTINATION is given then automatically install rules will be created, +# the language subdirectory will be taken into account (by default use share/locale/). +# If ALL is specified, the pot file is processed when building the all traget. +# It creates a custom target "potfile". +# +# GETTEXT_PROCESS_PO_FILES( [ALL] [INSTALL_DESTINATION ] ...) +# Process the given po files to mo files for the given language. +# If INSTALL_DESTINATION is given then automatically install rules will be created, +# the language subdirectory will be taken into account (by default use share/locale/). +# If ALL is specified, the po files are processed when building the all traget. +# It creates a custom target "pofiles". + + + +FIND_PROGRAM(GETTEXT_MSGMERGE_EXECUTABLE msgmerge) + +FIND_PROGRAM(GETTEXT_MSGFMT_EXECUTABLE msgfmt) + +MACRO(GETTEXT_CREATE_TRANSLATIONS _potFile _firstPoFile) + + SET(_gmoFiles) + GET_FILENAME_COMPONENT(_potBasename ${_potFile} NAME_WE) + GET_FILENAME_COMPONENT(_absPotFile ${_potFile} ABSOLUTE) + + SET(_addToAll) + IF(${_firstPoFile} STREQUAL "ALL") + SET(_addToAll "ALL") + SET(_firstPoFile) + ENDIF(${_firstPoFile} STREQUAL "ALL") + + FOREACH (_currentPoFile ${ARGN}) + GET_FILENAME_COMPONENT(_absFile ${_currentPoFile} ABSOLUTE) + GET_FILENAME_COMPONENT(_abs_PATH ${_absFile} PATH) + GET_FILENAME_COMPONENT(_lang ${_absFile} NAME_WE) + SET(_gmoFile ${CMAKE_CURRENT_BINARY_DIR}/${_lang}.gmo) + + ADD_CUSTOM_COMMAND( + OUTPUT ${_gmoFile} + COMMAND ${GETTEXT_MSGMERGE_EXECUTABLE} --quiet --update --backup=none -s ${_absFile} ${_absPotFile} + COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${_gmoFile} ${_absFile} + DEPENDS ${_absPotFile} ${_absFile} + ) + + INSTALL(FILES ${_gmoFile} DESTINATION share/locale/${_lang}/LC_MESSAGES RENAME ${_potBasename}.mo) + SET(_gmoFiles ${_gmoFiles} ${_gmoFile}) + + ENDFOREACH (_currentPoFile ) + + ADD_CUSTOM_TARGET(translations ${_addToAll} DEPENDS ${_gmoFiles}) + +ENDMACRO(GETTEXT_CREATE_TRANSLATIONS ) + +# GETTEXT_PROCESS_POT( [ALL] [INSTALL_DESTINATION ] ... ) +MACRO(GETTEXT_PROCESS_POT_FILE _potFile) + + SET(_gmoFiles) + SET(_args ${ARGN}) + SET(_addToAll) + SET(_installDest) + + IF(_args) + LIST(GET _args 0 _tmp) + IF("${_tmp}" STREQUAL "ALL") + SET(_addToAll ALL) + LIST(REMOVE_AT _args 0) + ENDIF("${_tmp}" STREQUAL "ALL") + ENDIF(_args) + + IF(_args) + LIST(GET _args 0 _tmp) + IF("${_tmp}" STREQUAL "INSTALL_DESTINATION") + LIST(GET _args 1 _installDest ) + LIST(REMOVE_AT _args 0 1) + ENDIF("${_tmp}" STREQUAL "INSTALL_DESTINATION") + ENDIF(_args) + + GET_FILENAME_COMPONENT(_potBasename ${_potFile} NAME_WE) + GET_FILENAME_COMPONENT(_absPotFile ${_potFile} ABSOLUTE) + +# message(STATUS "1 all ${_addToAll} dest ${_installDest} args: ${_args}") + + FOREACH (_lang ${_args}) + SET(_poFile "${CMAKE_CURRENT_BINARY_DIR}/${_lang}.po") + SET(_gmoFile "${CMAKE_CURRENT_BINARY_DIR}/${_lang}.gmo") + + ADD_CUSTOM_COMMAND( + OUTPUT "${_poFile}" + COMMAND ${GETTEXT_MSGMERGE_EXECUTABLE} --quiet --update --backup=none -s ${_poFile} ${_absPotFile} + DEPENDS ${_absPotFile} + ) + + ADD_CUSTOM_COMMAND( + OUTPUT "${_gmoFile}" + COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${_gmoFile} ${_poFile} + DEPENDS ${_absPotFile} ${_poFile} + ) + + IF(_installDest) + INSTALL(FILES ${_gmoFile} DESTINATION ${_installDest}/${_lang}/LC_MESSAGES RENAME ${_potBasename}.mo) + ENDIF(_installDest) + LIST(APPEND _gmoFiles ${_gmoFile}) + + ENDFOREACH (_lang ) + + ADD_CUSTOM_TARGET(potfile ${_addToAll} DEPENDS ${_gmoFiles}) + +ENDMACRO(GETTEXT_PROCESS_POT_FILE) + + +# GETTEXT_PROCESS_PO_FILES( [ALL] [INSTALL_DESTINATION ] ...) +MACRO(GETTEXT_PROCESS_PO_FILES _lang) + SET(_gmoFiles) + SET(_args ${ARGN}) + SET(_addToAll) + SET(_installDest) + + LIST(GET _args 0 _tmp) + IF("${_tmp}" STREQUAL "ALL") + SET(_addToAll ALL) + LIST(REMOVE_AT _args 0) + ENDIF("${_tmp}" STREQUAL "ALL") + + LIST(GET _args 0 _tmp) + IF("${_tmp}" STREQUAL "INSTALL_DESTINATION") + LIST(GET _args 1 _installDest ) + LIST(REMOVE_AT _args 0 1) + ENDIF("${_tmp}" STREQUAL "INSTALL_DESTINATION") + +# message(STATUS "2 all ${_addToAll} dest ${_installDest} args: ${_args}") + + FOREACH(_current_PO_FILE ${_args}) + GET_FILENAME_COMPONENT(_basename ${_current_PO_FILE} NAME_WE) + SET(_gmoFile ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.gmo) + add_custom_command(OUTPUT ${_gmoFile} + COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${_gmoFile} ${_current_PO_FILE} + WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" + DEPENDS ${_current_PO_FILE} + ) + + IF(_installDest) + INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.gmo DESTINATION ${_installDest}/${_lang}/LC_MESSAGES/ RENAME ${_basename}.mo) + ENDIF(_installDest) + LIST(APPEND _gmoFiles ${_gmoFile}) + ENDFOREACH(_current_PO_FILE) + ADD_CUSTOM_TARGET(pofiles ${_addToAll} DEPENDS ${_gmoFiles}) +ENDMACRO(GETTEXT_PROCESS_PO_FILES) + + +#IF (GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE ) +# SET(GETTEXT_FOUND TRUE) +#ELSE (GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE ) +# SET(GETTEXT_FOUND FALSE) +# IF (GetText_REQUIRED) +# MESSAGE(FATAL_ERROR "GetText not found") +# ENDIF (GetText_REQUIRED) +#ENDIF (GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE ) + + + diff --git a/cmake/modules/FindGphoto2.cmake b/cmake/modules/FindGphoto2.cmake new file mode 100644 index 0000000000..b1bd6270f1 --- /dev/null +++ b/cmake/modules/FindGphoto2.cmake @@ -0,0 +1,60 @@ +# cmake macro to test if we use gphoto2 +# GPHOTO2_FOUND - system has the GPHOTO2 library +# GPHOTO2_INCLUDE_DIR - the GPHOTO2 include directory +# GPHOTO2_LIBRARIES - The libraries needed to use GPHOTO2 + +# Copyright (c) 2006, 2007 Laurent Montel, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + + +option(KDE4_GPHOTO2 "do not build kamera (gphoto2 required)" ON) +if (KDE4_GPHOTO2 ) + IF (GPHOTO2_LIBRARIES AND GPHOTO2_INCLUDE_DIR) + # in cache already + SET(GPHOTO2_FOUND TRUE) + ELSE (GPHOTO2_LIBRARIES AND GPHOTO2_INCLUDE_DIR) + + FIND_PROGRAM(GHOTO2CONFIG_EXECUTABLE NAMES gphoto2-config + ) + + FIND_PROGRAM(GHOTO2PORTCONFIG_EXECUTABLE NAMES gphoto2-port-config + ) + set(GPHOTO2_LIBRARIES) + set(GPHOTO2_INCLUDE_DIRS) + # if gphoto2-port-config and gphoto2-config have been found + IF (GHOTO2PORTCONFIG_EXECUTABLE AND GHOTO2CONFIG_EXECUTABLE) + EXEC_PROGRAM(${GHOTO2PORTCONFIG_EXECUTABLE} ARGS --libs RETURN_VALUE _return_VALUE OUTPUT_VARIABLE GPHOTO2PORT_LIBRARY) + EXEC_PROGRAM(${GHOTO2CONFIG_EXECUTABLE} ARGS --libs RETURN_VALUE _return_VALUE OUTPUT_VARIABLE GPHOTO2_LIBRARY) + + EXEC_PROGRAM(${GHOTO2PORTCONFIG_EXECUTABLE} ARGS --cflags RETURN_VALUE _return_VALUE OUTPUT_VARIABLE _GPHOTO2PORT_RESULT_INCLUDE_DIR) + EXEC_PROGRAM(${GHOTO2CONFIG_EXECUTABLE} ARGS --cflags RETURN_VALUE _return_VALUE OUTPUT_VARIABLE _GPHOTO2_RESULT_INCLUDE_DIR) + + set(GPHOTO2_LIBRARIES ${GPHOTO2PORT_LIBRARY} ${GPHOTO2_LIBRARY}) + # the cflags for poppler-qt4 can contain more than one include path + separate_arguments(_GPHOTO2_RESULT_INCLUDE_DIR) + foreach(_includedir ${_GPHOTO2_RESULT_INCLUDE_DIR}) + string(REGEX REPLACE "-I(.+)" "\\1" _includedir "${_includedir}") + set(GPHOTO2_INCLUDE_DIR ${GPHOTO2_INCLUDE_DIR} ${_includedir}) + endforeach(_includedir) + separate_arguments(_GPHOTO2PORT_RESULT_INCLUDE_DIR) + foreach(_includedir ${_GPHOTO2PORT_RESULT_INCLUDE_DIR}) + string(REGEX REPLACE "-I(.+)" "\\1" _includedir "${_includedir}") + set(GPHOTO2PORT_INCLUDE_DIR ${GPHOTO2PORT_INCLUDE_DIR} ${_includedir}) + endforeach(_includedir) + + + + set(GPHOTO2_INCLUDE_DIRS ${GPHOTO2PORT_INCLUDE_DIR} ${GPHOTO2_INCLUDE_DIR} ) + endif(GHOTO2PORTCONFIG_EXECUTABLE AND GHOTO2CONFIG_EXECUTABLE) + + IF (GPHOTO2_LIBRARIES AND GPHOTO2_INCLUDE_DIRS) + SET(GPHOTO2_FOUND TRUE) + message(STATUS "Found gphoto2: ${GPHOTO2_LIBRARIES}") + ENDIF (GPHOTO2_LIBRARIES AND GPHOTO2_INCLUDE_DIRS) + ENDIF (GPHOTO2_LIBRARIES AND GPHOTO2_INCLUDE_DIR) + MARK_AS_ADVANCED(GPHOTO2_LIBRARIES GPHOTO2_INCLUDE_DIRS) + +endif(KDE4_GPHOTO2) + diff --git a/cmake/modules/FindKDE4Internal.cmake b/cmake/modules/FindKDE4Internal.cmake new file mode 100644 index 0000000000..0fda5ccc69 --- /dev/null +++ b/cmake/modules/FindKDE4Internal.cmake @@ -0,0 +1,1191 @@ +# - Find the KDE4 include and library dirs, KDE preprocessors and define a some macros +# +# This module defines the following variables: +# +# KDE4_FOUND - set to TRUE if everything required for building KDE software has been found +# +# KDE4_DEFINITIONS - compiler definitions required for compiling KDE software +# KDE4_INCLUDE_DIR - the KDE 4 include directory +# KDE4_INCLUDES - all include directories required for KDE, i.e. +# KDE4_INCLUDE_DIR, but also the Qt4 include directories +# and other platform specific include directories +# KDE4_LIB_DIR - the directory where the KDE libraries are installed, +# intended to be used with LINK_DIRECTORIES() +# +# The following variables are defined for the various tools required to +# compile KDE software: +# +# KDE4_KCFGC_EXECUTABLE - the kconfig_compiler executable +# KDE4_AUTOMOC_EXECUTABLE - the kde4automoc executable, deprecated, use AUTOMOC4_EXECUTABLE instead +# KDE4_MEINPROC_EXECUTABLE - the meinproc4 executable +# KDE4_MAKEKDEWIDGETS_EXECUTABLE - the makekdewidgets executable +# +# The following variables point to the location of the KDE libraries, +# but shouldn't be used directly: +# +# KDE4_KDECORE_LIBRARY - the kdecore library +# KDE4_KDEUI_LIBRARY - the kdeui library +# KDE4_KIO_LIBRARY - the kio library +# KDE4_KPARTS_LIBRARY - the kparts library +# KDE4_KUTILS_LIBRARY - the kutils library +# KDE4_KDE3SUPPORT_LIBRARY - the kde3support library +# KDE4_KFILE_LIBRARY - the kfile library +# KDE4_KHTML_LIBRARY - the khtml library +# KDE4_KJS_LIBRARY - the kjs library +# KDE4_KJSAPI_LIBRARY - the kjs public api library +# KDE4_KNEWSTUFF2_LIBRARY - the knewstuff2 library +# KDE4_KDNSSD_LIBRARY - the kdnssd library +# KDE4_PHONON_LIBRARY - the phonon library +# KDE4_THREADWEAVER_LIBRARY- the threadweaver library +# KDE4_SOLID_LIBRARY - the solid library +# KDE4_KNOTIFYCONFIG_LIBRARY- the knotifyconfig library +# KDE4_KROSSCORE_LIBRARY - the krosscore library +# KDE4_KTEXTEDITOR_LIBRARY - the ktexteditor library +# KDE4_KNEPOMUK_LIBRARY - the knepomuk library +# KDE4_KMETADATA_LIBRARY - the kmetadata library +# KDE4_PLASMA_LIBRARY - the plasma library +# +# KDE4_PLASMA_OPENGL_FOUND - TRUE if the OpenGL support of Plasma has been found, NOTFOUND otherwise +# +# Compared to the variables above, the following variables +# also contain all of the depending libraries, so the variables below +# should be used instead of the ones above: +# +# KDE4_KDECORE_LIBS - the kdecore library and all depending libraries +# KDE4_KDEUI_LIBS - the kdeui library and all depending libraries +# KDE4_KIO_LIBS - the kio library and all depending libraries +# KDE4_KPARTS_LIBS - the kparts library and all depending libraries +# KDE4_KUTILS_LIBS - the kutils library and all depending libraries +# KDE4_KDE3SUPPORT_LIBS - the kde3support library and all depending libraries +# KDE4_KFILE_LIBS - the kfile library and all depending libraries +# KDE4_KHTML_LIBS - the khtml library and all depending libraries +# KDE4_KJS_LIBS - the kjs library and all depending libraries +# KDE4_KJSAPI_LIBS - the kjs public api library and all depending libraries +# KDE4_KNEWSTUFF2_LIBS - the knewstuff2 library and all depending libraries +# KDE4_KDNSSD_LIBS - the kdnssd library and all depending libraries +# KDE4_KDESU_LIBS - the kdesu library and all depending libraries +# KDE4_KPTY_LIBS - the kpty library and all depending libraries +# KDE4_PHONON_LIBS - the phonon library and all depending librairies +# KDE4_THREADWEAVER_LIBRARIES- the threadweaver library and all depending libraries +# KDE4_SOLID_LIBS - the solid library and all depending libraries +# KDE4_KNOTIFYCONFIG_LIBS - the knotify config library and all depending libraries +# KDE4_KROSSCORE_LIBS - the kross core library and all depending libraries +# KDE4_KROSSUI_LIBS - the kross ui library which includes core and all depending libraries +# KDE4_KTEXTEDITOR_LIBS - the ktexteditor library and all depending libraries +# KDE4_KNEPOMUK_LIBS - the knepomuk library and all depending libraries +# KDE4_KMETADATA_LIBS - the kmetadata library and all depending libraries +# KDE4_PLASMA_LIBS - the plasma library and all depending librairies +# +# This module defines a bunch of variables used as locations for install directories. +# They can be relative (to CMAKE_INSTALL_PREFIX) or absolute. +# Under Windows they are always relative. +# +# BIN_INSTALL_DIR - the directory where executables will be installed (default is prefix/bin) +# BUNDLE_INSTALL_DIR - Mac only: the directory where application bundles will be installed (default is /Applications/KDE4 ) +# SBIN_INSTALL_DIR - the directory where system executables will be installed (default is prefix/sbin) +# LIB_INSTALL_DIR - the directory where libraries will be installed (default is prefix/lib) +# CONFIG_INSTALL_DIR - the config file install dir +# DATA_INSTALL_DIR - the parent directory where applications can install their data +# HTML_INSTALL_DIR - the HTML install dir for documentation +# ICON_INSTALL_DIR - the icon install dir (default prefix/share/icons/) +# INFO_INSTALL_DIR - the kde info install dir (default prefix/info) +# KCFG_INSTALL_DIR - the install dir for kconfig files +# LOCALE_INSTALL_DIR - the install dir for translations +# MAN_INSTALL_DIR - the kde man page install dir (default prefix/man/) +# MIME_INSTALL_DIR - the install dir for the mimetype desktop files +# PLUGIN_INSTALL_DIR - the subdirectory relative to the install prefix where plugins will be installed (default is ${KDE4_LIB_INSTALL_DIR}/kde4) +# SERVICES_INSTALL_DIR - the install dir for service (desktop, protocol, ...) files +# SERVICETYPES_INSTALL_DIR - the install dir for servicestypes desktop files +# SOUND_INSTALL_DIR - the install dir for sound files +# TEMPLATES_INSTALL_DIR - the install dir for templates (Create new file...) +# WALLPAPER_INSTALL_DIR - the install dir for wallpapers +# DEMO_INSTALL_DIR - the install dir for demos +# KCONF_UPDATE_INSTALL_DIR - the kconf_update install dir +# XDG_APPS_INSTALL_DIR - the XDG apps dir +# XDG_DIRECTORY_INSTALL_DIR- the XDG directory +# XDG_MIME_INSTALL_DIR - the XDG mimetypes install dir +# DBUS_INTERFACES_INSTALL_DIR - the directory where dbus interfaces be installed (default is prefix/share/dbus-1/interfaces) +# DBUS_SERVICES_INSTALL_DIR - the directory where dbus services be installed (default is prefix/share/dbus-1/services ) +# +# The following variable is provided, but seem to be unused: +# LIBS_HTML_INSTALL_DIR /share/doc/HTML CACHE STRING "Is this still used ?") +# +# The following user adjustable options are provided: +# +# KDE4_ENABLE_FINAL - enable KDE-style enable-final all-in-one-compilation +# KDE4_BUILD_TESTS - enable this to build the testcases +# KDE4_ENABLE_FPIE - enable it to use gcc Position Independent Executables feature +# KDE4_USE_COMMON_CMAKE_PACKAGE_CONFIG_DIR - only present for CMake >= 2.6.3, defaults to TRUE +# If enabled, the package should install its Config.cmake file to +# lib/cmake// instead to lib//cmake +# +# It also adds the following macros and functions (from KDE4Macros.cmake) +# KDE4_ADD_UI_FILES (SRCS_VAR file1.ui ... fileN.ui) +# Use this to add Qt designer ui files to your application/library. +# +# KDE4_ADD_UI3_FILES (SRCS_VAR file1.ui ... fileN.ui) +# Use this to add Qt designer ui files from Qt version 3 to your application/library. +# +# KDE4_ADD_KCFG_FILES (SRCS_VAR [GENERATE_MOC] file1.kcfgc ... fileN.kcfgc) +# Use this to add KDE config compiler files to your application/library. +# Use optional GENERATE_MOC to generate moc if you use signals in your kcfg files. +# +# KDE4_ADD_WIDGET_FILES (SRCS_VAR file1.widgets ... fileN.widgets) +# Use this to add widget description files for the makekdewidgets code generator +# for Qt Designer plugins. +# +# KDE4_CREATE_FINAL_FILES (filename_CXX filename_C file1 ... fileN) +# This macro is intended mainly for internal uses. +# It is used for enable-final. It will generate two source files, +# one for the C files and one for the C++ files. +# These files will have the names given in filename_CXX and filename_C. +# +# KDE4_ADD_PLUGIN ( name [WITH_PREFIX] file1 ... fileN ) +# Create a KDE plugin (KPart, kioslave, etc.) from the given source files. +# It supports KDE4_ENABLE_FINAL. +# If WITH_PREFIX is given, the resulting plugin will have the prefix "lib", otherwise it won't. +# +# KDE4_ADD_KDEINIT_EXECUTABLE (name [NOGUI] [RUN_UNINSTALLED] file1 ... fileN) +# Create a KDE application in the form of a module loadable via kdeinit. +# A library named kdeinit_ will be created and a small executable which links to it. +# It supports KDE4_ENABLE_FINAL +# If the executable has to be run from the buildtree (e.g. unit tests and code generators +# used later on when compiling), set the option RUN_UNINSTALLED. +# If the executable doesn't have a GUI, use the option NOGUI. By default on OS X +# application bundles are created, with the NOGUI option no bundles but simple executables +# are created. Currently it doesn't have any effect on other platforms. +# +# KDE4_ADD_EXECUTABLE (name [NOGUI] [TEST] [RUN_UNINSTALLED] file1 ... fileN) +# Equivalent to ADD_EXECUTABLE(), but additionally adds some more features: +# -support for KDE4_ENABLE_FINAL +# -support for automoc +# -automatic RPATH handling +# If the executable has to be run from the buildtree (e.g. unit tests and code generators +# used later on when compiling), set the option RUN_UNINSTALLED. +# If the executable doesn't have a GUI, use the option NOGUI. By default on OS X +# application bundles are created, with the NOGUI option no bundles but simple executables +# are created. Currently it doesn't have any effect on other platforms. +# +# KDE4_ADD_LIBRARY (name [STATIC | SHARED | MODULE ] file1 ... fileN) +# Equivalent to ADD_LIBRARY(), but additionally it supports KDE4_ENABLE_FINAL +# and under Windows it adds a -DMAKE__LIB definition to the compilation. +# +# KDE4_ADD_UNIT_TEST (testname [TESTNAME targetname] file1 ... fileN) +# add a unit test, which is executed when running make test +# it will be built with RPATH poiting to the build dir +# The targets are always created, but only built for the "all" +# target if the option KDE4_BUILD_TESTS is enabled. Otherwise the rules for the target +# are created but not built by default. You can build them by manually building the target. +# The name of the target can be specified using TESTNAME , if it is not given +# the macro will default to the +# KDESRCDIR is set to the source directory of the test, this can be used with +# KGlobal::dirs()->addResourceDir( "data", KDESRCDIR ) +# +# KDE4_UPDATE_ICONCACHE() +# Notifies the icon cache that new icons have been installed by updating +# mtime of ${ICON_INSTALL_DIR}/hicolor directory. +# +# KDE4_INSTALL_ICONS( path theme) +# Installs all png and svgz files in the current directory to the icon +# directoy given in path, in the subdirectory for the given icon theme. +# +# KDE4_CREATE_HANDBOOK( docbookfile [INSTALL_DESTINATION installdest] [SUBDIR subdir]) +# Create the handbook from the docbookfile (using meinproc4) +# The resulting handbook will be installed to when using +# INSTALL_DESTINATION , or to / if +# SUBDIR is specified. +# +# KDE4_CREATE_MANPAGE( docbookfile section ) +# Create the manpage for the specified section from the docbookfile (using meinproc4) +# The resulting manpage will be installed to when using +# INSTALL_DESTINATION , or to / if +# SUBDIR is specified. +# +# +# A note on the possible values for CMAKE_BUILD_TYPE and how KDE handles +# the flags for those buildtypes. FindKDE4Internal supports the values +# Debug, Release, RelWithDebInfo, Profile and Debugfull +# +# Release +# optimised for speed, qDebug/kDebug turned off, no debug symbols +# Release with debug info +# optimised for speed, debugging symbols on (-g) +# Debug +# optimised but debuggable, debugging on (-g) +# (-fno-reorder-blocks -fno-schedule-insns -fno-inline) +# DebugFull +# no optimisation, full debugging on (-g3) +# Profile +# DebugFull + -ftest-coverage -fprofile-arcs +# +# It is expected that the "Debug" build type be still debuggable with gdb +# without going all over the place, but still produce better performance. +# It's also important to note that gcc cannot detect all warning conditions +# unless the optimiser is active. +# +# This module allows to depend on a particular minimum version of kdelibs. +# To acomplish that one should use the apropriate cmake syntax for +# find_package. For example to depend on kdelibs >= 4.1.0 one should use +# +# find_package(KDE4 4.1.0 REQUIRED) +# +# In earlier versions of KDE you could use the variable KDE_MIN_VERSION to +# have such a dependency. This variable is deprecated with KDE 4.2.0, but +# will still work to make the module backwards-compatible. + +# _KDE4_PLATFORM_INCLUDE_DIRS is used only internally +# _KDE4_PLATFORM_DEFINITIONS is used only internally + +# Copyright (c) 2006-2009, Alexander Neundorf +# Copyright (c) 2006, Laurent Montel, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + + +# this is required now by cmake 2.6 and so must not be skipped by if(KDE4_FOUND) below +cmake_minimum_required(VERSION 2.6.2 FATAL_ERROR) +# set the cmake policies to the 2.4.x compatibility settings (may change for KDE 4.3) +cmake_policy(VERSION 2.4.5) + +# CMake 2.6, set compatibility behaviour to cmake 2.4 +# this must be executed always, because the CMAKE_MINIMUM_REQUIRED() command above +# resets the policy settings, so we get a lot of warnings + +# CMP0000: don't require cmake_minimum_version() directly in the top level CMakeLists.txt, FindKDE4Internal.cmake is good enough +cmake_policy(SET CMP0000 OLD) +# CMP0002: in KDE4 we have multiple targets with the same name for the unit tests +cmake_policy(SET CMP0002 OLD) +# CMP0003: add the link paths to the link command as with cmake 2.4 +cmake_policy(SET CMP0003 OLD) +# CMP0005: keep escaping behaviour for definitions added via add_definitions() +cmake_policy(SET CMP0005 OLD) +# since cmake 2.6.3: NEW behaviour is that setting policies doesn't "escape" the file +# where this is done, macros and functions are executed with the policies as they +# were when the were defined. Keep the OLD behaviour so we can set the policies here +# for all KDE software without the big warning +if(POLICY CMP0011) + cmake_policy(SET CMP0011 OLD) +endif(POLICY CMP0011) + + +# Only do something if it hasn't been found yet +if(NOT KDE4_FOUND) + +include (MacroEnsureVersion) + +# We may only search for other packages with "REQUIRED" if we are required ourselves. +# This file can be processed either (usually) included in FindKDE4.cmake or +# (when building kdelibs) directly via FIND_PACKAGE(KDE4Internal), that's why +# we have to check for both KDE4_FIND_REQUIRED and KDE4Internal_FIND_REQUIRED. +if(KDE4_FIND_REQUIRED OR KDE4Internal_FIND_REQUIRED) + set(_REQ_STRING_KDE4 "REQUIRED") + set(_REQ_STRING_KDE4_MESSAGE "FATAL_ERROR") +else(KDE4_FIND_REQUIRED OR KDE4Internal_FIND_REQUIRED) + set(_REQ_STRING_KDE4 ) + set(_REQ_STRING_KDE4_MESSAGE "STATUS") +endif(KDE4_FIND_REQUIRED OR KDE4Internal_FIND_REQUIRED) + +set(QT_MIN_VERSION "4.4.0") +#this line includes FindQt4.cmake, which searches the Qt library and headers +find_package(Qt4 ${_REQ_STRING_KDE4}) + +# automoc4 (from kdesupport) is now required, Alex +# AS do not need AUTOMOC +#find_package(Automoc4 ${_REQ_STRING_KDE4}) + +# cmake 2.6.0 and automoc4 < 0.9.84 don't work right for -D flags +#if (NOT AUTOMOC4_VERSION) + # the version macro was added for 0.9.84 +# set(AUTOMOC4_VERSION "0.9.83") +#endif (NOT AUTOMOC4_VERSION) +#macro_ensure_version("0.9.87" "${AUTOMOC4_VERSION}" _automoc4_version_ok) + +# for compatibility with KDE 4.0.x +#set(KDE4_AUTOMOC_EXECUTABLE "${AUTOMOC4_EXECUTABLE}" ) + +# Perl is required for building KDE software +find_package(Perl ${_REQ_STRING_KDE4}) + +# Check that we really found everything. +# If KDE4 was searched with REQUIRED, we error out with FATAL_ERROR if something wasn't found +# already above in the other FIND_PACKAGE() calls. +# If KDE4 was searched without REQUIRED and something in the FIND_PACKAGE() calls above wasn't found, +# then we get here and must check that everything has actually been found. If something is missing, +# we must not fail with FATAL_ERROR, but only not set KDE4_FOUND. +if(NOT PERL_FOUND) + message(STATUS "KDE4 not found, because Perl not found") + return() +endif(NOT PERL_FOUND) + +if(NOT QT4_FOUND) + message(STATUS "KDE4 not found, because Qt4 not found") + return() +endif(NOT QT4_FOUND) + +if(NOT AUTOMOC4_FOUND OR NOT _automoc4_version_ok) + if(NOT AUTOMOC4_FOUND) + message(${_REQ_STRING_KDE4_MESSAGE} "KDE4 not found, because Automoc4 not found.") + return() + else(NOT AUTOMOC4_FOUND) + if(NOT _automoc4_version_ok) + message(${_REQ_STRING_KDE4_MESSAGE} "Your version of automoc4 is too old. You have ${AUTOMOC4_VERSION}, you need at least 0.9.87") + return() + endif(NOT _automoc4_version_ok) + endif(NOT AUTOMOC4_FOUND) +endif(NOT AUTOMOC4_FOUND OR NOT _automoc4_version_ok) + + +# now we are sure we have everything we need + +include (MacroLibrary) +include (CheckCXXCompilerFlag) +include (CheckCXXSourceCompiles) + + +# get the directory of the current file, used later on in the file +get_filename_component( kde_cmake_module_dir ${CMAKE_CURRENT_LIST_FILE} PATH) + +# are we trying to compile kdelibs ? kdelibs_SOURCE_DIR comes from "project(kdelibs)" in kdelibs/CMakeLists.txt +# then enter bootstrap mode + +if(kdelibs_SOURCE_DIR) + set(_kdeBootStrapping TRUE) + message(STATUS "Building kdelibs...") +else(kdelibs_SOURCE_DIR) + set(_kdeBootStrapping FALSE) +endif(kdelibs_SOURCE_DIR) + +####################### #now try to find some kde stuff ################################ + +if (_kdeBootStrapping) + set(KDE4_INCLUDE_DIR ${kdelibs_SOURCE_DIR}) + set(KDE4_KDECORE_LIBS ${QT_QTCORE_LIBRARY} kdecore) + set(KDE4_KDEUI_LIBS ${KDE4_KDECORE_LIBS} kdeui) + set(KDE4_KIO_LIBS ${KDE4_KDEUI_LIBS} kio) + set(KDE4_KPARTS_LIBS ${KDE4_KIO_LIBS} kparts) + if (UNIX) + set(KDE4_KPTY_LIBS ${KDE4_KDECORE_LIBS} kpty) + endif (UNIX) + set(KDE4_KUTILS_LIBS ${KDE4_KIO_LIBS} kutils) + set(KDE4_KDE3SUPPORT_LIBS ${KDE4_KIO_LIBS} kde3support) + set(KDE4_SOLID_LIBS ${KDE4_KDECORE_LIBS} solid) + set(KDE4_KFILE_LIBS ${KDE4_KIO_LIBS} kfile) + set(KDE4_KHTML_LIBS ${KDE4_KPARTS_LIBS} khtml) + + set(EXECUTABLE_OUTPUT_PATH ${kdelibs_BINARY_DIR}/bin ) + + if (WIN32) + set(LIBRARY_OUTPUT_PATH ${EXECUTABLE_OUTPUT_PATH} ) + # CMAKE_CFG_INTDIR is the output subdirectory created e.g. by XCode and MSVC + set(KDE4_KCFGC_EXECUTABLE ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/kconfig_compiler ) + + set(KDE4_MEINPROC_EXECUTABLE ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/meinproc4 ) + set(KDE4_MAKEKDEWIDGETS_EXECUTABLE ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/makekdewidgets ) + else (WIN32) + set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib ) + set(KDE4_KCFGC_EXECUTABLE ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/kconfig_compiler.shell ) + + set(KDE4_MEINPROC_EXECUTABLE ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/meinproc4.shell ) + set(KDE4_MAKEKDEWIDGETS_EXECUTABLE ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/makekdewidgets.shell ) + endif (WIN32) + + set(KDE4_LIB_DIR ${LIBRARY_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}) + + # when building kdelibs, make the kcfg rules depend on the binaries... + set( _KDE4_KCONFIG_COMPILER_DEP kconfig_compiler) + set( _KDE4_MAKEKDEWIDGETS_DEP makekdewidgets) + set( _KDE4_MEINPROC_EXECUTABLE_DEP meinproc4) + + set(KDE4_INSTALLED_VERSION_OK TRUE) + +else (_kdeBootStrapping) + + # ... but NOT otherwise + set( _KDE4_KCONFIG_COMPILER_DEP) + set( _KDE4_MAKEKDEWIDGETS_DEP) + set( _KDE4_MEINPROC_EXECUTABLE_DEP) + + set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib ) + + if (WIN32) + # we don't want to be forced to set two paths into the build tree + set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin ) + + # on win32 the install dir is determined on runtime not install time + # KDELIBS_INSTALL_DIR and QT_INSTALL_DIR are used in KDELibsDependencies.cmake to setup + # kde install paths and library dependencies + get_filename_component(_DIR ${KDE4_KDECONFIG_EXECUTABLE} PATH ) + get_filename_component(KDE4_INSTALL_DIR ${_DIR} PATH ) + get_filename_component(_DIR ${QT_QMAKE_EXECUTABLE} PATH ) + get_filename_component(QT_INSTALL_DIR ${_DIR} PATH ) + endif (WIN32) + + # This file contains information about the installed kdelibs, Alex + include(${kde_cmake_module_dir}/KDELibsDependencies.cmake) + + # Check the version of KDE. It must be at least KDE_MIN_VERSION as set by the user. + # KDE_VERSION is set in KDELibsDependencies.cmake since KDE 4.0.x. Alex + # Support for the new-style (>= 2.6.0) support for requiring some version of a package: + if (NOT KDE_MIN_VERSION) + if (KDE4_FIND_VERSION_MAJOR) + set(KDE_MIN_VERSION "${KDE4_FIND_VERSION_MAJOR}.${KDE4_FIND_VERSION_MINOR}.${KDE4_FIND_VERSION_PATCH}") + else (KDE4_FIND_VERSION_MAJOR) + set(KDE_MIN_VERSION "4.0.0") + endif (KDE4_FIND_VERSION_MAJOR) + endif (NOT KDE_MIN_VERSION) + + #message(FATAL_ERROR "KDE_MIN_VERSION=${KDE_MIN_VERSION} found ${KDE_VERSION} exact: -${KDE4_FIND_VERSION_EXACT}- version: -${KDE4_FIND_VERSION}-") + macro_ensure_version( ${KDE_MIN_VERSION} ${KDE_VERSION} KDE4_INSTALLED_VERSION_OK ) + + # This file contains the exported library target from kdelibs (new with cmake 2.6.x), e.g. + # the library target "kdeui" is exported as "KDE4__kdeui". The "KDE4__" is used as + # "namespace" to separate the imported targets from "normal" targets, it is stored in + # KDE4_TARGET_PREFIX, which is set in KDELibsDependencies.cmake . + # Include it to "import" the libraries from kdelibs into the current projects as targets. + # This makes setting the _LIBRARY and _LIBS variables actually a bit superfluos, since e.g. + # the kdeui library could now also be used just as "KDE4__kdeui" and still have all their + # dependent libraries handled correctly. But to keep compatibility and not to change + # behaviour we set all these variables anyway as seen below. Alex + include(${kde_cmake_module_dir}/KDELibs4LibraryTargets.cmake) + + # helper macro, sets both the KDE4_FOO_LIBRARY and KDE4_FOO_LIBS variables to KDE4__foo + macro(_KDE4_SET_LIB_VARIABLES _var _lib _prefix) + set(KDE4_${_var}_LIBRARY ${_prefix}${_lib} ) + set(KDE4_${_var}_LIBS ${_prefix}${_lib} ) + endmacro(_KDE4_SET_LIB_VARIABLES _var _lib _prefix) + + # sorted by names + _kde4_set_lib_variables(KDE3SUPPORT kde3support ${KDE4_TARGET_PREFIX}) + _kde4_set_lib_variables(KDECORE kdecore ${KDE4_TARGET_PREFIX}) + _kde4_set_lib_variables(KDEUI kdeui ${KDE4_TARGET_PREFIX}) + _kde4_set_lib_variables(KDNSSD kdnssd ${KDE4_TARGET_PREFIX}) + _kde4_set_lib_variables(KFILE kfile ${KDE4_TARGET_PREFIX}) + _kde4_set_lib_variables(KHTML khtml ${KDE4_TARGET_PREFIX}) + _kde4_set_lib_variables(KIO kio ${KDE4_TARGET_PREFIX}) + _kde4_set_lib_variables(KJS kjs ${KDE4_TARGET_PREFIX}) + _kde4_set_lib_variables(KJSAPI kjsapi ${KDE4_TARGET_PREFIX}) + _kde4_set_lib_variables(KNEWSTUFF2 knewstuff2 ${KDE4_TARGET_PREFIX}) + _kde4_set_lib_variables(KNOTIFYCONFIG knotifyconfig ${KDE4_TARGET_PREFIX}) + _kde4_set_lib_variables(KPARTS kparts ${KDE4_TARGET_PREFIX}) + _kde4_set_lib_variables(KROSSCORE krosscore ${KDE4_TARGET_PREFIX}) + _kde4_set_lib_variables(KROSSUI krossui ${KDE4_TARGET_PREFIX}) + _kde4_set_lib_variables(KTEXTEDITOR ktexteditor ${KDE4_TARGET_PREFIX}) + _kde4_set_lib_variables(PLASMA plasma ${KDE4_TARGET_PREFIX}) + _kde4_set_lib_variables(SOLID solid ${KDE4_TARGET_PREFIX}) + _kde4_set_lib_variables(THREADWEAVER threadweaver ${KDE4_TARGET_PREFIX}) + _kde4_set_lib_variables(KUTILS kutils ${KDE4_TARGET_PREFIX}) + + if (UNIX) + _kde4_set_lib_variables(KDEFAKES kdefakes ${KDE4_TARGET_PREFIX}) + _kde4_set_lib_variables(KDESU kdesu ${KDE4_TARGET_PREFIX}) + _kde4_set_lib_variables(KPTY kpty ${KDE4_TARGET_PREFIX}) + endif (UNIX) + + # these targets do not always exist, since they are built conditionally: + if(TARGET ${KDE4_TARGET_PREFIX}knepomuk) + _kde4_set_lib_variables(KNEPOMUK knepomuk ${KDE4_TARGET_PREFIX}) + endif(TARGET ${KDE4_TARGET_PREFIX}knepomuk) + + if(TARGET ${KDE4_TARGET_PREFIX}kmetadata) + _kde4_set_lib_variables(KMETADATA kmetadata ${KDE4_TARGET_PREFIX}) + endif(TARGET ${KDE4_TARGET_PREFIX}kmetadata) + + # and this one for compatibility: + set(KDE4_THREADWEAVER_LIBRARIES ${KDE4_TARGET_PREFIX}threadweaver ) + + # KDE4_LIB_INSTALL_DIR and KDE4_INCLUDE_INSTALL_DIR are set in KDELibsDependencies.cmake, + # use them to set the KDE4_LIB_DIR and KDE4_INCLUDE_DIR "public interface" variables + set(KDE4_LIB_DIR ${KDE4_LIB_INSTALL_DIR} ) + set(KDE4_INCLUDE_DIR ${KDE4_INCLUDE_INSTALL_DIR} ) + + + # This setting is currently not recorded in KDELibsDependencies.cmake: + find_file(KDE4_PLASMA_OPENGL_FOUND plasma/glapplet.h PATHS ${KDE4_INCLUDE_DIR} NO_DEFAULT_PATH) + + # now include the file with the imported tools (executable targets) + # Having the libs and tools in two separate files should help with cross compiling. + include(${kde_cmake_module_dir}/KDELibs4ToolsTargets.cmake) + + # get the build CONFIGURATIONS which were exported in this file, and use just the first + # of them to get the location of the installed executables + get_target_property(_importedConfigurations ${KDE4_TARGET_PREFIX}kconfig_compiler IMPORTED_CONFIGURATIONS ) + list(GET _importedConfigurations 0 _firstConfig) + + get_target_property(KDE4_KCFGC_EXECUTABLE ${KDE4_TARGET_PREFIX}kconfig_compiler LOCATION_${firstConfig}) + get_target_property(KDE4_MEINPROC_EXECUTABLE ${KDE4_TARGET_PREFIX}meinproc4 LOCATION_${firstConfig}) + get_target_property(KDE4_MAKEKDEWIDGETS_EXECUTABLE ${KDE4_TARGET_PREFIX}makekdewidgets LOCATION_${firstConfig}) + + # allow searching cmake modules in all given kde install locations (KDEDIRS based) + execute_process(COMMAND "${KDE4_KDECONFIG_EXECUTABLE}" --path data OUTPUT_VARIABLE _data_DIR ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE) + file(TO_CMAKE_PATH "${_data_DIR}" _data_DIR) + foreach(dir ${_data_DIR}) + set (apath "${dir}/cmake/modules") + if (EXISTS "${apath}") + set (included 0) + string(TOLOWER "${apath}" _apath) + # ignore already added pathes, case insensitive + foreach(adir ${CMAKE_MODULE_PATH}) + string(TOLOWER "${adir}" _adir) + if ("${_adir}" STREQUAL "${_apath}") + set (included 1) + endif ("${_adir}" STREQUAL "${_apath}") + endforeach(adir) + if (NOT included) + message(STATUS "Adding ${apath} to CMAKE_MODULE_PATH") + set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${apath}") + endif (NOT included) + endif (EXISTS "${apath}") + endforeach(dir) + +endif (_kdeBootStrapping) + + +##################### provide some options ########################################## + +option(KDE4_ENABLE_FINAL "Enable final all-in-one compilation") +option(KDE4_BUILD_TESTS "Build the tests") +option(KDE4_ENABLE_HTMLHANDBOOK "Create targets htmlhandbook for creating the html versions of the docbook docs") + +# if CMake 2.6.3 or above is used, provide an option which should be used by other KDE packages +# whether to install a CMake FooConfig.cmake into lib/foo/cmake/ or /lib/cmake/foo/ +# (with 2.6.3 and above also lib/cmake/foo/ is supported): +if(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION} VERSION_GREATER 2.6.2) + option(KDE4_USE_COMMON_CMAKE_PACKAGE_CONFIG_DIR "Prefer to install the Config.cmake files to lib/cmake/ instead to lib//cmake" TRUE) +else(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION} VERSION_GREATER 2.6.2) + set(KDE4_USE_COMMON_CMAKE_PACKAGE_CONFIG_DIR FALSE) +endif(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION} VERSION_GREATER 2.6.2) + +# Position-Independent-Executable is a feature of Binutils, Libc, and GCC that creates an executable +# which is something between a shared library and a normal executable. +# Programs compiled with these features appear as ?shared object? with the file command. +# info from "http://www.linuxfromscratch.org/hlfs/view/unstable/glibc/chapter02/pie.html" +option(KDE4_ENABLE_FPIE "Enable platform supports PIE linking") + + +##################### some more settings ########################################## + +if( KDE4_ENABLE_FINAL) + add_definitions(-DKDE_USE_FINAL) +endif(KDE4_ENABLE_FINAL) + +# If we are building ! kdelibs, check where kdelibs are installed. +# If they are installed in a directory which contains "lib64", we default to "64" for LIB_SUFFIX, +# so the current project will by default also go into lib64. +# The same for lib32. Alex +set(_Init_LIB_SUFFIX "") +if ("${KDE4_LIB_DIR}" MATCHES lib64) + set(_Init_LIB_SUFFIX 64) +endif ("${KDE4_LIB_DIR}" MATCHES lib64) +if ("${KDE4_LIB_DIR}" MATCHES lib32) + set(_Init_LIB_SUFFIX 32) +endif ("${KDE4_LIB_DIR}" MATCHES lib32) + +set(LIB_SUFFIX "${_Init_LIB_SUFFIX}" CACHE STRING "Define suffix of directory name (32/64)" ) + + +########## the following are directories where stuff will be installed to ########### +# +# this has to be after find_xxx() block above, since there KDELibsDependencies.cmake is included +# which contains the install dirs from kdelibs, which are reused below + +if (WIN32) +# use relative install prefix to avoid hardcoded install paths in cmake_install.cmake files + + set(LIB_INSTALL_DIR "lib${LIB_SUFFIX}" ) # The subdirectory relative to the install prefix where libraries will be installed (default is ${EXEC_INSTALL_PREFIX}/lib${LIB_SUFFIX}) + + set(EXEC_INSTALL_PREFIX "" ) # Base directory for executables and libraries + set(SHARE_INSTALL_PREFIX "share" ) # Base directory for files which go to share/ + set(BIN_INSTALL_DIR "bin" ) # The install dir for executables (default ${EXEC_INSTALL_PREFIX}/bin) + set(SBIN_INSTALL_DIR "sbin" ) # The install dir for system executables (default ${EXEC_INSTALL_PREFIX}/sbin) + + set(LIBEXEC_INSTALL_DIR "${BIN_INSTALL_DIR}" ) # The subdirectory relative to the install prefix where libraries will be installed (default is ${BIN_INSTALL_DIR}) + set(INCLUDE_INSTALL_DIR "include" ) # The subdirectory to the header prefix + + set(PLUGIN_INSTALL_DIR "lib${LIB_SUFFIX}/kde4" ) # "The subdirectory relative to the install prefix where plugins will be installed (default is ${LIB_INSTALL_DIR}/kde4) + set(CONFIG_INSTALL_DIR "share/config" ) # The config file install dir + set(DATA_INSTALL_DIR "share/kde4/apps" ) # The parent directory where applications can install their data + set(HTML_INSTALL_DIR "share/doc/kde/HTML" ) # The HTML install dir for documentation + set(ICON_INSTALL_DIR "share/icons" ) # The icon install dir (default ${SHARE_INSTALL_PREFIX}/share/icons/) + set(KCFG_INSTALL_DIR "share/kde4/config.kcfg" ) # The install dir for kconfig files + set(LOCALE_INSTALL_DIR "share/locale" ) # The install dir for translations + set(MIME_INSTALL_DIR "share/mimelnk" ) # The install dir for the mimetype desktop files + set(SERVICES_INSTALL_DIR "share/kde4/services" ) # The install dir for service (desktop, protocol, ...) files + set(SERVICETYPES_INSTALL_DIR "share/kde4/servicetypes" ) # The install dir for servicestypes desktop files + set(SOUND_INSTALL_DIR "share/sounds" ) # The install dir for sound files + set(TEMPLATES_INSTALL_DIR "share/templates" ) # The install dir for templates (Create new file...) + set(WALLPAPER_INSTALL_DIR "share/wallpapers" ) # The install dir for wallpapers + set(DEMO_INSTALL_DIR "share/demos" ) # The install dir for demos + set(KCONF_UPDATE_INSTALL_DIR "share/apps/kconf_update" ) # The kconf_update install dir + set(AUTOSTART_INSTALL_DIR "share/autostart" ) # The install dir for autostart files + + set(XDG_APPS_INSTALL_DIR "share/applications/kde4" ) # The XDG apps dir + set(XDG_DIRECTORY_INSTALL_DIR "share/desktop-directories" ) # The XDG directory + set(XDG_MIME_INSTALL_DIR "share/mime/packages" ) # The install dir for the xdg mimetypes + + set(SYSCONF_INSTALL_DIR "etc" ) # The kde sysconfig install dir (default /etc) + set(MAN_INSTALL_DIR "share/man" ) # The kde man install dir (default ${SHARE_INSTALL_PREFIX}/man/) + set(INFO_INSTALL_DIR "share/info" ) # The kde info install dir (default ${SHARE_INSTALL_PREFIX}/info)") + set(DBUS_INTERFACES_INSTALL_DIR "share/dbus-1/interfaces" ) # The kde dbus interfaces install dir (default ${SHARE_INSTALL_PREFIX}/dbus-1/interfaces)") + set(DBUS_SERVICES_INSTALL_DIR "share/dbus-1/services" ) # The kde dbus services install dir (default ${SHARE_INSTALL_PREFIX}/dbus-1/services)") + +else (WIN32) + + # This macro implements some very special logic how to deal with the cache. + # By default the various install locations inherit their value from their "parent" variable + # so if you set CMAKE_INSTALL_PREFIX, then EXEC_INSTALL_PREFIX, PLUGIN_INSTALL_DIR will + # calculate their value by appending subdirs to CMAKE_INSTALL_PREFIX . + # This would work completely without using the cache. + # But if somebody wants e.g. a different EXEC_INSTALL_PREFIX this value has to go into + # the cache, otherwise it will be forgotten on the next cmake run. + # Once a variable is in the cache, it doesn't depend on its "parent" variables + # anymore and you can only change it by editing it directly. + # this macro helps in this regard, because as long as you don't set one of the + # variables explicitely to some location, it will always calculate its value from its + # parents. So modifying CMAKE_INSTALL_PREFIX later on will have the desired effect. + # But once you decide to set e.g. EXEC_INSTALL_PREFIX to some special location + # this will go into the cache and it will no longer depend on CMAKE_INSTALL_PREFIX. + # + # additionally if installing to the same location as kdelibs, the other install + # directories are reused from the installed kdelibs + macro(_SET_FANCY _var _value _comment) + set(predefinedvalue "${_value}") + if ("${CMAKE_INSTALL_PREFIX}" STREQUAL "${KDE4_INSTALL_DIR}" AND DEFINED KDE4_${_var}) + set(predefinedvalue "${KDE4_${_var}}") + endif ("${CMAKE_INSTALL_PREFIX}" STREQUAL "${KDE4_INSTALL_DIR}" AND DEFINED KDE4_${_var}) + + if (NOT DEFINED ${_var}) + set(${_var} ${predefinedvalue}) + else (NOT DEFINED ${_var}) + set(${_var} "${${_var}}" CACHE PATH "${_comment}") + endif (NOT DEFINED ${_var}) + endmacro(_SET_FANCY) + + if(APPLE) + set(BUNDLE_INSTALL_DIR "/Applications/KDE4" CACHE PATH "Directory where application bundles will be installed to on OSX" ) + endif(APPLE) + + _set_fancy(EXEC_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}" "Base directory for executables and libraries") + _set_fancy(SHARE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/share" "Base directory for files which go to share/") + _set_fancy(BIN_INSTALL_DIR "${EXEC_INSTALL_PREFIX}/bin" "The install dir for executables (default ${EXEC_INSTALL_PREFIX}/bin)") + _set_fancy(SBIN_INSTALL_DIR "${EXEC_INSTALL_PREFIX}/sbin" "The install dir for system executables (default ${EXEC_INSTALL_PREFIX}/sbin)") + _set_fancy(LIB_INSTALL_DIR "${EXEC_INSTALL_PREFIX}/lib${LIB_SUFFIX}" "The subdirectory relative to the install prefix where libraries will be installed (default is ${EXEC_INSTALL_PREFIX}/lib${LIB_SUFFIX})") + _set_fancy(LIBEXEC_INSTALL_DIR "${LIB_INSTALL_DIR}/kde4/libexec" "The subdirectory relative to the install prefix where libraries will be installed (default is ${LIB_INSTALL_DIR}/kde4/libexec)") + _set_fancy(INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include" "The subdirectory to the header prefix") + + _set_fancy(PLUGIN_INSTALL_DIR "${LIB_INSTALL_DIR}/kde4" "The subdirectory relative to the install prefix where plugins will be installed (default is ${LIB_INSTALL_DIR}/kde4)") + _set_fancy(CONFIG_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/config" "The config file install dir") + _set_fancy(DATA_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/apps" "The parent directory where applications can install their data") + _set_fancy(HTML_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/doc/HTML" "The HTML install dir for documentation") + _set_fancy(ICON_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/icons" "The icon install dir (default ${SHARE_INSTALL_PREFIX}/share/icons/)") + _set_fancy(KCFG_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/config.kcfg" "The install dir for kconfig files") + _set_fancy(LOCALE_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/locale" "The install dir for translations") + _set_fancy(MIME_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/mimelnk" "The install dir for the mimetype desktop files") + _set_fancy(SERVICES_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/kde4/services" "The install dir for service (desktop, protocol, ...) files") + _set_fancy(SERVICETYPES_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/kde4/servicetypes" "The install dir for servicestypes desktop files") + _set_fancy(SOUND_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/sounds" "The install dir for sound files") + _set_fancy(TEMPLATES_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/templates" "The install dir for templates (Create new file...)") + _set_fancy(WALLPAPER_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/wallpapers" "The install dir for wallpapers") + _set_fancy(DEMO_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/demos" "The install dir for demos") + _set_fancy(KCONF_UPDATE_INSTALL_DIR "${DATA_INSTALL_DIR}/kconf_update" "The kconf_update install dir") + _set_fancy(AUTOSTART_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/autostart" "The install dir for autostart files") + + _set_fancy(XDG_APPS_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/applications/kde4" "The XDG apps dir") + _set_fancy(XDG_DIRECTORY_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/desktop-directories" "The XDG directory") + _set_fancy(XDG_MIME_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/mime/packages" "The install dir for the xdg mimetypes") + + _set_fancy(SYSCONF_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/etc" "The kde sysconfig install dir (default ${CMAKE_INSTALL_PREFIX}/etc)") + _set_fancy(MAN_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/man" "The kde man install dir (default ${SHARE_INSTALL_PREFIX}/man/)") + _set_fancy(INFO_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/info" "The kde info install dir (default ${SHARE_INSTALL_PREFIX}/info)") + _set_fancy(DBUS_INTERFACES_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/dbus-1/interfaces" "The kde dbus interfaces install dir (default ${SHARE_INSTALL_PREFIX}/dbus-1/interfaces)") + _set_fancy(DBUS_SERVICES_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/dbus-1/services" "The kde dbus services install dir (default ${SHARE_INSTALL_PREFIX}/dbus-1/services)") + +endif (WIN32) + + +# The INSTALL_TARGETS_DEFAULT_ARGS variable should be used when libraries are installed. +# It should also be used when installing applications, since then +# on OS X application bundles will be installed to BUNDLE_INSTALL_DIR. +# The variable MUST NOT be used for installing plugins. +# It also MUST NOT be used for executables which are intended to go into sbin/ or libexec/. +# +# Usage is like this: +# install(TARGETS kdecore kdeui ${INSTALL_TARGETS_DEFAULT_ARGS} ) +# +# This will install libraries correctly under UNIX, OSX and Windows (i.e. dll's go +# into bin/. +# Later on it will be possible to extend this for installing OSX frameworks +# The COMPONENT Devel argument has the effect that static libraries belong to the +# "Devel" install component. If we use this also for all install() commands +# for header files, it will be possible to install +# -everything: make install OR cmake -P cmake_install.cmake +# -only the development files: cmake -DCOMPONENT=Devel -P cmake_install.cmake +# -everything except the development files: cmake -DCOMPONENT=Unspecified -P cmake_install.cmake +# This can then also be used for packaging with cpack. + +set(INSTALL_TARGETS_DEFAULT_ARGS RUNTIME DESTINATION "${BIN_INSTALL_DIR}" + LIBRARY DESTINATION "${LIB_INSTALL_DIR}" + ARCHIVE DESTINATION "${LIB_INSTALL_DIR}" COMPONENT Devel ) + + +# on the Mac support an extra install directory for application bundles starting with cmake 2.6 +if(APPLE) + set(INSTALL_TARGETS_DEFAULT_ARGS ${INSTALL_TARGETS_DEFAULT_ARGS} + BUNDLE DESTINATION "${BUNDLE_INSTALL_DIR}" ) +endif(APPLE) + + +############## add some more default search paths ############### +# +# the KDE4_xxx_INSTALL_DIR variables are empty when building kdelibs itself +# and otherwise point to the kde4 install dirs + +set(CMAKE_SYSTEM_INCLUDE_PATH ${CMAKE_SYSTEM_INCLUDE_PATH} + "${KDE4_INCLUDE_INSTALL_DIR}") + +set(CMAKE_SYSTEM_PROGRAM_PATH ${CMAKE_SYSTEM_PROGRAM_PATH} + "${KDE4_BIN_INSTALL_DIR}" ) + +set(CMAKE_SYSTEM_LIBRARY_PATH ${CMAKE_SYSTEM_LIBRARY_PATH} + "${KDE4_LIB_INSTALL_DIR}" ) + +# under Windows dlls may be also installed in bin/ +if(WIN32) + set(CMAKE_SYSTEM_LIBRARY_PATH ${CMAKE_SYSTEM_LIBRARY_PATH} + "${_CMAKE_INSTALL_DIR}/bin" + "${CMAKE_INSTALL_PREFIX}/bin" ) +endif(WIN32) + + +###################################################### +# and now the platform specific stuff +###################################################### + +# Set a default build type for single-configuration +# CMake generators if no build type is set. +if (NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE RelWithDebInfo) +endif (NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE) + + +if (WIN32) + + if(CYGWIN) + message(FATAL_ERROR "Cygwin is NOT supported, use mingw or MSVC to build KDE4.") + endif(CYGWIN) + + find_package(KDEWIN32 REQUIRED) + + # limit win32 packaging to kdelibs at now + # don't know if package name, version and notes are always available + if(_kdeBootStrapping) + find_package(KDEWIN_Packager) + if (KDEWIN_PACKAGER_FOUND) + kdewin_packager("kdelibs" "${KDE_VERSION}" "KDE base library" "") + endif (KDEWIN_PACKAGER_FOUND) + + include(Win32Macros) + addExplorerWrapper("kdelibs") + endif(_kdeBootStrapping) + + set( _KDE4_PLATFORM_INCLUDE_DIRS ${KDEWIN32_INCLUDES}) + + # if we are compiling kdelibs, add KDEWIN32_LIBRARIES explicitely, + # otherwise they come from KDELibsDependencies.cmake, Alex + if (_kdeBootStrapping) + set( KDE4_KDECORE_LIBS ${KDE4_KDECORE_LIBS} ${KDEWIN32_LIBRARIES} ) + endif (_kdeBootStrapping) + + # we prefer to use a different postfix for debug libs only on Windows + # does not work atm + set(CMAKE_DEBUG_POSTFIX "") + + # windows, microsoft compiler + if(MSVC) + set( _KDE4_PLATFORM_DEFINITIONS -DKDE_FULL_TEMPLATE_EXPORT_INSTANTIATION -DWIN32_LEAN_AND_MEAN -DUNICODE ) + # C4250: 'class1' : inherits 'class2::member' via dominance + set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -wd4250" ) + # C4251: 'identifier' : class 'type' needs to have dll-interface to be used by clients of class 'type2' + set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -wd4251" ) + # C4396: 'identifier' : 'function' the inline specifier cannot be used when a friend declaration refers to a specialization of a function template + set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -wd4396" ) + if(CMAKE_COMPILER_2005) + # to avoid a lot of deprecated warnings + add_definitions( -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS ) + # 'identifier' : no suitable definition provided for explicit template instantiation request + set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -wd4661" ) + endif(CMAKE_COMPILER_2005) + endif(MSVC) + + + # for visual studio IDE set the path correctly for custom commands + # maybe under windows bat-files should be generated for running apps during the build + if(MSVC_IDE) + get_filename_component(PERL_LOCATION "${PERL_EXECUTABLE}" PATH) + file(TO_NATIVE_PATH "${PERL_LOCATION}" PERL_PATH_WINDOWS) + file(TO_NATIVE_PATH "${QT_BINARY_DIR}" QT_BIN_DIR_WINDOWS) + set(CMAKE_MSVCIDE_RUN_PATH "${PERL_PATH_WINDOWS}\;${QT_BIN_DIR_WINDOWS}" + CACHE STATIC "MSVC IDE Run path" FORCE) + endif(MSVC_IDE) +endif (WIN32) + + +# setup default RPATH/install_name handling, may be overridden by KDE4_HANDLE_RPATH_FOR_EXECUTABLE +# It sets up to build with full RPATH. When installing, RPATH will be changed to the LIB_INSTALL_DIR +# and all link directories which are not inside the current build dir. +if (UNIX) + set( _KDE4_PLATFORM_INCLUDE_DIRS) + + # the rest is RPATH handling + # here the defaults are set + # which are partly overwritten in kde4_handle_rpath_for_library() + # and kde4_handle_rpath_for_executable(), both located in KDE4Macros.cmake, Alex + if (APPLE) + set(CMAKE_INSTALL_NAME_DIR ${LIB_INSTALL_DIR}) + else (APPLE) + # add our LIB_INSTALL_DIR to the RPATH and use the RPATH figured out by cmake when compiling + set(CMAKE_INSTALL_RPATH ${LIB_INSTALL_DIR} ) + set(CMAKE_SKIP_BUILD_RPATH FALSE) + set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) + set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) + endif (APPLE) +endif (UNIX) + + +if (Q_WS_X11) + # Done by FindQt4.cmake already + #find_package(X11 REQUIRED) + # UNIX has already set _KDE4_PLATFORM_INCLUDE_DIRS, so append + set(_KDE4_PLATFORM_INCLUDE_DIRS ${_KDE4_PLATFORM_INCLUDE_DIRS} ${X11_INCLUDE_DIR} ) +endif (Q_WS_X11) + + +# This will need to be modified later to support either Qt/X11 or Qt/Mac builds +if (APPLE) + + set ( _KDE4_PLATFORM_DEFINITIONS -D__APPLE_KDE__ ) + + # we need to set MACOSX_DEPLOYMENT_TARGET to (I believe) at least 10.2 or maybe 10.3 to allow + # -undefined dynamic_lookup; in the future we should do this programmatically + # hmm... why doesn't this work? + set (ENV{MACOSX_DEPLOYMENT_TARGET} 10.3) + + # "-undefined dynamic_lookup" means we don't care about missing symbols at link-time by default + # this is bad, but unavoidable until there is the equivalent of libtool -no-undefined implemented + # or perhaps it already is, and I just don't know where to look ;) + + set (CMAKE_SHARED_LINKER_FLAGS "-single_module -multiply_defined suppress ${CMAKE_SHARED_LINKER_FLAGS}") + set (CMAKE_MODULE_LINKER_FLAGS "-multiply_defined suppress ${CMAKE_MODULE_LINKER_FLAGS}") + #set(CMAKE_SHARED_LINKER_FLAGS "-single_module -undefined dynamic_lookup -multiply_defined suppress") + #set(CMAKE_MODULE_LINKER_FLAGS "-undefined dynamic_lookup -multiply_defined suppress") + + # we profile... + if(CMAKE_BUILD_TYPE_TOLOWER MATCHES profile) + set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fprofile-arcs -ftest-coverage") + set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -fprofile-arcs -ftest-coverage") + endif(CMAKE_BUILD_TYPE_TOLOWER MATCHES profile) + + # removed -Os, was there a special reason for using -Os instead of -O2 ?, Alex + # optimization flags are set below for the various build types + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-common") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-common") +endif (APPLE) + + +if (CMAKE_SYSTEM_NAME MATCHES Linux) + if (CMAKE_COMPILER_IS_GNUCXX) + set ( _KDE4_PLATFORM_DEFINITIONS -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_GNU_SOURCE) + set ( CMAKE_SHARED_LINKER_FLAGS "-Wl,--fatal-warnings -Wl,--no-undefined -lc ${CMAKE_SHARED_LINKER_FLAGS}") + set ( CMAKE_MODULE_LINKER_FLAGS "-Wl,--fatal-warnings -Wl,--no-undefined -lc ${CMAKE_MODULE_LINKER_FLAGS}") + + set ( CMAKE_SHARED_LINKER_FLAGS "-Wl,--enable-new-dtags ${CMAKE_SHARED_LINKER_FLAGS}") + set ( CMAKE_MODULE_LINKER_FLAGS "-Wl,--enable-new-dtags ${CMAKE_MODULE_LINKER_FLAGS}") + set ( CMAKE_EXE_LINKER_FLAGS "-Wl,--enable-new-dtags ${CMAKE_EXE_LINKER_FLAGS}") + + # we profile... + if(CMAKE_BUILD_TYPE_TOLOWER MATCHES profile) + set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fprofile-arcs -ftest-coverage") + set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -fprofile-arcs -ftest-coverage") + endif(CMAKE_BUILD_TYPE_TOLOWER MATCHES profile) + endif (CMAKE_COMPILER_IS_GNUCXX) + if (CMAKE_C_COMPILER MATCHES "icc") + set ( _KDE4_PLATFORM_DEFINITIONS -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_GNU_SOURCE) + set ( CMAKE_SHARED_LINKER_FLAGS "-Wl,--fatal-warnings -Wl,--no-undefined -lc ${CMAKE_SHARED_LINKER_FLAGS}") + set ( CMAKE_MODULE_LINKER_FLAGS "-Wl,--fatal-warnings -Wl,--no-undefined -lc ${CMAKE_MODULE_LINKER_FLAGS}") + endif (CMAKE_C_COMPILER MATCHES "icc") +endif (CMAKE_SYSTEM_NAME MATCHES Linux) + +if (UNIX) + set ( _KDE4_PLATFORM_DEFINITIONS "${_KDE4_PLATFORM_DEFINITIONS} -D_LARGEFILE64_SOURCE") + + check_cxx_source_compiles(" +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; + int main() { return 0; } +" _OFFT_IS_64BIT) + + if (NOT _OFFT_IS_64BIT) + set ( _KDE4_PLATFORM_DEFINITIONS "${_KDE4_PLATFORM_DEFINITIONS} -D_FILE_OFFSET_BITS=64") + endif (NOT _OFFT_IS_64BIT) +endif (UNIX) + +if (CMAKE_SYSTEM_NAME MATCHES BSD) + set ( _KDE4_PLATFORM_DEFINITIONS -D_GNU_SOURCE ) + set ( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -lc") + set ( CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -lc") +endif (CMAKE_SYSTEM_NAME MATCHES BSD) + + +############################################################ +# compiler specific settings +############################################################ + + +# this macro is for internal use only. +macro(KDE_CHECK_FLAG_EXISTS FLAG VAR DOC) + if(NOT ${VAR} MATCHES "${FLAG}") + set(${VAR} "${${VAR}} ${FLAG}" CACHE STRING "Flags used by the linker during ${DOC} builds." FORCE) + endif(NOT ${VAR} MATCHES "${FLAG}") +endmacro(KDE_CHECK_FLAG_EXISTS FLAG VAR) + +if (MSVC) + set (KDE4_ENABLE_EXCEPTIONS -EHsc) + + # make sure that no header adds libcmt by default using #pragma comment(lib, "libcmt.lib") as done by mfc/afx.h + kde_check_flag_exists("/NODEFAULTLIB:libcmt /DEFAULTLIB:msvcrt" CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "Release with Debug Info") + kde_check_flag_exists("/NODEFAULTLIB:libcmt /DEFAULTLIB:msvcrt" CMAKE_EXE_LINKER_FLAGS_RELEASE "release") + kde_check_flag_exists("/NODEFAULTLIB:libcmt /DEFAULTLIB:msvcrt" CMAKE_EXE_LINKER_FLAGS_MINSIZEREL "release minsize") + kde_check_flag_exists("/NODEFAULTLIB:libcmtd /DEFAULTLIB:msvcrtd" CMAKE_EXE_LINKER_FLAGS_DEBUG "debug") +endif(MSVC) + + +if (CMAKE_COMPILER_IS_GNUCXX) + set (KDE4_ENABLE_EXCEPTIONS -fexceptions) + # Select flags. + set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g") + set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG -DQT_NO_DEBUG") + set(CMAKE_CXX_FLAGS_DEBUG "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline") + set(CMAKE_CXX_FLAGS_DEBUGFULL "-g3 -fno-inline") + set(CMAKE_CXX_FLAGS_PROFILE "-g3 -fno-inline -ftest-coverage -fprofile-arcs") + set(CMAKE_CXX_FLAGS_DEBIAN "-DNDEBUG -DQT_NO_DEBUG") + set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g") + set(CMAKE_C_FLAGS_RELEASE "-O2 -DNDEBUG -DQT_NO_DEBUG") + set(CMAKE_C_FLAGS_DEBUG "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline") + set(CMAKE_C_FLAGS_DEBUGFULL "-g3 -fno-inline") + set(CMAKE_C_FLAGS_PROFILE "-g3 -fno-inline -ftest-coverage -fprofile-arcs") + set(CMAKE_C_FLAGS_DEBIAN "-DNDEBUG -DQT_NO_DEBUG") + + if (CMAKE_SYSTEM_NAME MATCHES Linux) + set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-long-long -std=iso9899:1990 -Wundef -Wcast-align -Werror-implicit-function-declaration -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute -fno-common") + set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wnon-virtual-dtor -Wno-long-long -ansi -Wundef -Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith -Wformat-security -fno-exceptions -fno-check-new -fno-common") + add_definitions (-D_BSD_SOURCE) + endif (CMAKE_SYSTEM_NAME MATCHES Linux) + + # gcc under Windows + if (MINGW) + set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--export-all-symbols -Wl,--disable-auto-import") + set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--export-all-symbols -Wl,--disable-auto-import") + + # we always link against the release version of QT with mingw + # (even for debug builds). So we need to define QT_NO_DEBUG + # or else QPluginLoader rejects plugins because it thinks + # they're built against the wrong QT. + add_definitions(-DQT_NO_DEBUG) + endif (MINGW) + + check_cxx_compiler_flag(-fPIE HAVE_FPIE_SUPPORT) + if(KDE4_ENABLE_FPIE) + if(HAVE_FPIE_SUPPORT) + set (KDE4_CXX_FPIE_FLAGS "-fPIE") + set (KDE4_PIE_LDFLAGS "-pie") + else(HAVE_FPIE_SUPPORT) + message(STATUS "Your compiler doesn't support the PIE flag") + endif(HAVE_FPIE_SUPPORT) + endif(KDE4_ENABLE_FPIE) + + check_cxx_compiler_flag(-Woverloaded-virtual __KDE_HAVE_W_OVERLOADED_VIRTUAL) + if(__KDE_HAVE_W_OVERLOADED_VIRTUAL) + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Woverloaded-virtual") + endif(__KDE_HAVE_W_OVERLOADED_VIRTUAL) + + # visibility support + check_cxx_compiler_flag(-fvisibility=hidden __KDE_HAVE_GCC_VISIBILITY) + set( __KDE_HAVE_GCC_VISIBILITY ${__KDE_HAVE_GCC_VISIBILITY} CACHE BOOL "GCC support for hidden visibility") + + # get the gcc version + exec_program(${CMAKE_C_COMPILER} ARGS --version OUTPUT_VARIABLE _gcc_version_info) + + string (REGEX MATCH "[345]\\.[0-9]\\.[0-9]" _gcc_version "${_gcc_version_info}") + # gcc on mac just reports: "gcc (GCC) 3.3 20030304 ..." without the patch level, handle this here: + if (NOT _gcc_version) + string (REGEX REPLACE ".*\\(GCC\\).* ([34]\\.[0-9]) .*" "\\1.0" _gcc_version "${_gcc_version_info}") + endif (NOT _gcc_version) + + macro_ensure_version("4.1.0" "${_gcc_version}" GCC_IS_NEWER_THAN_4_1) + macro_ensure_version("4.2.0" "${_gcc_version}" GCC_IS_NEWER_THAN_4_2) + macro_ensure_version("4.3.0" "${_gcc_version}" GCC_IS_NEWER_THAN_4_3) + + # save a little by making local statics not threadsafe + # ### do not enable it for older compilers, see + # ### http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31806 + if (GCC_IS_NEWER_THAN_4_3) + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-threadsafe-statics") + endif (GCC_IS_NEWER_THAN_4_3) + + set(_GCC_COMPILED_WITH_BAD_ALLOCATOR FALSE) + if (GCC_IS_NEWER_THAN_4_1) + exec_program(${CMAKE_C_COMPILER} ARGS -v OUTPUT_VARIABLE _gcc_alloc_info) + string(REGEX MATCH "(--enable-libstdcxx-allocator=mt)" _GCC_COMPILED_WITH_BAD_ALLOCATOR "${_gcc_alloc_info}") + endif (GCC_IS_NEWER_THAN_4_1) + + if (__KDE_HAVE_GCC_VISIBILITY AND GCC_IS_NEWER_THAN_4_1 AND NOT _GCC_COMPILED_WITH_BAD_ALLOCATOR) + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden") + set (KDE4_C_FLAGS "-fvisibility=hidden") + # check that Qt defines Q_DECL_EXPORT as __attribute__ ((visibility("default"))) + # if it doesn't and KDE compiles with hidden default visibiltiy plugins will break + set(_source "#include \n int main()\n {\n #ifdef QT_VISIBILITY_AVAILABLE \n return 0;\n #else \n return 1; \n #endif \n }\n") + set(_source_file ${CMAKE_BINARY_DIR}/CMakeTmp/check_qt_visibility.cpp) + file(WRITE "${_source_file}" "${_source}") + set(_include_dirs "-DINCLUDE_DIRECTORIES:STRING=${QT_INCLUDES}") + + try_run(_run_result _compile_result ${CMAKE_BINARY_DIR} ${_source_file} CMAKE_FLAGS "${_include_dirs}" COMPILE_OUTPUT_VARIABLE _compile_output_var) + + if(NOT _compile_result) + message(FATAL_ERROR "Could not compile simple test program:\n ${_source}\n${_compile_output_var}") + endif(NOT _compile_result) + if(_run_result) + message(FATAL_ERROR "Qt compiled without support for -fvisibility=hidden. This will break plugins and linking of some applications. Please fix your Qt installation.") + endif(_run_result) + + if (GCC_IS_NEWER_THAN_4_2) + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility-inlines-hidden") + endif (GCC_IS_NEWER_THAN_4_2) + else (__KDE_HAVE_GCC_VISIBILITY AND GCC_IS_NEWER_THAN_4_1 AND NOT _GCC_COMPILED_WITH_BAD_ALLOCATOR) + set (__KDE_HAVE_GCC_VISIBILITY 0) + endif (__KDE_HAVE_GCC_VISIBILITY AND GCC_IS_NEWER_THAN_4_1 AND NOT _GCC_COMPILED_WITH_BAD_ALLOCATOR) + +endif (CMAKE_COMPILER_IS_GNUCXX) + + +if (CMAKE_C_COMPILER MATCHES "icc") + + set (KDE4_ENABLE_EXCEPTIONS -fexceptions) + # Select flags. + set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g") + set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG -DQT_NO_DEBUG") + set(CMAKE_CXX_FLAGS_DEBUG "-O2 -g -fno-inline -noalign") + set(CMAKE_CXX_FLAGS_DEBUGFULL "-g -fno-inline -noalign") + set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g") + set(CMAKE_C_FLAGS_RELEASE "-O2 -DNDEBUG -DQT_NO_DEBUG") + set(CMAKE_C_FLAGS_DEBUG "-O2 -g -fno-inline -noalign") + set(CMAKE_C_FLAGS_DEBUGFULL "-g -fno-inline -noalign") + + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ansi -Wall -w1 -Wpointer-arith -fno-common") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ansi -Wall -w1 -Wpointer-arith -fno-exceptions -fno-common") + + # visibility support + set(__KDE_HAVE_ICC_VISIBILITY) +# check_cxx_compiler_flag(-fvisibility=hidden __KDE_HAVE_ICC_VISIBILITY) +# if (__KDE_HAVE_ICC_VISIBILITY) +# set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden") +# endif (__KDE_HAVE_ICC_VISIBILITY) + +endif (CMAKE_C_COMPILER MATCHES "icc") + + +########### end of platform specific stuff ########################## + + +# KDE4Macros.cmake contains all the KDE specific macros +include(${kde_cmake_module_dir}/KDE4Macros.cmake) + + +# decide whether KDE4 has been found +set(KDE4_FOUND FALSE) +if (KDE4_INCLUDE_DIR AND KDE4_LIB_DIR AND KDE4_KCFGC_EXECUTABLE AND KDE4_INSTALLED_VERSION_OK) + set(KDE4_FOUND TRUE) +endif (KDE4_INCLUDE_DIR AND KDE4_LIB_DIR AND KDE4_KCFGC_EXECUTABLE AND KDE4_INSTALLED_VERSION_OK) + + +macro (KDE4_PRINT_RESULTS) + + # inside kdelibs the include dir and lib dir are internal, not "found" + if (NOT _kdeBootStrapping) + if(KDE4_INCLUDE_DIR) + message(STATUS "Found KDE 4.2 include dir: ${KDE4_INCLUDE_DIR}") + else(KDE4_INCLUDE_DIR) + message(STATUS "ERROR: unable to find the KDE 4 headers") + endif(KDE4_INCLUDE_DIR) + + if(KDE4_LIB_DIR) + message(STATUS "Found KDE 4.2 library dir: ${KDE4_LIB_DIR}") + else(KDE4_LIB_DIR) + message(STATUS "ERROR: unable to find the KDE 4 core library") + endif(KDE4_LIB_DIR) + endif (NOT _kdeBootStrapping) + + if(KDE4_KCFGC_EXECUTABLE) + message(STATUS "Found the KDE4 kconfig_compiler preprocessor: ${KDE4_KCFGC_EXECUTABLE}") + else(KDE4_KCFGC_EXECUTABLE) + message(STATUS "Didn't find the KDE4 kconfig_compiler preprocessor") + endif(KDE4_KCFGC_EXECUTABLE) + + if(AUTOMOC4_EXECUTABLE) + message(STATUS "Found automoc4: ${AUTOMOC4_EXECUTABLE}") + else(AUTOMOC4_EXECUTABLE) + message(STATUS "Didn't find automoc4") + endif(AUTOMOC4_EXECUTABLE) +endmacro (KDE4_PRINT_RESULTS) + + +if (KDE4Internal_FIND_REQUIRED AND NOT KDE4_FOUND) + #bail out if something wasn't found + kde4_print_results() + if (NOT KDE4_INSTALLED_VERSION_OK) + message(FATAL_ERROR "ERROR: the installed kdelibs version ${KDE_VERSION} is too old, at least version ${KDE_MIN_VERSION} is required") + endif (NOT KDE4_INSTALLED_VERSION_OK) + + if (NOT KDE4_KCFGC_EXECUTABLE) + message(FATAL_ERROR "ERROR: could not detect a usable kconfig_compiler") + endif (NOT KDE4_KCFGC_EXECUTABLE) + + message(FATAL_ERROR "ERROR: could NOT find everything required for compiling KDE 4 programs") +endif (KDE4Internal_FIND_REQUIRED AND NOT KDE4_FOUND) + +find_package(Phonon REQUIRED) +set(KDE4_PHONON_LIBRARY ${PHONON_LIBRARY}) +set(KDE4_PHONON_LIBS ${PHONON_LIBS}) +set(KDE4_PHONON_INCLUDES ${PHONON_INCLUDES}) + +if (NOT KDE4Internal_FIND_QUIETLY) + kde4_print_results() +endif (NOT KDE4Internal_FIND_QUIETLY) + +#add the found Qt and KDE include directories to the current include path +#the ${KDE4_INCLUDE_DIR}/KDE directory is for forwarding includes, eg. #include +set(KDE4_INCLUDES + ${KDE4_INCLUDE_DIR} + ${KDE4_INCLUDE_DIR}/KDE + ${KDE4_PHONON_INCLUDES} + ${QT_INCLUDES} + ${_KDE4_PLATFORM_INCLUDE_DIRS} +) + +set(KDE4_DEFINITIONS ${_KDE4_PLATFORM_DEFINITIONS} -DQT_NO_STL -DQT_NO_CAST_TO_ASCII -D_REENTRANT -DKDE_DEPRECATED_WARNINGS ) + +if (NOT _kde4_uninstall_rule_created) + set(_kde4_uninstall_rule_created TRUE) + + configure_file("${kde_cmake_module_dir}/kde4_cmake_uninstall.cmake.in" "${CMAKE_BINARY_DIR}/cmake_uninstall.cmake" @ONLY) + + add_custom_target(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_BINARY_DIR}/cmake_uninstall.cmake") + +endif (NOT _kde4_uninstall_rule_created) + +endif(NOT KDE4_FOUND) diff --git a/cmake/modules/FindKDE4Workspace.cmake b/cmake/modules/FindKDE4Workspace.cmake new file mode 100644 index 0000000000..660c7b8dcb --- /dev/null +++ b/cmake/modules/FindKDE4Workspace.cmake @@ -0,0 +1,71 @@ +# Find if we installed kdebase/workspaces. +# Once done this will define +# +# KDE4WORKSPACE_FOUND - system has KDE workspace installed +# KDE4WORKSPACE_INCLUDE_DIR - the KDE workspace include directory +# +# It also sets variables for the following libraries: +# KDE4WORKSPACE_TASKMANAGER_LIBRARY, KDE4WORKSPACE_TASKMANAGER_LIBS +# KDE4WORKSPACE_KWORKSPACE_LIBRARY, KDE4WORKSPACE_KWORKSPACE_LIBS +# KDE4WORKSPACE_SOLIDCONTROLIFACES_LIBRARY, KDE4WORKSPACE_SOLIDCONTROLIFACES_LIBS +# KDE4WORKSPACE_SOLIDCONTROL_LIBRARY, KDE4WORKSPACE_SOLIDCONTROL_LIBS +# KDE4WORKSPACE_PROCESSUI_LIBRARY, KDE4WORKSPACE_PROCESSUI_LIBS +# KDE4WORKSPACE_LSOFUI_LIBRARY, KDE4WORKSPACE_LSOFUI_LIBS +# KDE4WORKSPACE_PLASMACLOCK_LIBRARY, KDE4WORKSPACE_PLASMACLOCK_LIBS +# KDE4WORKSPACE_NEPOMUKQUERYCLIENT_LIBRARY, KDE4WORKSPACE_NEPOMUKQUERYCLIENT_LIBS +# KDE4WORKSPACE_NEPOMUKQUERY_LIBRARY, KDE4WORKSPACE_NEPOMUKQUERY_LIBS +# KDE4WORKSPACE_KSCREENSAVER_LIBRARY, KDE4WORKSPACE_KSCREENSAVER_LIBS +# KDE4WORKSPACE_WEATHERION_LIBRARY, KDE4WORKSPACE_WEATHERION_LIBS +# KDE4WORKSPACE_KWINEFFECTS_LIBRARY, KDE4WORKSPACE_KWINEFFECTS_LIBS +# KDE4WORKSPACE_KDECORATIONS_LIBRARY, KDE4WORKSPACE_KDECORATIONS_LIBS +# KDE4WORKSPACE_KSGRD_LIBRARY, KDE4WORKSPACE_KSGRD_LIBS +# KDE4WORKSPACE_KEPHAL_LIBRARY, KDE4WORKSPACE_KEPHAL_LIBS +# +# And the following locations: +# KDE4WORKSPACE_LIB_DIR +# KDE4WORKSPACE_LIBEXEC_DIR +# KDE4WORKSPACE_INCLUDE_DIR +# KDE4WORKSPACE_BIN_DIR +# KDE4WORKSPACE_SBIN_DIR +# KDE4WORKSPACE_DATA_DIR +# KDE4WORKSPACE_HTML_DIR +# KDE4WORKSPACE_CONFIG_DIR +# KDE4WORKSPACE_ICON_DIR +# KDE4WORKSPACE_KCFG_DIR +# KDE4WORKSPACE_LOCALE_DIR +# KDE4WORKSPACE_MIME_DIR +# KDE4WORKSPACE_SOUND_DIR +# KDE4WORKSPACE_TEMPLATES_DIR +# KDE4WORKSPACE_WALLPAPER_DIR +# KDE4WORKSPACE_KCONF_UPDATE_DIR +# KDE4WORKSPACE_AUTOSTART_DIR +# KDE4WORKSPACE_XDG_APPS_DIR +# KDE4WORKSPACE_XDG_DIRECTORY_DIR +# KDE4WORKSPACE_SYSCONF_DIR +# KDE4WORKSPACE_MAN_DIR +# KDE4WORKSPACE_INFO_DIR +# KDE4WORKSPACE_DBUS_INTERFACES_DIR +# KDE4WORKSPACE_DBUS_SERVICES_DIR +# KDE4WORKSPACE_SERVICES_DIR +# KDE4WORKSPACE_SERVICETYPES_DIR + +# Copyright (c) 2008, Alexander Neundorf, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +# The find_package() call below loads the file KDE4WorkspaceConfig.cmake file. +# This file is created and installed by kdebase/workspace/CMakeLists.txt +# It contains settings for all install location of kdebase/workspace, as e.g. +# KDE4WORKSPACE_INCLUDE_DIR, and also variables for all libraries. +# See kdebase/workspace/CMakeLists.txt and kdebase/workspace/KDE4WorkspaceConfig.cmake.in +# for details. Alex + + +set(_KDE4Workspace_FIND_QUIETLY ${KDE4Workspace_FIND_QUIETLY}) +find_package(KDE4Workspace QUIET NO_MODULE PATHS ${KDE4_LIB_DIR}/KDE4Workspace/cmake ) +set(KDE4Workspace_FIND_QUIETLY ${_KDE4Workspace_FIND_QUIETLY}) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(KDE4Workspace DEFAULT_MSG KDE4Workspace_CONFIG ) + diff --git a/cmake/modules/FindKDEWIN32.cmake b/cmake/modules/FindKDEWIN32.cmake new file mode 100644 index 0000000000..abbff19e80 --- /dev/null +++ b/cmake/modules/FindKDEWIN32.cmake @@ -0,0 +1,73 @@ +# - Try to find the KDEWIN32 library +# +# Once done this will define +# +# KDEWIN32_FOUND - system has KDEWIN32 +# KDEWIN32_INCLUDES - the KDEWIN32 include directories +# KDEWIN32_LIBRARIES - The libraries needed to use KDEWIN32 + +# Copyright (c) 2006, Alexander Neundorf, +# Copyright (c) 2007-2008, Ralf Habacker, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + + +if (WIN32) + if (NOT KDEWIN32_DIR) + + find_path(KDEWIN32_INCLUDE_DIR winposix_export.h + ${CMAKE_INCLUDE_PATH} + ${CMAKE_INSTALL_PREFIX}/include + ) + + # search for kdewin32 in the default install directory for applications (default of (n)make install) + FILE(TO_CMAKE_PATH "${CMAKE_LIBRARY_PATH}" _cmakeLibraryPathCmakeStyle) + + if (CMAKE_BUILD_TYPE STREQUAL "Debug") + set (LIBRARY_NAME kdewin32d) + else (CMAKE_BUILD_TYPE STREQUAL "Debug") + set (LIBRARY_NAME kdewin32) + endif (CMAKE_BUILD_TYPE STREQUAL "Debug") + + find_library(KDEWIN32_LIBRARY + NAMES ${LIBRARY_NAME} + PATHS + ${_cmakeLibraryPathCmakeStyle} + ${CMAKE_INSTALL_PREFIX}/lib + NO_SYSTEM_ENVIRONMENT_PATH + ) + + if (KDEWIN32_LIBRARY AND KDEWIN32_INCLUDE_DIR) + set(KDEWIN32_FOUND TRUE) + # add needed system libs + set(KDEWIN32_LIBRARIES ${KDEWIN32_LIBRARY} user32 shell32 ws2_32 netapi32 userenv) + + if (MINGW) + #mingw compiler + set(KDEWIN32_INCLUDES ${KDEWIN32_INCLUDE_DIR} ${KDEWIN32_INCLUDE_DIR}/mingw ${QT_INCLUDES}) + else (MINGW) + # msvc compiler + # add the MS SDK include directory if available + file(TO_CMAKE_PATH "$ENV{MSSDK}" MSSDK_DIR) + set(KDEWIN32_INCLUDES ${KDEWIN32_INCLUDE_DIR} ${KDEWIN32_INCLUDE_DIR}/msvc ${QT_INCLUDES} ${MSSDK_DIR}) + endif (MINGW) + + endif (KDEWIN32_LIBRARY AND KDEWIN32_INCLUDE_DIR) + # required for configure + set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${KDEWIN32_INCLUDES}) + set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${KDEWIN32_LIBRARIES}) + + endif (NOT KDEWIN32_DIR) + + if (KDEWIN32_FOUND) + if (NOT KDEWIN32_FIND_QUIETLY) + message(STATUS "Found kdewin32 library: ${KDEWIN32_LIBRARY}") + endif (NOT KDEWIN32_FIND_QUIETLY) + + else (KDEWIN32_FOUND) + if (KDEWIN32_FIND_REQUIRED) + message(FATAL_ERROR "Could NOT find KDEWIN32 library\nPlease install it first") + endif (KDEWIN32_FIND_REQUIRED) + endif (KDEWIN32_FOUND) +endif (WIN32) diff --git a/cmake/modules/FindKDEWIN_Packager.cmake b/cmake/modules/FindKDEWIN_Packager.cmake new file mode 100644 index 0000000000..b8f023e50b --- /dev/null +++ b/cmake/modules/FindKDEWIN_Packager.cmake @@ -0,0 +1,171 @@ +# +# KDEWIN packager http://www.winkde.org/pub/kde/ports/win32/installer +# +# The kdewin packager is searched in the following pathes and order +# +# path specified by the environment dir KDEWIN_PACKAGER_DIR +# /kdewin-packager +# /kdewin-installer +# +# The macro KDEWIN_PACKAGER provides package building support and should be +# added to the top level CMakeLists.txt as shown below +# +# if (KDEWIN_PACKAGER_FOUND) +# KDEWIN_PACKAGER( +# "projectname" +# "version" +# "description" +# "additional options" +# ) +# endif (KDEWIN_PACKAGER_FOUND) + +# The macro KDEWIN_PACKAGER adds three additional makefile targets, which could be +# called using the regular make tool +# +# kdewin_package +# - build kdewin package with currently used compiler and build type +# kdewin_package_debug_and_release +# - build kdewin debug and release package with currently used compiler +# kdewin_package_debug_and_release_mingw_and_msvc +# - build kdewin debug and release package with mingw and msvc compiler +# +# +# +# Copyright (c) 2006-2007, Ralf Habacker +# +# Redistribution and use is allowed according to the terms of the BSD license. +# + +if (WIN32) + if(NOT KDEWIN_PACKAGER_DIR) + # check for enviroment variable + file(TO_CMAKE_PATH "$ENV{KDEWIN_PACKAGER_DIR}" KDEWIN_PACKAGER_DIR) + if(NOT KDEWIN_PACKAGER_DIR) + # search in the default program install folder + file(TO_CMAKE_PATH "$ENV{PROGRAMFILES}" _progFiles) + find_file(KDEWIN_PACKAGER_DIR_tmp kdewin-packager kdewin-installer + PATHS + "${_progFiles}" + ) + set(KDEWIN_PACKAGER_DIR ${KDEWIN_PACKAGER_DIR_tmp}) + endif(NOT KDEWIN_PACKAGER_DIR) + endif(NOT KDEWIN_PACKAGER_DIR) + + if (KDEWIN_PACKAGER_DIR) + + find_program(KDEWIN_PACKAGER_EXECUTABLE kdewin-packager + PATHS + ${KDEWIN_PACKAGER_DIR}/bin + ${CMAKE_INSTALL_PREFIX}/bin + ) + + set(KDEWIN_PACKAGER_FOUND TRUE) + else (KDEWIN_PACKAGER_DIR) + set(KDEWIN_PACKAGER_FOUND) + endif (KDEWIN_PACKAGER_DIR) + + if (KDEWIN_PACKAGER_FOUND) + if (NOT KDEWIN_Packager_FIND_QUIETLY) + message(STATUS "Found KDEWIN Packager: ${KDEWIN_PACKAGER_DIR}") + endif (NOT KDEWIN_Packager_FIND_QUIETLY) + else (KDEWIN_PACKAGER_FOUND) + if (KDEWIN_Packager_FIND_REQUIRED) + message(FATAL_ERROR "Could NOT find KDEWIN PAckager") + endif (KDEWIN_Packager_FIND_REQUIRED) + endif (KDEWIN_PACKAGER_FOUND) + +endif (WIN32) + +MACRO (KDEWIN_PACKAGER _name _version _notes _options) + if (KDEWIN_PACKAGER_FOUND) + if (MSVC) + set (type "msvc") + else (MSVC) + set (type "mingw") + endif (MSVC) + + add_custom_target(kdewin_package + COMMAND ${CMAKE_COMMAND} + -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/temp -P ${CMAKE_BINARY_DIR}/cmake_install.cmake + COMMAND ${KDEWIN_PACKAGER_EXECUTABLE} + -name ${_name} + -root ${CMAKE_BINARY_DIR}/temp + -srcroot ${CMAKE_SOURCE_DIR} + -version ${_version} + -notes "${_notes}" + -type ${type} + ${_options} + # FIXME: cleanup does not work + #COMMAND rmdir /Q /S ${CMAKE_BINARY_DIR}\temp + ) + # prelimary target + add_custom_target(kdewin_package_without_compiler + COMMAND ${CMAKE_COMMAND} + -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/temp -P ${CMAKE_BINARY_DIR}/cmake_install.cmake + COMMAND ${KDEWIN_PACKAGER_EXECUTABLE} + -name ${_name} + -root ${CMAKE_BINARY_DIR}/temp + -srcroot ${CMAKE_SOURCE_DIR} + -version ${_version} + -notes "${_notes}" + ${_options} + # FIXME: cleanup does not work + #COMMAND rmdir /Q /S ${CMAKE_BINARY_DIR}\temp + ) + add_custom_target(kdewin_package_debug_and_release + COMMAND ${CMAKE_COMMAND} + -H$(CMAKE_SOURCE_DIR) + -B$(CMAKE_BINARY_DIR) + -DCMAKE_BUILD_TYPE=Debug + COMMAND ${CMAKE_MAKE_PROGRAM} + clean + COMMAND ${CMAKE_MAKE_PROGRAM} + install/local + COMMAND ${CMAKE_COMMAND} + -H$(CMAKE_SOURCE_DIR) + -B$(CMAKE_BINARY_DIR) + -DCMAKE_BUILD_TYPE=Release + COMMAND ${CMAKE_MAKE_PROGRAM} + clean + COMMAND ${CMAKE_MAKE_PROGRAM} + install/local + COMMAND ${KDEWIN_PACKAGER_EXECUTABLE} + -name ${_name} + -root ${CMAKE_BINARY_DIR}/temp + -srcroot ${CMAKE_SOURCE_DIR} + -version ${_version} + -notes "${_notes}" + -type ${type} + ${_options} + # FIXME: cleanup does not work + #COMMAND rmdir /Q /S ${CMAKE_BINARY_DIR}\temp + ) +set (CONTENT " +if \"%1\" == \"package_only\" goto package_only + +del CMakeCache.txt +rmdir /Q /S ${CMAKE_BINARY_DIR}/temp +${CMAKE_COMMAND} ${CMAKE_SOURCE_DIR} -G \"MinGW Makefiles\" -DCMAKE_BUILD_TYPE=Debug +mingw32-make +${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/temp -P cmake_install.cmake +${CMAKE_COMMAND} ${CMAKE_SOURCE_DIR} -G \"MinGW Makefiles\" -DCMAKE_BUILD_TYPE=Release +mingw32-make +${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/temp -P cmake_install.cmake +del CMakeCache.txt +${CMAKE_COMMAND} ${CMAKE_SOURCE_DIR} -G \"NMake Makefiles\" -DCMAKE_BUILD_TYPE=Debug +nmake +${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/temp -P cmake_install.cmake +${CMAKE_COMMAND} ${CMAKE_SOURCE_DIR} -G \"NMake Makefiles\" -DCMAKE_BUILD_TYPE=Release +nmake +${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/temp -P cmake_install.cmake +:package_only +${KDEWIN_PACKAGER_EXECUTABLE} -name ${_name} -root ${CMAKE_BINARY_DIR}/temp -srcroot ${CMAKE_SOURCE_DIR} -version ${_version} -notes \"${_notes}\" ${_options} +" +) + write_file(${CMAKE_BINARY_DIR}/kdewin_package_debug_and_release_mingw_and_msvc.bat "${CONTENT}") + add_custom_target(kdewin_package_debug_and_release_mingw_and_msvc + COMMAND ${CMAKE_BINARY_DIR}/kdewin_package_debug_and_release_mingw_and_msvc.bat + ) + endif (KDEWIN_PACKAGER_FOUND) +ENDMACRO (KDEWIN_PACKAGER) + diff --git a/cmake/modules/FindKNepomuk.cmake b/cmake/modules/FindKNepomuk.cmake new file mode 100644 index 0000000000..655f6fe8ff --- /dev/null +++ b/cmake/modules/FindKNepomuk.cmake @@ -0,0 +1,39 @@ +# Once done this will define +# +# KNEPOMUK_FOUND - system has the Nepomuk-KDE backbone lib KNep +# KNEPOMUK_INCLUDES - the libKNep include directory +# KNEPOMUK_LIBRARIES - Link these to use libKNep +# + +# Copyright (c) 2008, Sebastian Trueg, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + + +if(KNEPOMUK_INCLUDES AND KNEPOMUK_LIBRARIES) + set(KNepomuk_FIND_QUIETLY TRUE) +endif(KNEPOMUK_INCLUDES AND KNEPOMUK_LIBRARIES) + +FIND_PATH(KNEPOMUK_INCLUDES + NAMES + knepomuk/knepomuk.h + PATHS + ${KDE4_INCLUDE_DIR} + ${INCLUDE_INSTALL_DIR} +) + +FIND_LIBRARY(KNEPOMUK_LIBRARIES + NAMES + knepomuk + PATHS + ${KDE4_LIB_DIR} + ${LIB_INSTALL_DIR} +) + +include(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(KNepomuk DEFAULT_MSG KNEPOMUK_INCLUDES KNEPOMUK_LIBRARIES ) + + +MARK_AS_ADVANCED(KNEPOMUK_INCLUDES KNEPOMUK_LIBRARIES) + diff --git a/cmake/modules/FindKdcraw.cmake b/cmake/modules/FindKdcraw.cmake new file mode 100644 index 0000000000..dfd901c5e9 --- /dev/null +++ b/cmake/modules/FindKdcraw.cmake @@ -0,0 +1,110 @@ +# - Try to find the Kdcraw library +# Once done this will define +# +# KDCRAW_FOUND - system has libkdcraw +# KDCRAW_INCLUDE_DIR - the libkdcraw include directory +# KDCRAW_LIBRARIES - Link these to use libkdcraw +# KDCRAW_DEFINITIONS - Compiler switches required for using libkdcraw +# + +# Copyright (c) 2008, Gilles Caulier, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + + +if (KDCRAW_INCLUDE_DIR AND KDCRAW_LIBRARIES) + + message(STATUS "Found Kdcraw library in cache: ${KDCRAW_LIBRARIES}") + + # in cache already + SET(KDCRAW_FOUND TRUE) + +else (KDCRAW_INCLUDE_DIR AND KDCRAW_LIBRARIES) + + message(STATUS "Check Kdcraw library in local sub-folder...") + + # Check if library is not in local sub-folder + + FIND_FILE(KDCRAW_LOCAL_FOUND libkdcraw/version.h ${CMAKE_BINARY_DIR}/libkdcraw ${CMAKE_BINARY_DIR}/libs/libkdcraw NO_DEFAULT_PATH) + + if (KDCRAW_LOCAL_FOUND) + + # Was it found in libkdcraw/ or in libs/libkdcraw? + FIND_FILE(KDCRAW_LOCAL_FOUND_IN_LIBS libkdcraw/version.h ${CMAKE_BINARY_DIR}/libs/libkdcraw NO_DEFAULT_PATH) + if (KDCRAW_LOCAL_FOUND_IN_LIBS) + set(KDCRAW_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/libs/libkdcraw) + else (KDCRAW_LOCAL_FOUND_IN_LIBS) + set(KDCRAW_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/libkdcraw) + endif (KDCRAW_LOCAL_FOUND_IN_LIBS) + set(KDCRAW_DEFINITIONS "-I${KDCRAW_INCLUDE_DIR}") + set(KDCRAW_LIBRARIES kdcraw) + message(STATUS "Found Kdcraw library in local sub-folder: ${KDCRAW_INCLUDE_DIR}") + set(KDCRAW_FOUND TRUE) + MARK_AS_ADVANCED(KDCRAW_INCLUDE_DIR KDCRAW_LIBRARIES) + + else(KDCRAW_LOCAL_FOUND) + + message(STATUS "Check Kdcraw library using pkg-config...") + if(NOT WIN32) + # use pkg-config to get the directories and then use these values + # in the FIND_PATH() and FIND_LIBRARY() calls + INCLUDE(UsePkgConfig) + + PKGCONFIG(libkdcraw _KDCRAWIncDir _KDCRAWLinkDir _KDCRAWLinkFlags _KDCRAWCflags) + + if(_KDCRAWLinkFlags) + # query pkg-config asking for a libkdcraw >= 0.2.0 + EXEC_PROGRAM(${PKGCONFIG_EXECUTABLE} ARGS --atleast-version=0.2.0 libkdcraw RETURN_VALUE _return_VALUE OUTPUT_VARIABLE _pkgconfigDevNull ) + if(_return_VALUE STREQUAL "0") + message(STATUS "Found libkdcraw release >= 0.2.0") + set(KDCRAW_VERSION_GOOD_FOUND TRUE) + else(_return_VALUE STREQUAL "0") + message(STATUS "Found libkdcaw release < 0.2.0, too old") + set(KDCRAW_VERSION_GOOD_FOUND FALSE) + set(KDCRAW_FOUND FALSE) + endif(_return_VALUE STREQUAL "0") + else(_KDCRAWLinkFlags) + set(KDCRAW_VERSION_GOOD_FOUND FALSE) + set(KDCRAW_FOUND FALSE) + endif(_KDCRAWLinkFlags) + ELSE(NOT WIN32) + set(KDCRAW_VERSION_GOOD_FOUND TRUE) + ENDif(NOT WIN32) + + if(KDCRAW_VERSION_GOOD_FOUND) + set(KDCRAW_DEFINITIONS "${_KDCRAWCflags}") + + FIND_PATH(KDCRAW_INCLUDE_DIR libkdcraw/version.h + ${_KDCRAWIncDir} + ) + + FIND_LIBRARY(KDCRAW_LIBRARIES NAMES kdcraw + PATHS + ${_KDCRAWLinkDir} + ) + + if (KDCRAW_INCLUDE_DIR AND KDCRAW_LIBRARIES) + set(KDCRAW_FOUND TRUE) + endif (KDCRAW_INCLUDE_DIR AND KDCRAW_LIBRARIES) + endif(KDCRAW_VERSION_GOOD_FOUND) + if (KDCRAW_FOUND) + if (NOT Kdcraw_FIND_QUIETLY) + message(STATUS "Found libkdcraw: ${KDCRAW_LIBRARIES}") + endif (NOT Kdcraw_FIND_QUIETLY) + else (KDCRAW_FOUND) + if (Kdcraw_FIND_REQUIRED) + if (NOT KDCRAW_INCLUDE_DIR) + message(FATAL_ERROR "Could NOT find libkdcraw header files") + endif (NOT KDCRAW_INCLUDE_DIR) + if (NOT KDCRAW_LIBRARIES) + message(FATAL_ERROR "Could NOT find libkdcraw library") + endif (NOT KDCRAW_LIBRARIES) + endif (Kdcraw_FIND_REQUIRED) + endif (KDCRAW_FOUND) + + MARK_AS_ADVANCED(KDCRAW_INCLUDE_DIR KDCRAW_LIBRARIES) + + endif(KDCRAW_LOCAL_FOUND) + +endif (KDCRAW_INCLUDE_DIR AND KDCRAW_LIBRARIES) diff --git a/cmake/modules/FindKdeMultimedia.cmake b/cmake/modules/FindKdeMultimedia.cmake new file mode 100644 index 0000000000..c88502913d --- /dev/null +++ b/cmake/modules/FindKdeMultimedia.cmake @@ -0,0 +1,48 @@ +# Module to see if we have KDE4 kdemultimedia installed +# +# This module defines +# KDEMULTIMEDIA_INCLUDE_DIR - the include dir +# KCDDB_LIBRARY - the kcddb library +# KCOMPACTDISC_LIBRARY - the kcompactdisk library +# KDEMULTIMEDIA_LIBRARIES - all of the KDE multimedia libraries together +# KDEMULTIMEDIA_FOUND - true if the above have been found + +# KDEMULTIMEDIA_INCLUDE_DIR +# KDEMULTIMEDIA_FOUND +# Copyright (C) 2007 Laurent Montel +# Copyright (C) 2007 Gerd Fleischer +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + + +if (KDEMULTIMEDIA_INCLUDE_DIR) + # Already in cache, be silent + set(KDEMULTIMEDIA_FOUND TRUE) +endif (KDEMULTIMEDIA_INCLUDE_DIR) + + +find_path(KDEMULTIMEDIA_INCLUDE_DIR NAMES libkcddb/kcddb.h libkcompactdisc/kcompactdisc.h + PATHS + ${INCLUDE_INSTALL_DIR} +) + +find_library(KCDDB_LIBRARY NAMES kcddb + PATHS + ${LIB_INSTALL_DIR} +) + +find_library(KCOMPACTDISC_LIBRARY NAMES kcompactdisc + PATHS + ${LIB_INSTALL_DIR} +) + +# audioencoder, audiocdplugins? + +set(KDEMULTIMEDIA_LIBRARIES ${KCDDB_LIBRARY} ${KCOMPACTDISC_LIBRARY}) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(KdeMultimedia DEFAULT_MSG KDEMULTIMEDIA_LIBRARIES KDEMULTIMEDIA_INCLUDE_DIR ) + +mark_as_advanced(KDEMULTIMEDIA_INCLUDE_DIR KDEMULTIMEDIA_LIBRARIES) + diff --git a/cmake/modules/FindKdepim.cmake b/cmake/modules/FindKdepim.cmake new file mode 100644 index 0000000000..d04886af32 --- /dev/null +++ b/cmake/modules/FindKdepim.cmake @@ -0,0 +1,31 @@ +# cmake macro to see if we have kdepim installed + +# KDEPIM_INCLUDE_DIR +# KDEPIM_FOUND +# Copyright (C) 2007 Laurent Montel +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + + +if (KDEPIM_INCLUDE_DIR) + # Already in cache, be silent + set(KDEPIM_FOUND TRUE) +endif (KDEPIM_INCLUDE_DIR) + + +FIND_PATH(KDEPIM_INCLUDE_DIR NAMES kdepimprotocols.h + PATHS + ${INCLUDE_INSTALL_DIR} +) + +FIND_LIBRARY(KDEPIM_LIBRARIES NAMES kdepim + PATHS + ${LIB_INSTALL_DIR} +) + +include(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(Kdepim DEFAULT_MSG KDEPIM_LIBRARIES KDEPIM_INCLUDE_DIR ) + +MARK_AS_ADVANCED(KDEPIM_INCLUDE_DIR KDEPIM_LIBRARIES) + diff --git a/cmake/modules/FindKdepimLibs.cmake b/cmake/modules/FindKdepimLibs.cmake new file mode 100644 index 0000000000..3ab58e21b7 --- /dev/null +++ b/cmake/modules/FindKdepimLibs.cmake @@ -0,0 +1,74 @@ +# Find if we installed kdepimlibs before to compile it +# Once done this will define +# +# KDEPIMLIBS_FOUND - system has KDE PIM Libraries +# KDEPIMLIBS_INCLUDE_DIR - the KDE PIM Libraries include directory +# +# It also sets variables for the following libraries: +# KDEPIMLIBS_AKONADI_LIBS +# KDEPIMLIBS_AKONADI_KMIME_LIBS +# KDEPIMLIBS_AKONADI_KABC_LIBS +# KDEPIMLIBS_GPGMEPP_LIBS +# KDEPIMLIBS_KABC_LIBS +# KDEPIMLIBS_KBLOG_LIBS +# KDEPIMLIBS_KCAL_LIBS +# KDEPIMLIBS_KIMAP_LIBS +# KDEPIMLIBS_KLDAP_LIBS +# KDEPIMLIBS_KMIME_LIBS +# KDEPIMLIBS_KPIMIDENTITIES_LIBS +# KDEPIMLIBS_KPIMUTILS_LIBS +# KDEPIMLIBS_KRESOURCES_LIBS +# KDEPIMLIBS_KTNEF_LIBS +# KDEPIMLIBS_KXMLRPCCLIENT_LIBS +# KDEPIMLIBS_MAILTRANSPORT_LIBS +# KDEPIMLIBS_QGPGME_LIBS +# KDEPIMLIBS_SYNDICATION_LIBS +# +# And the following locations: +# KDEPIMLIBS_DATA_DIR +# KDEPIMLIBS_DBUS_INTERFACES_DIR +# KDEPIMLIBS_DBUS_SERVICES_DIR +# KDEPIMLIBS_INCLUDE_DIR +# KDEPIMLIBS_LIB_DIR +# KDEPIMLIBS_BIN_DIR +# KDEPIMLIBS_LIBEXEC_DIR +# KDEPIMLIBS_SBIN_DIR +# KDEPIMLIBS_HTML_DIR +# KDEPIMLIBS_CONFIG_DIR +# KDEPIMLIBS_ICON_DIR +# KDEPIMLIBS_KCFG_DIR +# KDEPIMLIBS_LOCALE_DIR +# KDEPIMLIBS_MIME_DIR +# KDEPIMLIBS_SOUND_DIR +# KDEPIMLIBS_TEMPLATES_DIR +# KDEPIMLIBS_KCONF_UPDATE_DIR +# KDEPIMLIBS_AUTOSTART_DIR +# KDEPIMLIBS_XDG_APPS_DIR +# KDEPIMLIBS_XDG_DIRECTORY_DIR +# KDEPIMLIBS_SYSCONF_DIR +# KDEPIMLIBS_MAN_DIR +# KDEPIMLIBS_INFO_DIR +# KDEPIMLIBS_SERVICES_DIR +# KDEPIMLIBS_SERVICETYPES_DIR + + +# Copyright (c) 2008, Alexander Neundorf, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +# The find_package() call below loads the file KdepimLibsConfig.cmake file. +# This file is created and installed by kdepimlibs/CMakeLists.txt +# It contains settings for all install location of kdepimlibs, as e.g. +# KDEPIMLIBS_INCLUDE_DIR, and also variables for all libraries. +# See kdepimlibs/CMakeLists.txt and kdepimlibs/KdepimLibsConfig.cmake.in +# for details. Alex + + +set(_KdepimLibs_FIND_QUIETLY ${KdepimLibs_FIND_QUIETLY}) +find_package(KdepimLibs ${KdepimLibs_FIND_VERSION} QUIET NO_MODULE PATHS ${KDE4_LIB_DIR}/KdepimLibs/cmake ) +set(KdepimLibs_FIND_QUIETLY ${_KdepimLibs_FIND_QUIETLY}) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(KdepimLibs DEFAULT_MSG KdepimLibs_CONFIG ) + diff --git a/cmake/modules/FindKexiv2.cmake b/cmake/modules/FindKexiv2.cmake new file mode 100644 index 0000000000..dd62e88599 --- /dev/null +++ b/cmake/modules/FindKexiv2.cmake @@ -0,0 +1,108 @@ +# - Try to find the KExiv2 library +# Once done this will define +# +# KEXIV2_FOUND - system has libkexiv2 +# KEXIV2_INCLUDE_DIR - the libkexiv2 include directory +# KEXIV2_LIBRARIES - Link these to use libkexiv2 +# KEXIV2_DEFINITIONS - Compiler switches required for using libkexiv2 +# + +# Copyright (c) 2008, Gilles Caulier, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +if (KEXIV2_INCLUDE_DIR AND KEXIV2_LIBRARIES) + + message(STATUS "Found Kexiv2 library in cache: ${KEXIV2_LIBRARIES}") + + # in cache already + SET(KEXIV2_FOUND TRUE) + +else (KEXIV2_INCLUDE_DIR AND KEXIV2_LIBRARIES) + + message(STATUS "Check Kexiv2 library in local sub-folder...") + + # Check if library is not in local sub-folder + + FIND_FILE(KEXIV2_LOCAL_FOUND libkexiv2/version.h.cmake ${CMAKE_SOURCE_DIR}/libkexiv2 ${CMAKE_SOURCE_DIR}/libs/libkexiv2 NO_DEFAULT_PATH) + + if (KEXIV2_LOCAL_FOUND) + + FIND_FILE(KEXIV2_LOCAL_FOUND_IN_LIBS libkexiv2/version.h.cmake ${CMAKE_SOURCE_DIR}/libs/libkexiv2 NO_DEFAULT_PATH) + if (KEXIV2_LOCAL_FOUND_IN_LIBS) + set(KEXIV2_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/libs/libkexiv2) + else (KEXIV2_LOCAL_FOUND_IN_LIBS) + set(KEXIV2_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/libkexiv2) + endif (KEXIV2_LOCAL_FOUND_IN_LIBS) + set(KEXIV2_DEFINITIONS "-I${KEXIV2_INCLUDE_DIR}") + set(KEXIV2_LIBRARIES kexiv2) + message(STATUS "Found Kexiv2 library in local sub-folder: ${KEXIV2_INCLUDE_DIR}") + set(KEXIV2_FOUND TRUE) + MARK_AS_ADVANCED(KEXIV2_INCLUDE_DIR KEXIV2_LIBRARIES) + + else(KEXIV2_LOCAL_FOUND) + if(NOT WIN32) + message(STATUS "Check Kexiv2 library using pkg-config...") + + # use pkg-config to get the directories and then use these values + # in the FIND_PATH() and FIND_LIBRARY() calls + INCLUDE(UsePkgConfig) + + PKGCONFIG(libkexiv2 _KEXIV2IncDir _KEXIV2LinkDir _KEXIV2LinkFlags _KEXIV2Cflags) + + if(_KEXIV2LinkFlags) + # query pkg-config asking for a libkexiv2 >= 0.2.0 + EXEC_PROGRAM(${PKGCONFIG_EXECUTABLE} ARGS --atleast-version=0.2.0 libkexiv2 RETURN_VALUE _return_VALUE OUTPUT_VARIABLE _pkgconfigDevNull ) + if(_return_VALUE STREQUAL "0") + message(STATUS "Found libkexiv2 release >= 0.2.0") + set(KEXIV2_VERSION_GOOD_FOUND TRUE) + else(_return_VALUE STREQUAL "0") + message(STATUS "Found libkexiv2 release < 0.2.0, too old") + set(KEXIV2_VERSION_GOOD_FOUND FALSE) + set(KEXIV2_FOUND FALSE) + endif(_return_VALUE STREQUAL "0") + else(_KEXIV2LinkFlags) + set(KEXIV2_VERSION_GOOD_FOUND FALSE) + set(KEXIV2_FOUND FALSE) + endif(_KEXIV2LinkFlags) + else(NOT WIN32) + set(KEXIV2_VERSION_GOOD_FOUND TRUE) + endif(NOT WIN32) + + if(KEXIV2_VERSION_GOOD_FOUND) + set(KEXIV2_DEFINITIONS "${_KEXIV2Cflags}") + + FIND_PATH(KEXIV2_INCLUDE_DIR libkexiv2/version.h + ${_KEXIV2IncDir} + ) + + FIND_LIBRARY(KEXIV2_LIBRARIES NAMES kexiv2 + PATHS + ${_KEXIV2LinkDir} + ) + + if (KEXIV2_INCLUDE_DIR AND KEXIV2_LIBRARIES) + set(KEXIV2_FOUND TRUE) + endif (KEXIV2_INCLUDE_DIR AND KEXIV2_LIBRARIES) + endif(KEXIV2_VERSION_GOOD_FOUND) + if (KEXIV2_FOUND) + if (NOT Kexiv2_FIND_QUIETLY) + message(STATUS "Found libkexiv2: ${KEXIV2_LIBRARIES}") + endif (NOT Kexiv2_FIND_QUIETLY) + else (KEXIV2_FOUND) + if (Kexiv2_FIND_REQUIRED) + if (NOT KEXIV2_INCLUDE_DIR) + message(FATAL_ERROR "Could NOT find libkexiv2 header files") + endif (NOT KEXIV2_INCLUDE_DIR) + if (NOT KEXIV2_LIBRARIES) + message(FATAL_ERROR "Could NOT find libkexiv2 library") + endif (NOT KEXIV2_LIBRARIES) + endif (Kexiv2_FIND_REQUIRED) + endif (KEXIV2_FOUND) + + MARK_AS_ADVANCED(KEXIV2_INCLUDE_DIR KEXIV2_LIBRARIES) + + endif(KEXIV2_LOCAL_FOUND) + +endif (KEXIV2_INCLUDE_DIR AND KEXIV2_LIBRARIES) diff --git a/cmake/modules/FindKipi.cmake b/cmake/modules/FindKipi.cmake new file mode 100644 index 0000000000..ccb699f170 --- /dev/null +++ b/cmake/modules/FindKipi.cmake @@ -0,0 +1,102 @@ +# - Try to find the Kipi library +# Once done this will define +# +# KIPI_FOUND - system has libkipi +# KIPI_INCLUDE_DIR - the libkipi include directory +# KIPI_LIBRARIES - Link these to use libkipi +# KIPI_DEFINITIONS - Compiler switches required for using libkipi +# + +# Copyright (c) 2008, Gilles Caulier, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +if (KIPI_INCLUDE_DIR AND KIPI_LIBRARIES) + + message(STATUS "Found Kipi library in cache: ${KIPI_LIBRARIES}") + + # in cache already + SET(KIPI_FOUND TRUE) + +else (KIPI_INCLUDE_DIR AND KIPI_LIBRARIES) + + message(STATUS "Check Kipi library in local sub-folder...") + + # Check if library is not in local sub-folder + + find_file (KIPI_LOCAL_FOUND libkipi/version.h.cmake ${CMAKE_SOURCE_DIR}/libkipi ${CMAKE_SOURCE_DIR}/libs/libkipi NO_DEFAULT_PATH) + + if (KIPI_LOCAL_FOUND) + + find_file (KIPI_LOCAL_FOUND_IN_LIBS libkipi/version.h.cmake ${CMAKE_SOURCE_DIR}/libs/libkipi NO_DEFAULT_PATH) + if (KIPI_LOCAL_FOUND_IN_LIBS) + set(KIPI_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/libs/libkipi) + else (KIPI_LOCAL_FOUND_IN_LIBS) + set(KIPI_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/libkipi) + endif (KIPI_LOCAL_FOUND_IN_LIBS) + set(KIPI_DEFINITIONS -I${KIPI_INCLUDE_DIR}) + set(KIPI_LIBRARIES kipi) + message(STATUS "Found Kipi library in local sub-folder: ${KIPI_INCLUDE_DIR}") + set(KIPI_FOUND TRUE) + mark_as_advanced(KIPI_INCLUDE_DIR KIPI_LIBRARIES) + + else(KIPI_LOCAL_FOUND) + + if(NOT WIN32) + message(STATUS "Check Kipi library using pkg-config...") + + # use pkg-config to get the directories and then use these values + # in the FIND_PATH() and FIND_LIBRARY() calls + INCLUDE(UsePkgConfig) + + PKGCONFIG(libkipi _KIPIIncDir _KIPILinkDir _KIPILinkFlags _KIPICflags) + + if(_KIPILinkFlags) + # query pkg-config asking for a libkipi >= 0.2.0 + exec_program(${PKGCONFIG_EXECUTABLE} ARGS --atleast-version=0.2.0 libkipi RETURN_VALUE _return_VALUE OUTPUT_VARIABLE _pkgconfigDevNull ) + if(_return_VALUE STREQUAL "0") + message(STATUS "Found libkipi release >= 0.2.0") + set(KIPI_VERSION_GOOD_FOUND TRUE) + else(_return_VALUE STREQUAL "0") + message(STATUS "Found libkipi release < 0.2.0, too old") + set(KIPI_VERSION_GOOD_FOUND FALSE) + set(KIPI_FOUND FALSE) + endif(_return_VALUE STREQUAL "0") + else(_KIPILinkFlags) + set(KIPI_VERSION_GOOD_FOUND FALSE) + set(KIPI_FOUND FALSE) + endif(_KIPILinkFlags) + else(NOT WIN32) + set(KIPI_VERSION_GOOD_FOUND TRUE) + endif(NOT WIN32) + if(KIPI_VERSION_GOOD_FOUND) + set(KIPI_DEFINITIONS ${_KIPICflags}) + + find_path(KIPI_INCLUDE_DIR NAMES libkipi/version.h PATHS ${KDE4_INCLUDE_DIR} ${_KIPIIncDir}) + find_library(KIPI_LIBRARIES NAMES kipi PATHS ${KDE4_LIB_DIR} ${_KIPILinkDir}) + + if (KIPI_INCLUDE_DIR AND KIPI_LIBRARIES) + set(KIPI_FOUND TRUE) + endif (KIPI_INCLUDE_DIR AND KIPI_LIBRARIES) + endif(KIPI_VERSION_GOOD_FOUND) + if (KIPI_FOUND) + if (NOT Kipi_FIND_QUIETLY) + message(STATUS "Found libkipi: ${KIPI_LIBRARIES}") + endif (NOT Kipi_FIND_QUIETLY) + else (KIPI_FOUND) + if (Kipi_FIND_REQUIRED) + if (NOT KIPI_INCLUDE_DIR) + message(FATAL_ERROR "Could NOT find libkipi header files") + endif (NOT KIPI_INCLUDE_DIR) + if (NOT KIPI_LIBRARIES) + message(FATAL_ERROR "Could NOT find libkipi library") + endif (NOT KIPI_LIBRARIES) + endif (Kipi_FIND_REQUIRED) + endif (KIPI_FOUND) + + MARK_AS_ADVANCED(KIPI_INCLUDE_DIR KIPI_LIBRARIES) + + endif(KIPI_LOCAL_FOUND) + +endif (KIPI_INCLUDE_DIR AND KIPI_LIBRARIES) diff --git a/cmake/modules/FindKonto.cmake b/cmake/modules/FindKonto.cmake new file mode 100644 index 0000000000..d3c3458b99 --- /dev/null +++ b/cmake/modules/FindKonto.cmake @@ -0,0 +1,38 @@ +# Once done this will define +# +# KONTO_FOUND - system has the Nepomuk-KDE backbone lib Konto +# KONTO_INCLUDES - the libKonto include directory +# KONTO_LIBRARIES - Link these to use libKonto +# + +# Copyright (c) 2008, Sebastian Trueg, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + + +if(KONTO_INCLUDES AND KONTO_LIBRARIES) + # Already in cache, be silent + set(Konto_FIND_QUIETLY TRUE) +endif(KONTO_INCLUDES AND KONTO_LIBRARIES + + +FIND_PATH(KONTO_INCLUDES + NAMES + konto/class.h + PATHS + ${KDE4_INCLUDE_DIR} + ${INCLUDE_INSTALL_DIR} +) + +FIND_LIBRARY(KONTO_LIBRARIES + NAMES + konto + PATHS + ${KDE4_LIB_DIR} + ${LIB_INSTALL_DIR} +) + +include(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(Kondo DEFAULT_MSG KONTO_INCLUDES KONTO_LIBRARIES) + diff --git a/cmake/modules/FindKopete.cmake b/cmake/modules/FindKopete.cmake new file mode 100644 index 0000000000..cf65b5a170 --- /dev/null +++ b/cmake/modules/FindKopete.cmake @@ -0,0 +1,87 @@ +# - Try to find the Kopete library +# Once done this will define +# +# Kopete_FOUND - system has kopete +# KOPETE_INCLUDE_DIR - the kopete include directory +# KOPETE_LIBRARIES - Link these to use kopete + +# Copyright (c) 2007 Charles Connell +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +if(KOPETE_INCLUDE_DIR AND KOPETE_LIBRARIES) + + # read from cache + set(Kopete_FOUND TRUE) + +else(KOPETE_INCLUDE_DIR AND KOPETE_LIBRARIES) + + FIND_PATH(KOPETE_INCLUDE_DIR + NAMES + kopete/kopete_export.h + PATHS + ${KDE4_INCLUDE_DIR} + ${INCLUDE_INSTALL_DIR} + ) + + FIND_LIBRARY(KOPETE_LIBRARIES + NAMES + kopete + PATHS + ${KDE4_LIB_DIR} + ${LIB_INSTALL_DIR} + ) + if(KOPETE_INCLUDE_DIR AND KOPETE_LIBRARIES) + set(Kopete_FOUND TRUE) + endif(KOPETE_INCLUDE_DIR AND KOPETE_LIBRARIES) + + if(MSVC) + FIND_LIBRARY(KOPETE_LIBRARIES_DEBUG + NAMES + kopeted + PATHS + ${KDE4_LIB_DIR} + ${LIB_INSTALL_DIR} + ) + if(NOT KOPETE_LIBRARIES_DEBUG) + set(Kopete_FOUND FALSE) + endif(NOT KOPETE_LIBRARIES_DEBUG) + + if(MSVC_IDE) + if( NOT KOPETE_LIBRARIES_DEBUG OR NOT KOPETE_LIBRARIES) + message(FATAL_ERROR "\nCould NOT find the debug AND release version of the Kopete library.\nYou need to have both to use MSVC projects.\nPlease build and install both kopete libraries first.\n") + endif( NOT KOPETE_LIBRARIES_DEBUG OR NOT KOPETE_LIBRARIES) + else(MSVC_IDE) + string(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_TOLOWER) + if(CMAKE_BUILD_TYPE_TOLOWER MATCHES debug) + set(KOPETE_LIBRARIES ${KOPETE_LIBRARIES_DEBUG}) + else(CMAKE_BUILD_TYPE_TOLOWER MATCHES debug) + set(KOPETE_LIBRARIES ${KOPETE_LIBRARIES}) + endif(CMAKE_BUILD_TYPE_TOLOWER MATCHES debug) + endif(MSVC_IDE) + endif(MSVC) + + if(Kopete_FOUND) + if(NOT Kopete_FIND_QUIETLY) + message(STATUS "Found Kopete: ${KOPETE_LIBRARIES}") + endif(NOT Kopete_FIND_QUIETLY) + else(Kopete_FOUND) + if(Kopete_FIND_REQUIRED) + if(NOT KOPETE_INCLUDE_DIR) + message(FATAL_ERROR "Could not find Kopete includes.") + endif(NOT KOPETE_INCLUDE_DIR) + if(NOT KOPETE_LIBRARIES) + message(FATAL_ERROR "Could not find Kopete library.") + endif(NOT KOPETE_LIBRARIES) + else(Kopete_FIND_REQUIRED) + if(NOT KOPETE_INCLUDE_DIR) + message(STATUS "Could not find Kopete includes.") + endif(NOT KOPETE_INCLUDE_DIR) + if(NOT KOPETE_LIBRARIES) + message(STATUS "Could not find Kopete library.") + endif(NOT KOPETE_LIBRARIES) + endif(Kopete_FIND_REQUIRED) + endif(Kopete_FOUND) + +endif(KOPETE_INCLUDE_DIR AND KOPETE_LIBRARIES) diff --git a/cmake/modules/FindKorundum.cmake b/cmake/modules/FindKorundum.cmake new file mode 100644 index 0000000000..d921f6112f --- /dev/null +++ b/cmake/modules/FindKorundum.cmake @@ -0,0 +1,20 @@ +# - Find Korundum - the KDE Ruby bindings +# +# This module finds if Korundum is installed. +# It defines the following variables: +# KORUNDUM_PATH - the path to the korundum ruby file +# KORUNDUM_FOUND - true if it has been found + +# Copyright (c) 2006, Egon Willighagen, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +find_path(KORUNDUM_PATH Korundum.rb /usr/lib/ruby/1.8) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Korundum DEFAULT_MSG KORUNDUM_PATH) + +# just for compat.: +set(Korumdum_PATH ${KORUNDUM_PATH}) +set(Korumdum_FOUND ${KORUNDUM_FOUND}) diff --git a/cmake/modules/FindLCMS.cmake b/cmake/modules/FindLCMS.cmake new file mode 100644 index 0000000000..9d162d2cfd --- /dev/null +++ b/cmake/modules/FindLCMS.cmake @@ -0,0 +1,84 @@ +# - Find LCMS +# Find the LCMS includes and library +# This module defines +# LCMS_INCLUDE_DIR, where to find lcms.h +# LCMS_LIBRARIES, the libraries needed to use LCMS. +# LCMS_VERSION, The value of LCMS_VERSION defined in lcms.h +# LCMS_FOUND, If false, do not try to use LCMS. + + +# Copyright (c) 2008, Adrian Page, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + + +# use pkg-config to get the directories and then use these values +# in the FIND_PATH() and FIND_LIBRARY() calls +if(NOT WIN32) + find_package(PkgConfig) + pkg_check_modules(PC_LCMS lcms) + set(LCMS_DEFINITIONS ${PC_LCMS_CFLAGS_OTHER}) +endif(NOT WIN32) + +find_path(LCMS_INCLUDE_DIR lcms.h + PATHS + ${PC_LCMS_INCLUDEDIR} + ${PC_LCMS_INCLUDE_DIRS} + PATH_SUFFIXES lcms liblcms1 +) + +find_library(LCMS_LIBRARIES NAMES lcms liblcms lcms-1 liblcms-1 + PATHS + ${PC_LCMS_LIBDIR} + ${PC_LCMS_LIBRARY_DIRS} + PATH_SUFFIXES lcms +) + +if(LCMS_INCLUDE_DIR AND LCMS_LIBRARIES) + set(LCMS_FOUND TRUE) +else(LCMS_INCLUDE_DIR AND LCMS_LIBRARIES) + set(LCMS_FOUND FALSE) +endif(LCMS_INCLUDE_DIR AND LCMS_LIBRARIES) + +if(LCMS_FOUND) + set(FIND_LCMS_VERSION_SOURCE + "#include \n int main()\n {\n return LCMS_VERSION;\n }\n") + set(FIND_LCMS_VERSION_SOURCE_FILE ${CMAKE_BINARY_DIR}/CMakeTmp/FindLCMS.cxx) + file(WRITE "${FIND_LCMS_VERSION_SOURCE_FILE}" "${FIND_LCMS_VERSION_SOURCE}") + + set(FIND_LCMS_VERSION_ADD_INCLUDES + "-DINCLUDE_DIRECTORIES:STRING=${LCMS_INCLUDE_DIR}") + + try_run(LCMS_VERSION LCMS_COMPILE_RESULT + ${CMAKE_BINARY_DIR} + ${FIND_LCMS_VERSION_SOURCE_FILE} + CMAKE_FLAGS "${FIND_LCMS_VERSION_ADD_INCLUDES}" + OUTPUT_VARIABLE OUTPUT) + + if(LCMS_COMPILE_RESULT AND NOT LCMS_VERSION STREQUAL FAILED_TO_RUN) + if(NOT LCMS_FIND_QUIETLY) + string(SUBSTRING ${LCMS_VERSION} 0 1 LCMS_MAJOR_VERSION) + string(SUBSTRING ${LCMS_VERSION} 1 2 LCMS_MINOR_VERSION) + message(STATUS "Found lcms version ${LCMS_MAJOR_VERSION}.${LCMS_MINOR_VERSION}, ${LCMS_LIBRARIES}") + endif(NOT LCMS_FIND_QUIETLY) + else(LCMS_COMPILE_RESULT AND NOT LCMS_VERSION STREQUAL FAILED_TO_RUN) + if(NOT LCMS_FIND_QUIETLY) + message(STATUS "Found lcms but failed to find version ${LCMS_LIBRARIES}") + file(APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log + "Find lcms version failed with the following output:\n${OUTPUT}\nFindLCMS.cxx:\n${FIND_LCMS_VERSION_SOURCE}\n\n") + endif(NOT LCMS_FIND_QUIETLY) + set(LCMS_VERSION NOTFOUND) + endif(LCMS_COMPILE_RESULT AND NOT LCMS_VERSION STREQUAL FAILED_TO_RUN) +else(LCMS_FOUND) + if(NOT LCMS_FIND_QUIETLY) + if(LCMS_FIND_REQUIRED) + message(FATAL_ERROR "Required package lcms NOT found") + else(LCMS_FIND_REQUIRED) + message(STATUS "lcms NOT found") + endif(LCMS_FIND_REQUIRED) + endif(NOT LCMS_FIND_QUIETLY) +endif(LCMS_FOUND) + +mark_as_advanced(LCMS_INCLUDE_DIR LCMS_LIBRARIES LCMS_VERSION) + diff --git a/cmake/modules/FindLibArt.cmake b/cmake/modules/FindLibArt.cmake new file mode 100644 index 0000000000..99eaff65d4 --- /dev/null +++ b/cmake/modules/FindLibArt.cmake @@ -0,0 +1,63 @@ +# - Try to find the LibArt 2D graphics library +# Once done this will define +# +# LIBART_FOUND - system has the LibArt +# LIBART_INCLUDE_DIR - the LibArt include directory +# LIBART_LIBRARIES - The libraries needed to use LibArt + +# Copyright (c) 2006, Alexander Neundorf, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + + +if (LIBART_INCLUDE_DIR AND LIBART_LIBRARIES) + + # in cache already + SET(LIBART_FOUND TRUE) + +else (LIBART_INCLUDE_DIR AND LIBART_LIBRARIES) + + IF (NOT WIN32) + find_package(PkgConfig) + + # use pkg-config to get the directories and then use these values + # in the FIND_PATH() and FIND_LIBRARY() calls + pkg_check_modules(PC_LIBART libart-2.0) + + ######### ?? where is this used ?? ############### + set(LIBART_DEFINITIONS ${PC_LIBART_CFLAGS_OTHER}) + ENDIF (NOT WIN32) + + FIND_PATH(LIBART_INCLUDE_DIR NAMES libart_lgpl/libart.h + PATHS + ${PC_LIBART_INCLUDEDIR} + ${PC_LIBART_INCLUDE_DIRS} + PATH_SUFFIXES libart-2.0 + ) + + FIND_LIBRARY(LIBART_LIBRARIES NAMES art_lgpl_2 + PATHS + ${PC_LIBART_LIBDIR} + ${PC_LIBART_LIBRARY_DIRS} + ) + + + if (LIBART_INCLUDE_DIR AND LIBART_LIBRARIES) + set(LIBART_FOUND TRUE) + endif (LIBART_INCLUDE_DIR AND LIBART_LIBRARIES) + + + if (LIBART_FOUND) + if (NOT LibArt_FIND_QUIETLY) + message(STATUS "Found libart: ${LIBART_LIBRARIES}") + endif (NOT LibArt_FIND_QUIETLY) + else (LIBART_FOUND) + if (LibArt_FIND_REQUIRED) + message(FATAL_ERROR "Could NOT find libart") + endif (LibArt_FIND_REQUIRED) + endif (LIBART_FOUND) + + MARK_AS_ADVANCED(LIBART_INCLUDE_DIR LIBART_LIBRARIES) + +endif (LIBART_INCLUDE_DIR AND LIBART_LIBRARIES) diff --git a/cmake/modules/FindLibKonq.cmake b/cmake/modules/FindLibKonq.cmake new file mode 100644 index 0000000000..f9a06d2f3c --- /dev/null +++ b/cmake/modules/FindLibKonq.cmake @@ -0,0 +1,39 @@ +# - Try to find konqueror library +# Once done this will define +# +# LIBKONQ_FOUND - system has libkonq library +# LIBKONQ_INCLUDE_DIR - the LIBKONQ include directory +# LIBKONQ_LIBRARY - the libkonq library +# +# Original file: FindMarbleWidget.cmake (found in digikam-0.10.0-beta2) +# copyright 2008 by Patrick Spendrin +# use this file as you like +# +# Modifications to find libkonq by Joachim Eibl 2008 + +if(LIBKONQ_INCLUDE_DIR AND LIBKONQ_LIBRARY) + + # Already in cache + set(LIBKONQ_FOUND TRUE) + +else(LIBKONQ_INCLUDE_DIR AND LIBKONQ_LIBRARY) + find_path(LIBKONQ_INCLUDE_DIR konq_popupmenuplugin.h ) + + find_library(LIBKONQ_LIBRARY konq) + + if(LIBKONQ_INCLUDE_DIR AND LIBKONQ_LIBRARY) + set(LIBKONQ_FOUND TRUE) + endif(LIBKONQ_INCLUDE_DIR AND LIBKONQ_LIBRARY) + + if(LIBKONQ_FOUND) + if (NOT LIBKONQ_FIND_QUIETLY) + message(STATUS "Found libkonq: ${LIBKONQ_LIBRARY}") + endif (NOT LIBKONQ_FIND_QUIETLY) + else(LIBKONQ_FOUND) + if(LIBKONQ_FIND_REQUIRED) + message(FATAL_ERROR "Could NOT find KDE4 libkonq library") + endif(LIBKONQ_FIND_REQUIRED) + endif(LIBKONQ_FOUND) + + mark_as_advanced(LIBKONQ_INCLUDE_DIR LIBKONQ_LIBRARY) +endif(LIBKONQ_INCLUDE_DIR AND LIBKONQ_LIBRARY) diff --git a/cmake/modules/FindLibPython.py b/cmake/modules/FindLibPython.py new file mode 100644 index 0000000000..ec21b33817 --- /dev/null +++ b/cmake/modules/FindLibPython.py @@ -0,0 +1,13 @@ + +# Copyright (c) 2007, Simon Edwards +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +import sys +import distutils.sysconfig + +print("exec_prefix:%s" % sys.exec_prefix) +print("short_version:%s" % sys.version[:3]) +print("long_version:%s" % sys.version.split()[0]) +print("py_inc_dir:%s" % distutils.sysconfig.get_python_inc()) +print("site_packages_dir:%s" % distutils.sysconfig.get_python_lib(plat_specific=1)) diff --git a/cmake/modules/FindLibXml2.cmake b/cmake/modules/FindLibXml2.cmake new file mode 100644 index 0000000000..453c261b62 --- /dev/null +++ b/cmake/modules/FindLibXml2.cmake @@ -0,0 +1,58 @@ +# - Try to find LibXml2 +# Once done this will define +# +# LIBXML2_FOUND - System has LibXml2 +# LIBXML2_INCLUDE_DIR - The LibXml2 include directory +# LIBXML2_LIBRARIES - The libraries needed to use LibXml2 +# LIBXML2_DEFINITIONS - Compiler switches required for using LibXml2 +# LIBXML2_XMLLINT_EXECUTABLE - The XML checking tool xmllint coming with LibXml2 + +# Copyright (c) 2006, Alexander Neundorf, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + + +IF (LIBXML2_INCLUDE_DIR AND LIBXML2_LIBRARIES) + # in cache already + SET(LibXml2_FIND_QUIETLY TRUE) +ENDIF (LIBXML2_INCLUDE_DIR AND LIBXML2_LIBRARIES) + +IF (NOT WIN32) + # use pkg-config to get the directories and then use these values + # in the FIND_PATH() and FIND_LIBRARY() calls + FIND_PACKAGE(PkgConfig) + PKG_CHECK_MODULES(PC_LIBXML libxml-2.0) + SET(LIBXML2_DEFINITIONS ${PC_LIBXML_CFLAGS_OTHER}) +ENDIF (NOT WIN32) + +FIND_PATH(LIBXML2_INCLUDE_DIR libxml/xpath.h + HINTS + ${PC_LIBXML_INCLUDEDIR} + ${PC_LIBXML_INCLUDE_DIRS} + PATH_SUFFIXES libxml2 + ) + +FIND_LIBRARY(LIBXML2_LIBRARIES NAMES xml2 libxml2 + HINTS + ${PC_LIBXML_LIBDIR} + ${PC_LIBXML_LIBRARY_DIRS} + ) + +FIND_PROGRAM(LIBXML2_XMLLINT_EXECUTABLE xmllint) +# for backwards compat. with KDE 4.0.x: +SET(XMLLINT_EXECUTABLE "${LIBXML2_XMLLINT_EXECUTABLE}") + +IF( NOT LIBXML2_XMLLINT_EXECUTABLE ) + MESSAGE(STATUS "xmllint program not found. Install it if you want validate generated doc file.") +ENDIF(NOT LIBXML2_XMLLINT_EXECUTABLE ) + + +INCLUDE(FindPackageHandleStandardArgs) + +# handle the QUIETLY and REQUIRED arguments and set LIBXML2_FOUND to TRUE if +# all listed variables are TRUE +FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXml2 DEFAULT_MSG LIBXML2_LIBRARIES LIBXML2_INCLUDE_DIR) + +MARK_AS_ADVANCED(LIBXML2_INCLUDE_DIR LIBXML2_LIBRARIES LIBXML2_XMLLINT_EXECUTABLE) + diff --git a/cmake/modules/FindLibXslt.cmake b/cmake/modules/FindLibXslt.cmake new file mode 100644 index 0000000000..3a1bcd4669 --- /dev/null +++ b/cmake/modules/FindLibXslt.cmake @@ -0,0 +1,68 @@ +# - Try to find LibXslt +# Once done this will define +# +# LIBXSLT_FOUND - system has LibXslt +# LIBXSLT_INCLUDE_DIR - the LibXslt include directory +# LIBXSLT_LIBRARIES - Link these to LibXslt +# LIBXSLT_DEFINITIONS - Compiler switches required for using LibXslt +# LIBXSLT_XSLTPROC_EXECUTABLE - path to the xsltproc tool + +# Copyright (c) 2006, Alexander Neundorf, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + + +IF (LIBXSLT_INCLUDE_DIR AND LIBXSLT_LIBRARIES) + # in cache already + SET(LibXslt_FIND_QUIETLY TRUE) +ENDIF (LIBXSLT_INCLUDE_DIR AND LIBXSLT_LIBRARIES) + +IF (NOT WIN32) + # use pkg-config to get the directories and then use these values + # in the FIND_PATH() and FIND_LIBRARY() calls + find_package(PkgConfig) + pkg_check_modules(PC_XSLT libxslt) + SET(LIBXSLT_DEFINITIONS ${PC_XSLT_CFLAGS_OTHER}) +ENDIF (NOT WIN32) + +FIND_PATH(LIBXSLT_INCLUDE_DIR libxslt/xslt.h + PATHS + ${PC_XSLT_INCLUDEDIR} + ${PC_XSLT_INCLUDE_DIRS} + ) + +FIND_LIBRARY(LIBXSLT_LIBRARIES NAMES xslt libxslt + PATHS + ${PC_XSLT_LIBDIR} + ${PC_XSLT_LIBRARY_DIRS} + ) + +FIND_LIBRARY(LIBEXSLT_LIBRARIES NAMES exslt libexslt + PATHS + ${PC_XSLT_LIBDIR} + ${PC_XSLT_LIBRARY_DIRS} + ) + +IF (LIBXSLT_INCLUDE_DIR AND LIBXSLT_LIBRARIES) + SET(LIBXSLT_FOUND TRUE) +ELSE (LIBXSLT_INCLUDE_DIR AND LIBXSLT_LIBRARIES) + SET(LIBXSLT_FOUND FALSE) +ENDIF (LIBXSLT_INCLUDE_DIR AND LIBXSLT_LIBRARIES) + +FIND_PROGRAM(LIBXSLT_XSLTPROC_EXECUTABLE xsltproc) +# For compatibility with FindLibXslt.cmake from KDE 4.[01].x +SET(XSLTPROC_EXECUTABLE ${LIBXSLT_XSLTPROC_EXECUTABLE}) + +IF (LIBXSLT_FOUND) + IF (NOT LibXslt_FIND_QUIETLY) + MESSAGE(STATUS "Found LibXslt: ${LIBXSLT_LIBRARIES}") + ENDIF (NOT LibXslt_FIND_QUIETLY) +ELSE (LIBXSLT_FOUND) + IF (LibXslt_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "Could NOT find LibXslt") + ENDIF (LibXslt_FIND_REQUIRED) +ENDIF (LIBXSLT_FOUND) + +MARK_AS_ADVANCED(LIBXSLT_INCLUDE_DIR LIBXSLT_LIBRARIES LIBEXSLT_LIBRARIES LIBXSLT_XSLTPROC_EXECUTABLE) + diff --git a/cmake/modules/FindLibintl.cmake b/cmake/modules/FindLibintl.cmake new file mode 100644 index 0000000000..52ae647938 --- /dev/null +++ b/cmake/modules/FindLibintl.cmake @@ -0,0 +1,46 @@ +# Try to find Libintl functionality +# Once done this will define +# +# LIBINTL_FOUND - system has Libintl +# LIBINTL_INCLUDE_DIR - Libintl include directory +# LIBINTL_LIBRARIES - Libraries needed to use Libintl +# +# TODO: This will enable translations only if Gettext functionality is +# present in libc. Must have more robust system for release, where Gettext +# functionality can also reside in standalone Gettext library, or the one +# embedded within kdelibs (cf. gettext.m4 from Gettext source). + +# Copyright (c) 2006, Chusslove Illich, +# Copyright (c) 2007, Alexander Neundorf, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +if(LIBINTL_INCLUDE_DIR AND LIBINTL_LIB_FOUND) + set(Libintl_FIND_QUIETLY TRUE) +endif(LIBINTL_INCLUDE_DIR AND LIBINTL_LIB_FOUND) + +find_path(LIBINTL_INCLUDE_DIR libintl.h) + +set(LIBINTL_LIB_FOUND FALSE) + +if(LIBINTL_INCLUDE_DIR) + include(CheckFunctionExists) + check_function_exists(dgettext LIBINTL_LIBC_HAS_DGETTEXT) + + if (LIBINTL_LIBC_HAS_DGETTEXT) + set(LIBINTL_LIBRARIES) + set(LIBINTL_LIB_FOUND TRUE) + else (LIBINTL_LIBC_HAS_DGETTEXT) + find_library(LIBINTL_LIBRARIES NAMES intl libintl ) + if(LIBINTL_LIBRARIES) + set(LIBINTL_LIB_FOUND TRUE) + endif(LIBINTL_LIBRARIES) + endif (LIBINTL_LIBC_HAS_DGETTEXT) + +endif(LIBINTL_INCLUDE_DIR) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Libintl DEFAULT_MSG LIBINTL_INCLUDE_DIR LIBINTL_LIB_FOUND) + +mark_as_advanced(LIBINTL_INCLUDE_DIR LIBINTL_LIBRARIES LIBINTL_LIBC_HAS_DGETTEXT LIBINTL_LIB_FOUND) diff --git a/cmake/modules/FindLibraryWithDebug.cmake b/cmake/modules/FindLibraryWithDebug.cmake new file mode 100644 index 0000000000..58cd730862 --- /dev/null +++ b/cmake/modules/FindLibraryWithDebug.cmake @@ -0,0 +1,113 @@ +# +# FIND_LIBRARY_WITH_DEBUG +# -> enhanced FIND_LIBRARY to allow the search for an +# optional debug library with a WIN32_DEBUG_POSTFIX similar +# to CMAKE_DEBUG_POSTFIX when creating a shared lib +# it has to be the second and third argument + +# Copyright (c) 2007, Christian Ehrlicher, +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +MACRO(FIND_LIBRARY_WITH_DEBUG var_name win32_dbg_postfix_name dgb_postfix libname) + + IF(NOT "${win32_dbg_postfix_name}" STREQUAL "WIN32_DEBUG_POSTFIX") + + # no WIN32_DEBUG_POSTFIX -> simply pass all arguments to FIND_LIBRARY + FIND_LIBRARY(${var_name} + ${win32_dbg_postfix_name} + ${dgb_postfix} + ${libname} + ${ARGN} + ) + + ELSE(NOT "${win32_dbg_postfix_name}" STREQUAL "WIN32_DEBUG_POSTFIX") + + IF(NOT WIN32) + # on non-win32 we don't need to take care about WIN32_DEBUG_POSTFIX + + FIND_LIBRARY(${var_name} ${libname} ${ARGN}) + + ELSE(NOT WIN32) + + # 1. get all possible libnames + SET(args ${ARGN}) + SET(newargs "") + SET(libnames_release "") + SET(libnames_debug "") + + LIST(LENGTH args listCount) + + IF("${libname}" STREQUAL "NAMES") + SET(append_rest 0) + LIST(APPEND args " ") + + FOREACH(i RANGE ${listCount}) + LIST(GET args ${i} val) + + IF(append_rest) + LIST(APPEND newargs ${val}) + ELSE(append_rest) + IF("${val}" STREQUAL "PATHS") + LIST(APPEND newargs ${val}) + SET(append_rest 1) + ELSE("${val}" STREQUAL "PATHS") + LIST(APPEND libnames_release "${val}") + LIST(APPEND libnames_debug "${val}${dgb_postfix}") + ENDIF("${val}" STREQUAL "PATHS") + ENDIF(append_rest) + + ENDFOREACH(i) + + ELSE("${libname}" STREQUAL "NAMES") + + # just one name + LIST(APPEND libnames_release "${libname}") + LIST(APPEND libnames_debug "${libname}${dgb_postfix}") + + SET(newargs ${args}) + + ENDIF("${libname}" STREQUAL "NAMES") + + # search the release lib + FIND_LIBRARY(${var_name}_RELEASE + NAMES ${libnames_release} + ${newargs} + ) + + # search the debug lib + FIND_LIBRARY(${var_name}_DEBUG + NAMES ${libnames_debug} + ${newargs} + ) + + IF(${var_name}_RELEASE AND ${var_name}_DEBUG) + + # both libs found + SET(${var_name} optimized ${${var_name}_RELEASE} + debug ${${var_name}_DEBUG}) + + ELSE(${var_name}_RELEASE AND ${var_name}_DEBUG) + + IF(${var_name}_RELEASE) + + # only release found + SET(${var_name} ${${var_name}_RELEASE}) + + ELSE(${var_name}_RELEASE) + + # only debug (or nothing) found + SET(${var_name} ${${var_name}_DEBUG}) + + ENDIF(${var_name}_RELEASE) + + ENDIF(${var_name}_RELEASE AND ${var_name}_DEBUG) + + MARK_AS_ADVANCED(${var_name}_RELEASE) + MARK_AS_ADVANCED(${var_name}_DEBUG) + + ENDIF(NOT WIN32) + + ENDIF(NOT "${win32_dbg_postfix_name}" STREQUAL "WIN32_DEBUG_POSTFIX") + +ENDMACRO(FIND_LIBRARY_WITH_DEBUG) diff --git a/cmake/modules/FindLinuxWirelesstools.cmake b/cmake/modules/FindLinuxWirelesstools.cmake new file mode 100644 index 0000000000..794bba77d0 --- /dev/null +++ b/cmake/modules/FindLinuxWirelesstools.cmake @@ -0,0 +1,29 @@ +# - Try to find wireless extensions support libraries +# Once done this will define +# +# IW_FOUND - system has IW +# IW_INCLUDE_DIR - the IW include directory +# IW_LIBRARIES - Link to these to use IW + +# Copyright (c) 2006, Thorsten Roeder, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + + +IF (IW_INCLUDE_DIR) + # Already in cache, be silent + SET(LinuxWirelesstools_FIND_QUIETLY TRUE) +ENDIF (IW_INCLUDE_DIR) + +FIND_PATH(IW_INCLUDE_DIR iwlib.h) + +FIND_LIBRARY(IW_LIBRARIES NAMES iw) + +include(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(IW "Could not find Linux Wirelesstools (libIW)" IW_INCLUDE_DIR IW_LIBRARIES ) + + +# show the IW_INCLUDE_DIR and IW_LIBRARIES variables only in the advanced view +MARK_AS_ADVANCED(IW_INCLUDE_DIR IW_LIBRARIES ) + diff --git a/cmake/modules/FindMsgfmt.cmake b/cmake/modules/FindMsgfmt.cmake new file mode 100644 index 0000000000..47c61219ec --- /dev/null +++ b/cmake/modules/FindMsgfmt.cmake @@ -0,0 +1,28 @@ +# - Try to find msgfmt +# Once done this will define +# +# MSGFMT_FOUND - system has msgfmt + +# Copyright (c) 2007, Montel Laurent +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +### TODO: KDE4 needs msgfmt of version 0.15 or greater (cf. msgfmt --version ) + +if(MSGFMT_EXECUTABLE) + set(MSGFMT_FOUND TRUE) +else(MSGFMT_EXECUTABLE) + + FIND_PROGRAM(MSGFMT_EXECUTABLE NAMES msgfmt) + if (MSGFMT_EXECUTABLE) + set(MSGFMT_FOUND TRUE) + else (MSGFMT_EXECUTABLE) + if (Msgfmt_FIND_REQUIRED) + message(SEND_ERROR "Could NOT find msgfmt program") + endif (Msgfmt_FIND_REQUIRED) + endif (MSGFMT_EXECUTABLE) + MARK_AS_ADVANCED(MSGFMT_EXECUTABLE) + +endif (MSGFMT_EXECUTABLE) + diff --git a/cmake/modules/FindMusicBrainz.cmake b/cmake/modules/FindMusicBrainz.cmake new file mode 100644 index 0000000000..c93b2dcc57 --- /dev/null +++ b/cmake/modules/FindMusicBrainz.cmake @@ -0,0 +1,32 @@ +# Module to find the musicbrainz library +# +# It defines +# MUSICBRAINZ_INCLUDE_DIR - the include dir +# MUSICBRAINZ_LIBRARIES - the required libraries +# MUSICBRAINZ_FOUND - true if both of the above have been found + +# Copyright (c) 2006,2007 Laurent Montel, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +if(MUSICBRAINZ_INCLUDE_DIR AND MUSICBRAINZ_LIBRARIES) + set(MUSICBRAINZ_FIND_QUIETLY TRUE) +endif(MUSICBRAINZ_INCLUDE_DIR AND MUSICBRAINZ_LIBRARIES) + +FIND_PATH(MUSICBRAINZ_INCLUDE_DIR musicbrainz/musicbrainz.h) + +FIND_LIBRARY( MUSICBRAINZ_LIBRARIES NAMES musicbrainz) + +# We need version 2, version 3 is source-incompatible +FIND_PATH(MUSICBRAINZ3_INCLUDE_DIR musicbrainz3/musicbrainz.h) +if(MUSICBRAINZ3_INCLUDE_DIR AND NOT MUSICBRAINZ_INCLUDE_DIR) + message(STATUS "\nIncompatible version 3.x of the musicbrainz includes detected. Version 2.x is needed.\n") +endif(MUSICBRAINZ3_INCLUDE_DIR AND NOT MUSICBRAINZ_INCLUDE_DIR) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args( MusicBrainz DEFAULT_MSG + MUSICBRAINZ_INCLUDE_DIR MUSICBRAINZ_LIBRARIES) + +MARK_AS_ADVANCED(MUSICBRAINZ_INCLUDE_DIR MUSICBRAINZ_LIBRARIES) + diff --git a/cmake/modules/FindMySQL.cmake b/cmake/modules/FindMySQL.cmake new file mode 100644 index 0000000000..6a0f8941d4 --- /dev/null +++ b/cmake/modules/FindMySQL.cmake @@ -0,0 +1,138 @@ +# - Try to find MySQL / MySQL Embedded library +# Find the MySQL includes and client library +# This module defines +# MYSQL_INCLUDE_DIR, where to find mysql.h +# MYSQL_LIBRARIES, the libraries needed to use MySQL. +# MYSQL_LIB_DIR, path to the MYSQL_LIBRARIES +# MYSQL_EMBEDDED_LIBRARIES, the libraries needed to use MySQL Embedded. +# MYSQL_EMBEDDED_LIB_DIR, path to the MYSQL_EMBEDDED_LIBRARIES +# MYSQL_FOUND, If false, do not try to use MySQL. +# MYSQL_EMBEDDED_FOUND, If false, do not try to use MySQL Embedded. + +# Copyright (c) 2006-2008, JarosĊ‚aw Staniek +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +include(CheckCXXSourceCompiles) +include(MacroPushRequiredVars) + +if(WIN32) + find_path(MYSQL_INCLUDE_DIR mysql.h + PATHS + $ENV{MYSQL_INCLUDE_DIR} + $ENV{MYSQL_DIR}/include + $ENV{ProgramFiles}/MySQL/*/include + $ENV{SystemDrive}/MySQL/*/include + ) +else(WIN32) + find_path(MYSQL_INCLUDE_DIR mysql.h + PATHS + $ENV{MYSQL_INCLUDE_DIR} + $ENV{MYSQL_DIR}/include + /usr/local/mysql/include + /opt/mysql/mysql/include + PATH_SUFFIXES + mysql + ) +endif(WIN32) + +if(WIN32) + # path suffix for debug/release mode + # binary_dist: mysql binary distribution + # build_dist: custom build + if(CMAKE_BUILD_TYPE STREQUAL "Debug") + set(binary_dist debug) + set(build_dist Debug) + else(CMAKE_BUILD_TYPE STREQUAL "Debug") + ADD_DEFINITIONS(-DDBUG_OFF) + set(binary_dist opt) + set(build_dist Release) + endif(CMAKE_BUILD_TYPE STREQUAL "Debug") + +# find_library(MYSQL_LIBRARIES NAMES mysqlclient + find_library(MYSQL_LIBRARIES NAMES libmysql + PATHS + $ENV{MYSQL_DIR}/lib/${binary_dist} + $ENV{MYSQL_DIR}/libmysql/${build_dist} + $ENV{MYSQL_DIR}/client/${build_dist} + $ENV{ProgramFiles}/MySQL/*/lib/${binary_dist} + $ENV{SystemDrive}/MySQL/*/lib/${binary_dist} + ) +else(WIN32) +# find_library(MYSQL_LIBRARIES NAMES mysqlclient + find_library(MYSQL_LIBRARIES NAMES libmysql + PATHS + $ENV{MYSQL_DIR}/libmysql_r/.libs + $ENV{MYSQL_DIR}/lib + $ENV{MYSQL_DIR}/lib/mysql + /usr/local/mysql/lib + /opt/mysql/mysql/lib + PATH_SUFFIXES + mysql + ) +endif(WIN32) + +if(WIN32) + set(MYSQL_LIB_PATHS + $ENV{MYSQL_DIR}/lib/opt + $ENV{MYSQL_DIR}/client/release + $ENV{ProgramFiles}/MySQL/*/lib/opt + $ENV{SystemDrive}/MySQL/*/lib/opt + ) + find_library(MYSQL_LIBRARIES NAMES mysqlclient + PATHS + ${MYSQL_LIB_PATHS} + ) +else(WIN32) + set(MYSQL_LIB_PATHS + $ENV{MYSQL_DIR}/libmysql_r/.libs + $ENV{MYSQL_DIR}/lib + $ENV{MYSQL_DIR}/lib/mysql + /usr/local/mysql/lib + /opt/mysql/mysql/lib + PATH_SUFFIXES + mysql + ) + find_library(MYSQL_LIBRARIES NAMES mysqlclient + PATHS + ${MYSQL_LIB_PATHS} + ) +endif(WIN32) + +find_library(MYSQL_EMBEDDED_LIBRARIES NAMES mysqld + PATHS + ${MYSQL_LIB_PATHS} +) + +if(MYSQL_LIBRARIES) + get_filename_component(MYSQL_LIB_DIR ${MYSQL_LIBRARIES} PATH) +endif(MYSQL_LIBRARIES) + +if(MYSQL_EMBEDDED_LIBRARIES) + get_filename_component(MYSQL_EMBEDDED_LIB_DIR ${MYSQL_EMBEDDED_LIBRARIES} PATH) +endif(MYSQL_EMBEDDED_LIBRARIES) + +macro_push_required_vars() +set( CMAKE_REQUIRED_INCLUDES ${MYSQL_INCLUDE_DIR} ) +set( CMAKE_REQUIRED_LIBRARIES ${MYSQL_EMBEDDED_LIBRARIES} ) +check_cxx_source_compiles( "#include \nint main() { int i = MYSQL_OPT_USE_EMBEDDED_CONNECTION; }" HAVE_MYSQL_OPT_EMBEDDED_CONNECTION ) +macro_pop_required_vars() + +if(MYSQL_INCLUDE_DIR AND MYSQL_LIBRARIES) + set(MYSQL_FOUND TRUE) + message(STATUS "Found MySQL: ${MYSQL_INCLUDE_DIR}, ${MYSQL_LIBRARIES}") +else(MYSQL_INCLUDE_DIR AND MYSQL_LIBRARIES) + set(MYSQL_FOUND FALSE) + message(STATUS "MySQL not found.") +endif(MYSQL_INCLUDE_DIR AND MYSQL_LIBRARIES) + +if(MYSQL_INCLUDE_DIR AND MYSQL_EMBEDDED_LIBRARIES AND HAVE_MYSQL_OPT_EMBEDDED_CONNECTION) + set(MYSQL_EMBEDDED_FOUND TRUE) + message(STATUS "Found MySQL Embedded: ${MYSQL_INCLUDE_DIR}, ${MYSQL_EMBEDDED_LIBRARIES}") +else(MYSQL_INCLUDE_DIR AND MYSQL_EMBEDDED_LIBRARIES AND HAVE_MYSQL_OPT_EMBEDDED_CONNECTION) + set(MYSQL_EMBEDDED_FOUND FALSE) + message(STATUS "MySQL Embedded not found.") +endif(MYSQL_INCLUDE_DIR AND MYSQL_EMBEDDED_LIBRARIES AND HAVE_MYSQL_OPT_EMBEDDED_CONNECTION) + +mark_as_advanced(MYSQL_INCLUDE_DIR MYSQL_LIBRARIES MYSQL_EMBEDDED_LIBRARIES) diff --git a/cmake/modules/FindNepomuk.cmake b/cmake/modules/FindNepomuk.cmake new file mode 100644 index 0000000000..deb0c8c631 --- /dev/null +++ b/cmake/modules/FindNepomuk.cmake @@ -0,0 +1,58 @@ +# Once done this will define +# +# Nepomuk requires Soprano, so this module checks for Soprano too. +# +# NEPOMUK_FOUND - system has Nepomuk +# NEPOMUK_INCLUDE_DIR - the Nepomuk include directory +# NEPOMUK_LIBRARIES - Link these to use Nepomuk +# NEPOMUK_DEFINITIONS - Compiler switches required for using Nepomuk +# + + +# Copyright (c) 2008, Sebastian Trueg, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + + +if (NOT DEFINED Soprano_FOUND) + macro_optional_find_package(Soprano) + macro_log_feature(Soprano_FOUND "Soprano" "Semantic Desktop Storing" "" FALSE "" "Soprano is needed for Nepomuk") +endif (NOT DEFINED Soprano_FOUND) + +if (Soprano_FOUND) + + set (NEPOMUK_FIND_REQUIRED ${Nepomuk_FIND_REQUIRED}) + if (NEPOMUK_INCLUDE_DIR AND NEPOMUK_LIBRARIES) + + # Already in cache, be silent + set(NEPOMUK_FIND_QUIETLY TRUE) + + else (NEPOMUK_INCLUDE_DIR AND NEPOMUK_LIBRARIES) + find_path(NEPOMUK_INCLUDE_DIR + NAMES + nepomuk/global.h + PATHS + ${KDE4_INCLUDE_DIR} + ${INCLUDE_INSTALL_DIR} + ) + + find_library(NEPOMUK_LIBRARIES + NAMES + nepomuk + PATHS + ${KDE4_LIB_DIR} + ${LIB_INSTALL_DIR} + ) + + mark_as_advanced(NEPOMUK_INCLUDE_DIR NEPOMUK_LIBRARIES) + + endif (NEPOMUK_INCLUDE_DIR AND NEPOMUK_LIBRARIES) + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(NEPOMUK DEFAULT_MSG + NEPOMUK_LIBRARIES NEPOMUK_INCLUDE_DIR) + #to retain backward compatibility + set (Nepomuk_FOUND ${NEPOMUK_FOUND}) + +endif (Soprano_FOUND) diff --git a/cmake/modules/FindNetworkManager.cmake b/cmake/modules/FindNetworkManager.cmake new file mode 100644 index 0000000000..ced2017ce5 --- /dev/null +++ b/cmake/modules/FindNetworkManager.cmake @@ -0,0 +1,42 @@ +# - Try to find NetworkManager +# Once done this will define +# +# NETWORKMANAGER_FOUND - system has NetworkManager +# NETWORKMANAGER_INCLUDE_DIRS - the NetworkManager include directories +# NETWORKMANAGER_LIBRARIES - the libraries needed to use NetworkManager +# NETWORKMANAGER_CFLAGS - Compiler switches required for using NetworkManager +# NETWORKMANAGER_VERSION - version number of NetworkManager + +# Copyright (c) 2006, Alexander Neundorf, +# Copyright (c) 2007, Will Stephenson, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + + +IF (NETWORKMANAGER_INCLUDE_DIRS AND NM-UTIL_INCLUDE_DIRS) + # in cache already + SET(NetworkManager_FIND_QUIETLY TRUE) +ENDIF (NETWORKMANAGER_INCLUDE_DIRS AND NM-UTIL_INCLUDE_DIRS) + +IF (NOT WIN32) + # use pkg-config to get the directories and then use these values + # in the FIND_PATH() and FIND_LIBRARY() calls + find_package(PkgConfig) + PKG_SEARCH_MODULE( NETWORKMANAGER NetworkManager ) + PKG_SEARCH_MODULE( NM-UTIL libnm-util ) +ENDIF (NOT WIN32) + +IF (NETWORKMANAGER_FOUND AND NM-UTIL_FOUND) + IF (NOT NetworkManager_FIND_QUIETLY) + MESSAGE(STATUS "Found NetworkManager ${NETWORKMANAGER_VERSION}: ${NETWORKMANAGER_LIBRARY_DIRS}") + MESSAGE(STATUS "Found libnm-util: ${NM-UTIL_LIBRARY_DIRS}") + ENDIF (NOT NetworkManager_FIND_QUIETLY) +ELSE (NETWORKMANAGER_FOUND AND NM-UTIL_FOUND) + IF (NetworkManager_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "Could NOT find NetworkManager or libnm-util, check FindPkgConfig output above!") + ENDIF (NetworkManager_FIND_REQUIRED) +ENDIF (NETWORKMANAGER_FOUND AND NM-UTIL_FOUND) + +MARK_AS_ADVANCED(NETWORKMANAGER_INCLUDE_DIRS NM-UTIL_INCLUDE_DIRS) + diff --git a/cmake/modules/FindOggVorbis.cmake b/cmake/modules/FindOggVorbis.cmake new file mode 100644 index 0000000000..e72d849d24 --- /dev/null +++ b/cmake/modules/FindOggVorbis.cmake @@ -0,0 +1,89 @@ +# - Try to find the OggVorbis libraries +# Once done this will define +# +# OGGVORBIS_FOUND - system has OggVorbis +# OGGVORBIS_VERSION - set either to 1 or 2 +# OGGVORBIS_INCLUDE_DIR - the OggVorbis include directory +# OGGVORBIS_LIBRARIES - The libraries needed to use OggVorbis +# OGG_LIBRARY - The Ogg library +# VORBIS_LIBRARY - The Vorbis library +# VORBISFILE_LIBRARY - The VorbisFile library +# VORBISENC_LIBRARY - The VorbisEnc library + +# Copyright (c) 2006, Richard Laerkaeng, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + + +include (CheckLibraryExists) + +find_path(VORBIS_INCLUDE_DIR vorbis/vorbisfile.h) +find_path(OGG_INCLUDE_DIR ogg/ogg.h) + +find_library(OGG_LIBRARY NAMES ogg) +find_library(VORBIS_LIBRARY NAMES vorbis) +find_library(VORBISFILE_LIBRARY NAMES vorbisfile) +find_library(VORBISENC_LIBRARY NAMES vorbisenc) + +mark_as_advanced(VORBIS_INCLUDE_DIR OGG_INCLUDE_DIR + OGG_LIBRARY VORBIS_LIBRARY VORBISFILE_LIBRARY VORBISENC_LIBRARY) + + +if (VORBIS_INCLUDE_DIR AND VORBIS_LIBRARY AND VORBISFILE_LIBRARY AND VORBISENC_LIBRARY) + set(OGGVORBIS_FOUND TRUE) + + set(OGGVORBIS_LIBRARIES ${OGG_LIBRARY} ${VORBIS_LIBRARY} ${VORBISFILE_LIBRARY} ${VORBISENC_LIBRARY}) + + set(_CMAKE_REQUIRED_LIBRARIES_TMP ${CMAKE_REQUIRED_LIBRARIES}) + set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${OGGVORBIS_LIBRARIES}) + check_library_exists(vorbis vorbis_bitrate_addblock "" HAVE_LIBVORBISENC2) + set(CMAKE_REQUIRED_LIBRARIES ${_CMAKE_REQUIRED_LIBRARIES_TMP}) + + if (HAVE_LIBVORBISENC2) + set (OGGVORBIS_VERSION 2) + else (HAVE_LIBVORBISENC2) + set (OGGVORBIS_VERSION 1) + endif (HAVE_LIBVORBISENC2) + +else (VORBIS_INCLUDE_DIR AND VORBIS_LIBRARY AND VORBISFILE_LIBRARY AND VORBISENC_LIBRARY) + set (OGGVORBIS_VERSION) + set(OGGVORBIS_FOUND FALSE) +endif (VORBIS_INCLUDE_DIR AND VORBIS_LIBRARY AND VORBISFILE_LIBRARY AND VORBISENC_LIBRARY) + + +if (OGGVORBIS_FOUND) + if (NOT OggVorbis_FIND_QUIETLY) + message(STATUS "Found OggVorbis: ${OGGVORBIS_LIBRARIES}") + endif (NOT OggVorbis_FIND_QUIETLY) +else (OGGVORBIS_FOUND) + if (OggVorbis_FIND_REQUIRED) + message(FATAL_ERROR "Could NOT find OggVorbis libraries") + endif (OggVorbis_FIND_REQUIRED) + if (NOT OggVorbis_FIND_QUITELY) + message(STATUS "Could NOT find OggVorbis libraries") + endif (NOT OggVorbis_FIND_QUITELY) +endif (OGGVORBIS_FOUND) + +#check_include_files(vorbis/vorbisfile.h HAVE_VORBISFILE_H) +#check_library_exists(ogg ogg_page_version "" HAVE_LIBOGG) +#check_library_exists(vorbis vorbis_info_init "" HAVE_LIBVORBIS) +#check_library_exists(vorbisfile ov_open "" HAVE_LIBVORBISFILE) +#check_library_exists(vorbisenc vorbis_info_clear "" HAVE_LIBVORBISENC) +#check_library_exists(vorbis vorbis_bitrate_addblock "" HAVE_LIBVORBISENC2) + +#if (HAVE_LIBOGG AND HAVE_VORBISFILE_H AND HAVE_LIBVORBIS AND HAVE_LIBVORBISFILE AND HAVE_LIBVORBISENC) +# message(STATUS "Ogg/Vorbis found") +# set (VORBIS_LIBS "-lvorbis -logg") +# set (VORBISFILE_LIBS "-lvorbisfile") +# set (VORBISENC_LIBS "-lvorbisenc") +# set (OGGVORBIS_FOUND TRUE) +# if (HAVE_LIBVORBISENC2) +# set (HAVE_VORBIS 2) +# else (HAVE_LIBVORBISENC2) +# set (HAVE_VORBIS 1) +# endif (HAVE_LIBVORBISENC2) +#else (HAVE_LIBOGG AND HAVE_VORBISFILE_H AND HAVE_LIBVORBIS AND HAVE_LIBVORBISFILE AND HAVE_LIBVORBISENC) +# message(STATUS "Ogg/Vorbis not found") +#endif (HAVE_LIBOGG AND HAVE_VORBISFILE_H AND HAVE_LIBVORBIS AND HAVE_LIBVORBISFILE AND HAVE_LIBVORBISENC) + diff --git a/cmake/modules/FindOpenEXR.cmake b/cmake/modules/FindOpenEXR.cmake new file mode 100644 index 0000000000..eb3829cb1f --- /dev/null +++ b/cmake/modules/FindOpenEXR.cmake @@ -0,0 +1,104 @@ +# Try to find the OpenEXR libraries +# This check defines: +# +# OPENEXR_FOUND - system has OpenEXR +# OPENEXR_INCLUDE_DIR - OpenEXR include directory +# OPENEXR_LIBRARIES - Libraries needed to use OpenEXR +# OPENEXR_DEFINITIONS - definitions required to use OpenEXR + +# Copyright (c) 2006, Alexander Neundorf, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + + +if (OPENEXR_INCLUDE_DIR AND OPENEXR_LIBRARIES) + # in cache already + set(OPENEXR_FOUND TRUE) + +else (OPENEXR_INCLUDE_DIR AND OPENEXR_LIBRARIES) + + # use pkg-config to get the directories and then use these values + # in the FIND_PATH() and FIND_LIBRARY() calls + find_package(PkgConfig) + pkg_check_modules(PC_OPENEXR OpenEXR) + + FIND_PATH(OPENEXR_INCLUDE_DIR ImfRgbaFile.h + HINTS + ${PC_OPENEXR_INCLUDEDIR} + ${PC_OPENEXR_INCLUDE_DIRS} + PATH_SUFFIXES OpenEXR + ) + + FIND_LIBRARY(OPENEXR_HALF_LIBRARY NAMES Half + HINTS + ${PC_OPENEXR_LIBDIR} + ${PC_OPENEXR_LIBRARY_DIRS} + ) + + + FIND_LIBRARY(OPENEXR_IEX_LIBRARY NAMES Iex + PATHS + ${PC_OPENEXR_LIBDIR} + ${PC_OPENEXR_LIBRARY_DIRS} + ) + + FIND_LIBRARY(OPENEXR_IMATH_LIBRARY NAMES Imath + HINTS + ${PC_OPENEXR_LIBDIR} + ${PC_OPENEXR_LIBRARY_DIRS} + NO_DEFAULT_PATH + ) + + FIND_LIBRARY(OPENEXR_ILMIMF_LIBRARY NAMES IlmImf + HINTS + ${PC_OPENEXR_LIBDIR} + ${PC_OPENEXR_LIBRARY_DIRS} + ) + + FIND_LIBRARY(OPENEXR_ILMTHREAD_LIBRARY NAMES IlmThread + HINTS + ${PC_OPENEXR_LIBDIR} + ${PC_OPENEXR_LIBRARY_DIRS} + ) + + if (OPENEXR_INCLUDE_DIR AND OPENEXR_IMATH_LIBRARY AND OPENEXR_ILMIMF_LIBRARY AND OPENEXR_IEX_LIBRARY AND OPENEXR_HALF_LIBRARY) + set(OPENEXR_FOUND TRUE) + if (OPENEXR_ILMTHREAD_LIBRARY) + set(OPENEXR_LIBRARIES ${OPENEXR_IMATH_LIBRARY} ${OPENEXR_ILMIMF_LIBRARY} ${OPENEXR_IEX_LIBRARY} ${OPENEXR_HALF_LIBRARY} ${OPENEXR_ILMTHREAD_LIBRARY} ) + else (OPENEXR_ILMTHREAD_LIBRARY) + set(OPENEXR_LIBRARIES ${OPENEXR_IMATH_LIBRARY} ${OPENEXR_ILMIMF_LIBRARY} ${OPENEXR_IEX_LIBRARY} ${OPENEXR_HALF_LIBRARY} ) + endif (OPENEXR_ILMTHREAD_LIBRARY) + + if (WIN32) + set(_OPENEXR_DEFINITIONS -DOPENEXR_DLL) + else (WIN32) + set(_OPENEXR_DEFINITIONS) + endif (WIN32) + + set(OPENEXR_DEFINITIONS ${_OPENEXR_DEFINITIONS}) + + endif (OPENEXR_INCLUDE_DIR AND OPENEXR_IMATH_LIBRARY AND OPENEXR_ILMIMF_LIBRARY AND OPENEXR_IEX_LIBRARY AND OPENEXR_HALF_LIBRARY) + + + if (OPENEXR_FOUND) + if (NOT OpenEXR_FIND_QUIETLY) + message(STATUS "Found OPENEXR: ${OPENEXR_LIBRARIES}") + endif (NOT OpenEXR_FIND_QUIETLY) + else (OPENEXR_FOUND) + if (OpenEXR_FIND_REQUIRED) + message(FATAL_ERROR "Could NOT find OPENEXR") + endif (OpenEXR_FIND_REQUIRED) + endif (OPENEXR_FOUND) + + mark_as_advanced( + OPENEXR_INCLUDE_DIR + OPENEXR_LIBRARIES + OPENEXR_ILMIMF_LIBRARY + OPENEXR_ILMTHREAD_LIBRARY + OPENEXR_IMATH_LIBRARY + OPENEXR_IEX_LIBRARY + OPENEXR_HALF_LIBRARY + OPENEXR_DEFINITIONS ) + +endif (OPENEXR_INCLUDE_DIR AND OPENEXR_LIBRARIES) diff --git a/cmake/modules/FindOpenSSL.cmake b/cmake/modules/FindOpenSSL.cmake new file mode 100644 index 0000000000..1b915530ae --- /dev/null +++ b/cmake/modules/FindOpenSSL.cmake @@ -0,0 +1,63 @@ +# - Try to find the OpenSSL encryption library +# Once done this will define +# +# OPENSSL_FOUND - system has the OpenSSL library +# OPENSSL_INCLUDE_DIR - the OpenSSL include directory +# OPENSSL_LIBRARIES - The libraries needed to use OpenSSL +# OPENSSL_EAY_LIBRARIES - The additional libraries needed to use OpenSSL on windows + +# Copyright (c) 2006, Alexander Neundorf, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +INCLUDE(FindLibraryWithDebug) + +# on win32 we additional need to link to libeay32.lib +MACRO(OPENSSL_ADD_LIB_EAY_LIBS) + FIND_LIBRARY_WITH_DEBUG(OPENSSL_EAY_LIBRARIES + WIN32_DEBUG_POSTFIX d + NAMES eay libeay libeay32 libeay32MD) +ENDMACRO(OPENSSL_ADD_LIB_EAY_LIBS) + +IF(OPENSSL_LIBRARIES) + SET(OpenSSL_FIND_QUIETLY TRUE) +ENDIF(OPENSSL_LIBRARIES) + +IF(SSL_EAY_DEBUG AND SSL_EAY_RELEASE) + SET(LIB_FOUND 1) +ENDIF(SSL_EAY_DEBUG AND SSL_EAY_RELEASE) + +FIND_PATH(OPENSSL_INCLUDE_DIR openssl/ssl.h ) + +FIND_LIBRARY_WITH_DEBUG(OPENSSL_LIBRARIES + WIN32_DEBUG_POSTFIX d + NAMES ssl ssleay ssleay32 ssleay32MD) + +IF(WIN32) + OPENSSL_ADD_LIB_EAY_LIBS() + IF(OPENSSL_INCLUDE_DIR AND OPENSSL_LIBRARIES AND OPENSSL_EAY_LIBRARIES) + SET(OPENSSL_FOUND TRUE) + ELSE(OPENSSL_INCLUDE_DIR AND OPENSSL_LIBRARIES AND OPENSSL_EAY_LIBRARIES) + SET(OPENSSL_FOUND FALSE) + ENDIF (OPENSSL_INCLUDE_DIR AND OPENSSL_LIBRARIES AND OPENSSL_EAY_LIBRARIES) +ELSE(WIN32) + IF(OPENSSL_INCLUDE_DIR AND OPENSSL_LIBRARIES) + SET(OPENSSL_FOUND TRUE) + ELSE(OPENSSL_INCLUDE_DIR AND OPENSSL_LIBRARIES) + SET(OPENSSL_FOUND FALSE) + ENDIF (OPENSSL_INCLUDE_DIR AND OPENSSL_LIBRARIES) +ENDIF(WIN32) + +IF (OPENSSL_FOUND) + IF (NOT OpenSSL_FIND_QUIETLY) + MESSAGE(STATUS "Found OpenSSL: ${OPENSSL_LIBRARIES}") + ENDIF (NOT OpenSSL_FIND_QUIETLY) +ELSE (OPENSSL_FOUND) + IF (OpenSSL_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "Could NOT find OpenSSL") + ENDIF (OpenSSL_FIND_REQUIRED) +ENDIF (OPENSSL_FOUND) + +MARK_AS_ADVANCED(OPENSSL_INCLUDE_DIR OPENSSL_LIBRARIES) + diff --git a/cmake/modules/FindPCRE.cmake b/cmake/modules/FindPCRE.cmake new file mode 100644 index 0000000000..efba0652d9 --- /dev/null +++ b/cmake/modules/FindPCRE.cmake @@ -0,0 +1,44 @@ +# - Try to find the PCRE regular expression library +# Once done this will define +# +# PCRE_FOUND - system has the PCRE library +# PCRE_INCLUDE_DIR - the PCRE include directory +# PCRE_LIBRARIES - The libraries needed to use PCRE + +# Copyright (c) 2006, Alexander Neundorf, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + + +if (PCRE_INCLUDE_DIR AND PCRE_PCREPOSIX_LIBRARY AND PCRE_PCRE_LIBRARY) + # Already in cache, be silent + set(PCRE_FIND_QUIETLY TRUE) +endif (PCRE_INCLUDE_DIR AND PCRE_PCREPOSIX_LIBRARY AND PCRE_PCRE_LIBRARY) + + +if (NOT WIN32) + # use pkg-config to get the directories and then use these values + # in the FIND_PATH() and FIND_LIBRARY() calls + find_package(PkgConfig) + + pkg_check_modules(PC_PCRE libpcre) + + set(PCRE_DEFINITIONS ${PC_PCRE_CFLAGS_OTHER}) + +endif (NOT WIN32) + +find_path(PCRE_INCLUDE_DIR pcre.h + HINTS ${PC_PCRE_INCLUDEDIR} ${PC_PCRE_INCLUDE_DIRS} + PATH_SUFFIXES pcre) + +find_library(PCRE_PCRE_LIBRARY NAMES pcre HINTS ${PC_PCRE_LIBDIR} ${PC_PCRE_LIBRARY_DIRS}) + +find_library(PCRE_PCREPOSIX_LIBRARY NAMES pcreposix HINTS ${PC_PCRE_LIBDIR} ${PC_PCRE_LIBRARY_DIRS}) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(PCRE DEFAULT_MSG PCRE_INCLUDE_DIR PCRE_PCRE_LIBRARY PCRE_PCREPOSIX_LIBRARY ) + +set(PCRE_LIBRARIES ${PCRE_PCRE_LIBRARY} ${PCRE_PCREPOSIX_LIBRARY}) + +mark_as_advanced(PCRE_INCLUDE_DIR PCRE_LIBRARIES PCRE_PCREPOSIX_LIBRARY PCRE_PCRE_LIBRARY) diff --git a/cmake/modules/FindPhonon.cmake b/cmake/modules/FindPhonon.cmake new file mode 100644 index 0000000000..9333269733 --- /dev/null +++ b/cmake/modules/FindPhonon.cmake @@ -0,0 +1,67 @@ +# Find libphonon +# Once done this will define +# +# PHONON_FOUND - system has Phonon Library +# PHONON_INCLUDES - the Phonon include directory +# PHONON_LIBS - link these to use Phonon +# PHONON_VERSION - the version of the Phonon Library + +# Copyright (c) 2008, Matthias Kretz +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +macro(_phonon_find_version) + file(READ "${PHONON_INCLUDE_DIR}/phonon/phononnamespace.h" _phonon_header LIMIT 5000 OFFSET 1000) + string(REGEX MATCH "define PHONON_VERSION_STR \"(4\\.[0-9]+\\.[0-9a-z]+)\"" _phonon_version_match "${_phonon_header}") + set(PHONON_VERSION "${CMAKE_MATCH_1}") + message(STATUS "Phonon Version: ${PHONON_VERSION}") +endmacro(_phonon_find_version) + +if(PHONON_FOUND) + # Already found, nothing more to do except figuring out the version + _phonon_find_version() +else(PHONON_FOUND) + if(PHONON_INCLUDE_DIR AND PHONON_LIBRARY) + set(PHONON_FIND_QUIETLY TRUE) + endif(PHONON_INCLUDE_DIR AND PHONON_LIBRARY) + + # As discussed on kde-buildsystem: first look at CMAKE_PREFIX_PATH, then at the suggested PATHS (kde4 install dir) + find_library(PHONON_LIBRARY NAMES phonon PATHS ${KDE4_LIB_INSTALL_DIR} ${QT_LIBRARY_DIR} NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_SYSTEM_PATH) + # then at the default system locations (CMAKE_SYSTEM_PREFIX_PATH, i.e. /usr etc.) + find_library(PHONON_LIBRARY NAMES phonon) + + find_path(PHONON_INCLUDE_DIR NAMES phonon/phonon_export.h PATHS ${KDE4_INCLUDE_INSTALL_DIR} ${QT_INCLUDE_DIR} ${INCLUDE_INSTALL_DIR} NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_SYSTEM_PATH) + find_path(PHONON_INCLUDE_DIR NAMES phonon/phonon_export.h) + + if(PHONON_INCLUDE_DIR AND PHONON_LIBRARY) + set(PHONON_LIBS ${phonon_LIB_DEPENDS} ${PHONON_LIBRARY}) + set(PHONON_INCLUDES ${PHONON_INCLUDE_DIR}/KDE ${PHONON_INCLUDE_DIR}) + set(PHONON_FOUND TRUE) + _phonon_find_version() + else(PHONON_INCLUDE_DIR AND PHONON_LIBRARY) + set(PHONON_FOUND FALSE) + endif(PHONON_INCLUDE_DIR AND PHONON_LIBRARY) + + if(PHONON_FOUND) + if(NOT PHONON_FIND_QUIETLY) + message(STATUS "Found Phonon: ${PHONON_LIBRARY}") + message(STATUS "Found Phonon Includes: ${PHONON_INCLUDES}") + endif(NOT PHONON_FIND_QUIETLY) + else(PHONON_FOUND) + if(Phonon_FIND_REQUIRED) + if(NOT PHONON_INCLUDE_DIR) + message(STATUS "Phonon includes NOT found!") + endif(NOT PHONON_INCLUDE_DIR) + if(NOT PHONON_LIBRARY) + message(STATUS "Phonon library NOT found!") + endif(NOT PHONON_LIBRARY) + message(FATAL_ERROR "Phonon library or includes NOT found!") + else(Phonon_FIND_REQUIRED) + message(STATUS "Unable to find Phonon") + endif(Phonon_FIND_REQUIRED) + endif(PHONON_FOUND) + + + mark_as_advanced(PHONON_INCLUDE_DIR PHONON_LIBRARY PHONON_INCLUDES) +endif(PHONON_FOUND) diff --git a/cmake/modules/FindPlasma.cmake b/cmake/modules/FindPlasma.cmake new file mode 100644 index 0000000000..72d07c791e --- /dev/null +++ b/cmake/modules/FindPlasma.cmake @@ -0,0 +1,20 @@ + +# FindPlasma.cmake was part of KDE 4.1, but Plasma itself didn't guarantee compatibility before 4.2, +# so anything which relied on Plasma < 4.2 is broken anyway with KDE 4.2. +# So since the package itself didn't keep compatibility, it doesn't make sense to provide +# this file just to keep compatibility for the cmake part, this doesn't help anybody. +# Especially now that plasma is part of kdelibs and as such the variables required +# for using plasma are set by FindKDE4Internal.cmake. +# This file is not used anywhere in trunk/KDE/ anymore, 3rd party projects get a +# error message which tells them what to do, so we should be fine. +# Alex +# + +message(FATAL_ERROR "FindPlasma.cmake is deprecated. Now with KDE 4.2 Plasma is part of kdelibs and automatically found using find_package(KDE4) instead. +Replace the variables previously coming from FindPlasma.cmake as follows: +PLASMA_OPENGL_FOUND -> KDE4_PLASMA_OPENGL_FOUND +PLASMA_LIBS -> KDE4_PLASMA_LIBS +PLASMA_INCLUDE_DIR -> KDE4_INCLUDE_DIR or KDE4_INCLUDES, should be already set anyway +PLASMA_FOUND -> nothing, it's always there if KDE4, version 4.2 or newer has been found. +If you see this error message in a module within KDE/, update it from svn, it has been fixed already. +") diff --git a/cmake/modules/FindPopplerQt4.cmake b/cmake/modules/FindPopplerQt4.cmake new file mode 100644 index 0000000000..fbc1820ccc --- /dev/null +++ b/cmake/modules/FindPopplerQt4.cmake @@ -0,0 +1,53 @@ +# - Try to find the Qt4 binding of the Poppler library +# Once done this will define +# +# POPPLER_QT4_FOUND - system has poppler-qt4 +# POPPLER_QT4_INCLUDE_DIR - the poppler-qt4 include directory +# POPPLER_QT4_LIBRARIES - Link these to use poppler-qt4 +# POPPLER_QT4_DEFINITIONS - Compiler switches required for using poppler-qt4 +# + +# use pkg-config to get the directories and then use these values +# in the FIND_PATH() and FIND_LIBRARY() calls + +# Copyright (c) 2006, Wilfried Huss, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + + +if(NOT WIN32) + include(UsePkgConfig) + + pkgconfig(poppler-qt4 _PopplerQt4IncDir _PopplerQt4LinkDir _PopplerQt4LinkFlags _PopplerQt4Cflags) + + set(POPPLER_QT4_DEFINITIONS ${_PopplerQt4Cflags}) +endif(NOT WIN32) + +find_path(POPPLER_QT4_INCLUDE_DIR + NAMES poppler-qt4.h + PATH_SUFFIXES poppler/qt4 poppler + PATHS ${_PopplerQt4IncDir} +) + +find_library(POPPLER_QT4_LIBRARIES poppler-qt4 + ${_PopplerQt4LinkDir} +) + +if (POPPLER_QT4_INCLUDE_DIR AND POPPLER_QT4_LIBRARIES) + set(POPPLER_QT4_FOUND TRUE) +else (POPPLER_QT4_INCLUDE_DIR AND POPPLER_QT4_LIBRARIES) + set(POPPLER_QT4_FOUND FALSE) +endif (POPPLER_QT4_INCLUDE_DIR AND POPPLER_QT4_LIBRARIES) + +if (POPPLER_QT4_FOUND) + if (NOT PopplerQt4_FIND_QUIETLY) + message(STATUS "Found poppler-qt4: library: ${POPPLER_QT4_LIBRARIES}, include path: ${POPPLER_QT4_INCLUDE_DIR}") + endif (NOT PopplerQt4_FIND_QUIETLY) +else (POPPLER_QT4_FOUND) + if (PopplerQt4_FIND_REQUIRED) + message(FATAL_ERROR "Could NOT find poppler-qt4") + endif (PopplerQt4_FIND_REQUIRED) +endif (POPPLER_QT4_FOUND) + +mark_as_advanced(POPPLER_QT4_INCLUDE_DIR POPPLER_QT4_LIBRARIES) diff --git a/cmake/modules/FindPostgreSQL.cmake b/cmake/modules/FindPostgreSQL.cmake new file mode 100644 index 0000000000..b16e9e5e3e --- /dev/null +++ b/cmake/modules/FindPostgreSQL.cmake @@ -0,0 +1,33 @@ +# - Find PostgreSQL +# Find the PostgreSQL includes and client library +# This module defines +# POSTGRESQL_INCLUDE_DIR, where to find POSTGRESQL.h +# POSTGRESQL_LIBRARIES, the libraries needed to use POSTGRESQL. +# POSTGRESQL_FOUND, If false, do not try to use PostgreSQL. + +# Copyright (c) 2006, Jaroslaw Staniek, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + + +if (POSTGRESQL_INCLUDE_DIR AND POSTGRESQL_LIBRARIES) + # Already in cache, be silent + set(PostgreSQL_FIND_QUIETLY TRUE) +endif (POSTGRESQL_INCLUDE_DIR AND POSTGRESQL_LIBRARIES) + + +find_path(POSTGRESQL_INCLUDE_DIR libpq-fe.h + /usr/include/pgsql/ + /usr/local/include/pgsql/ + /usr/include/postgresql/ +) + +find_library(POSTGRESQL_LIBRARIES NAMES pq) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(PostgreSQL DEFAULT_MSG + POSTGRESQL_INCLUDE_DIR POSTGRESQL_LIBRARIES ) + +mark_as_advanced(POSTGRESQL_INCLUDE_DIR POSTGRESQL_LIBRARIES) + diff --git a/cmake/modules/FindPulseAudio.cmake b/cmake/modules/FindPulseAudio.cmake new file mode 100644 index 0000000000..6436a5676e --- /dev/null +++ b/cmake/modules/FindPulseAudio.cmake @@ -0,0 +1,68 @@ +# Try to find the PulseAudio library +# +# Once done this will define: +# +# PULSEAUDIO_FOUND - system has the PulseAudio library +# PULSEAUDIO_INCLUDE_DIR - the PulseAudio include directory +# PULSEAUDIO_LIBRARY - the libraries needed to use PulseAudio +# PULSEAUDIO_MAINLOOP_LIBRARY - the libraries needed to use PulsAudio Mailoop +# +# Copyright (c) 2008, Matthias Kretz, +# Copyright (c) 2009, Marcus Hufgard, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +if (NOT PULSEAUDIO_MINIMUM_VERSION) + set(PULSEAUDIO_MINIMUM_VERSION "0.9.9") +endif (NOT PULSEAUDIO_MINIMUM_VERSION) + +if (PULSEAUDIO_INCLUDE_DIR AND PULSEAUDIO_LIBRARY AND PULSEAUDIO_MAINLOOP_LIBRARY) + # Already in cache, be silent + set(PULSEAUDIO_FIND_QUIETLY TRUE) +endif (PULSEAUDIO_INCLUDE_DIR AND PULSEAUDIO_LIBRARY AND PULSEAUDIO_MAINLOOP_LIBRARY) + +if (NOT WIN32) + include(FindPkgConfig) + pkg_check_modules(PC_PULSEAUDIO libpulse>=${PULSEAUDIO_MINIMUM_VERSION}) + pkg_check_modules(PC_PULSEAUDIO_MAINLOOP libpulse-mainloop-glib) +endif (NOT WIN32) + +FIND_PATH(PULSEAUDIO_INCLUDE_DIR pulse/pulseaudio.h + HINTS + ${PC_PULSEAUDIO_INCLUDEDIR} + ${PC_PULSEAUDIO_INCLUDE_DIRS} + ) + +FIND_LIBRARY(PULSEAUDIO_LIBRARY NAMES pulse libpulse + HINTS + ${PC_PULSEAUDIO_LIBDIR} + ${PC_PULSEAUDIO_LIBRARY_DIRS} + ) + +FIND_LIBRARY(PULSEAUDIO_MAINLOOP_LIBRARY NAMES pulse-mainloop pulse-mainloop-glib libpulse-mainloop-glib + HINTS + ${PC_PULSEAUDIO_LIBDIR} + ${PC_PULSEAUDIO_LIBRARY_DIRS} + ) + +if (PULSEAUDIO_INCLUDE_DIR AND PULSEAUDIO_LIBRARY) + set(PULSEAUDIO_FOUND TRUE) +else (PULSEAUDIO_INCLUDE_DIR AND PULSEAUDIO_LIBRARY) + set(PULSEAUDIO_FOUND FALSE) +endif (PULSEAUDIO_INCLUDE_DIR AND PULSEAUDIO_LIBRARY) + +if (PULSEAUDIO_FOUND) + if (NOT PULSEAUDIO_FIND_QUIETLY) + message(STATUS "Found PulseAudio: ${PULSEAUDIO_LIBRARY}") + if (PULSEAUDIO_MAINLOOP_LIBRARY) + message(STATUS "Found PulseAudio Mainloop: ${PULSEAUDIO_MAINLOOP_LIBRARY}") + else (PULSAUDIO_MAINLOOP_LIBRARY) + message(STATUS "Could NOT find PulseAudio Mainloop Library") + endif (PULSEAUDIO_MAINLOOP_LIBRARY) + endif (NOT PULSEAUDIO_FIND_QUIETLY) +else (PULSEAUDIO_FOUND) + message(STATUS "Could NOT find PulseAudio") +endif (PULSEAUDIO_FOUND) + +mark_as_advanced(PULSEAUDIO_INCLUDE_DIR PULSEAUDIO_LIBRARY PULSEAUDIO_MAINLOOP_LIBRARY) diff --git a/cmake/modules/FindPyKDE4.cmake b/cmake/modules/FindPyKDE4.cmake new file mode 100644 index 0000000000..f738741e97 --- /dev/null +++ b/cmake/modules/FindPyKDE4.cmake @@ -0,0 +1,160 @@ +# FindPyKDE4 +# +# Checks that Python and PyKDE4 are installed and defines a couple macros: +# * PYKDE4_INSTALL_PYTHON_FILES +# * PYKDE4_ADD_UI_FILES +# * PYKDE4_ADD_EXECUTABLE + +# By Simon Edwards +# This file is in the public domain. + +INCLUDE(FindPythonInterp) + +SET(PYKDE4_FOUND FALSE) + +get_filename_component( current_module_dir ${CMAKE_CURRENT_LIST_FILE} PATH) + +IF(PYTHONINTERP_FOUND) + EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} ${current_module_dir}/FindPyKDE4.py OUTPUT_VARIABLE pykde_config) + IF(NOT pykde_config) + # Failure to run + SET(PYKDE4_FOUND FALSE) + ELSE(NOT pykde_config) + + STRING(REGEX REPLACE ".*\npykde_version:([^\n]+).*$" "\\1" PYKDE4_VERSION ${pykde_config}) + STRING(REGEX REPLACE ".*\npykde_version_str:([^\n]+).*$" "\\1" PYKDE4_VERSION_STR ${pykde_config}) + STRING(REGEX REPLACE ".*\npykde_kde_sip_flags:([^\n]+).*$" "\\1" PYKDE4_SIP_FLAGS ${pykde_config}) + STRING(REGEX REPLACE ".*\npykde_sip_dir:([^\n]+).*$" "\\1" PYKDE4_SIP_DIR ${pykde_config}) + STRING(REGEX REPLACE ".*\npykde_version_tag:([^\n]+).*$" "\\1" PYKDE4_VERSION_TAG ${pykde_config}) + MESSAGE(STATUS "Found PyKDE4 version ${PYKDE4_VERSION_STR} ${PYKDE4_SIP_DIR}") + + SET(PYKDE4_FOUND TRUE) + + # PyKDE4 doesn't install pykdeuic4 when installing via CMake. + # Fortunately pykdeuic4 isn't needed by pate. + # + ## FIND_PROGRAM(PYKDE4_PYKDEUIC_EXE pykdeuic4 PATHS)# ${PYKDE4_BIN_DIR}) + ## IF(NOT PYKDE4_PYKDEUIC_EXE) + ## MESSAGE(FATAL_ERROR "ERROR: Could not find pykdeuic4 (part of PyKDE4)") + ## ENDIF(NOT PYKDE4_PYKDEUIC_EXE) + + ########################################################################### + # This comes mostly from KDE's FindKDE4Internal.cmake + + macro(_SET_FANCY _var _value _comment) + set(predefinedvalue "${_value}") + if ("${CMAKE_INSTALL_PREFIX}" STREQUAL "${KDE4_INSTALL_DIR}" AND DEFINED KDE4_${_var}) + set(predefinedvalue "${KDE4_${_var}}") + endif ("${CMAKE_INSTALL_PREFIX}" STREQUAL "${KDE4_INSTALL_DIR}" AND DEFINED KDE4_${_var}) + + if (NOT DEFINED ${_var}) + set(${_var} ${predefinedvalue}) + else (NOT DEFINED ${_var}) + set(${_var} "${${_var}}" CACHE PATH "${_comment}") + endif (NOT DEFINED ${_var}) + endmacro(_SET_FANCY) + + if (WIN32) + # use relative install prefix to avoid hardcoded install pathes in cmake_install.cmake files + _set_fancy(EXEC_INSTALL_PREFIX "" "Base directory for executables and libraries") + _set_fancy(SHARE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/share" "Base directory for files which go to share/") + _set_fancy(BIN_INSTALL_DIR "bin" "The install dir for executables (default ${EXEC_INSTALL_PREFIX}/bin)") + _set_fancy(SBIN_INSTALL_DIR "sbin" "The install dir for system executables (default ${EXEC_INSTALL_PREFIX}/sbin)") + else (WIN32) + _set_fancy(EXEC_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}" "Base directory for executables and libraries") + _set_fancy(SHARE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/share" "Base directory for files which go to share/") + _set_fancy(BIN_INSTALL_DIR "${EXEC_INSTALL_PREFIX}/bin" "The install dir for executables (default ${EXEC_INSTALL_PREFIX}/bin)") + _set_fancy(SBIN_INSTALL_DIR "${EXEC_INSTALL_PREFIX}/sbin" "The install dir for system executables (default ${EXEC_INSTALL_PREFIX}/sbin)") + endif (WIN32) + + _set_fancy(PLUGIN_INSTALL_DIR "${LIB_INSTALL_DIR}/kde4" "The subdirectory relative to the install prefix where plugins will be installed (default is ${LIB_INSTALL_DIR}/kde4)") + _set_fancy(CONFIG_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/config" "The config file install dir") + _set_fancy(DATA_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/apps" "The parent directory where applications can install their data") + _set_fancy(HTML_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/doc/HTML" "The HTML install dir for documentation") + _set_fancy(ICON_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/icons" "The icon install dir (default ${SHARE_INSTALL_PREFIX}/share/icons/)") + _set_fancy(KCFG_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/config.kcfg" "The install dir for kconfig files") + _set_fancy(LOCALE_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/locale" "The install dir for translations") + _set_fancy(MIME_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/mimelnk" "The install dir for the mimetype desktop files") + _set_fancy(SERVICES_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/kde4/services" "The install dir for service (desktop, protocol, ...) files") + _set_fancy(SERVICETYPES_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/kde4/servicetypes" "The install dir for servicestypes desktop files") + _set_fancy(SOUND_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/sounds" "The install dir for sound files") + _set_fancy(TEMPLATES_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/templates" "The install dir for templates (Create new file...)") + _set_fancy(WALLPAPER_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/wallpapers" "The install dir for wallpapers") + _set_fancy(KCONF_UPDATE_INSTALL_DIR "${DATA_INSTALL_DIR}/kconf_update" "The kconf_update install dir") + # this one shouldn't be used anymore + _set_fancy(APPLNK_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/applnk" "Is this still used ?") + _set_fancy(AUTOSTART_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/autostart" "The install dir for autostart files") + + _set_fancy(XDG_APPS_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/applications/kde4" "The XDG apps dir") + _set_fancy(XDG_DIRECTORY_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/desktop-directories" "The XDG directory") + _set_fancy(XDG_MIME_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/mime/packages" "The install dir for the xdg mimetypes") + + _set_fancy(SYSCONF_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/etc" "The kde sysconfig install dir (default /etc)") + _set_fancy(MAN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/man" "The kde man install dir (default ${CMAKE_INSTALL_PREFIX}/man/)") + _set_fancy(INFO_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/info" "The kde info install dir (default ${CMAKE_INSTALL_PREFIX}/info)") + _set_fancy(DBUS_INTERFACES_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/dbus-1/interfaces" "The kde dbus interfaces install dir (default ${SHARE_INSTALL_PREFIX}/dbus-1/interfaces)") + _set_fancy(DBUS_SERVICES_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/dbus-1/services" "The kde dbus services install dir (default ${SHARE_INSTALL_PREFIX}/dbus-1/services)") + + ENDIF(NOT pykde_config) +ENDIF(PYTHONINTERP_FOUND) + +########################################################################### +# PYKDE4_INSTALL_PYTHON_FILES(file_name...) +# +# Installs and bytes compiles Python files into the data directory for this +# project.. +# +MACRO(PYKDE4_INSTALL_PYTHON_FILES) + + ADD_CUSTOM_TARGET(pysupport ALL) + FOREACH (_current_file ${ARGN}) + + # Install the source file. + INSTALL(FILES ${_current_file} DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME}) + + # Byte compile and install the .pyc file. + GET_FILENAME_COMPONENT(_absfilename ${_current_file} ABSOLUTE) + GET_FILENAME_COMPONENT(_filename ${_current_file} NAME) + GET_FILENAME_COMPONENT(_filenamebase ${_current_file} NAME_WE) + GET_FILENAME_COMPONENT(_basepath ${_current_file} PATH) + SET(_bin_py ${CMAKE_BINARY_DIR}/${_basepath}/${_filename}) + SET(_bin_pyc ${CMAKE_BINARY_DIR}/${_basepath}/${_filenamebase}.pyc) + + FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${_basepath}) + + SET(_message "-DMESSAGE=Byte-compiling ${_bin_py}") + + GET_FILENAME_COMPONENT(_abs_bin_py ${_bin_py} ABSOLUTE) + IF(_abs_bin_py STREQUAL ${_absfilename}) # Don't copy the file onto itself. + ADD_CUSTOM_COMMAND( + TARGET pysupport + COMMAND ${CMAKE_COMMAND} -E echo ${message} + COMMAND ${PYTHON_EXECUTABLE} ${current_module_dir}/PythonCompile.py ${_bin_py} + DEPENDS ${_absfilename} + ) + ELSE(_abs_bin_py STREQUAL ${_absfilename}) + ADD_CUSTOM_COMMAND( + TARGET pysupport + COMMAND ${CMAKE_COMMAND} -E echo ${message} + COMMAND ${CMAKE_COMMAND} -E copy ${_absfilename} ${_bin_py} + COMMAND ${PYTHON_EXECUTABLE} ${current_module_dir}/PythonCompile.py ${_bin_py} + DEPENDS ${_absfilename} + ) + ENDIF(_abs_bin_py STREQUAL ${_absfilename}) + + INSTALL(FILES ${_bin_pyc} DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME}) + + ENDFOREACH (_current_file) +ENDMACRO(PYKDE4_INSTALL_PYTHON_FILES) + + +########################################################################### +# PYKDE4_ADD_EXECUTABLE(py_name exe_name) +# +# Creates a smybolic link with name exe_name at install time from the +# install bin directory to the Python file. The Python file is also make +# executable. +# +MACRO(PYKDE4_ADD_EXECUTABLE _pyname _exename) + INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -DTARGET=${DATA_INSTALL_DIR}/${PROJECT_NAME}/${_pyname} -DLINK_NAME=${BIN_INSTALL_DIR}/${_exename} -P ${CMAKE_SOURCE_DIR}/cmake/modules/create_exe_symlink.cmake)" ) +ENDMACRO(PYKDE4_ADD_EXECUTABLE) diff --git a/cmake/modules/FindPyKDE4.py b/cmake/modules/FindPyKDE4.py new file mode 100644 index 0000000000..e436c2a907 --- /dev/null +++ b/cmake/modules/FindPyKDE4.py @@ -0,0 +1,46 @@ +# By Simon Edwards +# modified by Paul Giannaros to add better PyKDE4 +# sip directory finding +# This file is in the public domain. + +import sys +import os +import PyKDE4.pykdeconfig +import PyQt4.pyqtconfig + +if "_pkg_config" in dir(PyKDE4.pykdeconfig): + _pkg_config = PyKDE4.pykdeconfig._pkg_config + + for varname in [ + 'kde_version', + 'kde_version_extra', + 'kdebasedir', + 'kdeincdir', + 'kdelibdir', + 'libdir', + 'pykde_kde_sip_flags', + 'pykde_mod_dir', + 'pykde_modules', + 'pykde_sip_dir', + 'pykde_version', + 'pykde_version_str']: + varvalue = _pkg_config[varname] + if varname == 'pykde_sip_dir': + d = os.path.join(_pkg_config[varname], 'PyKDE4') + if os.path.exists(d): + varvalue = d + print("%s:%s\n" % (varname, varvalue)) + pykde_version_tag = '' + in_t = False + for item in _pkg_config['pykde_kde_sip_flags'].split(): + if item == "-t": + in_t = True + elif in_t: + if item.startswith("KDE_"): + pykde_version_tag = item + else: + in_t = False + print("pykde_version_tag:%s" % pykde_version_tag) + +else: + sys.exit(1) diff --git a/cmake/modules/FindPyQt.py b/cmake/modules/FindPyQt.py new file mode 100644 index 0000000000..5d2f9514d8 --- /dev/null +++ b/cmake/modules/FindPyQt.py @@ -0,0 +1,24 @@ +# Copyright (c) 2007, Simon Edwards +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +import PyQt4.pyqtconfig + +pyqtcfg = PyQt4.pyqtconfig.Configuration() +print("pyqt_version:%06.0x" % pyqtcfg.pyqt_version) +print("pyqt_version_str:%s" % pyqtcfg.pyqt_version_str) + +pyqt_version_tag = "" +in_t = False +for item in pyqtcfg.pyqt_sip_flags.split(' '): + if item=="-t": + in_t = True + elif in_t: + if item.startswith("Qt_4"): + pyqt_version_tag = item + else: + in_t = False +print("pyqt_version_tag:%s" % pyqt_version_tag) + +print("pyqt_sip_dir:%s" % pyqtcfg.pyqt_sip_dir) +print("pyqt_sip_flags:%s" % pyqtcfg.pyqt_sip_flags) diff --git a/cmake/modules/FindPyQt4.cmake b/cmake/modules/FindPyQt4.cmake new file mode 100644 index 0000000000..37f645ea6c --- /dev/null +++ b/cmake/modules/FindPyQt4.cmake @@ -0,0 +1,53 @@ +# Find PyQt4 +# ~~~~~~~~~~ +# Copyright (c) 2007-2008, Simon Edwards +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. +# +# PyQt4 website: http://www.riverbankcomputing.co.uk/pyqt/index.php +# +# Find the installed version of PyQt4. FindPyQt4 should only be called after +# Python has been found. +# +# This file defines the following variables: +# +# PYQT4_VERSION - The version of PyQt4 found expressed as a 6 digit hex number +# suitable for comparision as a string +# +# PYQT4_VERSION_STR - The version of PyQt4 as a human readable string. +# +# PYQT4_VERSION_TAG - The PyQt version tag using by PyQt's sip files. +# +# PYQT4_SIP_DIR - The directory holding the PyQt4 .sip files. +# +# PYQT4_SIP_FLAGS - The SIP flags used to build PyQt. + +IF(EXISTS PYQT4_VERSION) + # Already in cache, be silent + SET(PYQT4_FOUND TRUE) +ELSE(EXISTS PYQT4_VERSION) + + FIND_FILE(_find_pyqt_py FindPyQt.py PATHS ${CMAKE_MODULE_PATH}) + + EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} ${_find_pyqt_py} OUTPUT_VARIABLE pyqt_config) + IF(pyqt_config) + STRING(REGEX REPLACE "^pyqt_version:([^\n]+).*$" "\\1" PYQT4_VERSION ${pyqt_config}) + STRING(REGEX REPLACE ".*\npyqt_version_str:([^\n]+).*$" "\\1" PYQT4_VERSION_STR ${pyqt_config}) + STRING(REGEX REPLACE ".*\npyqt_version_tag:([^\n]+).*$" "\\1" PYQT4_VERSION_TAG ${pyqt_config}) + STRING(REGEX REPLACE ".*\npyqt_sip_dir:([^\n]+).*$" "\\1" PYQT4_SIP_DIR ${pyqt_config}) + STRING(REGEX REPLACE ".*\npyqt_sip_flags:([^\n]+).*$" "\\1" PYQT4_SIP_FLAGS ${pyqt_config}) + + SET(PYQT4_FOUND TRUE) + ENDIF(pyqt_config) + + IF(PYQT4_FOUND) + IF(NOT PYQT4_FIND_QUIETLY) + MESSAGE(STATUS "Found PyQt4 version: ${PYQT4_VERSION_STR}") + ENDIF(NOT PYQT4_FIND_QUIETLY) + ELSE(PYQT4_FOUND) + IF(PYQT4_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "Could not find Python") + ENDIF(PYQT4_FIND_REQUIRED) + ENDIF(PYQT4_FOUND) + +ENDIF(EXISTS PYQT4_VERSION) diff --git a/cmake/modules/FindPythonLibrary.cmake b/cmake/modules/FindPythonLibrary.cmake new file mode 100644 index 0000000000..80f3f4ab33 --- /dev/null +++ b/cmake/modules/FindPythonLibrary.cmake @@ -0,0 +1,88 @@ +# Find Python +# ~~~~~~~~~~~ +# Find the Python interpreter and related Python directories. +# +# This file defines the following variables: +# +# PYTHON_EXECUTABLE - The path and filename of the Python interpreter. +# +# PYTHON_SHORT_VERSION - The version of the Python interpreter found, +# excluding the patch version number. (e.g. 2.5 and not 2.5.1)) +# +# PYTHON_LONG_VERSION - The version of the Python interpreter found as a human +# readable string. +# +# PYTHON_SITE_PACKAGES_DIR - Location of the Python site-packages directory. +# +# PYTHON_INCLUDE_PATH - Directory holding the python.h include file. +# +# PYTHON_LIBRARY, PYTHON_LIBRARIES- Location of the Python library. + +# Copyright (c) 2007, Simon Edwards +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + + + +INCLUDE(CMakeFindFrameworks) + +if(EXISTS PYTHON_LIBRARY) + # Already in cache, be silent + set(PYTHONLIBRARY_FOUND TRUE) +else(EXISTS PYTHON_LIBRARY) + + FIND_PACKAGE(PythonInterp) + + if(PYTHONINTERP_FOUND) + + FIND_FILE(_find_lib_python_py FindLibPython.py PATHS ${CMAKE_MODULE_PATH}) + + EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} ${_find_lib_python_py} OUTPUT_VARIABLE python_config) + if(python_config) + STRING(REGEX REPLACE ".*exec_prefix:([^\n]+).*$" "\\1" PYTHON_PREFIX ${python_config}) + STRING(REGEX REPLACE ".*\nshort_version:([^\n]+).*$" "\\1" PYTHON_SHORT_VERSION ${python_config}) + STRING(REGEX REPLACE ".*\nlong_version:([^\n]+).*$" "\\1" PYTHON_LONG_VERSION ${python_config}) + STRING(REGEX REPLACE ".*\npy_inc_dir:([^\n]+).*$" "\\1" PYTHON_INCLUDE_PATH ${python_config}) + STRING(REGEX REPLACE ".*\nsite_packages_dir:([^\n]+).*$" "\\1" PYTHON_SITE_PACKAGES_DIR ${python_config}) + STRING(REGEX REPLACE "([0-9]+).([0-9]+)" "\\1\\2" PYTHON_SHORT_VERSION_NO_DOT ${PYTHON_SHORT_VERSION}) + set(PYTHON_LIBRARY_NAMES python${PYTHON_SHORT_VERSION} python${PYTHON_SHORT_VERSION_NO_DOT}) + if(WIN32) + STRING(REPLACE "\\" "/" PYTHON_SITE_PACKAGES_DIR ${PYTHON_SITE_PACKAGES_DIR}) + endif(WIN32) + FIND_LIBRARY(PYTHON_LIBRARY NAMES ${PYTHON_LIBRARY_NAMES} PATHS ${PYTHON_PREFIX}/lib ${PYTHON_PREFIX}/libs NO_DEFAULT_PATH) + set(PYTHONLIBRARY_FOUND TRUE) + endif(python_config) + + # adapted from cmake's builtin FindPythonLibs + if(APPLE) + CMAKE_FIND_FRAMEWORKS(Python) + set(PYTHON_FRAMEWORK_INCLUDES) + if(Python_FRAMEWORKS) + # If a framework has been selected for the include path, + # make sure "-framework" is used to link it. + if("${PYTHON_INCLUDE_PATH}" MATCHES "Python\\.framework") + set(PYTHON_LIBRARY "") + set(PYTHON_DEBUG_LIBRARY "") + endif("${PYTHON_INCLUDE_PATH}" MATCHES "Python\\.framework") + if(NOT PYTHON_LIBRARY) + set (PYTHON_LIBRARY "-framework Python" CACHE FILEPATH "Python Framework" FORCE) + endif(NOT PYTHON_LIBRARY) + set(PYTHONLIBRARY_FOUND TRUE) + endif(Python_FRAMEWORKS) + endif(APPLE) + endif(PYTHONINTERP_FOUND) + + if(PYTHONLIBRARY_FOUND) + set(PYTHON_LIBRARIES ${PYTHON_LIBRARY}) + if(NOT PYTHONLIBRARY_FIND_QUIETLY) + message(STATUS "Found Python executable: ${PYTHON_EXECUTABLE}") + message(STATUS "Found Python version: ${PYTHON_LONG_VERSION}") + message(STATUS "Found Python library: ${PYTHON_LIBRARY}") + endif(NOT PYTHONLIBRARY_FIND_QUIETLY) + else(PYTHONLIBRARY_FOUND) + if(PYTHONLIBRARY_FIND_REQUIRED) + message(FATAL_ERROR "Could not find Python") + endif(PYTHONLIBRARY_FIND_REQUIRED) + endif(PYTHONLIBRARY_FOUND) + +endif (EXISTS PYTHON_LIBRARY) diff --git a/cmake/modules/FindQCA2.cmake b/cmake/modules/FindQCA2.cmake new file mode 100644 index 0000000000..9966c22409 --- /dev/null +++ b/cmake/modules/FindQCA2.cmake @@ -0,0 +1,48 @@ +# - Try to find QCA2 (Qt Cryptography Architecture 2) +# Once done this will define +# +# QCA2_FOUND - system has QCA2 +# QCA2_INCLUDE_DIR - the QCA2 include directory +# QCA2_LIBRARIES - the libraries needed to use QCA2 +# QCA2_DEFINITIONS - Compiler switches required for using QCA2 +# +# use pkg-config to get the directories and then use these values +# in the FIND_PATH() and FIND_LIBRARY() calls + +# Copyright (c) 2006, Michael Larouche, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +include(FindLibraryWithDebug) + +if (QCA2_INCLUDE_DIR AND QCA2_LIBRARIES) + + # in cache already + set(QCA2_FOUND TRUE) + +else (QCA2_INCLUDE_DIR AND QCA2_LIBRARIES) + + + if (NOT WIN32) + find_package(PkgConfig) + pkg_check_modules(PC_QCA2 qca2) + set(QCA2_DEFINITIONS ${PC_QCA2_CFLAGS_OTHER}) + endif (NOT WIN32) + + find_library_with_debug(QCA2_LIBRARIES + WIN32_DEBUG_POSTFIX d + NAMES qca + HINTS ${PC_QCA2_LIBDIR} ${PC_QCA2_LIBRARY_DIRS} + ) + + find_path(QCA2_INCLUDE_DIR qca.h + HINTS ${PC_QCA2_INCLUDEDIR} ${PC_QCA2_INCLUDE_DIRS} + PATH_SUFFIXES QtCrypto) + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(QCA2 DEFAULT_MSG QCA2_LIBRARIES QCA2_INCLUDE_DIR) + + mark_as_advanced(QCA2_INCLUDE_DIR QCA2_LIBRARIES) + +endif (QCA2_INCLUDE_DIR AND QCA2_LIBRARIES) diff --git a/cmake/modules/FindQImageBlitz.cmake b/cmake/modules/FindQImageBlitz.cmake new file mode 100644 index 0000000000..9e31c047eb --- /dev/null +++ b/cmake/modules/FindQImageBlitz.cmake @@ -0,0 +1,53 @@ +# - Try to find the qimageblitz lib +# Once done this will define +# +# QIMAGEBLITZ_FOUND - system has qimageblitz lib +# QIMAGEBLITZ_INCLUDES - the qimageblitz include directory +# QIMAGEBLITZ_LIBRARIES - The libraries needed to use qimageblitz + +# Copyright (c) 2006, Montel Laurent, +# Copyright (c) 2007, Allen Winter, +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +include(FindLibraryWithDebug) + +if (QIMAGEBLITZ_INCLUDES AND QIMAGEBLITZ_LIBRARIES) + set(QImageBlitz_FIND_QUIETLY TRUE) +endif (QIMAGEBLITZ_INCLUDES AND QIMAGEBLITZ_LIBRARIES) + +if (NOT WIN32) + # use pkg-config to get the directories and then use these values + # in the FIND_PATH() and FIND_LIBRARY() calls + find_package(PkgConfig) + pkg_check_modules(PC_QIMAGEBLITZ qimageblitz) +endif (NOT WIN32) + +find_path(QIMAGEBLITZ_INCLUDES + NAMES + qimageblitz.h + PATH_SUFFIXES qimageblitz + PATHS + $ENV{QIMAGEBLITZDIR}/include + ${PC_QIMAGEBLITZ_INCLUDEDIR} + ${PC_QIMAGEBLITZ_INCLUDE_DIRS} + ${KDE4_INCLUDE_DIR} + ${INCLUDE_INSTALL_DIR} +) + +find_library_with_debug(QIMAGEBLITZ_LIBRARIES + WIN32_DEBUG_POSTFIX d + qimageblitz + PATHS + $ENV{QIMAGEBLITZDIR}/lib + ${PC_QIMAGEBLITZ_LIBDIR} + ${PC_QIMAGEBLITZ_LIBRARY_DIRS} + ${KDE4_LIB_DIR} + ${LIB_INSTALL_DIR} +) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(QImageBlitz DEFAULT_MSG + QIMAGEBLITZ_INCLUDES QIMAGEBLITZ_LIBRARIES) + +mark_as_advanced(QIMAGEBLITZ_INCLUDES QIMAGEBLITZ_LIBRARIES) diff --git a/cmake/modules/FindQt4.cmake b/cmake/modules/FindQt4.cmake new file mode 100644 index 0000000000..f3fd817197 --- /dev/null +++ b/cmake/modules/FindQt4.cmake @@ -0,0 +1,1493 @@ +# - Find QT 4 +# This module can be used to find Qt4. +# The most important issue is that the Qt4 qmake is available via the system path. +# This qmake is then used to detect basically everything else. +# This module defines a number of key variables and macros. +# First is QT_USE_FILE which is the path to a CMake file that can be included +# to compile Qt 4 applications and libraries. By default, the QtCore and QtGui +# libraries are loaded. This behavior can be changed by setting one or more +# of the following variables to true before doing INCLUDE(${QT_USE_FILE}): +# QT_DONT_USE_QTCORE +# QT_DONT_USE_QTGUI +# QT_USE_QT3SUPPORT +# QT_USE_QTASSISTANT +# QT_USE_QTDESIGNER +# QT_USE_QTMOTIF +# QT_USE_QTMAIN +# QT_USE_QTNETWORK +# QT_USE_QTNSPLUGIN +# QT_USE_QTOPENGL +# QT_USE_QTSQL +# QT_USE_QTXML +# QT_USE_QTSVG +# QT_USE_QTTEST +# QT_USE_QTUITOOLS +# QT_USE_QTDBUS +# QT_USE_QTSCRIPT +# QT_USE_QTASSISTANTCLIENT +# QT_USE_QTHELP +# QT_USE_QTWEBKIT +# QT_USE_QTXMLPATTERNS +# QT_USE_PHONON +# +# The file pointed to by QT_USE_FILE will set up your compile environment +# by adding include directories, preprocessor defines, and populate a +# QT_LIBRARIES variable containing all the Qt libraries and their dependencies. +# Add the QT_LIBRARIES variable to your TARGET_LINK_LIBRARIES. +# +# Typical usage could be something like: +# FIND_PACKAGE(Qt4) +# SET(QT_USE_QTXML 1) +# INCLUDE(${QT_USE_FILE}) +# ADD_EXECUTABLE(myexe main.cpp) +# TARGET_LINK_LIBRARIES(myexe ${QT_LIBRARIES}) +# +# +# There are also some files that need processing by some Qt tools such as moc +# and uic. Listed below are macros that may be used to process those files. +# +# macro QT4_WRAP_CPP(outfiles inputfile ... OPTIONS ...) +# create moc code from a list of files containing Qt class with +# the Q_OBJECT declaration. Options may be given to moc, such as those found +# when executing "moc -help" +# +# macro QT4_WRAP_UI(outfiles inputfile ... OPTIONS ...) +# create code from a list of Qt designer ui files. +# Options may be given to uic, such as those found +# when executing "uic -help" +# +# macro QT4_ADD_RESOURCES(outfiles inputfile ... OPTIONS ...) +# create code from a list of Qt resource files. +# Options may be given to rcc, such as those found +# when executing "rcc -help" +# +# macro QT4_GENERATE_MOC(inputfile outputfile ) +# creates a rule to run moc on infile and create outfile. +# Use this if for some reason QT4_WRAP_CPP() isn't appropriate, e.g. +# because you need a custom filename for the moc file or something similar. +# +# macro QT4_AUTOMOC(sourcefile1 sourcefile2 ... ) +# This macro is still experimental. +# It can be used to have moc automatically handled. +# So if you have the files foo.h and foo.cpp, and in foo.h a +# a class uses the Q_OBJECT macro, moc has to run on it. If you don't +# want to use QT4_WRAP_CPP() (which is reliable and mature), you can insert +# #include "foo.moc" +# in foo.cpp and then give foo.cpp as argument to QT4_AUTOMOC(). This will the +# scan all listed files at cmake-time for such included moc files and if it finds +# them cause a rule to be generated to run moc at build time on the +# accompanying header file foo.h. +# If a source file has the SKIP_AUTOMOC property set it will be ignored by this macro. +# +# macro QT4_ADD_DBUS_INTERFACE(outfiles interface basename) +# create a the interface header and implementation files with the +# given basename from the given interface xml file and add it to +# the list of sources. +# To disable generating a namespace header, set the source file property +# NO_NAMESPACE to TRUE on the interface file. +# To include a header in the interface header, set the source file property +# INCLUDE to the name of the header. +# To specify a class name to use, set the source file property CLASSNAME +# to the name of the class. +# +# macro QT4_ADD_DBUS_INTERFACES(outfiles inputfile ... ) +# create the interface header and implementation files +# for all listed interface xml files +# the name will be automatically determined from the name of the xml file +# To disable generating namespace headers, set the source file property +# NO_NAMESPACE to TRUE for these inputfiles. +# To include a header in the interface header, set the source file property +# INCLUDE to the name of the header. +# To specify a class name to use, set the source file property CLASSNAME +# to the name of the class. +# +# macro QT4_ADD_DBUS_ADAPTOR(outfiles xmlfile parentheader parentclassname [basename] [classname]) +# create a dbus adaptor (header and implementation file) from the xml file +# describing the interface, and add it to the list of sources. The adaptor +# forwards the calls to a parent class, defined in parentheader and named +# parentclassname. The name of the generated files will be +# adaptor.{cpp,h} where basename defaults to the basename of the xml file. +# If is provided, then it will be used as the classname of the +# adaptor itself. +# +# macro QT4_GENERATE_DBUS_INTERFACE( header [interfacename] OPTIONS ...) +# generate the xml interface file from the given header. +# If the optional argument interfacename is omitted, the name of the +# interface file is constructed from the basename of the header with +# the suffix .xml appended. +# Options may be given to qdbuscpp2xml, such as those found when executing "qdbuscpp2xml --help" +# +# QT_FOUND If false, don't try to use Qt. +# QT4_FOUND If false, don't try to use Qt 4. +# +# QT_QTCORE_FOUND True if QtCore was found. +# QT_QTGUI_FOUND True if QtGui was found. +# QT_QT3SUPPORT_FOUND True if Qt3Support was found. +# QT_QTASSISTANT_FOUND True if QtAssistant was found. +# QT_QTDBUS_FOUND True if QtDBus was found. +# QT_QTDESIGNER_FOUND True if QtDesigner was found. +# QT_QTDESIGNERCOMPONENTS True if QtDesignerComponents was found. +# QT_QTMOTIF_FOUND True if QtMotif was found. +# QT_QTNETWORK_FOUND True if QtNetwork was found. +# QT_QTNSPLUGIN_FOUND True if QtNsPlugin was found. +# QT_QTOPENGL_FOUND True if QtOpenGL was found. +# QT_QTSQL_FOUND True if QtSql was found. +# QT_QTXML_FOUND True if QtXml was found. +# QT_QTSVG_FOUND True if QtSvg was found. +# QT_QTSCRIPT_FOUND True if QtScript was found. +# QT_QTTEST_FOUND True if QtTest was found. +# QT_QTUITOOLS_FOUND True if QtUiTools was found. +# QT_QTASSISTANTCLIENT_FOUND True if QtAssistantClient was found. +# QT_QTHELP_FOUND True if QtHelp was found. +# QT_QTWEBKIT_FOUND True if QtWebKit was found. +# QT_QTXMLPATTERNS_FOUND True if QtXmlPatterns was found. +# QT_PHONON_FOUND True if phonon was found. +# +# +# QT_DEFINITIONS Definitions to use when compiling code that uses Qt. +# You do not need to use this if you include QT_USE_FILE. +# The QT_USE_FILE will also define QT_DEBUG and QT_NO_DEBUG +# to fit your current build type. Those are not contained +# in QT_DEFINITIONS. +# +# QT_INCLUDES List of paths to all include directories of +# Qt4 QT_INCLUDE_DIR and QT_QTCORE_INCLUDE_DIR are +# always in this variable even if NOTFOUND, +# all other INCLUDE_DIRS are +# only added if they are found. +# You do not need to use this if you include QT_USE_FILE. +# +# +# Include directories for the Qt modules are listed here. +# You do not need to use these variables if you include QT_USE_FILE. +# +# QT_INCLUDE_DIR Path to "include" of Qt4 +# QT_QT_INCLUDE_DIR Path to "include/Qt" +# QT_QT3SUPPORT_INCLUDE_DIR Path to "include/Qt3Support" +# QT_QTASSISTANT_INCLUDE_DIR Path to "include/QtAssistant" +# QT_QTCORE_INCLUDE_DIR Path to "include/QtCore" +# QT_QTDESIGNER_INCLUDE_DIR Path to "include/QtDesigner" +# QT_QTDESIGNERCOMPONENTS_INCLUDE_DIR Path to "include/QtDesigner" +# QT_QTDBUS_INCLUDE_DIR Path to "include/QtDBus" +# QT_QTGUI_INCLUDE_DIR Path to "include/QtGui" +# QT_QTMOTIF_INCLUDE_DIR Path to "include/QtMotif" +# QT_QTNETWORK_INCLUDE_DIR Path to "include/QtNetwork" +# QT_QTNSPLUGIN_INCLUDE_DIR Path to "include/QtNsPlugin" +# QT_QTOPENGL_INCLUDE_DIR Path to "include/QtOpenGL" +# QT_QTSQL_INCLUDE_DIR Path to "include/QtSql" +# QT_QTXML_INCLUDE_DIR Path to "include/QtXml" +# QT_QTSVG_INCLUDE_DIR Path to "include/QtSvg" +# QT_QTSCRIPT_INCLUDE_DIR Path to "include/QtScript" +# QT_QTTEST_INCLUDE_DIR Path to "include/QtTest" +# QT_QTASSISTANTCLIENT_INCLUDE_DIR Path to "include/QtAssistant" +# QT_QTHELP_INCLUDE_DIR Path to "include/QtHelp" +# QT_QTWEBKIT_INCLUDE_DIR Path to "include/QtWebKit" +# QT_QTXMLPATTERNS_INCLUDE_DIR Path to "include/QtXmlPatterns" +# QT_PHONON_INCLUDE_DIR Path to "include/phonon" +# +# QT_LIBRARY_DIR Path to "lib" of Qt4 +# +# QT_PLUGINS_DIR Path to "plugins" for Qt4 +# +# For every library of Qt, a QT_QTFOO_LIBRARY variable is defined, with the full path to the library. +# +# So there are the following variables: +# The Qt3Support library: QT_QT3SUPPORT_LIBRARY +# +# The QtAssistant library: QT_QTASSISTANT_LIBRARY +# +# The QtCore library: QT_QTCORE_LIBRARY +# +# The QtDBus library: QT_QTDBUS_LIBRARY +# +# The QtDesigner library: QT_QTDESIGNER_LIBRARY +# +# The QtDesignerComponents library: QT_QTDESIGNERCOMPONENTS_LIBRARY +# +# The QtGui library: QT_QTGUI_LIBRARY +# +# The QtMotif library: QT_QTMOTIF_LIBRARY +# +# The QtNetwork library: QT_QTNETWORK_LIBRARY +# +# The QtNsPLugin library: QT_QTNSPLUGIN_LIBRARY +# +# The QtOpenGL library: QT_QTOPENGL_LIBRARY +# +# The QtSql library: QT_QTSQL_LIBRARY +# +# The QtXml library: QT_QTXML_LIBRARY +# +# The QtSvg library: QT_QTSVG_LIBRARY +# +# The QtScript library: QT_QTSCRIPT_LIBRARY +# +# The QtTest library: QT_QTTEST_LIBRARY +# +# The qtmain library for Windows QT_QTMAIN_LIBRARY +# +# The QtUiTools library: QT_QTUITOOLS_LIBRARY +# +# The QtAssistantClient library: QT_QTASSISTANTCLIENT_LIBRARY +# +# The QtHelp library: QT_QTHELP_LIBRARY +# +# The QtWebKit library: QT_QTWEBKIT_LIBRARY +# +# The QtXmlPatterns library: QT_QTXMLPATTERNS_LIBRARY +# +# The Phonon library: QT_PHONON_LIBRARY +# +# also defined, but NOT for general use are +# QT_MOC_EXECUTABLE Where to find the moc tool. +# QT_UIC_EXECUTABLE Where to find the uic tool. +# QT_UIC3_EXECUTABLE Where to find the uic3 tool. +# QT_RCC_EXECUTABLE Where to find the rcc tool +# QT_DBUSCPP2XML_EXECUTABLE Where to find the qdbuscpp2xml tool. +# QT_DBUSXML2CPP_EXECUTABLE Where to find the qdbusxml2cpp tool. +# QT_LUPDATE_EXECUTABLE Where to find the lupdate tool. +# QT_LRELEASE_EXECUTABLE Where to find the lrelease tool. +# +# QT_DOC_DIR Path to "doc" of Qt4 +# QT_MKSPECS_DIR Path to "mkspecs" of Qt4 +# +# +# These are around for backwards compatibility +# they will be set +# QT_WRAP_CPP Set true if QT_MOC_EXECUTABLE is found +# QT_WRAP_UI Set true if QT_UIC_EXECUTABLE is found +# +# These variables do _NOT_ have any effect anymore (compared to FindQt.cmake) +# QT_MT_REQUIRED Qt4 is now always multithreaded +# +# These variables are set to "" Because Qt structure changed +# (They make no sense in Qt4) +# QT_QT_LIBRARY Qt-Library is now split + +# Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. +# See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. + + +# If Qt3 has already been found, fail. +IF(QT_QT_LIBRARY) + IF(Qt4_FIND_REQUIRED) + MESSAGE( FATAL_ERROR "Qt3 and Qt4 cannot be used together in one project.") + ELSE(Qt4_FIND_REQUIRED) + IF(NOT Qt4_FIND_QUIETLY) + MESSAGE( STATUS "Qt3 and Qt4 cannot be used together in one project.") + ENDIF(NOT Qt4_FIND_QUIETLY) + RETURN() + ENDIF(Qt4_FIND_REQUIRED) +ENDIF(QT_QT_LIBRARY) + + +IF (QT4_QMAKE_FOUND) + # Check already done in this cmake run, nothing more to do + RETURN() +ENDIF (QT4_QMAKE_FOUND) + +# check that QT_NO_DEBUG is defined for release configurations +MACRO(QT_CHECK_FLAG_EXISTS FLAG VAR DOC) + IF(NOT ${VAR} MATCHES "${FLAG}") + SET(${VAR} "${${VAR}} ${FLAG}" + CACHE STRING "Flags used by the compiler during ${DOC} builds." FORCE) + ENDIF(NOT ${VAR} MATCHES "${FLAG}") +ENDMACRO(QT_CHECK_FLAG_EXISTS FLAG VAR) +QT_CHECK_FLAG_EXISTS(-DQT_NO_DEBUG CMAKE_CXX_FLAGS_RELWITHDEBINFO "Release with Debug Info") +QT_CHECK_FLAG_EXISTS(-DQT_NO_DEBUG CMAKE_CXX_FLAGS_RELEASE "release") +QT_CHECK_FLAG_EXISTS(-DQT_NO_DEBUG CMAKE_CXX_FLAGS_MINSIZEREL "release minsize") + +INCLUDE(CheckSymbolExists) +INCLUDE(MacroAddFileDependencies) +INCLUDE(MacroPushRequiredVars) + +SET(QT_USE_FILE ${CMAKE_ROOT}/Modules/UseQt4.cmake) + +SET( QT_DEFINITIONS "") + +IF (WIN32) + SET(QT_DEFINITIONS -DQT_DLL) +ENDIF(WIN32) + +SET(QT4_INSTALLED_VERSION_TOO_OLD FALSE) + +# macro for asking qmake to process pro files +MACRO(QT_QUERY_QMAKE outvar invar) + FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmpQmake/tmp.pro + "message(CMAKE_MESSAGE<$$${invar}>)") + + # Invoke qmake with the tmp.pro program to get the desired + # information. Use the same variable for both stdout and stderr + # to make sure we get the output on all platforms. + EXECUTE_PROCESS(COMMAND ${QT_QMAKE_EXECUTABLE} + WORKING_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmpQmake + OUTPUT_VARIABLE _qmake_query_output + RESULT_VARIABLE _qmake_result + ERROR_VARIABLE _qmake_query_output ) + + FILE(REMOVE_RECURSE + "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmpQmake") + + IF(_qmake_result) + MESSAGE(WARNING " querying qmake for ${invar}. qmake reported:\n${_qmake_query_output}") + ELSE(_qmake_result) + STRING(REGEX REPLACE ".*CMAKE_MESSAGE<([^>]*).*" "\\1" ${outvar} "${_qmake_query_output}") + ENDIF(_qmake_result) + +ENDMACRO(QT_QUERY_QMAKE) + +GET_FILENAME_COMPONENT(qt_install_version "[HKEY_CURRENT_USER\\Software\\trolltech\\Versions;DefaultQtVersion]" NAME) +# check for qmake +FIND_PROGRAM(QT_QMAKE_EXECUTABLE NAMES qmake qmake4 qmake-qt4 PATHS + "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\4.0.0;InstallDir]/bin" + "[HKEY_CURRENT_USER\\Software\\Trolltech\\Versions\\4.0.0;InstallDir]/bin" + "[HKEY_CURRENT_USER\\Software\\Trolltech\\Versions\\${qt_install_version};InstallDir]/bin" + $ENV{QTDIR}/bin +) + +IF (QT_QMAKE_EXECUTABLE) + + SET(QT4_QMAKE_FOUND FALSE) + + EXEC_PROGRAM(${QT_QMAKE_EXECUTABLE} ARGS "-query QT_VERSION" OUTPUT_VARIABLE QTVERSION) + + # check for qt3 qmake and then try and find qmake4 or qmake-qt4 in the path + IF("${QTVERSION}" MATCHES "Unknown") + SET(QT_QMAKE_EXECUTABLE NOTFOUND CACHE FILEPATH "" FORCE) + FIND_PROGRAM(QT_QMAKE_EXECUTABLE NAMES qmake4 qmake-qt4 PATHS + "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\4.0.0;InstallDir]/bin" + "[HKEY_CURRENT_USER\\Software\\Trolltech\\Versions\\4.0.0;InstallDir]/bin" + $ENV{QTDIR}/bin + ) + IF(QT_QMAKE_EXECUTABLE) + EXEC_PROGRAM(${QT_QMAKE_EXECUTABLE} + ARGS "-query QT_VERSION" OUTPUT_VARIABLE QTVERSION) + ENDIF(QT_QMAKE_EXECUTABLE) + ENDIF("${QTVERSION}" MATCHES "Unknown") + + # check that we found the Qt4 qmake, Qt3 qmake output won't match here + STRING(REGEX MATCH "^[0-9]+\\.[0-9]+\\.[0-9]+" qt_version_tmp "${QTVERSION}") + IF (qt_version_tmp) + + # we need at least version 4.0.0 + IF (NOT QT_MIN_VERSION) + SET(QT_MIN_VERSION "4.0.0") + ENDIF (NOT QT_MIN_VERSION) + + #now parse the parts of the user given version string into variables + STRING(REGEX MATCH "^[0-9]+\\.[0-9]+\\.[0-9]+" req_qt_major_vers "${QT_MIN_VERSION}") + IF (NOT req_qt_major_vers) + MESSAGE( FATAL_ERROR "Invalid Qt version string given: \"${QT_MIN_VERSION}\", expected e.g. \"4.0.1\"") + ENDIF (NOT req_qt_major_vers) + + # now parse the parts of the user given version string into variables + STRING(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+" "\\1" req_qt_major_vers "${QT_MIN_VERSION}") + STRING(REGEX REPLACE "^[0-9]+\\.([0-9])+\\.[0-9]+" "\\1" req_qt_minor_vers "${QT_MIN_VERSION}") + STRING(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" req_qt_patch_vers "${QT_MIN_VERSION}") + + IF (NOT req_qt_major_vers EQUAL 4) + MESSAGE( FATAL_ERROR "Invalid Qt version string given: \"${QT_MIN_VERSION}\", major version 4 is required, e.g. \"4.0.1\"") + ENDIF (NOT req_qt_major_vers EQUAL 4) + + # and now the version string given by qmake + STRING(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" found_qt_major_vers "${QTVERSION}") + STRING(REGEX REPLACE "^[0-9]+\\.([0-9])+\\.[0-9]+.*" "\\1" found_qt_minor_vers "${QTVERSION}") + STRING(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" found_qt_patch_vers "${QTVERSION}") + + # compute an overall version number which can be compared at once + MATH(EXPR req_vers "${req_qt_major_vers}*10000 + ${req_qt_minor_vers}*100 + ${req_qt_patch_vers}") + MATH(EXPR found_vers "${found_qt_major_vers}*10000 + ${found_qt_minor_vers}*100 + ${found_qt_patch_vers}") + + IF (found_vers LESS req_vers) + SET(QT4_QMAKE_FOUND FALSE) + SET(QT4_INSTALLED_VERSION_TOO_OLD TRUE) + ELSE (found_vers LESS req_vers) + SET(QT4_QMAKE_FOUND TRUE) + ENDIF (found_vers LESS req_vers) + ENDIF (qt_version_tmp) + +ENDIF (QT_QMAKE_EXECUTABLE) + +IF (QT4_QMAKE_FOUND) + + if (WIN32) + # get qt install dir + get_filename_component(_DIR ${QT_QMAKE_EXECUTABLE} PATH ) + get_filename_component(QT_INSTALL_DIR ${_DIR} PATH ) + endif (WIN32) + + # ask qmake for the library dir + # Set QT_LIBRARY_DIR + IF (NOT QT_LIBRARY_DIR) + EXEC_PROGRAM( ${QT_QMAKE_EXECUTABLE} + ARGS "-query QT_INSTALL_LIBS" + OUTPUT_VARIABLE QT_LIBRARY_DIR_TMP ) + # make sure we have / and not \ as qmake gives on windows + FILE(TO_CMAKE_PATH "${QT_LIBRARY_DIR_TMP}" QT_LIBRARY_DIR_TMP) + IF(EXISTS "${QT_LIBRARY_DIR_TMP}") + SET(QT_LIBRARY_DIR ${QT_LIBRARY_DIR_TMP} CACHE PATH "Qt library dir") + ELSE(EXISTS "${QT_LIBRARY_DIR_TMP}") + MESSAGE("Warning: QT_QMAKE_EXECUTABLE reported QT_INSTALL_LIBS as ${QT_LIBRARY_DIR_TMP}") + MESSAGE("Warning: ${QT_LIBRARY_DIR_TMP} does NOT exist, Qt is not installed correctly.") + ENDIF(EXISTS "${QT_LIBRARY_DIR_TMP}") + ENDIF(NOT QT_LIBRARY_DIR) + + IF (APPLE) + IF (EXISTS ${QT_LIBRARY_DIR}/QtCore.framework) + SET(QT_USE_FRAMEWORKS ON + CACHE BOOL "Set to ON if Qt build uses frameworks.") + ELSE (EXISTS ${QT_LIBRARY_DIR}/QtCore.framework) + SET(QT_USE_FRAMEWORKS OFF + CACHE BOOL "Set to ON if Qt build uses frameworks.") + ENDIF (EXISTS ${QT_LIBRARY_DIR}/QtCore.framework) + + MARK_AS_ADVANCED(QT_USE_FRAMEWORKS) + ENDIF (APPLE) + + # ask qmake for the binary dir + IF (QT_LIBRARY_DIR AND NOT QT_BINARY_DIR) + EXEC_PROGRAM(${QT_QMAKE_EXECUTABLE} + ARGS "-query QT_INSTALL_BINS" + OUTPUT_VARIABLE qt_bins ) + # make sure we have / and not \ as qmake gives on windows + FILE(TO_CMAKE_PATH "${qt_bins}" qt_bins) + SET(QT_BINARY_DIR ${qt_bins} CACHE INTERNAL "") + ENDIF (QT_LIBRARY_DIR AND NOT QT_BINARY_DIR) + + # ask qmake for the include dir + IF (QT_LIBRARY_DIR AND NOT QT_HEADERS_DIR) + EXEC_PROGRAM( ${QT_QMAKE_EXECUTABLE} + ARGS "-query QT_INSTALL_HEADERS" + OUTPUT_VARIABLE qt_headers ) + # make sure we have / and not \ as qmake gives on windows + FILE(TO_CMAKE_PATH "${qt_headers}" qt_headers) + SET(QT_HEADERS_DIR ${qt_headers} CACHE INTERNAL "") + ENDIF(QT_LIBRARY_DIR AND NOT QT_HEADERS_DIR) + + + # ask qmake for the documentation directory + IF (QT_LIBRARY_DIR AND NOT QT_DOC_DIR) + EXEC_PROGRAM( ${QT_QMAKE_EXECUTABLE} + ARGS "-query QT_INSTALL_DOCS" + OUTPUT_VARIABLE qt_doc_dir ) + # make sure we have / and not \ as qmake gives on windows + FILE(TO_CMAKE_PATH "${qt_doc_dir}" qt_doc_dir) + SET(QT_DOC_DIR ${qt_doc_dir} CACHE PATH "The location of the Qt docs") + ENDIF (QT_LIBRARY_DIR AND NOT QT_DOC_DIR) + + # ask qmake for the mkspecs directory + IF (QT_LIBRARY_DIR AND NOT QT_MKSPECS_DIR) + EXEC_PROGRAM( ${QT_QMAKE_EXECUTABLE} + ARGS "-query QMAKE_MKSPECS" + OUTPUT_VARIABLE qt_mkspecs_dirs ) + # do not replace : on windows as it might be a drive letter + # and windows should already use ; as a separator + IF(UNIX) + STRING(REPLACE ":" ";" qt_mkspecs_dirs "${qt_mkspecs_dirs}") + ENDIF(UNIX) + FIND_PATH(QT_MKSPECS_DIR qconfig.pri PATHS ${qt_mkspecs_dirs} + DOC "The location of the Qt mkspecs containing qconfig.pri" + NO_DEFAULT_PATH ) + ENDIF (QT_LIBRARY_DIR AND NOT QT_MKSPECS_DIR) + + # ask qmake for the plugins directory + IF (QT_LIBRARY_DIR AND NOT QT_PLUGINS_DIR) + EXEC_PROGRAM( ${QT_QMAKE_EXECUTABLE} + ARGS "-query QT_INSTALL_PLUGINS" + OUTPUT_VARIABLE qt_plugins_dir ) + # make sure we have / and not \ as qmake gives on windows + FILE(TO_CMAKE_PATH "${qt_plugins_dir}" qt_plugins_dir) + SET(QT_PLUGINS_DIR ${qt_plugins_dir} CACHE PATH "The location of the Qt plugins") + ENDIF (QT_LIBRARY_DIR AND NOT QT_PLUGINS_DIR) + ######################################## + # + # Setting the INCLUDE-Variables + # + ######################################## + + FIND_PATH(QT_QTCORE_INCLUDE_DIR QtGlobal + ${QT_HEADERS_DIR}/QtCore + ${QT_LIBRARY_DIR}/QtCore.framework/Headers + NO_DEFAULT_PATH + ) + + # Set QT_INCLUDE_DIR by removine "/QtCore" in the string ${QT_QTCORE_INCLUDE_DIR} + IF( QT_QTCORE_INCLUDE_DIR AND NOT QT_INCLUDE_DIR) + IF (QT_USE_FRAMEWORKS) + SET(QT_INCLUDE_DIR ${QT_HEADERS_DIR}) + ELSE (QT_USE_FRAMEWORKS) + STRING( REGEX REPLACE "/QtCore$" "" qt4_include_dir ${QT_QTCORE_INCLUDE_DIR}) + SET( QT_INCLUDE_DIR ${qt4_include_dir} CACHE PATH "") + ENDIF (QT_USE_FRAMEWORKS) + ENDIF( QT_QTCORE_INCLUDE_DIR AND NOT QT_INCLUDE_DIR) + + IF( NOT QT_INCLUDE_DIR) + IF(Qt4_FIND_REQUIRED) + MESSAGE( FATAL_ERROR "Could NOT find QtGlobal header") + ENDIF(Qt4_FIND_REQUIRED) + ENDIF( NOT QT_INCLUDE_DIR) + + ############################################# + # + # Find out what window system we're using + # + ############################################# + # Save required includes and required_flags variables + macro_push_required_vars() + # Add QT_INCLUDE_DIR to CMAKE_REQUIRED_INCLUDES + SET(CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES};${QT_INCLUDE_DIR}") + # On Mac OS X when Qt has framework support, also add the framework path + IF( QT_USE_FRAMEWORKS ) + SET(CMAKE_REQUIRED_FLAGS "-F${QT_LIBRARY_DIR} ") + ENDIF( QT_USE_FRAMEWORKS ) + # Check for Window system symbols (note: only one should end up being set) + CHECK_SYMBOL_EXISTS(Q_WS_X11 "QtCore/qglobal.h" Q_WS_X11) + CHECK_SYMBOL_EXISTS(Q_WS_WIN "QtCore/qglobal.h" Q_WS_WIN) + CHECK_SYMBOL_EXISTS(Q_WS_QWS "QtCore/qglobal.h" Q_WS_QWS) + CHECK_SYMBOL_EXISTS(Q_WS_MAC "QtCore/qglobal.h" Q_WS_MAC) + + IF (QT_QTCOPY_REQUIRED) + CHECK_SYMBOL_EXISTS(QT_IS_QTCOPY "QtCore/qglobal.h" QT_KDE_QT_COPY) + IF (NOT QT_IS_QTCOPY) + MESSAGE(FATAL_ERROR "qt-copy is required, but hasn't been found") + ENDIF (NOT QT_IS_QTCOPY) + ENDIF (QT_QTCOPY_REQUIRED) + + # Restore CMAKE_REQUIRED_INCLUDES+CMAKE_REQUIRED_FLAGS variables + macro_pop_required_vars() + # + ############################################# + + IF (QT_USE_FRAMEWORKS) + SET(QT_DEFINITIONS ${QT_DEFINITIONS} -F${QT_LIBRARY_DIR} -L${QT_LIBRARY_DIR} ) + ENDIF (QT_USE_FRAMEWORKS) + + # Set QT_QT3SUPPORT_INCLUDE_DIR + FIND_PATH(QT_QT3SUPPORT_INCLUDE_DIR Qt3Support + PATHS + ${QT_INCLUDE_DIR}/Qt3Support + ${QT_LIBRARY_DIR}/Qt3Support.framework/Headers + NO_DEFAULT_PATH + ) + + # Set QT_QT_INCLUDE_DIR + FIND_PATH(QT_QT_INCLUDE_DIR qglobal.h + PATHS + ${QT_INCLUDE_DIR}/Qt + ${QT_LIBRARY_DIR}/QtCore.framework/Headers + NO_DEFAULT_PATH + ) + + # Set QT_QTGUI_INCLUDE_DIR + FIND_PATH(QT_QTGUI_INCLUDE_DIR QtGui + PATHS + ${QT_INCLUDE_DIR}/QtGui + ${QT_LIBRARY_DIR}/QtGui.framework/Headers + NO_DEFAULT_PATH + ) + + # Set QT_QTSVG_INCLUDE_DIR + FIND_PATH(QT_QTSVG_INCLUDE_DIR QtSvg + PATHS + ${QT_INCLUDE_DIR}/QtSvg + ${QT_LIBRARY_DIR}/QtSvg.framework/Headers + NO_DEFAULT_PATH + ) + + # Set QT_QTSCRIPT_INCLUDE_DIR + FIND_PATH(QT_QTSCRIPT_INCLUDE_DIR QtScript + PATHS + ${QT_INCLUDE_DIR}/QtScript + ${QT_LIBRARY_DIR}/QtScript.framework/Headers + NO_DEFAULT_PATH + ) + + # Set QT_QTTEST_INCLUDE_DIR + FIND_PATH(QT_QTTEST_INCLUDE_DIR QtTest + PATHS + ${QT_INCLUDE_DIR}/QtTest + ${QT_LIBRARY_DIR}/QtTest.framework/Headers + NO_DEFAULT_PATH + ) + + # Set QT_QTUITOOLS_INCLUDE_DIR + FIND_PATH(QT_QTUITOOLS_INCLUDE_DIR QtUiTools + PATHS + ${QT_INCLUDE_DIR}/QtUiTools + ${QT_LIBRARY_DIR}/QtUiTools.framework/Headers + NO_DEFAULT_PATH + ) + + # Set QT_QTMOTIF_INCLUDE_DIR + IF(Q_WS_X11) + FIND_PATH(QT_QTMOTIF_INCLUDE_DIR QtMotif + PATHS + ${QT_INCLUDE_DIR}/QtMotif + NO_DEFAULT_PATH ) + ENDIF(Q_WS_X11) + + # Set QT_QTNETWORK_INCLUDE_DIR + FIND_PATH(QT_QTNETWORK_INCLUDE_DIR QtNetwork + PATHS + ${QT_INCLUDE_DIR}/QtNetwork + ${QT_LIBRARY_DIR}/QtNetwork.framework/Headers + NO_DEFAULT_PATH + ) + + # Set QT_QTNSPLUGIN_INCLUDE_DIR + FIND_PATH(QT_QTNSPLUGIN_INCLUDE_DIR QtNsPlugin + PATHS + ${QT_INCLUDE_DIR}/QtNsPlugin + ${QT_LIBRARY_DIR}/QtNsPlugin.framework/Headers + NO_DEFAULT_PATH + ) + + # Set QT_QTOPENGL_INCLUDE_DIR + FIND_PATH(QT_QTOPENGL_INCLUDE_DIR QtOpenGL + PATHS + ${QT_INCLUDE_DIR}/QtOpenGL + ${QT_LIBRARY_DIR}/QtOpenGL.framework/Headers + NO_DEFAULT_PATH + ) + + # Set QT_QTSQL_INCLUDE_DIR + FIND_PATH(QT_QTSQL_INCLUDE_DIR QtSql + PATHS + ${QT_INCLUDE_DIR}/QtSql + ${QT_LIBRARY_DIR}/QtSql.framework/Headers + NO_DEFAULT_PATH + ) + + # Set QT_QTXML_INCLUDE_DIR + FIND_PATH(QT_QTXML_INCLUDE_DIR QtXml + PATHS + ${QT_INCLUDE_DIR}/QtXml + ${QT_LIBRARY_DIR}/QtXml.framework/Headers + NO_DEFAULT_PATH + ) + + # Set QT_QTASSISTANT_INCLUDE_DIR + FIND_PATH(QT_QTASSISTANT_INCLUDE_DIR QtAssistant + PATHS + ${QT_INCLUDE_DIR}/QtAssistant + ${QT_HEADERS_DIR}/QtAssistant + ${QT_LIBRARY_DIR}/QtAssistant.framework/Headers + NO_DEFAULT_PATH + ) + + # Set QT_QTDESIGNER_INCLUDE_DIR + FIND_PATH(QT_QTDESIGNER_INCLUDE_DIR QDesignerComponents + PATHS + ${QT_INCLUDE_DIR}/QtDesigner + ${QT_HEADERS_DIR}/QtDesigner + ${QT_LIBRARY_DIR}/QtDesigner.framework/Headers + NO_DEFAULT_PATH + ) + + # Set QT_QTDESIGNERCOMPONENTS_INCLUDE_DIR + FIND_PATH(QT_QTDESIGNERCOMPONENTS_INCLUDE_DIR QDesignerComponents + PATHS + ${QT_INCLUDE_DIR}/QtDesigner + ${QT_HEADERS_DIR}/QtDesigner + NO_DEFAULT_PATH + ) + + # Set QT_QTDBUS_INCLUDE_DIR + FIND_PATH(QT_QTDBUS_INCLUDE_DIR QtDBus + PATHS + ${QT_INCLUDE_DIR}/QtDBus + ${QT_HEADERS_DIR}/QtDBus + ${QT_LIBRARY_DIR}/QtDBus.framework/Headers + NO_DEFAULT_PATH + ) + + # Set QT_QTASSISTANTCLIENT_INCLUDE_DIR + FIND_PATH(QT_QTASSISTANTCLIENT_INCLUDE_DIR QAssistantClient + PATHS + ${QT_INCLUDE_DIR}/QtAssistant + ${QT_HEADERS_DIR}/QtAssistant + NO_DEFAULT_PATH + ) + + # Set QT_QTHELP_INCLUDE_DIR + FIND_PATH(QT_QTHELP_INCLUDE_DIR QtHelp + PATHS + ${QT_INCLUDE_DIR}/QtHelp + ${QT_HEADERS_DIR}/QtHelp + NO_DEFAULT_PATH + ) + + # Set QT_QTWEBKIT_INCLUDE_DIR + FIND_PATH(QT_QTWEBKIT_INCLUDE_DIR QtWebKit + PATHS + ${QT_INCLUDE_DIR}/QtWebKit + ${QT_HEADERS_DIR}/QtWebKit + NO_DEFAULT_PATH + ) + + # Set QT_QTXMLPATTERNS_INCLUDE_DIR + FIND_PATH(QT_QTXMLPATTERNS_INCLUDE_DIR QtXmlPatterns + PATHS + ${QT_INCLUDE_DIR}/QtXmlPatterns + ${QT_HEADERS_DIR}/QtXmlPatterns + NO_DEFAULT_PATH + ) + + # Set QT_PHONON_INCLUDE_DIR + FIND_PATH(QT_PHONON_INCLUDE_DIR phonon + PATHS + ${QT_INCLUDE_DIR}/phonon + NO_DEFAULT_PATH + ) + + # Make variables changeble to the advanced user + MARK_AS_ADVANCED( QT_LIBRARY_DIR QT_INCLUDE_DIR QT_QT_INCLUDE_DIR QT_DOC_DIR QT_MKSPECS_DIR QT_PLUGINS_DIR) + + # Set QT_INCLUDES + SET( QT_INCLUDES ${QT_QT_INCLUDE_DIR} ${QT_MKSPECS_DIR}/default ${QT_INCLUDE_DIR} ) + + ######################################## + # + # Setting the LIBRARY-Variables + # + ######################################## + + IF (QT_USE_FRAMEWORKS) + # If FIND_LIBRARY found libraries in Apple frameworks, we would NOT have + # to jump through these hoops. + IF(EXISTS ${QT_LIBRARY_DIR}/QtCore.framework) + SET(QT_QTCORE_FOUND TRUE) + SET(QT_QTCORE_LIBRARY "-F${QT_LIBRARY_DIR} -framework QtCore" CACHE STRING "The QtCore library.") + ELSE(EXISTS ${QT_LIBRARY_DIR}/QtCore.framework) + SET(QT_QTCORE_FOUND FALSE) + ENDIF(EXISTS ${QT_LIBRARY_DIR}/QtCore.framework) + + IF(EXISTS ${QT_LIBRARY_DIR}/QtGui.framework) + SET(QT_QTGUI_FOUND TRUE) + SET(QT_QTGUI_LIBRARY "-F${QT_LIBRARY_DIR} -framework QtGui" CACHE STRING "The QtGui library.") + ELSE(EXISTS ${QT_LIBRARY_DIR}/QtGui.framework) + SET(QT_QTGUI_FOUND FALSE) + ENDIF(EXISTS ${QT_LIBRARY_DIR}/QtGui.framework) + + IF(EXISTS ${QT_LIBRARY_DIR}/Qt3Support.framework) + SET(QT_QT3SUPPORT_FOUND TRUE) + SET(QT_QT3SUPPORT_LIBRARY "-F${QT_LIBRARY_DIR} -framework Qt3Support" CACHE STRING "The Qt3Support library.") + ELSE(EXISTS ${QT_LIBRARY_DIR}/Qt3Support.framework) + SET(QT_QT3SUPPORT_FOUND FALSE) + ENDIF(EXISTS ${QT_LIBRARY_DIR}/Qt3Support.framework) + + IF(EXISTS ${QT_LIBRARY_DIR}/QtNetwork.framework) + SET(QT_QTNETWORK_FOUND TRUE) + SET(QT_QTNETWORK_LIBRARY "-F${QT_LIBRARY_DIR} -framework QtNetwork" CACHE STRING "The QtNetwork library.") + ELSE(EXISTS ${QT_LIBRARY_DIR}/QtNetwork.framework) + SET(QT_QTNETWORK_FOUND FALSE) + ENDIF(EXISTS ${QT_LIBRARY_DIR}/QtNetwork.framework) + + IF(EXISTS ${QT_LIBRARY_DIR}/QtOpenGL.framework) + SET(QT_QTOPENGL_FOUND TRUE) + SET(QT_QTOPENGL_LIBRARY "-F${QT_LIBRARY_DIR} -framework QtOpenGL" CACHE STRING "The QtOpenGL library.") + ELSE(EXISTS ${QT_LIBRARY_DIR}/QtOpenGL.framework) + SET(QT_QTOPENGL_FOUND FALSE) + ENDIF(EXISTS ${QT_LIBRARY_DIR}/QtOpenGL.framework) + + IF(EXISTS ${QT_LIBRARY_DIR}/QtSql.framework) + SET(QT_QTSQL_FOUND TRUE) + SET(QT_QTSQL_LIBRARY "-F${QT_LIBRARY_DIR} -framework QtSql" CACHE STRING "The QtSql library.") + ELSE(EXISTS ${QT_LIBRARY_DIR}/QtSql.framework) + SET(QT_QTSQL_FOUND FALSE) + ENDIF(EXISTS ${QT_LIBRARY_DIR}/QtSql.framework) + + IF(EXISTS ${QT_LIBRARY_DIR}/QtXml.framework) + SET(QT_QTXML_FOUND TRUE) + SET(QT_QTXML_LIBRARY "-F${QT_LIBRARY_DIR} -framework QtXml" CACHE STRING "The QtXml library.") + ELSE(EXISTS ${QT_LIBRARY_DIR}/QtXml.framework) + SET(QT_QTXML_FOUND FALSE) + ENDIF(EXISTS ${QT_LIBRARY_DIR}/QtXml.framework) + + IF(EXISTS ${QT_LIBRARY_DIR}/QtSvg.framework) + SET(QT_QTSVG_FOUND TRUE) + SET(QT_QTSVG_LIBRARY "-F${QT_LIBRARY_DIR} -framework QtSvg" CACHE STRING "The QtSvg library.") + ELSE(EXISTS ${QT_LIBRARY_DIR}/QtSvg.framework) + SET(QT_QTSVG_FOUND FALSE) + ENDIF(EXISTS ${QT_LIBRARY_DIR}/QtSvg.framework) + + IF(EXISTS ${QT_LIBRARY_DIR}/QtDBus.framework) + SET(QT_QTDBUS_FOUND TRUE) + SET(QT_QTDBUS_LIBRARY "-F${QT_LIBRARY_DIR} -framework QtDBus" CACHE STRING "The QtDBus library.") + ELSE(EXISTS ${QT_LIBRARY_DIR}/QtDBus.framework) + SET(QT_QTDBUS_FOUND FALSE) + ENDIF(EXISTS ${QT_LIBRARY_DIR}/QtDBus.framework) + + IF(EXISTS ${QT_LIBRARY_DIR}/QtTest.framework) + SET(QT_QTTEST_FOUND TRUE) + SET(QT_QTTEST_LIBRARY "-F${QT_LIBRARY_DIR} -framework QtTest" CACHE STRING "The QtTest library.") + ELSE(EXISTS ${QT_LIBRARY_DIR}/QtTest.framework) + SET(QT_QTTEST_FOUND FALSE) + ENDIF(EXISTS ${QT_LIBRARY_DIR}/QtTest.framework) + + IF(EXISTS ${QT_LIBRARY_DIR}/QtAssistantClient.framework) + SET(QT_QTASSISTANTCLIENT_FOUND TRUE) + SET(QT_QTASSISTANTCLIENT_LIBRARY "-F${QT_LIBRARY_DIR} -framework QtAssistantClient" CACHE STRING "The QtAssistantClient library.") + ELSE(EXISTS ${QT_LIBRARY_DIR}/QtAssistantClient.framework) + SET(QT_QTASSISTANTCLIENT_FOUND FALSE) + ENDIF(EXISTS ${QT_LIBRARY_DIR}/QtAssistantClient.framework) + + IF(EXISTS ${QT_LIBRARY_DIR}/QtWebKit.framework) + SET(QT_QTWEBKIT_FOUND TRUE) + SET(QT_QTWEBKIT_LIBRARY "-F${QT_LIBRARY_DIR} -framework QtWebKit" CACHE STRING "The QtWebKit library.") + ELSE(EXISTS ${QT_LIBRARY_DIR}/QtWebKit.framework) + SET(QT_QTWEBKIT_FOUND FALSE) + ENDIF(EXISTS ${QT_LIBRARY_DIR}/QtWebKit.framework) + + IF(EXISTS ${QT_LIBRARY_DIR}/QtXmlPatterns.framework) + SET(QT_QTXMLPATTERNS_FOUND TRUE) + SET(QT_QTXMLPATTERNS_LIBRARY "-F${QT_LIBRARY_DIR} -framework QtXmlPatterns" CACHE STRING "The QtXmlPatterns library.") + ELSE(EXISTS ${QT_LIBRARY_DIR}/QtXmlPatterns.framework) + SET(QT_QTXMLPATTERNS_FOUND FALSE) + ENDIF(EXISTS ${QT_LIBRARY_DIR}/QtXmlPatterns.framework) + + + # WTF? why don't we have frameworks? :P + # Set QT_QTUITOOLS_LIBRARY + FIND_LIBRARY(QT_QTUITOOLS_LIBRARY NAMES QtUiTools QtUiTools4 PATHS ${QT_LIBRARY_DIR} ) + # Set QT_QTSCRIPT_LIBRARY + FIND_LIBRARY(QT_QTSCRIPT_LIBRARY NAMES QtScript QtScript4 PATHS ${QT_LIBRARY_DIR} ) + + ELSE (QT_USE_FRAMEWORKS) + + # Set QT_QTCORE_LIBRARY by searching for a lib with "QtCore." as part of the filename + FIND_LIBRARY(QT_QTCORE_LIBRARY NAMES QtCore QtCore4 QtCored4 QtCore_debug PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH ) + + # Set QT_QT3SUPPORT_LIBRARY + FIND_LIBRARY(QT_QT3SUPPORT_LIBRARY NAMES Qt3Support Qt3Support_debug Qt3Support4 Qt3Supportd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH) + + # Set QT_QTGUI_LIBRARY + FIND_LIBRARY(QT_QTGUI_LIBRARY NAMES QtGui QtGui_debug QtGui_debug QtGui4 QtGuid4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH) + + # Set QT_QTMOTIF_LIBRARY + IF(Q_WS_X11) + FIND_LIBRARY(QT_QTMOTIF_LIBRARY NAMES QtMotif QtMotif_debug PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH) + ENDIF(Q_WS_X11) + + # Set QT_QTNETWORK_LIBRARY + FIND_LIBRARY(QT_QTNETWORK_LIBRARY NAMES QtNetwork QtNetwork_debug QtNetwork4 QtNetworkd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH) + + # Set QT_QTNSPLUGIN_LIBRARY + FIND_LIBRARY(QT_QTNSPLUGIN_LIBRARY NAMES QtNsPlugin QtNsPlugin_debug PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH) + + # Set QT_QTOPENGL_LIBRARY + FIND_LIBRARY(QT_QTOPENGL_LIBRARY NAMES QtOpenGL QtOpenGL_debug QtOpenGL4 QtOpenGLd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH) + + # Set QT_QTSQL_LIBRARY + FIND_LIBRARY(QT_QTSQL_LIBRARY NAMES QtSql QtSql_debug QtSql4 QtSqld4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH) + + # Set QT_QTXML_LIBRARY + FIND_LIBRARY(QT_QTXML_LIBRARY NAMES QtXml QtXml_debug QtXml4 QtXmld4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH) + + # Set QT_QTSVG_LIBRARY + FIND_LIBRARY(QT_QTSVG_LIBRARY NAMES QtSvg QtSvg_debug QtSvg4 QtSvgd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH) + + # Set QT_QTSCRIPT_LIBRARY + FIND_LIBRARY(QT_QTSCRIPT_LIBRARY NAMES QtScript QtScript_debug QtScript4 QtScriptd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH) + + # Set QT_QTUITOOLS_LIBRARY + FIND_LIBRARY(QT_QTUITOOLS_LIBRARY NAMES QtUiTools QtUiTools_debug QtUiTools4 QtUiToolsd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH) + + # Set QT_QTTEST_LIBRARY + FIND_LIBRARY(QT_QTTEST_LIBRARY NAMES QtTest QtTest_debug QtTest4 QtTestd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH) + + FIND_LIBRARY(QT_QTDBUS_LIBRARY NAMES QtDBus QtDBus_debug QtDBus4 QtDBusd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH) + + FIND_LIBRARY(QT_QTASSISTANTCLIENT_LIBRARY NAMES QtAssistantClient QtAssistantClient_debug QtAssistantClient4 QtAssistantClientd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH) + + FIND_LIBRARY(QT_QTHELP_LIBRARY NAMES QtHelp QtHelp_debug QtHelp4 QtHelpd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH) + + FIND_LIBRARY(QT_QTWEBKIT_LIBRARY NAMES QtWebKit QtWebKit_debug QtWebKit4 QtWebKitd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH) + + FIND_LIBRARY(QT_QTXMLPATTERNS_LIBRARY NAMES QtXmlPatterns QtXmlPatterns_debug QtXmlPatterns4 QtXmlPatternsd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH) + + FIND_LIBRARY(QT_PHONON_LIBRARY NAMES phonon phonon4 phonon_debug phonond4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH) + + + IF(MSVC) + FIND_LIBRARY(QT_QTCORE_LIBRARY_RELEASE NAMES QtCore4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH) + FIND_LIBRARY(QT_QTCORE_LIBRARY_DEBUG NAMES QtCored4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH) + FIND_LIBRARY(QT_QT3SUPPORT_LIBRARY_RELEASE NAMES Qt3Support4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH) + FIND_LIBRARY(QT_QT3SUPPORT_LIBRARY_DEBUG NAMES Qt3Supportd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH) + FIND_LIBRARY(QT_QTGUI_LIBRARY_RELEASE NAMES QtGui4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH) + FIND_LIBRARY(QT_QTGUI_LIBRARY_DEBUG NAMES QtGuid4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH) + FIND_LIBRARY(QT_QTNETWORK_LIBRARY_RELEASE NAMES QtNetwork4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH) + FIND_LIBRARY(QT_QTNETWORK_LIBRARY_DEBUG NAMES QtNetworkd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH) + FIND_LIBRARY(QT_QTOPENGL_LIBRARY_RELEASE NAMES QtOpenGL4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH) + FIND_LIBRARY(QT_QTOPENGL_LIBRARY_DEBUG NAMES QtOpenGLd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH) + FIND_LIBRARY(QT_QTSQL_LIBRARY_RELEASE NAMES QtSql4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH) + FIND_LIBRARY(QT_QTSQL_LIBRARY_DEBUG NAMES QtSqld4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH) + FIND_LIBRARY(QT_QTXML_LIBRARY_RELEASE NAMES QtXml4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH) + FIND_LIBRARY(QT_QTXML_LIBRARY_DEBUG NAMES QtXmld4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH) + FIND_LIBRARY(QT_QTSVG_LIBRARY_RELEASE NAMES QtSvg4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH) + FIND_LIBRARY(QT_QTSVG_LIBRARY_DEBUG NAMES QtSvgd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH) + FIND_LIBRARY(QT_QTSCRIPT_LIBRARY_RELEASE NAMES QtScript4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH) + FIND_LIBRARY(QT_QTSCRIPT_LIBRARY_DEBUG NAMES QtScriptd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH) + FIND_LIBRARY(QT_QTUITOOLS_LIBRARY_RELEASE NAMES QtUiTools QtUiTools4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH) + FIND_LIBRARY(QT_QTUITOOLS_LIBRARY_DEBUG NAMES QtUiToolsd QtUiToolsd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH) + FIND_LIBRARY(QT_QTTEST_LIBRARY_RELEASE NAMES QtTest4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH) + FIND_LIBRARY(QT_QTTEST_LIBRARY_DEBUG NAMES QtTestd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH) + FIND_LIBRARY(QT_QTDBUS_LIBRARY_RELEASE NAMES QtDBus4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH) + FIND_LIBRARY(QT_QTDBUS_LIBRARY_DEBUG NAMES QtDBusd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH) + FIND_LIBRARY(QT_QTASSISTANT_LIBRARY_RELEASE NAMES QtAssistantClient4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH) + FIND_LIBRARY(QT_QTASSISTANT_LIBRARY_DEBUG NAMES QtAssistantClientd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH) + FIND_LIBRARY(QT_QTDESIGNER_LIBRARY_RELEASE NAMES QtDesigner4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH) + FIND_LIBRARY(QT_QTDESIGNER_LIBRARY_DEBUG NAMES QtDesignerd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH) + FIND_LIBRARY(QT_QTDESIGNERCOMPONENTS_LIBRARY_RELEASE NAMES QtDesignerComponents4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH) + FIND_LIBRARY(QT_QTDESIGNERCOMPONENTS_LIBRARY_DEBUG NAMES QtDesignerComponentsd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH) + FIND_LIBRARY(QT_QTMAIN_LIBRARY_RELEASE NAMES qtmain PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH) + FIND_LIBRARY(QT_QTMAIN_LIBRARY_DEBUG NAMES qtmaind PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH) + ENDIF(MSVC) + ENDIF (QT_USE_FRAMEWORKS) + + IF( NOT QT_QTCORE_LIBRARY ) + IF(Qt4_FIND_REQUIRED) + MESSAGE( FATAL_ERROR "Could NOT find QtCore. Check ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log for more details.") + ENDIF(Qt4_FIND_REQUIRED) + ENDIF( NOT QT_QTCORE_LIBRARY ) + + # Set QT_QTASSISTANT_LIBRARY + FIND_LIBRARY(QT_QTASSISTANT_LIBRARY NAMES QtAssistantClient QtAssistantClient4 QtAssistant QtAssistant4 QtAssistantd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH) + + # Set QT_QTDESIGNER_LIBRARY + FIND_LIBRARY(QT_QTDESIGNER_LIBRARY NAMES QtDesigner QtDesigner_debug QtDesigner4 QtDesignerd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH) + + # Set QT_QTDESIGNERCOMPONENTS_LIBRARY + FIND_LIBRARY(QT_QTDESIGNERCOMPONENTS_LIBRARY NAMES QtDesignerComponents QtDesignerComponents_debug QtDesignerComponents4 QtDesignerComponentsd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH) + + # Set QT_QTMAIN_LIBRARY + IF(WIN32) + FIND_LIBRARY(QT_QTMAIN_LIBRARY NAMES qtmain qtmaind PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH) + ENDIF(WIN32) + + ############################################ + # + # Check the existence of the libraries. + # + ############################################ + + MACRO (_QT4_ADJUST_LIB_VARS basename) + IF (QT_${basename}_LIBRARY OR QT_${basename}_LIBRARY_DEBUG) + + IF(MSVC) + # Both set + IF (QT_${basename}_LIBRARY_RELEASE AND QT_${basename}_LIBRARY_DEBUG) + SET(QT_${basename}_LIBRARY optimized ${QT_${basename}_LIBRARY_RELEASE} debug ${QT_${basename}_LIBRARY_DEBUG}) + ENDIF (QT_${basename}_LIBRARY_RELEASE AND QT_${basename}_LIBRARY_DEBUG) + + # Only debug was found + IF (NOT QT_${basename}_LIBRARY_RELEASE AND QT_${basename}_LIBRARY_DEBUG) + SET(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY_DEBUG}) + ENDIF (NOT QT_${basename}_LIBRARY_RELEASE AND QT_${basename}_LIBRARY_DEBUG) + + # Only release was found + IF (QT_${basename}_LIBRARY_RELEASE AND NOT QT_${basename}_LIBRARY_DEBUG) + SET(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY_RELEASE}) + ENDIF (QT_${basename}_LIBRARY_RELEASE AND NOT QT_${basename}_LIBRARY_DEBUG) + + # Hmm, is this used anywhere ? Yes, in UseQt4.cmake. We are currently incompatible :-( + SET(QT_${basename}_LIBRARIES optimized ${QT_${basename}_LIBRARY} debug ${QT_${basename}_LIBRARY_DEBUG}) + + ENDIF(MSVC) + + SET(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY} CACHE FILEPATH "The Qt ${basename} library") + + IF (QT_${basename}_LIBRARY) + SET(QT_${basename}_FOUND 1) + ENDIF (QT_${basename}_LIBRARY) + + ENDIF (QT_${basename}_LIBRARY OR QT_${basename}_LIBRARY_DEBUG) + + IF (QT_${basename}_INCLUDE_DIR) + #add the include directory to QT_INCLUDES + SET(QT_INCLUDES "${QT_${basename}_INCLUDE_DIR}" ${QT_INCLUDES}) + ENDIF (QT_${basename}_INCLUDE_DIR) + + # Make variables changeble to the advanced user + MARK_AS_ADVANCED(QT_${basename}_LIBRARY QT_${basename}_INCLUDE_DIR) + ENDMACRO (_QT4_ADJUST_LIB_VARS) + + + # Set QT_xyz_LIBRARY variable and add + # library include path to QT_INCLUDES + _QT4_ADJUST_LIB_VARS(QTCORE) + _QT4_ADJUST_LIB_VARS(QTGUI) + _QT4_ADJUST_LIB_VARS(QT3SUPPORT) + _QT4_ADJUST_LIB_VARS(QTASSISTANT) + _QT4_ADJUST_LIB_VARS(QTDESIGNER) + _QT4_ADJUST_LIB_VARS(QTDESIGNERCOMPONENTS) + _QT4_ADJUST_LIB_VARS(QTNETWORK) + _QT4_ADJUST_LIB_VARS(QTNSPLUGIN) + _QT4_ADJUST_LIB_VARS(QTOPENGL) + _QT4_ADJUST_LIB_VARS(QTSQL) + _QT4_ADJUST_LIB_VARS(QTXML) + _QT4_ADJUST_LIB_VARS(QTSVG) + _QT4_ADJUST_LIB_VARS(QTSCRIPT) + _QT4_ADJUST_LIB_VARS(QTUITOOLS) + _QT4_ADJUST_LIB_VARS(QTTEST) + _QT4_ADJUST_LIB_VARS(QTDBUS) + _QT4_ADJUST_LIB_VARS(QTASSISTANTCLIENT) + _QT4_ADJUST_LIB_VARS(QTHELP) + _QT4_ADJUST_LIB_VARS(QTWEBKIT) + _QT4_ADJUST_LIB_VARS(QTXMLPATTERNS) + _QT4_ADJUST_LIB_VARS(PHONON) + + # platform dependent libraries + IF(Q_WS_X11) + _QT4_ADJUST_LIB_VARS(QTMOTIF) + ENDIF(Q_WS_X11) + IF(WIN32) + _QT4_ADJUST_LIB_VARS(QTMAIN) + ENDIF(WIN32) + + + ####################################### + # + # Check the executables of Qt + # ( moc, uic, rcc ) + # + ####################################### + + + # find moc and uic using qmake + QT_QUERY_QMAKE(QT_MOC_EXECUTABLE_INTERNAL "QMAKE_MOC") + QT_QUERY_QMAKE(QT_UIC_EXECUTABLE_INTERNAL "QMAKE_UIC") + + # make sure we have / and not \ as qmake gives on windows + FILE(TO_CMAKE_PATH + "${QT_MOC_EXECUTABLE_INTERNAL}" QT_MOC_EXECUTABLE_INTERNAL) + # make sure we have / and not \ as qmake gives on windows + FILE(TO_CMAKE_PATH + "${QT_UIC_EXECUTABLE_INTERNAL}" QT_UIC_EXECUTABLE_INTERNAL) + + SET(QT_MOC_EXECUTABLE + ${QT_MOC_EXECUTABLE_INTERNAL} CACHE FILEPATH "The moc executable") + SET(QT_UIC_EXECUTABLE + ${QT_UIC_EXECUTABLE_INTERNAL} CACHE FILEPATH "The uic executable") + + FIND_PROGRAM(QT_UIC3_EXECUTABLE + NAMES uic3 + PATHS ${QT_BINARY_DIR} + NO_DEFAULT_PATH + ) + + FIND_PROGRAM(QT_RCC_EXECUTABLE + NAMES rcc + PATHS ${QT_BINARY_DIR} + NO_DEFAULT_PATH + ) + + FIND_PROGRAM(QT_DBUSCPP2XML_EXECUTABLE + NAMES qdbuscpp2xml + PATHS ${QT_BINARY_DIR} + NO_DEFAULT_PATH + ) + + FIND_PROGRAM(QT_DBUSXML2CPP_EXECUTABLE + NAMES qdbusxml2cpp + PATHS ${QT_BINARY_DIR} + NO_DEFAULT_PATH + ) + + FIND_PROGRAM(QT_LUPDATE_EXECUTABLE + NAMES lupdate + PATHS ${QT_BINARY_DIR} + NO_DEFAULT_PATH + ) + + FIND_PROGRAM(QT_LRELEASE_EXECUTABLE + NAMES lrelease + PATHS ${QT_BINARY_DIR} + NO_DEFAULT_PATH + ) + + IF (QT_MOC_EXECUTABLE) + SET(QT_WRAP_CPP "YES") + ENDIF (QT_MOC_EXECUTABLE) + + IF (QT_UIC_EXECUTABLE) + SET(QT_WRAP_UI "YES") + ENDIF (QT_UIC_EXECUTABLE) + + + + MARK_AS_ADVANCED( QT_UIC_EXECUTABLE QT_UIC3_EXECUTABLE QT_MOC_EXECUTABLE + QT_RCC_EXECUTABLE QT_DBUSXML2CPP_EXECUTABLE QT_DBUSCPP2XML_EXECUTABLE + QT_LUPDATE_EXECUTABLE QT_LRELEASE_EXECUTABLE) + + ###################################### + # + # Macros for building Qt files + # + ###################################### + + MACRO (QT4_EXTRACT_OPTIONS _qt4_files _qt4_options) + SET(${_qt4_files}) + SET(${_qt4_options}) + SET(_QT4_DOING_OPTIONS FALSE) + FOREACH(_currentArg ${ARGN}) + IF ("${_currentArg}" STREQUAL "OPTIONS") + SET(_QT4_DOING_OPTIONS TRUE) + ELSE ("${_currentArg}" STREQUAL "OPTIONS") + IF(_QT4_DOING_OPTIONS) + LIST(APPEND ${_qt4_options} "${_currentArg}") + ELSE(_QT4_DOING_OPTIONS) + LIST(APPEND ${_qt4_files} "${_currentArg}") + ENDIF(_QT4_DOING_OPTIONS) + ENDIF ("${_currentArg}" STREQUAL "OPTIONS") + ENDFOREACH(_currentArg) + ENDMACRO (QT4_EXTRACT_OPTIONS) + + MACRO (QT4_GET_MOC_INC_DIRS _moc_INC_DIRS) + SET(${_moc_INC_DIRS}) + GET_DIRECTORY_PROPERTY(_inc_DIRS INCLUDE_DIRECTORIES) + + FOREACH(_current ${_inc_DIRS}) + SET(${_moc_INC_DIRS} ${${_moc_INC_DIRS}} "-I" ${_current}) + ENDFOREACH(_current ${_inc_DIRS}) + + # if Qt is installed only as framework, add -F /library/Frameworks to the moc arguments + # otherwise moc can't find the headers in the framework include dirs + IF(APPLE AND "${QT_QTCORE_INCLUDE_DIR}" MATCHES "/Library/Frameworks/") + SET(${_moc_INC_DIRS} ${${_moc_INC_DIRS}} "-F/Library/Frameworks") + ENDIF(APPLE AND "${QT_QTCORE_INCLUDE_DIR}" MATCHES "/Library/Frameworks/") + + ENDMACRO(QT4_GET_MOC_INC_DIRS) + + + MACRO (QT4_GENERATE_MOC infile outfile ) + # get include dirs + QT4_GET_MOC_INC_DIRS(moc_includes) + + GET_FILENAME_COMPONENT(abs_infile ${infile} ABSOLUTE) + + IF (MSVC_IDE) + SET (_moc_parameter_file ${outfile}_parameters) + SET (_moc_param "${moc_includes} \n-o${outfile} \n${abs_infile}") + STRING(REGEX REPLACE ";-I;" "\\n-I" _moc_param "${_moc_param}") + FILE (WRITE ${_moc_parameter_file} "${_moc_param}") + ADD_CUSTOM_COMMAND(OUTPUT ${outfile} + COMMAND ${QT_MOC_EXECUTABLE} + ARGS @"${_moc_parameter_file}" + DEPENDS ${abs_infile}) + ELSE (MSVC_IDE) + ADD_CUSTOM_COMMAND(OUTPUT ${outfile} + COMMAND ${QT_MOC_EXECUTABLE} + ARGS ${moc_includes} -o ${outfile} ${abs_infile} + DEPENDS ${abs_infile}) + ENDIF (MSVC_IDE) + + SET_SOURCE_FILES_PROPERTIES(${outfile} PROPERTIES SKIP_AUTOMOC TRUE) # dont run automoc on this file + + MACRO_ADD_FILE_DEPENDENCIES(${abs_infile} ${outfile}) + ENDMACRO (QT4_GENERATE_MOC) + + + # QT4_WRAP_CPP(outfiles inputfile ... ) + + MACRO (QT4_WRAP_CPP outfiles ) + # get include dirs + QT4_GET_MOC_INC_DIRS(moc_includes) + QT4_EXTRACT_OPTIONS(moc_files moc_options ${ARGN}) + + FOREACH (it ${moc_files}) + GET_FILENAME_COMPONENT(it ${it} ABSOLUTE) + GET_FILENAME_COMPONENT(outfile ${it} NAME_WE) + + SET(outfile ${CMAKE_CURRENT_BINARY_DIR}/moc_${outfile}.cxx) + ADD_CUSTOM_COMMAND(OUTPUT ${outfile} + COMMAND ${QT_MOC_EXECUTABLE} + ARGS ${moc_includes} ${moc_options} -o ${outfile} ${it} + DEPENDS ${it}) + SET(${outfiles} ${${outfiles}} ${outfile}) + ENDFOREACH(it) + + ENDMACRO (QT4_WRAP_CPP) + + + # QT4_WRAP_UI(outfiles inputfile ... ) + + MACRO (QT4_WRAP_UI outfiles ) + QT4_EXTRACT_OPTIONS(ui_files ui_options ${ARGN}) + + FOREACH (it ${ui_files}) + GET_FILENAME_COMPONENT(outfile ${it} NAME_WE) + GET_FILENAME_COMPONENT(infile ${it} ABSOLUTE) + SET(outfile ${CMAKE_CURRENT_BINARY_DIR}/ui_${outfile}.h) + ADD_CUSTOM_COMMAND(OUTPUT ${outfile} + COMMAND ${QT_UIC_EXECUTABLE} + ARGS ${ui_options} -o ${outfile} ${infile} + MAIN_DEPENDENCY ${infile}) + SET(${outfiles} ${${outfiles}} ${outfile}) + ENDFOREACH (it) + + ENDMACRO (QT4_WRAP_UI) + + + # QT4_ADD_RESOURCES(outfiles inputfile ... ) + + MACRO (QT4_ADD_RESOURCES outfiles ) + QT4_EXTRACT_OPTIONS(rcc_files rcc_options ${ARGN}) + + FOREACH (it ${rcc_files}) + GET_FILENAME_COMPONENT(outfilename ${it} NAME_WE) + GET_FILENAME_COMPONENT(infile ${it} ABSOLUTE) + GET_FILENAME_COMPONENT(rc_path ${infile} PATH) + SET(outfile ${CMAKE_CURRENT_BINARY_DIR}/qrc_${outfilename}.cxx) + # parse file for dependencies + # all files are absolute paths or relative to the location of the qrc file + FILE(READ "${infile}" _RC_FILE_CONTENTS) + STRING(REGEX MATCHALL "]*>" "" _RC_FILE "${_RC_FILE}") + STRING(REGEX MATCH "^/|([A-Za-z]:/)" _ABS_PATH_INDICATOR "${_RC_FILE}") + IF(NOT _ABS_PATH_INDICATOR) + SET(_RC_FILE "${rc_path}/${_RC_FILE}") + ENDIF(NOT _ABS_PATH_INDICATOR) + SET(_RC_DEPENDS ${_RC_DEPENDS} "${_RC_FILE}") + ENDFOREACH(_RC_FILE) + ADD_CUSTOM_COMMAND(OUTPUT ${outfile} + COMMAND ${QT_RCC_EXECUTABLE} + ARGS ${rcc_options} -name ${outfilename} -o ${outfile} ${infile} + MAIN_DEPENDENCY ${infile} + DEPENDS ${_RC_DEPENDS}) + SET(${outfiles} ${${outfiles}} ${outfile}) + ENDFOREACH (it) + + ENDMACRO (QT4_ADD_RESOURCES) + + MACRO(QT4_ADD_DBUS_INTERFACE _sources _interface _basename) + GET_FILENAME_COMPONENT(_infile ${_interface} ABSOLUTE) + SET(_header ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.h) + SET(_impl ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.cpp) + SET(_moc ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.moc) + + GET_SOURCE_FILE_PROPERTY(_nonamespace ${_interface} NO_NAMESPACE) + IF ( _nonamespace ) + SET(_params -N -m) + ELSE ( _nonamespace ) + SET(_params -m) + ENDIF ( _nonamespace ) + + GET_SOURCE_FILE_PROPERTY(_classname ${_interface} CLASSNAME) + IF ( _classname ) + SET(_params ${_params} -c ${_classname}) + ENDIF ( _classname ) + + GET_SOURCE_FILE_PROPERTY(_include ${_interface} INCLUDE) + IF ( _include ) + SET(_params ${_params} -i ${_include}) + ENDIF ( _include ) + + ADD_CUSTOM_COMMAND(OUTPUT ${_impl} ${_header} + COMMAND ${QT_DBUSXML2CPP_EXECUTABLE} ${_params} -p ${_basename} ${_infile} + DEPENDS ${_infile}) + + SET_SOURCE_FILES_PROPERTIES(${_impl} PROPERTIES SKIP_AUTOMOC TRUE) + + QT4_GENERATE_MOC(${_header} ${_moc}) + + SET(${_sources} ${${_sources}} ${_impl} ${_header} ${_moc}) + MACRO_ADD_FILE_DEPENDENCIES(${_impl} ${_moc}) + + ENDMACRO(QT4_ADD_DBUS_INTERFACE) + + + MACRO(QT4_ADD_DBUS_INTERFACES _sources) + FOREACH (_current_FILE ${ARGN}) + GET_FILENAME_COMPONENT(_infile ${_current_FILE} ABSOLUTE) + # get the part before the ".xml" suffix + STRING(REGEX REPLACE "(.*[/\\.])?([^\\.]+)\\.xml" "\\2" _basename ${_current_FILE}) + STRING(TOLOWER ${_basename} _basename) + QT4_ADD_DBUS_INTERFACE(${_sources} ${_infile} ${_basename}interface) + ENDFOREACH (_current_FILE) + ENDMACRO(QT4_ADD_DBUS_INTERFACES) + + + MACRO(QT4_GENERATE_DBUS_INTERFACE _header) # _customName OPTIONS -some -options ) + QT4_EXTRACT_OPTIONS(_customName _qt4_dbus_options ${ARGN}) + + GET_FILENAME_COMPONENT(_in_file ${_header} ABSOLUTE) + GET_FILENAME_COMPONENT(_basename ${_header} NAME_WE) + + IF (_customName) + SET(_target ${CMAKE_CURRENT_BINARY_DIR}/${_customName}) + ELSE (_customName) + SET(_target ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.xml) + ENDIF (_customName) + + ADD_CUSTOM_COMMAND(OUTPUT ${_target} + COMMAND ${QT_DBUSCPP2XML_EXECUTABLE} ${_qt4_dbus_options} ${_in_file} > ${_target} + DEPENDS ${_in_file} + ) + ENDMACRO(QT4_GENERATE_DBUS_INTERFACE) + + + MACRO(QT4_ADD_DBUS_ADAPTOR _sources _xml_file _include _parentClass) # _optionalBasename _optionalClassName) + GET_FILENAME_COMPONENT(_infile ${_xml_file} ABSOLUTE) + + SET(_optionalBasename "${ARGV4}") + IF (_optionalBasename) + SET(_basename ${_optionalBasename} ) + ELSE (_optionalBasename) + STRING(REGEX REPLACE "(.*[/\\.])?([^\\.]+)\\.xml" "\\2adaptor" _basename ${_infile}) + STRING(TOLOWER ${_basename} _basename) + ENDIF (_optionalBasename) + + SET(_optionalClassName "${ARGV5}") + SET(_header ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.h) + SET(_impl ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.cpp) + SET(_moc ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.moc) + + IF(_optionalClassName) + ADD_CUSTOM_COMMAND(OUTPUT ${_impl} ${_header} + COMMAND ${QT_DBUSXML2CPP_EXECUTABLE} -m -a ${_basename} -c ${_optionalClassName} -i ${_include} -l ${_parentClass} ${_infile} + DEPENDS ${_infile} + ) + ELSE(_optionalClassName) + ADD_CUSTOM_COMMAND(OUTPUT ${_impl} ${_header} + COMMAND ${QT_DBUSXML2CPP_EXECUTABLE} -m -a ${_basename} -i ${_include} -l ${_parentClass} ${_infile} + DEPENDS ${_infile} + ) + ENDIF(_optionalClassName) + + QT4_GENERATE_MOC(${_header} ${_moc}) + SET_SOURCE_FILES_PROPERTIES(${_impl} PROPERTIES SKIP_AUTOMOC TRUE) + MACRO_ADD_FILE_DEPENDENCIES(${_impl} ${_moc}) + + SET(${_sources} ${${_sources}} ${_impl} ${_header} ${_moc}) + ENDMACRO(QT4_ADD_DBUS_ADAPTOR) + + MACRO(QT4_AUTOMOC) + QT4_GET_MOC_INC_DIRS(_moc_INCS) + + SET(_matching_FILES ) + FOREACH (_current_FILE ${ARGN}) + + GET_FILENAME_COMPONENT(_abs_FILE ${_current_FILE} ABSOLUTE) + # if "SKIP_AUTOMOC" is set to true, we will not handle this file here. + # This is required to make uic work correctly: + # we need to add generated .cpp files to the sources (to compile them), + # but we cannot let automoc handle them, as the .cpp files don't exist yet when + # cmake is run for the very first time on them -> however the .cpp files might + # exist at a later run. at that time we need to skip them, so that we don't add two + # different rules for the same moc file + GET_SOURCE_FILE_PROPERTY(_skip ${_abs_FILE} SKIP_AUTOMOC) + + IF ( NOT _skip AND EXISTS ${_abs_FILE} ) + + FILE(READ ${_abs_FILE} _contents) + + GET_FILENAME_COMPONENT(_abs_PATH ${_abs_FILE} PATH) + + STRING(REGEX MATCHALL "#include +[^ ]+\\.moc[\">]" _match "${_contents}") + IF(_match) + FOREACH (_current_MOC_INC ${_match}) + STRING(REGEX MATCH "[^ <\"]+\\.moc" _current_MOC "${_current_MOC_INC}") + + GET_filename_component(_basename ${_current_MOC} NAME_WE) + # SET(_header ${CMAKE_CURRENT_SOURCE_DIR}/${_basename}.h) + SET(_header ${_abs_PATH}/${_basename}.h) + SET(_moc ${CMAKE_CURRENT_BINARY_DIR}/${_current_MOC}) + ADD_CUSTOM_COMMAND(OUTPUT ${_moc} + COMMAND ${QT_MOC_EXECUTABLE} + ARGS ${_moc_INCS} ${_header} -o ${_moc} + DEPENDS ${_header} + ) + + MACRO_ADD_FILE_DEPENDENCIES(${_abs_FILE} ${_moc}) + ENDFOREACH (_current_MOC_INC) + ENDIF(_match) + ENDIF ( NOT _skip AND EXISTS ${_abs_FILE} ) + ENDFOREACH (_current_FILE) + ENDMACRO(QT4_AUTOMOC) + + + + ###################################### + # + # decide if Qt got found + # + ###################################### + + # if the includes,libraries,moc,uic and rcc are found then we have it + IF( QT_LIBRARY_DIR AND QT_INCLUDE_DIR AND QT_MOC_EXECUTABLE AND QT_UIC_EXECUTABLE AND QT_RCC_EXECUTABLE) + SET( QT4_FOUND "YES" ) + IF( NOT Qt4_FIND_QUIETLY) + MESSAGE(STATUS "Found Qt-Version ${QTVERSION} (using ${QT_QMAKE_EXECUTABLE})") + ENDIF( NOT Qt4_FIND_QUIETLY) + ELSE( QT_LIBRARY_DIR AND QT_INCLUDE_DIR AND QT_MOC_EXECUTABLE AND QT_UIC_EXECUTABLE AND QT_RCC_EXECUTABLE) + SET( QT4_FOUND "NO") + SET(QT_QMAKE_EXECUTABLE "${QT_QMAKE_EXECUTABLE}-NOTFOUND" CACHE FILEPATH "Invalid qmake found" FORCE) + IF( Qt4_FIND_REQUIRED) + IF ( NOT QT_LIBRARY_DIR ) + MESSAGE(STATUS "Qt libraries NOT found!") + ENDIF(NOT QT_LIBRARY_DIR ) + IF ( NOT QT_INCLUDE_DIR ) + MESSAGE(STATUS "Qt includes NOT found!") + ENDIF( NOT QT_INCLUDE_DIR ) + IF ( NOT QT_MOC_EXECUTABLE ) + MESSAGE(STATUS "Qt's moc NOT found!") + ENDIF( NOT QT_MOC_EXECUTABLE ) + IF ( NOT QT_UIC_EXECUTABLE ) + MESSAGE(STATUS "Qt's uic NOT found!") + ENDIF( NOT QT_UIC_EXECUTABLE ) + IF ( NOT QT_RCC_EXECUTABLE ) + MESSAGE(STATUS "Qt's rcc NOT found!") + ENDIF( NOT QT_RCC_EXECUTABLE ) + MESSAGE( FATAL_ERROR "Qt libraries, includes, moc, uic or/and rcc NOT found!") + ENDIF( Qt4_FIND_REQUIRED) + ENDIF( QT_LIBRARY_DIR AND QT_INCLUDE_DIR AND QT_MOC_EXECUTABLE AND QT_UIC_EXECUTABLE AND QT_RCC_EXECUTABLE) + SET(QT_FOUND ${QT4_FOUND}) + + + ####################################### + # + # System dependent settings + # + ####################################### + # for unix add X11 stuff + IF(UNIX) + # on OS X X11 may not be required + IF (Q_WS_X11) + FIND_PACKAGE(X11) + ENDIF (Q_WS_X11) + FIND_PACKAGE(Threads) + ENDIF(UNIX) + + + ####################################### + # + # compatibility settings + # + ####################################### + # Backwards compatibility for CMake1.4 and 1.2 + SET (QT_MOC_EXE ${QT_MOC_EXECUTABLE} ) + SET (QT_UIC_EXE ${QT_UIC_EXECUTABLE} ) + + SET( QT_QT_LIBRARY "") + +ELSE(QT4_QMAKE_FOUND) + + SET(QT_QMAKE_EXECUTABLE "${QT_QMAKE_EXECUTABLE}-NOTFOUND" CACHE FILEPATH "Invalid qmake found" FORCE) + IF(Qt4_FIND_REQUIRED) + IF(QT4_INSTALLED_VERSION_TOO_OLD) + MESSAGE(FATAL_ERROR "The installed Qt version ${QTVERSION} is too old, at least version ${QT_MIN_VERSION} is required") + ELSE(QT4_INSTALLED_VERSION_TOO_OLD) + MESSAGE( FATAL_ERROR "Qt qmake not found!") + ENDIF(QT4_INSTALLED_VERSION_TOO_OLD) + ELSE(Qt4_FIND_REQUIRED) + IF(QT4_INSTALLED_VERSION_TOO_OLD AND NOT Qt4_FIND_QUIETLY) + MESSAGE(STATUS "The installed Qt version ${QTVERSION} is too old, at least version ${QT_MIN_VERSION} is required") + ENDIF(QT4_INSTALLED_VERSION_TOO_OLD AND NOT Qt4_FIND_QUIETLY) + ENDIF(Qt4_FIND_REQUIRED) + +ENDIF (QT4_QMAKE_FOUND) + diff --git a/cmake/modules/FindRUBY.cmake b/cmake/modules/FindRUBY.cmake new file mode 100644 index 0000000000..b5d3c0fdf3 --- /dev/null +++ b/cmake/modules/FindRUBY.cmake @@ -0,0 +1,89 @@ +# - Find Ruby +# This module finds if Ruby is installed and determines where the include files +# and libraries are. It also determines what the name of the library is. This +# code sets the following variables: +# +# RUBY_LIBRARY = full path+file to the ruby library +# RUBY_INCLUDE_PATH = path to where ruby.h can be found +# RUBY_EXECUTABLE = full path+file to the ruby binary +# RUBY_FOUND = Ruby was found under system. + +# Copyright (c) 2006,2007 Laurent Montel, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + + +if(RUBY_LIBRARY AND RUBY_INCLUDE_PATH) + # Already in cache, be silent + SET(RUBY_FOUND TRUE) +endif (RUBY_LIBRARY AND RUBY_INCLUDE_PATH) + +# RUBY_ARCHDIR=`$RUBY -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"archdir"@:>@)'` +# RUBY_SITEARCHDIR=`$RUBY -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"sitearchdir"@:>@)'` +# RUBY_SITEDIR=`$RUBY -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"sitelibdir"@:>@)'` +# RUBY_LIBDIR=`$RUBY -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"libdir"@:>@)'` +# RUBY_LIBRUBYARG=`$RUBY -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"LIBRUBYARG_SHARED"@:>@)'` + +FIND_PROGRAM(RUBY_EXECUTABLE NAMES ruby ruby1.8 ruby18 ruby1.9 ruby19) + +IF(RUBY_EXECUTABLE) + EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "puts Config::CONFIG['archdir'] || Config::CONFIG['rubyincludedir']" + OUTPUT_VARIABLE RUBY_ARCH_DIR) + + EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "puts Config::CONFIG['libdir']" + OUTPUT_VARIABLE RUBY_POSSIBLE_LIB_PATH) + + EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "puts Config::CONFIG['rubylibdir']" + OUTPUT_VARIABLE RUBY_RUBY_LIB_PATH) + + EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "puts Config::CONFIG['ruby_version']" + OUTPUT_VARIABLE RUBY_VERSION) + + EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "puts Config::CONFIG['sitelibdir']" + OUTPUT_VARIABLE RUBY_SITE_LIB_DIR) + + EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "puts Config::CONFIG['sitearchdir']" + OUTPUT_VARIABLE RUBY_SITE_ARCH_DIR) + + # remove the new lines from the output by replacing them with empty strings + STRING(REPLACE "\n" "" RUBY_ARCH_DIR "${RUBY_ARCH_DIR}") + STRING(REPLACE "\n" "" RUBY_POSSIBLE_LIB_PATH "${RUBY_POSSIBLE_LIB_PATH}") + STRING(REPLACE "\n" "" RUBY_RUBY_LIB_PATH "${RUBY_RUBY_LIB_PATH}") + STRING(REPLACE "\n" "" RUBY_VERSION "${RUBY_VERSION}") + STRING(REPLACE "." "" RUBY_VERSION_NODOT "${RUBY_VERSION}") + STRING(REPLACE "\n" "" RUBY_SITE_LIB_DIR "${RUBY_SITE_LIB_DIR}") + STRING(REPLACE "\n" "" RUBY_SITE_ARCH_DIR "${RUBY_SITE_ARCH_DIR}") + + FIND_PATH(RUBY_INCLUDE_PATH + NAMES ruby.h + PATHS ${RUBY_ARCH_DIR} /usr/include/ruby-${RUBY_VERSION} + ) + + FIND_LIBRARY(RUBY_LIBRARY + NAMES ruby${RUBY_VERSION} ruby msvcrt-ruby${RUBY_VERSION_NODOT} + PATHS ${RUBY_POSSIBLE_LIB_PATH} ${RUBY_RUBY_LIB_PATH} + ) + + if(RUBY_LIBRARY AND RUBY_INCLUDE_PATH) + SET(RUBY_FOUND TRUE) + endif (RUBY_LIBRARY AND RUBY_INCLUDE_PATH) + + MARK_AS_ADVANCED( + RUBY_EXECUTABLE + RUBY_LIBRARY + RUBY_INCLUDE_PATH + ) +ENDIF(RUBY_EXECUTABLE) + +IF(RUBY_FOUND) + IF(NOT RUBY_FIND_QUIETLY) + MESSAGE(STATUS "Ruby found: ${RUBY_LIBRARY}") + ENDIF(NOT RUBY_FIND_QUIETLY) +ELSE(RUBY_FOUND) + IF(RUBY_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "Could not find Ruby") + ENDIF(RUBY_FIND_REQUIRED) +ENDIF(RUBY_FOUND) + + diff --git a/cmake/modules/FindSIP.cmake b/cmake/modules/FindSIP.cmake new file mode 100644 index 0000000000..01f3bd1636 --- /dev/null +++ b/cmake/modules/FindSIP.cmake @@ -0,0 +1,56 @@ +# Find SIP +# ~~~~~~~~ +# +# SIP website: http://www.riverbankcomputing.co.uk/sip/index.php +# +# Find the installed version of SIP. FindSIP should be called after Python +# has been found. +# +# This file defines the following variables: +# +# SIP_VERSION - The version of SIP found expressed as a 6 digit hex number +# suitable for comparision as a string. +# +# SIP_VERSION_STR - The version of SIP found as a human readable string. +# +# SIP_EXECUTABLE - Path and filename of the SIP command line executable. +# +# SIP_INCLUDE_DIR - Directory holding the SIP C++ header file. +# +# SIP_DEFAULT_SIP_DIR - Default directory where .sip files should be installed +# into. + +# Copyright (c) 2007, Simon Edwards +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + + + +IF(SIP_VERSION) + # Already in cache, be silent + SET(SIP_FOUND TRUE) +ELSE(SIP_VERSION) + + FIND_FILE(_find_sip_py FindSIP.py PATHS ${CMAKE_MODULE_PATH}) + + EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} ${_find_sip_py} OUTPUT_VARIABLE sip_config) + IF(sip_config) + STRING(REGEX REPLACE "^sip_version:([^\n]+).*$" "\\1" SIP_VERSION ${sip_config}) + STRING(REGEX REPLACE ".*\nsip_version_str:([^\n]+).*$" "\\1" SIP_VERSION_STR ${sip_config}) + STRING(REGEX REPLACE ".*\nsip_bin:([^\n]+).*$" "\\1" SIP_EXECUTABLE ${sip_config}) + STRING(REGEX REPLACE ".*\ndefault_sip_dir:([^\n]+).*$" "\\1" SIP_DEFAULT_SIP_DIR ${sip_config}) + STRING(REGEX REPLACE ".*\nsip_inc_dir:([^\n]+).*$" "\\1" SIP_INCLUDE_DIR ${sip_config}) + SET(SIP_FOUND TRUE) + ENDIF(sip_config) + + IF(SIP_FOUND) + IF(NOT SIP_FIND_QUIETLY) + MESSAGE(STATUS "Found SIP version: ${SIP_VERSION_STR}") + ENDIF(NOT SIP_FIND_QUIETLY) + ELSE(SIP_FOUND) + IF(SIP_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "Could not find SIP") + ENDIF(SIP_FIND_REQUIRED) + ENDIF(SIP_FOUND) + +ENDIF(SIP_VERSION) diff --git a/cmake/modules/FindSIP.py b/cmake/modules/FindSIP.py new file mode 100644 index 0000000000..ecb734f2cc --- /dev/null +++ b/cmake/modules/FindSIP.py @@ -0,0 +1,15 @@ +# FindSIP.py +# +# Copyright (c) 2007, Simon Edwards +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +import sys +import sipconfig + +sipcfg = sipconfig.Configuration() +print("sip_version:%06.0x" % sipcfg.sip_version) +print("sip_version_str:%s" % sipcfg.sip_version_str) +print("sip_bin:%s" % sipcfg.sip_bin) +print("default_sip_dir:%s" % sipcfg.default_sip_dir) +print("sip_inc_dir:%s" % sipcfg.sip_inc_dir) diff --git a/cmake/modules/FindSamba.cmake b/cmake/modules/FindSamba.cmake new file mode 100644 index 0000000000..16522c6482 --- /dev/null +++ b/cmake/modules/FindSamba.cmake @@ -0,0 +1,62 @@ +# - Try to find the samba directory library +# Once done this will define +# +# SAMBA_FOUND - system has SAMBA +# SAMBA_INCLUDE_DIR - the SAMBA include directory +# SAMBA_LIBRARIES - The libraries needed to use SAMBA +# Set SAMBA_REQUIRE_SMBC_SET_CONTEXT to TRUE if you need a version of Samba +# which comes with smbc_set_context() + +# Copyright (c) 2006, Alexander Neundorf, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +if(SAMBA_INCLUDE_DIR AND SAMBA_LIBRARIES) + # Already in cache, be silent + set(Samba_FIND_QUIETLY TRUE) +endif(SAMBA_INCLUDE_DIR AND SAMBA_LIBRARIES) + +find_path(SAMBA_INCLUDE_DIR NAMES libsmbclient.h ) + +find_library(SAMBA_LIBRARIES NAMES smbclient ) + + +if(SAMBA_INCLUDE_DIR AND SAMBA_LIBRARIES) + set(SAMBA_FOUND TRUE) + # check whether libsmbclient has smbc_set_context() + include(CheckSymbolExists) + include(MacroPushRequiredVars) + macro_push_required_vars() + set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${SAMBA_LIBRARIES}) + set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${SAMBA_INCLUDE_DIR}) + check_symbol_exists(smbc_set_context "libsmbclient.h" SAMBA_HAVE_SMBC_SET_CONTEXT) + check_symbol_exists(smbc_option_set "libsmbclient.h" SAMBA_HAVE_SMBC_OPTION_SET) + macro_pop_required_vars() + # fail if smbc_set_context() was required but hasn't been found + if (SAMBA_REQUIRE_SMBC_SET_CONTEXT AND NOT SAMBA_HAVE_SMBC_SET_CONTEXT) + set(SAMBA_FOUND FALSE) + endif (SAMBA_REQUIRE_SMBC_SET_CONTEXT AND NOT SAMBA_HAVE_SMBC_SET_CONTEXT) + # fail if smbc_option_set() was required but hasn't been found + if (SAMBA_REQUIRE_SMBC_OPTION_SET AND NOT SAMBA_HAVE_SMBC_OPTION_SET) + set(SAMBA_FOUND FALSE) + endif (SAMBA_REQUIRE_SMBC_OPTION_SET AND NOT SAMBA_HAVE_SMBC_OPTION_SET) + +else(SAMBA_INCLUDE_DIR AND SAMBA_LIBRARIES) + set(SAMBA_FOUND FALSE) + set(SAMBA_HAVE_SMBC_SET_CONTEXT FALSE) +endif(SAMBA_INCLUDE_DIR AND SAMBA_LIBRARIES) + + +if(SAMBA_FOUND) + if(NOT Samba_FIND_QUIETLY) + message(STATUS "Found samba: ${SAMBA_LIBRARIES}") + endif(NOT Samba_FIND_QUIETLY) +else(SAMBA_FOUND) + if (Samba_FIND_REQUIRED) + message(FATAL_ERROR "Could not find Samba library") + endif (Samba_FIND_REQUIRED) +endif(SAMBA_FOUND) + +mark_as_advanced(SAMBA_INCLUDE_DIR SAMBA_LIBRARIES) + diff --git a/cmake/modules/FindSane.cmake b/cmake/modules/FindSane.cmake new file mode 100644 index 0000000000..6c60cf63f8 --- /dev/null +++ b/cmake/modules/FindSane.cmake @@ -0,0 +1,28 @@ +# cmake macro to test if we use sane +# +# SANE_FOUND - system has SANE libs +# SANE_INCLUDE_DIR - the SANE include directory +# SANE_LIBRARIES - The libraries needed to use SANE + +# Copyright (c) 2006, Marcus Hufgard 2006 +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +if (SANE_INCLUDE_DIR AND SANE_LIBRARY) + # Already in cache, be silent + set(Sane_FIND_QUIETLY TRUE) +endif (SANE_INCLUDE_DIR AND SANE_LIBRARY) + +FIND_PATH(SANE_INCLUDE_DIR sane/sane.h) + +FIND_LIBRARY(SANE_LIBRARY NAMES sane libsane + PATHS + /usr/lib/sane + /usr/local/lib/sane +) + +include(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(Sane DEFAULT_MSG SANE_INCLUDE_DIR SANE_LIBRARY ) + +MARK_AS_ADVANCED(SANE_INCLUDE_DIR SANE_LIBRARY) diff --git a/cmake/modules/FindSasl2.cmake b/cmake/modules/FindSasl2.cmake new file mode 100644 index 0000000000..855266fc9a --- /dev/null +++ b/cmake/modules/FindSasl2.cmake @@ -0,0 +1,29 @@ +# - Try to find the sasl2 directory library +# Once done this will define +# +# SASL2_FOUND - system has SASL2 +# SASL2_INCLUDE_DIR - the SASL2 include directory +# SASL2_LIBRARIES - The libraries needed to use SASL2 + +# Copyright (c) 2006, 2007 Laurent Montel, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + + +if (SASL2_INCLUDE_DIR) + # Already in cache, be silent + set(SASL2_FIND_QUIETLY TRUE) +endif (SASL2_INCLUDE_DIR) + +FIND_PATH(SASL2_INCLUDE_DIR sasl/sasl.h +) + +FIND_LIBRARY(SASL2_LIBRARIES NAMES sasl2 +) + +include(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(Sasl2 DEFAULT_MSG SASL2_INCLUDE_DIR SASL2_LIBRARIES) + +MARK_AS_ADVANCED(SASL2_INCLUDE_DIR SASL2_LIBRARIES) + diff --git a/cmake/modules/FindSharedMimeInfo.cmake b/cmake/modules/FindSharedMimeInfo.cmake new file mode 100644 index 0000000000..707cb00615 --- /dev/null +++ b/cmake/modules/FindSharedMimeInfo.cmake @@ -0,0 +1,76 @@ +# - Try to find the shared-mime-info package +# +# SHARED_MIME_INFO_MINIMUM_VERSION - Set this to the minimum version you need, default is 0.18 +# +# Once done this will define +# +# SHARED_MIME_INFO_FOUND - system has the shared-mime-info package +# UPDATE_MIME_DATABASE_EXECUTABLE - the update-mime-database executable + +# Copyright (c) 2007, Pino Toscano, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +# the minimum version of shared-mime-database we require +if (NOT SHARED_MIME_INFO_MINIMUM_VERSION) + set(SHARED_MIME_INFO_MINIMUM_VERSION "0.18") +endif (NOT SHARED_MIME_INFO_MINIMUM_VERSION) + +if (UPDATE_MIME_DATABASE_EXECUTABLE) + + # in cache already + set(SHARED_MIME_INFO_FOUND TRUE) + +else (UPDATE_MIME_DATABASE_EXECUTABLE) + + include (MacroEnsureVersion) + + find_program (UPDATE_MIME_DATABASE_EXECUTABLE NAMES update-mime-database) + + if (UPDATE_MIME_DATABASE_EXECUTABLE) + + exec_program (${UPDATE_MIME_DATABASE_EXECUTABLE} ARGS -v RETURN_VALUE _null OUTPUT_VARIABLE _smiVersionRaw) + + string(REGEX REPLACE "update-mime-database \\([a-zA-Z\\-]+\\) ([0-9]\\.[0-9]+).*" + "\\1" smiVersion "${_smiVersionRaw}") + set (SHARED_MIME_INFO_FOUND TRUE) + endif (UPDATE_MIME_DATABASE_EXECUTABLE) + + if (SHARED_MIME_INFO_FOUND) + if (NOT SharedMimeInfo_FIND_QUIETLY) + message(STATUS "Found shared-mime-info version: ${smiVersion}") + macro_ensure_version(${SHARED_MIME_INFO_MINIMUM_VERSION} ${smiVersion} _smiVersion_OK) + if (NOT _smiVersion_OK) + message(FATAL_ERROR "The found version of shared-mime-info (${smiVersion}) is below the minimum required (${SHARED_MIME_INFO_MINIMUM_VERSION})") + endif (NOT _smiVersion_OK) + + endif (NOT SharedMimeInfo_FIND_QUIETLY) + else (SHARED_MIME_INFO_FOUND) + if (SharedMimeInfo_FIND_REQUIRED) + message(FATAL_ERROR "Could NOT find shared-mime-info. See http://freedesktop.org/wiki/Software/shared-mime-info.") + endif (SharedMimeInfo_FIND_REQUIRED) + endif (SHARED_MIME_INFO_FOUND) + +endif (UPDATE_MIME_DATABASE_EXECUTABLE) + +mark_as_advanced(UPDATE_MIME_DATABASE_EXECUTABLE) + + +macro(UPDATE_XDG_MIMETYPES _path) + get_filename_component(_xdgmimeDir "${_path}" NAME) + if("${_xdgmimeDir}" STREQUAL packages ) + get_filename_component(_xdgmimeDir "${_path}" PATH) + else("${_xdgmimeDir}" STREQUAL packages ) + set(_xdgmimeDir "${_path}") + endif("${_xdgmimeDir}" STREQUAL packages ) + + install(CODE " +set(DESTDIR_VALUE \"\$ENV{DESTDIR}\") +if (NOT DESTDIR_VALUE) + # under Windows relative paths are used, that's why it runs from CMAKE_INSTALL_PREFIX + execute_process(COMMAND ${UPDATE_MIME_DATABASE_EXECUTABLE} ${_xdgmimeDir} + WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}) +endif (NOT DESTDIR_VALUE) +") +endmacro (UPDATE_XDG_MIMETYPES) diff --git a/cmake/modules/FindSoprano.cmake b/cmake/modules/FindSoprano.cmake new file mode 100644 index 0000000000..fc00a9c900 --- /dev/null +++ b/cmake/modules/FindSoprano.cmake @@ -0,0 +1,198 @@ +# +# Find an installation of Soprano +# +# Sets the following variables: +# Soprano_FOUND - true is Soprano has been found +# SOPRANO_INCLUDE_DIR - The include directory +# SOPRANO_LIBRARIES - The Soprano core library to link to (libsoprano) +# SOPRANO_INDEX_LIBRARIES - The Soprano index library (libsopranoindex) +# SOPRANO_CLIENT_LIBRARIES - The Soprano client library (libsopranoclient) +# SOPRANO_SERVER_LIBRARIES - The Soprano server library (libsopranoserver) +# SOPRANO_VERSION - The Soprano version (string value) +# +# SOPRANO_PLUGIN_NQUADPARSER_FOUND - true if the nquadparser plugin is found +# SOPRANO_PLUGIN_NQUADSERIALIZER_FOUND - true if the nquadserializer plugin is found +# SOPRANO_PLUGIN_RAPTORPARSER_FOUND - true if the raptorparser plugin is found +# SOPRANO_PLUGIN_RAPTORSERIALIZER_FOUND - true if the raptorserializer plugin is found +# SOPRANO_PLUGIN_REDLANDBACKEND_FOUND - true if the redlandbackend plugin is found +# SOPRANO_PLUGIN_SESAME2BACKEND_FOUND - true if the sesame2backend plugin is found +# +# Options: +# Set SOPRANO_MIN_VERSION to set the minimum required Soprano version (default: 1.99) +# + +# Copyright (c) 2008, Sebastian Trueg, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + + +#if(SOPRANO_INCLUDE_DIR AND SOPRANO_LIBRARIES AND SOPRANO_INDEX_LIBRARIES AND SOPRANO_SERVER_LIBRARIES) + + # read from cache +# set(Soprano_FOUND TRUE) +# set(SopranoServer_FOUND TRUE) +# set(SopranoClient_FOUND TRUE) +# set(SopranoIndex_FOUND TRUE) + +#else(SOPRANO_INCLUDE_DIR AND SOPRANO_LIBRARIES AND SOPRANO_INDEX_LIBRARIES AND SOPRANO_SERVER_LIBRARIES) + include(FindLibraryWithDebug) + + find_path(SOPRANO_INCLUDE_DIR + NAMES + soprano/soprano.h + PATHS + ${KDE4_INCLUDE_DIR} + ${INCLUDE_INSTALL_DIR} + ) + + find_library_with_debug(SOPRANO_INDEX_LIBRARIES + WIN32_DEBUG_POSTFIX d + NAMES + sopranoindex + PATHS + ${KDE4_LIB_DIR} + ${LIB_INSTALL_DIR} + ) + + find_library_with_debug(SOPRANO_CLIENT_LIBRARIES + WIN32_DEBUG_POSTFIX d + NAMES + sopranoclient + PATHS + ${KDE4_LIB_DIR} + ${LIB_INSTALL_DIR} + ) + + find_library_with_debug(SOPRANO_LIBRARIES + WIN32_DEBUG_POSTFIX d + NAMES soprano + PATHS + ${KDE4_LIB_DIR} + ${LIB_INSTALL_DIR} + ) + + find_library_with_debug(SOPRANO_SERVER_LIBRARIES + WIN32_DEBUG_POSTFIX d + NAMES + sopranoserver + PATHS + ${KDE4_LIB_DIR} + ${LIB_INSTALL_DIR} + ) + + # check for all the libs as required to make sure that we do not try to compile with an old version + + if(SOPRANO_INCLUDE_DIR AND SOPRANO_LIBRARIES) + set(Soprano_FOUND TRUE) + endif(SOPRANO_INCLUDE_DIR AND SOPRANO_LIBRARIES) + + if(Soprano_FOUND AND SOPRANO_INDEX_LIBRARIES) + set(SopranoIndex_FOUND TRUE) + endif(Soprano_FOUND AND SOPRANO_INDEX_LIBRARIES) + + if(Soprano_FOUND AND SOPRANO_CLIENT_LIBRARIES) + set(SopranoClient_FOUND TRUE) + endif(Soprano_FOUND AND SOPRANO_CLIENT_LIBRARIES) + + if(Soprano_FOUND AND SOPRANO_SERVER_LIBRARIES) + set(SopranoServer_FOUND TRUE) + endif(Soprano_FOUND AND SOPRANO_SERVER_LIBRARIES) + + # check Soprano version + + # We set a default for the minimum required version to be backwards compatible + if(NOT SOPRANO_MIN_VERSION) + set(SOPRANO_MIN_VERSION "1.99") + endif(NOT SOPRANO_MIN_VERSION) + + if(Soprano_FOUND) + file(READ ${SOPRANO_INCLUDE_DIR}/soprano/version.h SOPRANO_VERSION_CONTENT) + string(REGEX MATCH "SOPRANO_VERSION_STRING \".*\"\n" SOPRANO_VERSION_MATCH ${SOPRANO_VERSION_CONTENT}) + if(SOPRANO_VERSION_MATCH) + string(REGEX REPLACE "SOPRANO_VERSION_STRING \"(.*)\"\n" "\\1" SOPRANO_VERSION ${SOPRANO_VERSION_MATCH}) + if(SOPRANO_VERSION STRLESS "${SOPRANO_MIN_VERSION}") + set(Soprano_FOUND FALSE) + if(Soprano_FIND_REQUIRED) + message(FATAL_ERROR "Soprano version ${SOPRANO_VERSION} is too old. Please install ${SOPRANO_MIN_VERSION} or newer") + else(Soprano_FIND_REQUIRED) + message(STATUS "Soprano version ${SOPRANO_VERSION} is too old. Please install ${SOPRANO_MIN_VERSION} or newer") + endif(Soprano_FIND_REQUIRED) + endif(SOPRANO_VERSION STRLESS "${SOPRANO_MIN_VERSION}") + endif(SOPRANO_VERSION_MATCH) + endif(Soprano_FOUND) + + #look for parser plugins + if(Soprano_FOUND) + find_path(SOPRANO_PLUGIN_DIR + NAMES + soprano/plugins + PATHS + ${SHARE_INSTALL_PREFIX} /usr/share /usr/local/share + NO_DEFAULT_PATH + NO_SYSTEM_ENVIRONMENT_PATH + ) + set(SOPRANO_PLUGIN_DIR "${SOPRANO_PLUGIN_DIR}/soprano/plugins") + + if(EXISTS ${SOPRANO_PLUGIN_DIR}/nquadparser.desktop) + set(SOPRANO_PLUGIN_NQUADPARSER_FOUND TRUE) + set(_plugins "${_plugins} nquadparser") + endif(EXISTS ${SOPRANO_PLUGIN_DIR}/nquadparser.desktop) + + if(EXISTS ${SOPRANO_PLUGIN_DIR}/nquadserializer.desktop) + set(SOPRANO_PLUGIN_NQUADSERIALIZER_FOUND TRUE) + set(_plugins "${_plugins} nquadserializer") + endif(EXISTS ${SOPRANO_PLUGIN_DIR}/nquadserializer.desktop) + + if(EXISTS ${SOPRANO_PLUGIN_DIR}/raptorparser.desktop) + set(SOPRANO_PLUGIN_RAPTORPARSER_FOUND TRUE) + set(_plugins "${_plugins} raptorparser") + endif(EXISTS ${SOPRANO_PLUGIN_DIR}/raptorparser.desktop) + + if(EXISTS ${SOPRANO_PLUGIN_DIR}/raptorserializer.desktop) + set(SOPRANO_PLUGIN_RAPTORSERIALIZER_FOUND TRUE) + set(_plugins "${_plugins} raptorserializer") + endif(EXISTS ${SOPRANO_PLUGIN_DIR}/raptorserializer.desktop) + + if(EXISTS ${SOPRANO_PLUGIN_DIR}/redlandbackend.desktop) + set(SOPRANO_PLUGIN_REDLANDBACKEND_FOUND TRUE) + set(_plugins "${_plugins} redlandbackend") + endif(EXISTS ${SOPRANO_PLUGIN_DIR}/redlandbackend.desktop) + + if(EXISTS ${SOPRANO_PLUGIN_DIR}/sesame2backend.desktop) + set(SOPRANO_PLUGIN_SESAME2BACKEND_FOUND TRUE) + set(_plugins "${_plugins} sesame2backend") + endif(EXISTS ${SOPRANO_PLUGIN_DIR}/sesame2backend.desktop) + + endif(Soprano_FOUND) + + if(Soprano_FOUND) + if(NOT Soprano_FIND_QUIETLY) + message(STATUS "Found Soprano: ${SOPRANO_LIBRARIES}") + message(STATUS "Found Soprano includes: ${SOPRANO_INCLUDE_DIR}") + message(STATUS "Found Soprano Index: ${SOPRANO_INDEX_LIBRARIES}") + message(STATUS "Found Soprano Client: ${SOPRANO_CLIENT_LIBRARIES}") + message(STATUS "Found Soprano Plugin Dir: ${SOPRANO_PLUGIN_DIR}") + message(STATUS "Found Soprano Plugins:${_plugins}") + endif(NOT Soprano_FIND_QUIETLY) + else(Soprano_FOUND) + if(Soprano_FIND_REQUIRED) + if(NOT SOPRANO_INCLUDE_DIR) + message(FATAL_ERROR "Could not find Soprano includes.") + endif(NOT SOPRANO_INCLUDE_DIR) + if(NOT SOPRANO_LIBRARIES) + message(FATAL_ERROR "Could not find Soprano library.") + endif(NOT SOPRANO_LIBRARIES) + else(Soprano_FIND_REQUIRED) + if(NOT SOPRANO_INCLUDE_DIR) + message(STATUS "Could not find Soprano includes.") + endif(NOT SOPRANO_INCLUDE_DIR) + if(NOT SOPRANO_LIBRARIES) + message(STATUS "Could not find Soprano library.") + endif(NOT SOPRANO_LIBRARIES) + endif(Soprano_FIND_REQUIRED) + endif(Soprano_FOUND) + +mark_as_advanced(SOPRANO_CLIENT_LIBRARIES SOPRANO_INDEX_LIBRARIES SOPRANO_LIBRARIES SOPRANO_SERVER_LIBRARIES SOPRANO_INCLUDE_DIR ) + +#endif(SOPRANO_INCLUDE_DIR AND SOPRANO_LIBRARIES AND SOPRANO_INDEX_LIBRARIES AND SOPRANO_SERVER_LIBRARIES) diff --git a/cmake/modules/FindSqlite.cmake b/cmake/modules/FindSqlite.cmake new file mode 100644 index 0000000000..2fa763301b --- /dev/null +++ b/cmake/modules/FindSqlite.cmake @@ -0,0 +1,50 @@ +# - Try to find Sqlite +# Once done this will define +# +# SQLITE_FOUND - system has Sqlite +# SQLITE_INCLUDE_DIR - the Sqlite include directory +# SQLITE_LIBRARIES - Link these to use Sqlite +# SQLITE_DEFINITIONS - Compiler switches required for using Sqlite +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. +# + + +# Copyright (c) 2008, Gilles Caulier, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +if ( SQLITE_INCLUDE_DIR AND SQLITE_LIBRARIES ) + # in cache already + SET(Sqlite_FIND_QUIETLY TRUE) +endif ( SQLITE_INCLUDE_DIR AND SQLITE_LIBRARIES ) + +# use pkg-config to get the directories and then use these values +# in the FIND_PATH() and FIND_LIBRARY() calls +if( NOT WIN32 ) + find_package(PkgConfig) + + pkg_check_modules(PC_SQLITE sqlite3) + + set(SQLITE_DEFINITIONS ${PC_SQLITE_CFLAGS_OTHER}) +endif( NOT WIN32 ) + +FIND_PATH(SQLITE_INCLUDE_DIR NAMES sqlite3.h + PATHS + ${PC_SQLITE_INCLUDEDIR} + ${PC_SQLITE_INCLUDE_DIRS} +) + +FIND_LIBRARY(SQLITE_LIBRARIES NAMES sqlite3 + PATHS + ${PC_SQLITE_LIBDIR} + ${PC_SQLITE_LIBRARY_DIRS} +) + +include(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(Sqlite DEFAULT_MSG SQLITE_INCLUDE_DIR SQLITE_LIBRARIES ) + +# show the SQLITE_INCLUDE_DIR and SQLITE_LIBRARIES variables only in the advanced view +MARK_AS_ADVANCED(SQLITE_INCLUDE_DIR SQLITE_LIBRARIES ) + diff --git a/cmake/modules/FindStrigi.cmake b/cmake/modules/FindStrigi.cmake new file mode 100644 index 0000000000..f0a3921ee1 --- /dev/null +++ b/cmake/modules/FindStrigi.cmake @@ -0,0 +1,182 @@ +# - Try to find Strigi, a fast and small desktop search program (http://strigi.sourceforge.net ) +# Once done this will define +# +# STRIGI_FOUND - system has Strigi +# STRIGI_INCLUDE_DIR - the Strigi include directory +# STRIGI_STREAMANALYZER_LIBRARY - Link these to use Strigi streamanalyzer +# STRIGI_STREAMS_LIBRARY - Link these to use Strigi streams +# STRIGI_LINE_ANALYZER_PREFIX - strigi plugin prefix +# STRIGI_THROUGH_ANALYZER_PREFIX - strigi plugin prefix + +# Copyright (c) 2008, Jos van den Oever, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + + +if(NOT STRIGI_MIN_VERSION) + set(STRIGI_MIN_VERSION "0.5.9") +endif(NOT STRIGI_MIN_VERSION) + +file(TO_CMAKE_PATH "$ENV{STRIGI_HOME}" strigi_home) + +set(_Strigi_FIND_QUIETLY ${Strigi_FIND_QUIETLY}) +# Try to find and load the StrigiConfig.cmake installed by kdesupport/strigi +find_package(Strigi QUIET NO_MODULE PATHS "${strigi_home}/lib/strigi" "${strigi_home}/lib64/strigi") +set(Strigi_FIND_QUIETLY ${_Strigi_FIND_QUIETLY}) + +# If StrigiConfig.cmake (installed by kdesupport/Strigi) has been found +# and it contains all necessary information (since November 16th, 2008), use the information +# included there, otherwise search it in the same way as any non-cmake project. +# This variable is set by StrigiConfig.cmake . Alex +if (STRIGI_CONFIG_FOUND_AND_HAS_COMPLETE_INFORMATION) + set (_strigiErrorMessage "Couldn't find Strigi streams and streamanalyzer libraries. Set the environment variable STRIGI_HOME (or CMAKE_PREFIX_PATH) to the strigi install dir.") + set(STRIGI_VERSION_OK TRUE) + if(STRIGI_VERSION VERSION_LESS ${STRIGI_MIN_VERSION}) + set(_strigiErrorMessage "Strigi version ${STRIGI_VERSION} found, but at least version ${STRIGI_MIN_VERSION} is required") + set(STRIGI_VERSION_OK FALSE) + endif(STRIGI_VERSION VERSION_LESS ${STRIGI_MIN_VERSION}) + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(Strigi + "${_strigiErrorMessage}" + STRIGI_STREAMS_LIBRARY STRIGI_STREAMANALYZER_LIBRARY STRIGI_INCLUDE_DIR STRIGI_VERSION_OK) + +else(STRIGI_CONFIG_FOUND_AND_HAS_COMPLETE_INFORMATION) + # this else() branch is for finding strigi versions before November 16th, 2008. Alex + include(FindLibraryWithDebug) + include(MacroPushRequiredVars) + + if (WIN32) + file(TO_CMAKE_PATH "$ENV{PROGRAMFILES}" _program_FILES_DIR) + endif(WIN32) + + if (NOT WIN32) + if(NOT strigi_home) + find_package(PkgConfig) + if(PKG_CONFIG_EXECUTABLE) + pkg_check_modules(STRIGI libstreamanalyzer>=${STRIGI_MIN_VERSION}) + endif(PKG_CONFIG_EXECUTABLE) + endif(NOT strigi_home) + endif(NOT WIN32) + + if (NOT STRIGI_INCLUDEDIR) + find_path(STRIGI_INCLUDE_DIR strigi/streamanalyzer.h + PATHS + ${strigi_home}/include + ${STRIGI_INCLUDEDIR} + ${_program_FILES_DIR}/strigi/include + ) + set( STRIGI_INCLUDEDIR ${STRIGI_INCLUDE_DIR} ) + else (NOT STRIGI_INCLUDEDIR) + set( STRIGI_INCLUDE_DIR ${STRIGI_INCLUDEDIR} ) + endif (NOT STRIGI_INCLUDEDIR) + + + find_library_with_debug(STRIGI_STREAMANALYZER_LIBRARY + WIN32_DEBUG_POSTFIX d + NAMES streamanalyzer + PATHS + ${strigi_home}/lib + ${STRIGI_LIBRARY_DIRS} + ${_program_FILES_DIR}/strigi/lib + ) + + find_library_with_debug(STRIGI_STREAMS_LIBRARY + WIN32_DEBUG_POSTFIX d + NAMES streams + PATHS + ${strigi_home}/lib + ${STRIGI_LIBRARY_DIRS} + ${_program_FILES_DIR}/strigi/lib + ) + + find_library_with_debug(STRIGI_STRIGIQTDBUSCLIENT_LIBRARY + WIN32_DEBUG_POSTFIX d + NAMES strigiqtdbusclient + PATHS + ${strigi_home}/lib + ${STRIGI_LIBRARY_DIRS} + ${_program_FILES_DIR}/strigi/lib + ) + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(Strigi + "Couldn't find Strigi streams and streamanalyzer libraries. Set the environment variable STRIGI_HOME (or CMAKE_PREFIX_PATH if using CMake >=2.6) to the strigi install dir." + STRIGI_STREAMS_LIBRARY STRIGI_STREAMANALYZER_LIBRARY STRIGI_INCLUDE_DIR) + + if (STRIGI_FOUND) + # Check for the SIC change between 0.5.9 and 0.6.0... + + macro(MACRO_CHECK_STRIGI_API_SCREWUP _RETTYPE _RESULT) + set (_STRIGI_API_SCREWUP_SOURCE_CODE " +#include +using namespace Strigi; + class ScrewupEndAnalyzer : public StreamEndAnalyzer { +public: + ScrewupEndAnalyzer() {} + bool checkHeader(const char*, int32_t) const { return false; } + ${_RETTYPE} analyze(Strigi::AnalysisResult&, InputStream*) { + return -1; + } + const char* name() const { return \"Write 1000 times: I promise to keep source compat next time\"; } +}; +int main() +{ + ScrewupEndAnalyzer a; + return 0; +} +") + check_cxx_source_compiles("${_STRIGI_API_SCREWUP_SOURCE_CODE}" ${_RESULT}) + endmacro(MACRO_CHECK_STRIGI_API_SCREWUP) + + include(CheckCXXSourceCompiles) + macro_push_required_vars() + set( CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${STRIGI_INCLUDEDIR} ) + set( CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${STRIGI_STREAMS_LIBRARY} ${STRIGI_STREAMANALYZER_LIBRARY} ) + macro_check_strigi_api_screwup( "signed char" STRIGI_NEEDS_SIGNED_CHAR ) + macro_check_strigi_api_screwup( "char" STRIGI_NEEDS_CHAR ) + set( STRIGI_NEEDS_SIGNED_CHAR ${STRIGI_NEEDS_SIGNED_CHAR} CACHE BOOL "TRUE if strigi is 0.6.0 or later" ) + set( STRIGI_NEEDS_CHAR ${STRIGI_NEEDS_CHAR} CACHE BOOL "TRUE if strigi is 0.5.9 or before" ) + if (STRIGI_NEEDS_SIGNED_CHAR) + message(STATUS "Strigi API needs 'signed char'") + else (STRIGI_NEEDS_SIGNED_CHAR) + if (STRIGI_NEEDS_CHAR) + message(STATUS "Strigi API needs 'char'") + else (STRIGI_NEEDS_CHAR) + message(FATAL_ERROR "Strigi was found, but a simple test program does not compile, check CMakeFiles/CMakeError.log") + endif (STRIGI_NEEDS_CHAR) + endif (STRIGI_NEEDS_SIGNED_CHAR) + macro_pop_required_vars() + endif (STRIGI_FOUND) + +endif (STRIGI_CONFIG_FOUND_AND_HAS_COMPLETE_INFORMATION) + + +if(WIN32) + # this is needed to have mingw, cygwin and msvc libs installed in one directory + if(MSVC) + set(STRIGI_LINE_ANALYZER_PREFIX msvc_strigila_) + set(STRIGI_THROUGH_ANALYZER_PREFIX msvc_strigita_) + elseif(CYGWIN) + set(STRIGI_LINE_ANALYZER_PREFIX cyg_strigila_) + set(STRIGI_THROUGH_ANALYZER_PREFIX cyg_strigita_) + elseif(MINGW) + set(STRIGI_LINE_ANALYZER_PREFIX mingw_strigila_) + set(STRIGI_THROUGH_ANALYZER_PREFIX mingw_strigita_) + endif(MSVC) +else(WIN32) + set(STRIGI_LINE_ANALYZER_PREFIX strigila_) + set(STRIGI_THROUGH_ANALYZER_PREFIX strigita_) +endif(WIN32) + +mark_as_advanced( + STRIGI_INCLUDE_DIR + STRIGI_STREAMANALYZER_LIBRARY + STRIGI_STREAMS_LIBRARY + STRIGI_STRIGIQTDBUSCLIENT_LIBRARY + STRIGI_LINE_ANALYZER_PREFIX + STRIGI_THROUGH_ANALYZER_PREFIX + STRIGI_NEEDS_SIGNED_CHAR + STRIGI_NEEDS_CHAR +) diff --git a/cmake/modules/FindTaglib.cmake b/cmake/modules/FindTaglib.cmake new file mode 100644 index 0000000000..5bbb8ee1b7 --- /dev/null +++ b/cmake/modules/FindTaglib.cmake @@ -0,0 +1,85 @@ +# - Try to find the Taglib library +# Once done this will define +# +# TAGLIB_FOUND - system has the taglib library +# TAGLIB_CFLAGS - the taglib cflags +# TAGLIB_LIBRARIES - The libraries needed to use taglib + +# Copyright (c) 2006, Laurent Montel, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +if(NOT TAGLIB_MIN_VERSION) + set(TAGLIB_MIN_VERSION "1.4") +endif(NOT TAGLIB_MIN_VERSION) + +if(NOT WIN32) + find_program(TAGLIBCONFIG_EXECUTABLE NAMES taglib-config PATHS + ${BIN_INSTALL_DIR} + ) +endif(NOT WIN32) + +#reset vars +set(TAGLIB_LIBRARIES) +set(TAGLIB_CFLAGS) + +# if taglib-config has been found +if(TAGLIBCONFIG_EXECUTABLE) + + exec_program(${TAGLIBCONFIG_EXECUTABLE} ARGS --version RETURN_VALUE _return_VALUE OUTPUT_VARIABLE TAGLIB_VERSION) + + if(TAGLIB_VERSION STRLESS "${TAGLIB_MIN_VERSION}") + message(STATUS "TagLib version not found: version searched :${TAGLIB_MIN_VERSION}, found ${TAGLIB_VERSION}") + set(TAGLIB_FOUND FALSE) + else(TAGLIB_VERSION STRLESS "${TAGLIB_MIN_VERSION}") + + exec_program(${TAGLIBCONFIG_EXECUTABLE} ARGS --libs RETURN_VALUE _return_VALUE OUTPUT_VARIABLE TAGLIB_LIBRARIES) + + exec_program(${TAGLIBCONFIG_EXECUTABLE} ARGS --cflags RETURN_VALUE _return_VALUE OUTPUT_VARIABLE TAGLIB_CFLAGS) + + if(TAGLIB_LIBRARIES AND TAGLIB_CFLAGS) + set(TAGLIB_FOUND TRUE) + message(STATUS "Found taglib: ${TAGLIB_LIBRARIES}") + endif(TAGLIB_LIBRARIES AND TAGLIB_CFLAGS) + string(REGEX REPLACE " *-I" ";" TAGLIB_INCLUDES "${TAGLIB_CFLAGS}") + endif(TAGLIB_VERSION STRLESS "${TAGLIB_MIN_VERSION}") + mark_as_advanced(TAGLIB_CFLAGS TAGLIB_LIBRARIES TAGLIB_INCLUDES) + +else(TAGLIBCONFIG_EXECUTABLE) + + include(FindLibraryWithDebug) + include(FindPackageHandleStandardArgs) + + find_path(TAGLIB_INCLUDES + NAMES + tag.h + PATH_SUFFIXES taglib + PATHS + ${KDE4_INCLUDE_DIR} + ${INCLUDE_INSTALL_DIR} + ) + + find_library_with_debug(TAGLIB_LIBRARIES + WIN32_DEBUG_POSTFIX d + NAMES tag + PATHS + ${KDE4_LIB_DIR} + ${LIB_INSTALL_DIR} + ) + + find_package_handle_standard_args(Taglib DEFAULT_MSG + TAGLIB_INCLUDES TAGLIB_LIBRARIES) +endif(TAGLIBCONFIG_EXECUTABLE) + + +if(TAGLIB_FOUND) + if(NOT Taglib_FIND_QUIETLY AND TAGLIBCONFIG_EXECUTABLE) + message(STATUS "Taglib found: ${TAGLIB_LIBRARIES}") + endif(NOT Taglib_FIND_QUIETLY AND TAGLIBCONFIG_EXECUTABLE) +else(TAGLIB_FOUND) + if(Taglib_FIND_REQUIRED) + message(FATAL_ERROR "Could not find Taglib") + endif(Taglib_FIND_REQUIRED) +endif(TAGLIB_FOUND) + diff --git a/cmake/modules/FindUSB.cmake b/cmake/modules/FindUSB.cmake new file mode 100644 index 0000000000..566cdd8ee8 --- /dev/null +++ b/cmake/modules/FindUSB.cmake @@ -0,0 +1,38 @@ +# - Try to find the freetype library +# Once done this defines +# +# LIBUSB_FOUND - system has libusb +# LIBUSB_INCLUDE_DIR - the libusb include directory +# LIBUSB_LIBRARIES - Link these to use libusb + +# Copyright (c) 2006, 2008 Laurent Montel, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + + +if (LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES) + + # in cache already + set(LIBUSB_FOUND TRUE) + +else (LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES) + IF (NOT WIN32) + # use pkg-config to get the directories and then use these values + # in the FIND_PATH() and FIND_LIBRARY() calls + find_package(PkgConfig) + pkg_check_modules(PC_LIBUSB libusb) + ENDIF(NOT WIN32) + + FIND_PATH(LIBUSB_INCLUDE_DIR usb.h + PATHS ${PC_LIBUSB_INCLUDEDIR} ${PC_LIBUSB_INCLUDE_DIRS}) + + FIND_LIBRARY(LIBUSB_LIBRARIES NAMES usb + PATHS ${PC_LIBUSB_LIBDIR} ${PC_LIBUSB_LIBRARY_DIRS}) + + include(FindPackageHandleStandardArgs) + FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBUSB DEFAULT_MSG LIBUSB_LIBRARIES LIBUSB_INCLUDE_DIR) + + MARK_AS_ADVANCED(LIBUSB_INCLUDE_DIR LIBUSB_LIBRARIES) + +endif (LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES) diff --git a/cmake/modules/FindX11.cmake b/cmake/modules/FindX11.cmake new file mode 100644 index 0000000000..2d6d24e91c --- /dev/null +++ b/cmake/modules/FindX11.cmake @@ -0,0 +1,454 @@ +# - Find X11 installation +# Try to find X11 on UNIX systems. The following values are defined +# X11_FOUND - True if X11 is available +# X11_INCLUDE_DIR - include directories to use X11 +# X11_LIBRARIES - link against these to use X11 +# +# and also the following more fine grained variables: +# X11_ICE_INCLUDE_PATH, X11_ICE_LIB, X11_ICE_FOUND +# X11_SM_INCLUDE_PATH, X11_SM_LIB, X11_SM_FOUND +# X11_Xaccessrules_INCLUDE_PATH, X11_Xaccess_FOUND +# X11_Xaccessstr_INCLUDE_PATH, X11_Xaccess_FOUND +# X11_Xau_INCLUDE_PATH, X11_Xau_LIB, X11_Xau_FOUND +# X11_Xcomposite_INCLUDE_PATH, X11_Xcomposite_LIB, X11_Xcomposite_FOUND +# X11_Xcursor_INCLUDE_PATH, X11_Xcursor_LIB, X11_Xcursor_FOUND +# X11_Xdamage_INCLUDE_PATH, X11_Xdamage_LIB, X11_Xdamage_FOUND +# X11_Xdmcp_INCLUDE_PATH, X11_Xdmcp_LIB, X11_Xdmcp_FOUND +# X11_Xext_LIB, X11_Xext_FOUND +# X11_dpms_INCLUDE_PATH, (in X11_Xext_LIB), X11_dpms_FOUND +# X11_XShm_INCLUDE_PATH, (in X11_Xext_LIB), X11_XShm_FOUND +# X11_Xshape_INCLUDE_PATH, (in X11_Xext_LIB), X11_Xshape_FOUND +# X11_xf86misc_INCLUDE_PATH, X11_Xxf86misc_LIB, X11_xf86misc_FOUND +# X11_xf86vmode_INCLUDE_PATH, X11_xf86vmode_FOUND +# X11_Xfixes_INCLUDE_PATH, X11_Xfixes_LIB, X11_Xfixes_FOUND +# X11_Xft_INCLUDE_PATH, X11_Xft_LIB, X11_Xft_FOUND +# X11_Xinerama_INCLUDE_PATH, X11_Xinerama_LIB, X11_Xinerama_FOUND +# X11_Xinput_INCLUDE_PATH, X11_Xinput_LIB, X11_Xinput_FOUND +# X11_Xkb_INCLUDE_PATH, X11_Xkb_FOUND +# X11_Xkblib_INCLUDE_PATH, X11_Xkb_FOUND +# X11_Xkbfile_INCLUDE_PATH, X11_Xkbfile_LIB, X11_Xkbfile_FOUND +# X11_Xpm_INCLUDE_PATH, X11_Xpm_LIB, X11_Xpm_FOUND +# X11_XTest_INCLUDE_PATH, X11_XTest_LIB, X11_XTest_FOUND +# X11_Xrandr_INCLUDE_PATH, X11_Xrandr_LIB, X11_Xrandr_FOUND +# X11_Xrender_INCLUDE_PATH, X11_Xrender_LIB, X11_Xrender_FOUND +# X11_Xscreensaver_INCLUDE_PATH, X11_Xscreensaver_LIB, X11_Xscreensaver_FOUND +# X11_Xt_INCLUDE_PATH, X11_Xt_LIB, X11_Xt_FOUND +# X11_Xutil_INCLUDE_PATH, X11_Xutil_FOUND +# X11_Xv_INCLUDE_PATH, X11_Xv_LIB, X11_Xv_FOUND +# X11_XSync_INCLUDE_PATH, (in X11_Xext_LIB), X11_XSync_FOUND + +# Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. +# See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. + +IF (UNIX) + SET(X11_FOUND 0) + # X11 is never a framework and some header files may be + # found in tcl on the mac + SET(CMAKE_FIND_FRAMEWORK_SAVE ${CMAKE_FIND_FRAMEWORK}) + SET(CMAKE_FIND_FRAMEWORK NEVER) + SET(X11_INC_SEARCH_PATH + /usr/pkg/xorg/include + /usr/X11R6/include + /usr/X11R7/include + /usr/include/X11 + /usr/openwin/include + /usr/openwin/share/include + /opt/graphics/OpenGL/include + ) + + SET(X11_LIB_SEARCH_PATH + /usr/pkg/xorg/lib + /usr/X11R6/lib + /usr/X11R7/lib + /usr/openwin/lib + ) + + FIND_PATH(X11_X11_INCLUDE_PATH X11/X.h ${X11_INC_SEARCH_PATH}) + FIND_PATH(X11_Xlib_INCLUDE_PATH X11/Xlib.h ${X11_INC_SEARCH_PATH}) + + # Look for includes; keep the list sorted by name of the cmake *_INCLUDE_PATH + # variable (which doesn't need to match the include file name). + + # Solaris lacks XKBrules.h, so we should skip kxkbd there. + FIND_PATH(X11_ICE_INCLUDE_PATH X11/ICE/ICE.h ${X11_INC_SEARCH_PATH}) + FIND_PATH(X11_SM_INCLUDE_PATH X11/SM/SM.h ${X11_INC_SEARCH_PATH}) + FIND_PATH(X11_Xaccessrules_INCLUDE_PATH X11/extensions/XKBrules.h ${X11_INC_SEARCH_PATH}) + FIND_PATH(X11_Xaccessstr_INCLUDE_PATH X11/extensions/XKBstr.h ${X11_INC_SEARCH_PATH}) + FIND_PATH(X11_Xau_INCLUDE_PATH X11/Xauth.h ${X11_INC_SEARCH_PATH}) + FIND_PATH(X11_Xcomposite_INCLUDE_PATH X11/extensions/Xcomposite.h ${X11_INC_SEARCH_PATH}) + FIND_PATH(X11_Xcursor_INCLUDE_PATH X11/Xcursor/Xcursor.h ${X11_INC_SEARCH_PATH}) + FIND_PATH(X11_Xdamage_INCLUDE_PATH X11/extensions/Xdamage.h ${X11_INC_SEARCH_PATH}) + FIND_PATH(X11_Xdmcp_INCLUDE_PATH X11/Xdmcp.h ${X11_INC_SEARCH_PATH}) + FIND_PATH(X11_dpms_INCLUDE_PATH X11/extensions/dpms.h ${X11_INC_SEARCH_PATH}) + FIND_PATH(X11_xf86misc_INCLUDE_PATH X11/extensions/xf86misc.h ${X11_INC_SEARCH_PATH}) + FIND_PATH(X11_xf86vmode_INCLUDE_PATH X11/extensions/xf86vmode.h ${X11_INC_SEARCH_PATH}) + FIND_PATH(X11_Xfixes_INCLUDE_PATH X11/extensions/Xfixes.h ${X11_INC_SEARCH_PATH}) + FIND_PATH(X11_Xft_INCLUDE_PATH X11/Xft/Xft.h ${X11_INC_SEARCH_PATH}) + FIND_PATH(X11_Xinerama_INCLUDE_PATH X11/extensions/Xinerama.h ${X11_INC_SEARCH_PATH}) + FIND_PATH(X11_Xinput_INCLUDE_PATH X11/extensions/XInput.h ${X11_INC_SEARCH_PATH}) + FIND_PATH(X11_Xkb_INCLUDE_PATH X11/extensions/XKB.h ${X11_INC_SEARCH_PATH}) + FIND_PATH(X11_Xkblib_INCLUDE_PATH X11/XKBlib.h ${X11_INC_SEARCH_PATH}) + FIND_PATH(X11_Xkbfile_INCLUDE_PATH X11/extensions/XKBfile.h ${X11_INC_SEARCH_PATH}) + FIND_PATH(X11_Xpm_INCLUDE_PATH X11/xpm.h ${X11_INC_SEARCH_PATH}) + FIND_PATH(X11_XTest_INCLUDE_PATH X11/extensions/XTest.h ${X11_INC_SEARCH_PATH}) + FIND_PATH(X11_XShm_INCLUDE_PATH X11/extensions/XShm.h ${X11_INC_SEARCH_PATH}) + FIND_PATH(X11_Xrandr_INCLUDE_PATH X11/extensions/Xrandr.h ${X11_INC_SEARCH_PATH}) + FIND_PATH(X11_Xrender_INCLUDE_PATH X11/extensions/Xrender.h ${X11_INC_SEARCH_PATH}) + FIND_PATH(X11_Xscreensaver_INCLUDE_PATH X11/extensions/scrnsaver.h ${X11_INC_SEARCH_PATH}) + FIND_PATH(X11_Xshape_INCLUDE_PATH X11/extensions/shape.h ${X11_INC_SEARCH_PATH}) + FIND_PATH(X11_Xutil_INCLUDE_PATH X11/Xutil.h ${X11_INC_SEARCH_PATH}) + FIND_PATH(X11_Xt_INCLUDE_PATH X11/Intrinsic.h ${X11_INC_SEARCH_PATH}) + FIND_PATH(X11_Xv_INCLUDE_PATH X11/extensions/Xvlib.h ${X11_INC_SEARCH_PATH}) + FIND_PATH(X11_XSync_INCLUDE_PATH X11/extensions/sync.h ${X11_INC_SEARCH_PATH}) + + + FIND_LIBRARY(X11_X11_LIB X11 ${X11_LIB_SEARCH_PATH}) + + # Find additional X libraries. Keep list sorted by library name. + FIND_LIBRARY(X11_ICE_LIB ICE ${X11_LIB_SEARCH_PATH}) + FIND_LIBRARY(X11_SM_LIB SM ${X11_LIB_SEARCH_PATH}) + FIND_LIBRARY(X11_Xau_LIB Xau ${X11_LIB_SEARCH_PATH}) + FIND_LIBRARY(X11_Xcomposite_LIB Xcomposite ${X11_LIB_SEARCH_PATH}) + FIND_LIBRARY(X11_Xcursor_LIB Xcursor ${X11_LIB_SEARCH_PATH}) + FIND_LIBRARY(X11_Xdamage_LIB Xdamage ${X11_LIB_SEARCH_PATH}) + FIND_LIBRARY(X11_Xdmcp_LIB Xdmcp ${X11_LIB_SEARCH_PATH}) + FIND_LIBRARY(X11_Xext_LIB Xext ${X11_LIB_SEARCH_PATH}) + FIND_LIBRARY(X11_Xfixes_LIB Xfixes ${X11_LIB_SEARCH_PATH}) + FIND_LIBRARY(X11_Xft_LIB Xft ${X11_LIB_SEARCH_PATH}) + FIND_LIBRARY(X11_Xinerama_LIB Xinerama ${X11_LIB_SEARCH_PATH}) + FIND_LIBRARY(X11_Xinput_LIB Xi ${X11_LIB_SEARCH_PATH}) + FIND_LIBRARY(X11_Xkbfile_LIB xkbfile ${X11_LIB_SEARCH_PATH}) + FIND_LIBRARY(X11_Xpm_LIB Xpm ${X11_LIB_SEARCH_PATH}) + FIND_LIBRARY(X11_Xrandr_LIB Xrandr ${X11_LIB_SEARCH_PATH}) + FIND_LIBRARY(X11_Xrender_LIB Xrender ${X11_LIB_SEARCH_PATH}) + FIND_LIBRARY(X11_Xscreensaver_LIB Xss ${X11_LIB_SEARCH_PATH}) + FIND_LIBRARY(X11_Xt_LIB Xt ${X11_LIB_SEARCH_PATH}) + FIND_LIBRARY(X11_XTest_LIB Xtst ${X11_LIB_SEARCH_PATH}) + FIND_LIBRARY(X11_Xv_LIB Xv ${X11_LIB_SEARCH_PATH}) + FIND_LIBRARY(X11_Xxf86misc_LIB Xxf86misc ${X11_LIB_SEARCH_PATH}) + + SET(X11_LIBRARY_DIR "") + IF(X11_X11_LIB) + GET_FILENAME_COMPONENT(X11_LIBRARY_DIR ${X11_X11_LIB} PATH) + ENDIF(X11_X11_LIB) + + SET(X11_INCLUDE_DIR) # start with empty list + IF(X11_X11_INCLUDE_PATH) + SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_X11_INCLUDE_PATH}) + ENDIF(X11_X11_INCLUDE_PATH) + + IF(X11_Xlib_INCLUDE_PATH) + SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xlib_INCLUDE_PATH}) + ENDIF(X11_Xlib_INCLUDE_PATH) + + IF(X11_Xutil_INCLUDE_PATH) + SET(X11_Xutil_FOUND TRUE) + SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xutil_INCLUDE_PATH}) + ENDIF(X11_Xutil_INCLUDE_PATH) + + IF(X11_Xshape_INCLUDE_PATH) + SET(X11_Xshape_FOUND TRUE) + SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xshape_INCLUDE_PATH}) + ENDIF(X11_Xshape_INCLUDE_PATH) + + SET(X11_LIBRARIES) # start with empty list + IF(X11_X11_LIB) + SET(X11_LIBRARIES ${X11_LIBRARIES} ${X11_X11_LIB}) + ENDIF(X11_X11_LIB) + + IF(X11_Xext_LIB) + SET(X11_Xext_FOUND TRUE) + SET(X11_LIBRARIES ${X11_LIBRARIES} ${X11_Xext_LIB}) + ENDIF(X11_Xext_LIB) + + IF(X11_Xt_LIB AND X11_Xt_INCLUDE_PATH) + SET(X11_Xt_FOUND TRUE) + ENDIF(X11_Xt_LIB AND X11_Xt_INCLUDE_PATH) + + IF(X11_Xft_LIB AND X11_Xft_INCLUDE_PATH) + SET(X11_Xft_FOUND TRUE) + SET(X11_LIBRARIES ${X11_LIBRARIES} ${X11_Xft_LIB}) + SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xft_INCLUDE_PATH}) + ENDIF(X11_Xft_LIB AND X11_Xft_INCLUDE_PATH) + + IF(X11_Xv_LIB AND X11_Xv_INCLUDE_PATH) + SET(X11_Xv_FOUND TRUE) + SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xv_INCLUDE_PATH}) + ENDIF(X11_Xv_LIB AND X11_Xv_INCLUDE_PATH) + + IF (X11_Xau_LIB AND X11_Xau_INCLUDE_PATH) + SET(X11_Xau_FOUND TRUE) + SET(X11_LIBRARIES ${X11_LIBRARIES} ${X11_Xau_LIB}) + ENDIF (X11_Xau_LIB AND X11_Xau_INCLUDE_PATH) + + IF (X11_Xdmcp_INCLUDE_PATH AND X11_Xdmcp_LIB) + SET(X11_Xdmcp_FOUND TRUE) + SET(X11_LIBRARIES ${X11_LIBRARIES} ${X11_Xdmcp_LIB}) + SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xdmcp_INCLUDE_PATH}) + ENDIF (X11_Xdmcp_INCLUDE_PATH AND X11_Xdmcp_LIB) + + IF (X11_Xaccessrules_INCLUDE_PATH AND X11_Xaccessstr_INCLUDE_PATH) + SET(X11_Xaccess_FOUND TRUE) + SET(X11_Xaccess_INCLUDE_PATH ${X11_Xaccessstr_INCLUDE_PATH}) + SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xaccess_INCLUDE_PATH}) + ENDIF (X11_Xaccessrules_INCLUDE_PATH AND X11_Xaccessstr_INCLUDE_PATH) + + IF (X11_Xpm_INCLUDE_PATH AND X11_Xpm_LIB) + SET(X11_Xpm_FOUND TRUE) + SET(X11_LIBRARIES ${X11_LIBRARIES} ${X11_Xpm_LIB}) + SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xpm_INCLUDE_PATH}) + ENDIF (X11_Xpm_INCLUDE_PATH AND X11_Xpm_LIB) + + IF (X11_Xcomposite_INCLUDE_PATH AND X11_Xcomposite_LIB) + SET(X11_Xcomposite_FOUND TRUE) + SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xcomposite_INCLUDE_PATH}) + ENDIF (X11_Xcomposite_INCLUDE_PATH AND X11_Xcomposite_LIB) + + IF (X11_Xdamage_INCLUDE_PATH AND X11_Xdamage_LIB) + SET(X11_Xdamage_FOUND TRUE) + SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xdamage_INCLUDE_PATH}) + ENDIF (X11_Xdamage_INCLUDE_PATH AND X11_Xdamage_LIB) + + IF (X11_XShm_INCLUDE_PATH) + SET(X11_XShm_FOUND TRUE) + SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_XShm_INCLUDE_PATH}) + ENDIF (X11_XShm_INCLUDE_PATH) + + IF (X11_XTest_INCLUDE_PATH AND X11_XTest_LIB) + SET(X11_XTest_FOUND TRUE) + SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_XTest_INCLUDE_PATH}) + ENDIF (X11_XTest_INCLUDE_PATH AND X11_XTest_LIB) + + IF (X11_Xinerama_INCLUDE_PATH AND X11_Xinerama_LIB) + SET(X11_Xinerama_FOUND TRUE) + SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xinerama_INCLUDE_PATH}) + ENDIF (X11_Xinerama_INCLUDE_PATH AND X11_Xinerama_LIB) + + IF (X11_Xfixes_INCLUDE_PATH AND X11_Xfixes_LIB) + SET(X11_Xfixes_FOUND TRUE) + SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xfixes_INCLUDE_PATH}) + ENDIF (X11_Xfixes_INCLUDE_PATH AND X11_Xfixes_LIB) + + IF (X11_Xrender_INCLUDE_PATH AND X11_Xrender_LIB) + SET(X11_Xrender_FOUND TRUE) + SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xrender_INCLUDE_PATH}) + ENDIF (X11_Xrender_INCLUDE_PATH AND X11_Xrender_LIB) + + IF (X11_Xrandr_INCLUDE_PATH AND X11_Xrandr_LIB) + SET(X11_Xrandr_FOUND TRUE) + SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xrandr_INCLUDE_PATH}) + ENDIF (X11_Xrandr_INCLUDE_PATH AND X11_Xrandr_LIB) + + IF (X11_xf86misc_INCLUDE_PATH AND X11_Xxf86misc_LIB) + SET(X11_xf86misc_FOUND TRUE) + SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_xf86misc_INCLUDE_PATH}) + ENDIF (X11_xf86misc_INCLUDE_PATH AND X11_Xxf86misc_LIB) + + IF (X11_xf86vmode_INCLUDE_PATH) + SET(X11_xf86vmode_FOUND TRUE) + SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_xf86vmode_INCLUDE_PATH}) + ENDIF (X11_xf86vmode_INCLUDE_PATH) + + IF (X11_Xcursor_INCLUDE_PATH AND X11_Xcursor_LIB) + SET(X11_Xcursor_FOUND TRUE) + SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xcursor_INCLUDE_PATH}) + ENDIF (X11_Xcursor_INCLUDE_PATH AND X11_Xcursor_LIB) + + IF (X11_Xscreensaver_INCLUDE_PATH AND X11_Xscreensaver_LIB) + SET(X11_Xscreensaver_FOUND TRUE) + SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xscreensaver_INCLUDE_PATH}) + ENDIF (X11_Xscreensaver_INCLUDE_PATH AND X11_Xscreensaver_LIB) + SET(X11_Xss_FOUND ${X11_Xscreensaver_FOUND}) + SET(X11_Xss_LIB ${X11_Xscreensaver_LIB}) + + + IF (X11_dpms_INCLUDE_PATH) + SET(X11_dpms_FOUND TRUE) + SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_dpms_INCLUDE_PATH}) + ENDIF (X11_dpms_INCLUDE_PATH) + + IF (X11_Xkb_INCLUDE_PATH AND X11_Xkblib_INCLUDE_PATH AND X11_Xlib_INCLUDE_PATH) + SET(X11_Xkb_FOUND TRUE) + SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xkb_INCLUDE_PATH} ) + ENDIF (X11_Xkb_INCLUDE_PATH AND X11_Xkblib_INCLUDE_PATH AND X11_Xlib_INCLUDE_PATH) + + IF (X11_Xkbfile_INCLUDE_PATH AND X11_Xkbfile_LIB AND X11_Xlib_INCLUDE_PATH) + SET(X11_Xkbfile_FOUND TRUE) + SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xkbfile_INCLUDE_PATH} ) + ENDIF (X11_Xkbfile_INCLUDE_PATH AND X11_Xkbfile_LIB AND X11_Xlib_INCLUDE_PATH) + + IF (X11_Xinput_INCLUDE_PATH AND X11_Xinput_LIB) + SET(X11_Xinput_FOUND TRUE) + SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xinput_INCLUDE_PATH}) + ENDIF (X11_Xinput_INCLUDE_PATH AND X11_Xinput_LIB) + + IF (X11_XSync_INCLUDE_PATH) + SET(X11_XSync_FOUND TRUE) + SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_XSync_INCLUDE_PATH}) + ENDIF (X11_XSync_INCLUDE_PATH) + + IF(X11_ICE_LIB AND X11_ICE_INCLUDE_PATH) + SET(X11_ICE_FOUND TRUE) + ENDIF(X11_ICE_LIB AND X11_ICE_INCLUDE_PATH) + + IF(X11_SM_LIB AND X11_SM_INCLUDE_PATH) + SET(X11_SM_FOUND TRUE) + ENDIF(X11_SM_LIB AND X11_SM_INCLUDE_PATH) + + # Deprecated variable for backwards compatibility with CMake 1.4 + IF (X11_X11_INCLUDE_PATH AND X11_LIBRARIES) + SET(X11_FOUND 1) + ENDIF (X11_X11_INCLUDE_PATH AND X11_LIBRARIES) + + IF(X11_FOUND) + INCLUDE(CheckFunctionExists) + INCLUDE(CheckLibraryExists) + + # Translated from an autoconf-generated configure script. + # See libs.m4 in autoconf's m4 directory. + IF($ENV{ISC} MATCHES "^yes$") + SET(X11_X_EXTRA_LIBS -lnsl_s -linet) + ELSE($ENV{ISC} MATCHES "^yes$") + SET(X11_X_EXTRA_LIBS "") + + # See if XOpenDisplay in X11 works by itself. + CHECK_LIBRARY_EXISTS("${X11_LIBRARIES}" "XOpenDisplay" "${X11_LIBRARY_DIR}" X11_LIB_X11_SOLO) + IF(NOT X11_LIB_X11_SOLO) + # Find library needed for dnet_ntoa. + CHECK_LIBRARY_EXISTS("dnet" "dnet_ntoa" "" X11_LIB_DNET_HAS_DNET_NTOA) + IF (X11_LIB_DNET_HAS_DNET_NTOA) + SET (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -ldnet) + ELSE (X11_LIB_DNET_HAS_DNET_NTOA) + CHECK_LIBRARY_EXISTS("dnet_stub" "dnet_ntoa" "" X11_LIB_DNET_STUB_HAS_DNET_NTOA) + IF (X11_LIB_DNET_STUB_HAS_DNET_NTOA) + SET (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -ldnet_stub) + ENDIF (X11_LIB_DNET_STUB_HAS_DNET_NTOA) + ENDIF (X11_LIB_DNET_HAS_DNET_NTOA) + ENDIF(NOT X11_LIB_X11_SOLO) + + # Find library needed for gethostbyname. + CHECK_FUNCTION_EXISTS("gethostbyname" CMAKE_HAVE_GETHOSTBYNAME) + IF(NOT CMAKE_HAVE_GETHOSTBYNAME) + CHECK_LIBRARY_EXISTS("nsl" "gethostbyname" "" CMAKE_LIB_NSL_HAS_GETHOSTBYNAME) + IF (CMAKE_LIB_NSL_HAS_GETHOSTBYNAME) + SET (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lnsl) + ELSE (CMAKE_LIB_NSL_HAS_GETHOSTBYNAME) + CHECK_LIBRARY_EXISTS("bsd" "gethostbyname" "" CMAKE_LIB_BSD_HAS_GETHOSTBYNAME) + IF (CMAKE_LIB_BSD_HAS_GETHOSTBYNAME) + SET (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lbsd) + ENDIF (CMAKE_LIB_BSD_HAS_GETHOSTBYNAME) + ENDIF (CMAKE_LIB_NSL_HAS_GETHOSTBYNAME) + ENDIF(NOT CMAKE_HAVE_GETHOSTBYNAME) + + # Find library needed for connect. + CHECK_FUNCTION_EXISTS("connect" CMAKE_HAVE_CONNECT) + IF(NOT CMAKE_HAVE_CONNECT) + CHECK_LIBRARY_EXISTS("socket" "connect" "" CMAKE_LIB_SOCKET_HAS_CONNECT) + IF (CMAKE_LIB_SOCKET_HAS_CONNECT) + SET (X11_X_EXTRA_LIBS -lsocket ${X11_X_EXTRA_LIBS}) + ENDIF (CMAKE_LIB_SOCKET_HAS_CONNECT) + ENDIF(NOT CMAKE_HAVE_CONNECT) + + # Find library needed for remove. + CHECK_FUNCTION_EXISTS("remove" CMAKE_HAVE_REMOVE) + IF(NOT CMAKE_HAVE_REMOVE) + CHECK_LIBRARY_EXISTS("posix" "remove" "" CMAKE_LIB_POSIX_HAS_REMOVE) + IF (CMAKE_LIB_POSIX_HAS_REMOVE) + SET (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lposix) + ENDIF (CMAKE_LIB_POSIX_HAS_REMOVE) + ENDIF(NOT CMAKE_HAVE_REMOVE) + + # Find library needed for shmat. + CHECK_FUNCTION_EXISTS("shmat" CMAKE_HAVE_SHMAT) + IF(NOT CMAKE_HAVE_SHMAT) + CHECK_LIBRARY_EXISTS("ipc" "shmat" "" CMAKE_LIB_IPS_HAS_SHMAT) + IF (CMAKE_LIB_IPS_HAS_SHMAT) + SET (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lipc) + ENDIF (CMAKE_LIB_IPS_HAS_SHMAT) + ENDIF(NOT CMAKE_HAVE_SHMAT) + ENDIF($ENV{ISC} MATCHES "^yes$") + + IF (X11_SM_FOUND) + SET (X11_X_PRE_LIBS ${X11_X_PRE_LIBS} ${X11_SM_LIB}) + ENDIF (X11_SM_FOUND) + + IF (X11_ICE_FOUND) + CHECK_LIBRARY_EXISTS("ICE" "IceConnectionNumber" "${X11_LIBRARY_DIR}" + CMAKE_LIB_ICE_HAS_ICECONNECTIONNUMBER) + IF(CMAKE_LIB_ICE_HAS_ICECONNECTIONNUMBER) + SET (X11_X_PRE_LIBS ${X11_X_PRE_LIBS} ${X11_ICE_LIB}) + ENDIF(CMAKE_LIB_ICE_HAS_ICECONNECTIONNUMBER) + ENDIF (X11_ICE_FOUND) + + # Build the final list of libraries. + SET(X11_LIBRARIES ${X11_X_PRE_LIBS} ${X11_LIBRARIES} ${X11_X_EXTRA_LIBS}) + + MESSAGE(STATUS "Found X11: ${X11_X11_LIB}") + ELSE (X11_FOUND) + IF (X11_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "Could not find X11") + ENDIF (X11_FIND_REQUIRED) + ENDIF (X11_FOUND) + + MARK_AS_ADVANCED( + X11_X11_INCLUDE_PATH + X11_X11_LIB + X11_Xext_LIB + X11_Xau_LIB + X11_Xau_INCLUDE_PATH + X11_Xlib_INCLUDE_PATH + X11_Xutil_INCLUDE_PATH + X11_Xcomposite_INCLUDE_PATH + X11_Xcomposite_LIB + X11_Xaccess_INCLUDE_PATH + X11_Xfixes_LIB + X11_Xfixes_INCLUDE_PATH + X11_Xrandr_LIB + X11_Xrandr_INCLUDE_PATH + X11_Xdamage_LIB + X11_Xdamage_INCLUDE_PATH + X11_Xrender_LIB + X11_Xrender_INCLUDE_PATH + X11_Xxf86misc_LIB + X11_xf86misc_INCLUDE_PATH + X11_xf86vmode_INCLUDE_PATH + X11_Xinerama_LIB + X11_Xinerama_INCLUDE_PATH + X11_XTest_LIB + X11_XTest_INCLUDE_PATH + X11_Xcursor_LIB + X11_Xcursor_INCLUDE_PATH + X11_dpms_INCLUDE_PATH + X11_Xt_LIB + X11_Xt_INCLUDE_PATH + X11_Xdmcp_LIB + X11_LIBRARIES + X11_Xaccessrules_INCLUDE_PATH + X11_Xaccessstr_INCLUDE_PATH + X11_Xdmcp_INCLUDE_PATH + X11_Xkb_INCLUDE_PATH + X11_Xkblib_INCLUDE_PATH + X11_Xkbfile_INCLUDE_PATH + X11_Xkbfile_LIB + X11_Xscreensaver_INCLUDE_PATH + X11_Xscreensaver_LIB + X11_Xpm_INCLUDE_PATH + X11_Xpm_LIB + X11_Xinput_LIB + X11_Xinput_INCLUDE_PATH + X11_Xft_LIB + X11_Xft_INCLUDE_PATH + X11_Xshape_INCLUDE_PATH + X11_Xv_LIB + X11_Xv_INCLUDE_PATH + X11_XShm_INCLUDE_PATH + X11_ICE_LIB + X11_ICE_INCLUDE_PATH + X11_SM_LIB + X11_SM_INCLUDE_PATH + X11_XSync_INCLUDE_PATH + ) + SET(CMAKE_FIND_FRAMEWORK ${CMAKE_FIND_FRAMEWORK_SAVE}) +ENDIF (UNIX) + +# X11_FIND_REQUIRED_ could be checked too diff --git a/cmake/modules/FindXKB.cmake b/cmake/modules/FindXKB.cmake new file mode 100644 index 0000000000..a91078ad37 --- /dev/null +++ b/cmake/modules/FindXKB.cmake @@ -0,0 +1,15 @@ +# + + find_path(X11_XKB_INCLUDE_PATH X11/XKBlib.h "${X11_INC_SEARCH_PATH}") + if (X11_XKB_INCLUDE_PATH) + MACRO_PUSH_REQUIRED_VARS() + set(CMAKE_REQUIRED_LIBRARIES "${X11_LIBRARIES} ${CMAKE_REQUIRED_LIBRARIES}") + check_library_exists(X11 XkbLockModifiers "" HAVE_XKB) + MACRO_POP_REQUIRED_VARS() + if (HAVE_XKB) + set(XKB_FOUND TRUE) + endif (HAVE_XKB) + endif (X11_XKB_INCLUDE_PATH) + + + diff --git a/cmake/modules/FindXine.cmake b/cmake/modules/FindXine.cmake new file mode 100644 index 0000000000..1223851b17 --- /dev/null +++ b/cmake/modules/FindXine.cmake @@ -0,0 +1,64 @@ +# - Try to find the XINE library +# Once done this will define +# +# XINE_FOUND - system has the XINE library +# XINE_VERSION - XINE version +# XINE_BUGFIX_VERSION - the XINE bugfix version +# XINE_INCLUDE_DIR - the XINE include directory +# XINE_LIBRARY - The libraries needed to use XINE +# XINE_XCB_FOUND - libxine can use XCB for video output + +# Copyright (c) 2006,2007 Laurent Montel, +# Copyright (c) 2006, Matthias Kretz, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +if (XINE_INCLUDE_DIR AND XINE_LIBRARY) + # Already in cache, be silent + set(Xine_FIND_QUIETLY TRUE) +endif (XINE_INCLUDE_DIR AND XINE_LIBRARY) + +find_package(PkgConfig) +if (PKG_CONFIG_FOUND) + pkg_check_modules(PC_LIBXINE libxine) +endif (PKG_CONFIG_FOUND) + +find_path(XINE_INCLUDE_DIR NAMES xine.h + HINTS # HINTS is new in cmake 2.6. These dirs will be preferred over the default ones + ${PC_LIBXINE_INCLUDEDIR} + ${PC_LIBXINE_INCLUDE_DIRS} + ) + +find_library(XINE_LIBRARY NAMES xine + HINTS + ${PC_LIBXINE_LIBDIR} + ${PC_LIBXINE_LIBRARY_DIRS} + ) + +find_program(XINECONFIG_EXECUTABLE NAMES xine-config + HINTS + ${PC_LIBXINE_PREFIX}/bin +) + +if (XINE_INCLUDE_DIR AND XINE_LIBRARY AND XINECONFIG_EXECUTABLE) + exec_program(${XINECONFIG_EXECUTABLE} ARGS --version RETURN_VALUE _return_VALUE OUTPUT_VARIABLE XINE_VERSION) + if("${XINE_VERSION}" VERSION_GREATER "1.1.0") #if (... VERSION_GREATER) is new since cmake 2.6.2 + set(XINE_VERSION_OK TRUE) + string(REGEX REPLACE "[0-9]\\.[0-9]\\." "" XINE_BUGFIX_VERSION ${XINE_VERSION}) + endif("${XINE_VERSION}" VERSION_GREATER "1.1.0") +endif (XINE_INCLUDE_DIR AND XINE_LIBRARY AND XINECONFIG_EXECUTABLE) + + +if( XINE_VERSION_OK) + include(CheckCSourceCompiles) + set(CMAKE_REQUIRED_INCLUDES ${XINE_INCLUDE_DIR}) + set(CMAKE_REQUIRED_LIBRARIES ${XINE_LIBRARY}) + check_c_source_compiles("#include \nint main()\n{\n xine_open_video_driver(xine_new(), \"auto\", XINE_VISUAL_TYPE_XCB, NULL);\n return 0;\n}\n" XINE_XCB_FOUND) + set(XINE_FOUND TRUE) +endif(XINE_VERSION_OK) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Xine "Could NOT find XINE 1.1.1 or greater" XINE_INCLUDE_DIR XINE_LIBRARY XINECONFIG_EXECUTABLE XINE_VERSION_OK) + +mark_as_advanced(XINE_INCLUDE_DIR XINE_LIBRARY XINECONFIG_EXECUTABLE) diff --git a/cmake/modules/FindXmms.cmake b/cmake/modules/FindXmms.cmake new file mode 100644 index 0000000000..c43893fbb8 --- /dev/null +++ b/cmake/modules/FindXmms.cmake @@ -0,0 +1,44 @@ +# Search xmms +# Once done this will define +# +# XMMS_FOUND - system has xmms +# XMMS_INCLUDE_DIRS - the xmms include directory +# XMMS_LIBRARIES - Link these to use xmms +# XMMS_LDFLAGS - for compatibility only, same as XMMS_LIBRARIES + +# Copyright (c) 2006, 2007 Laurent Montel, +# Copyright (c) 2007 Allen Winter +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +if (XMMS_INCLUDE_DIRS AND XMMS_LIBRARIES) + # in cache already + set(XMMS_FOUND TRUE) + +else (XMMS_INCLUDE_DIRS AND XMMS_LIBRARIES) + if (NOT WIN32) + # use pkg-config to get the directories and then use these values + # in the FIND_PATH() and FIND_LIBRARY() calls + find_package(PkgConfig) + + pkg_check_modules(PC_XMMS xmms) + endif(NOT WIN32) + + find_path(XMMS_INCLUDE_DIRS xmmsctrl.h + PATHS ${PC_XMMS_INCLUDEDIR} ${PC_XMMS_INCLUDE_DIRS} + PATH_SUFFIXES xmms) + + find_library(XMMS_LIBRARIES NAMES xmms + PATHS ${PC_XMMS_LIBDIR} ${PC_XMMS_LIBRARY_DIRS}) + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(Xmms DEFAULT_MSG + XMMS_LIBRARIES XMMS_INCLUDE_DIRS) + + mark_as_advanced(XMMS_INCLUDE_DIRS XMMS_LIBRARIES) + +endif (XMMS_INCLUDE_DIRS AND XMMS_LIBRARIES) + +# for compatibility +set(XMMS_LDFLAGS ${XMMS_LIBRARIES}) diff --git a/cmake/modules/KDE4CTestNightlySetup.cmake b/cmake/modules/KDE4CTestNightlySetup.cmake new file mode 100644 index 0000000000..4c21a58345 --- /dev/null +++ b/cmake/modules/KDE4CTestNightlySetup.cmake @@ -0,0 +1,102 @@ +# The following variables have to be set before including this file: +# CTEST_CMAKE_GENERATOR +# CTEST_UPDATE_TYPE (if update from cvs or svn is required) +# SVN_REPOSITORY or CVS_REPOSITORY and CVS_MODULE +# +# If the project doesn't build with spaces in the path, do the following: +# set(CTEST_AVOID_SPACES TRUE) +# +# After this file has been included, the regular new style ctest +# scripting commands can be used, e.g. +# +# ctest_empty_binary_directory("${CTEST_BINARY_DIRECTORY}") +# ctest_start(Nightly) +# ctest_update(SOURCE "${CTEST_SOURCE_DIRECTORY}" ) +# ctest_configure(BUILD "${CTEST_BINARY_DIRECTORY}" ) +# ctest_build(BUILD "${CTEST_BINARY_DIRECTORY}" ) +# ctest_test(BUILD "${CTEST_BINARY_DIRECTORY}" ) +# ctest_submit() + + + + +set(currentDirectory "${CTEST_SCRIPT_DIRECTORY}") + +if(NOT EXISTS "${currentDirectory}/CMakeLists.txt") + message(FATAL_ERROR "This macro must be called from a cmake script in the source tree of your project.") +endif(NOT EXISTS "${currentDirectory}/CMakeLists.txt") + +include("${currentDirectory}/CTestConfig.cmake") +include("${currentDirectory}/CTestCustom.cmake" OPTIONAL) + +# Set up the directories where the dashboards will be created +# By default this will be "$HOME/Dashboards//(src|build) dir". +# It can be overriden by the user. +set(DASHBOARD_DIR "$ENV{HOME}/Dashboards" ) + +if(NOT DEFINED CTEST_SOURCE_DIRECTORY) + if(CTEST_AVOID_SPACES) + set(CTEST_SOURCE_DIRECTORY "${DASHBOARD_DIR}/${CTEST_PROJECT_NAME}/srcdir" ) + else(CTEST_AVOID_SPACES) + set(CTEST_SOURCE_DIRECTORY "${DASHBOARD_DIR}/${CTEST_PROJECT_NAME}/src dir" ) + endif(CTEST_AVOID_SPACES) +endif(NOT DEFINED CTEST_SOURCE_DIRECTORY) + +if(NOT DEFINED CTEST_BINARY_DIRECTORY) + if(CTEST_AVOID_SPACES) + set(CTEST_BINARY_DIRECTORY "${DASHBOARD_DIR}/${CTEST_PROJECT_NAME}/builddir" ) + else(CTEST_AVOID_SPACES) + set(CTEST_BINARY_DIRECTORY "${DASHBOARD_DIR}/${CTEST_PROJECT_NAME}/build dir" ) + endif(CTEST_AVOID_SPACES) +endif(NOT DEFINED CTEST_BINARY_DIRECTORY) + + + +site_name(CTEST_SITE) +if(NOT DEFINED CTEST_BUILD_NAME) + set(CTEST_BUILD_NAME ${CMAKE_SYSTEM_NAME}) +endif(NOT DEFINED CTEST_BUILD_NAME) + +if("${CTEST_CMAKE_GENERATOR}" MATCHES Makefile) + find_program(MAKE_EXECUTABLE make gmake) + set(CTEST_BUILD_COMMAND "${MAKE_EXECUTABLE}" ) +else("${CTEST_CMAKE_GENERATOR}" MATCHES Makefile) + if(NOT DEFINED CTEST_BUILD_COMMAND) + message(FATAL_ERROR "CTEST_CMAKE_GENERATOR is set to \"${CTEST_CMAKE_GENERATOR}\", but CTEST_BUILD_COMMAND has not been set") + endif(NOT DEFINED CTEST_BUILD_COMMAND) +endif("${CTEST_CMAKE_GENERATOR}" MATCHES Makefile) + +# set up version control + +string(TOLOWER ${CTEST_UPDATE_TYPE} _ctest_vcs) +set(_have_vcs FALSE) + +if ("${_ctest_vcs}" STREQUAL svn) + find_program(SVN_EXECUTABLE svn) + if (NOT SVN_EXECUTABLE) + message(FATAL_ERROR "Error: CTEST_UPDATE_TYPE is svn, but could not find svn executable") + endif (NOT SVN_EXECUTABLE) + if(NOT SVN_REPOSITORY) + message(FATAL_ERROR "Error: CTEST_UPDATE_TYPE is svn, but SVN_REPOSITORY is not set") + endif(NOT SVN_REPOSITORY) + set(CTEST_UPDATE_COMMAND ${SVN_EXECUTABLE}) + set(CTEST_CHECKOUT_COMMAND "${SVN_EXECUTABLE} co ${SVN_REPOSITORY} \"${CTEST_SOURCE_DIRECTORY}\"") + set(_have_vcs TRUE) +endif ("${_ctest_vcs}" STREQUAL svn) + +if ("${_ctest_vcs}" STREQUAL cvs) + find_program(CVS_EXECUTABLE cvs cvsnt) + if (NOT CVS_EXECUTABLE) + message(FATAL_ERROR "Error: CTEST_UPDATE_TYPE is cvs, but could not find cvs or cvsnt executable") + endif (NOT CVS_EXECUTABLE) + if (NOT CVS_REPOSITORY) + message(FATAL_ERROR "Error: CTEST_UPDATE_TYPE is cvs, but CVS_REPOSITORY is not set") + endif (NOT CVS_REPOSITORY) + if (NOT CVS_MODULE) + message(FATAL_ERROR "Error: CTEST_UPDATE_TYPE is cvs, but CVS_MODULE is not set") + endif (NOT CVS_MODULE) + + set(CTEST_UPDATE_COMMAND ${CVS_EXECUTABLE}) + set(CTEST_CHECKOUT_COMMAND "${CVS_EXECUTABLE} -d ${CVS_REPOSITORY} co -d \"${CTEST_SOURCE_DIRECTORY}\" ${CVS_MODULE}") + set(_have_vcs TRUE) +endif ("${_ctest_vcs}" STREQUAL cvs) diff --git a/cmake/modules/KDE4Defaults.cmake b/cmake/modules/KDE4Defaults.cmake new file mode 100644 index 0000000000..de56a822e5 --- /dev/null +++ b/cmake/modules/KDE4Defaults.cmake @@ -0,0 +1,41 @@ + +enable_testing() + +# support for Dart: http://public.kitware.com/dashboard.php?name=kde +if (EXISTS ${CMAKE_SOURCE_DIR}/CTestConfig.cmake) + include(CTest) +endif (EXISTS ${CMAKE_SOURCE_DIR}/CTestConfig.cmake) + +# Always include srcdir and builddir in include path +# This saves typing ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY} in about every subdir +# since cmake 2.4.0 +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +# put the include dirs which are in the source or build tree +# before all other include dirs, so the headers in the sources +# are prefered over the already installed ones +# since cmake 2.4.1 +set(CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE ON) + +# Use colored output +# since cmake 2.4.0 +set(CMAKE_COLOR_MAKEFILE ON) + +# define the generic version of the libraries here +# this makes it easy to advance it when the next KDE release comes +# Use this version number for libraries which are at version n in KDE version n +set(GENERIC_LIB_VERSION "4.2.0") +set(GENERIC_LIB_SOVERSION "4") + +# Use this version number for libraries which are already at version n+1 in KDE version n +set(KDE_NON_GENERIC_LIB_VERSION "5.2.0") +set(KDE_NON_GENERIC_LIB_SOVERSION "5") + +# windows does not support LD_LIBRARY_PATH or similar +# all searchable directories has to be defined by the PATH environment var +# to reduce the number of required pathes executables are placed into +# the build bin dir +if (WIN32) + set (EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin) +# set (LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin) +endif(WIN32) diff --git a/cmake/modules/KDE4Macros.cmake b/cmake/modules/KDE4Macros.cmake new file mode 100644 index 0000000000..5533284b4a --- /dev/null +++ b/cmake/modules/KDE4Macros.cmake @@ -0,0 +1,1150 @@ +# for documentation look at FindKDE4Internal.cmake + +# this file contains the following macros (or functions): +# KDE4_ADD_UI_FILES +# KDE4_ADD_UI3_FILES +# KDE4_ADD_KCFG_FILES +# _KDE4_SET_CUSTOM_TARGET_PROPERTY +# _KDE4_GET_CUSTOM_TARGET_PROPERTY +# KDE4_MOC_HEADERS +# KDE4_HANDLE_AUTOMOC +# KDE4_CREATE_FINAL_FILES +# KDE4_ADD_PLUGIN +# KDE4_ADD_KDEINIT_EXECUTABLE +# KDE4_ADD_UNIT_TEST +# KDE4_ADD_EXECUTABLE +# KDE4_ADD_WIDGET_FILES +# KDE4_UPDATE_ICONCACHE +# KDE4_INSTALL_ICONS +# KDE4_REMOVE_OBSOLETE_CMAKE_FILES +# KDE4_NO_ENABLE_FINAL +# KDE4_CREATE_HANDBOOK +# KDE4_ADD_APP_ICON +# KDE4_CREATE_MANPAGE +# KDE4_CREATE_BASIC_CMAKE_VERSION_FILE (function) + +# Copyright (c) 2006-2009 Alexander Neundorf, +# Copyright (c) 2006, 2007, Laurent Montel, +# Copyright (c) 2007 Matthias Kretz +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + + +# This is for versions of automoc4 which don't provide these two macros. +# If such a version is used, just use the "old" style automoc handling. +if(NOT COMMAND _AUTOMOC4_KDE4_PRE_TARGET_HANDLING) + + macro(_AUTOMOC4_KDE4_PRE_TARGET_HANDLING _target _srcs) + if(MSVC) + add_automoc4_target("${_target}_automoc" ${_srcs}) + else(MSVC) + automoc4(${_target} ${_srcs} ) + endif(MSVC) + endmacro(_AUTOMOC4_KDE4_PRE_TARGET_HANDLING) + + + macro(_AUTOMOC4_KDE4_POST_TARGET_HANDLING _target) + if(MSVC) + add_dependencies(${_target} "${_target}_automoc") + endif(MSVC) + endmacro(_AUTOMOC4_KDE4_POST_TARGET_HANDLING) + +endif(NOT COMMAND _AUTOMOC4_KDE4_PRE_TARGET_HANDLING) + + +macro (KDE4_ADD_KCFG_FILES _sources ) + if( ${ARGV1} STREQUAL "GENERATE_MOC" ) + set(_kcfg_generatemoc TRUE) + endif( ${ARGV1} STREQUAL "GENERATE_MOC" ) + + foreach (_current_FILE ${ARGN}) + + if(NOT ${_current_FILE} STREQUAL "GENERATE_MOC") + get_filename_component(_tmp_FILE ${_current_FILE} ABSOLUTE) + get_filename_component(_abs_PATH ${_tmp_FILE} PATH) + get_filename_component(_basename ${_tmp_FILE} NAME_WE) + + file(READ ${_tmp_FILE} _contents) + string(REGEX REPLACE "^(.*\n)?File=([^\n]+kcfg).*\n.*$" "\\2" _kcfg_FILE "${_contents}") + set(_src_FILE ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.cpp) + set(_header_FILE ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.h) + set(_moc_FILE ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.moc) + + # the command for creating the source file from the kcfg file + add_custom_command(OUTPUT ${_header_FILE} ${_src_FILE} + COMMAND ${KDE4_KCFGC_EXECUTABLE} + ARGS ${_abs_PATH}/${_kcfg_FILE} ${_tmp_FILE} -d ${CMAKE_CURRENT_BINARY_DIR} + MAIN_DEPENDENCY ${_tmp_FILE} + DEPENDS ${_abs_PATH}/${_kcfg_FILE} ${_KDE4_KCONFIG_COMPILER_DEP} ) + + if(_kcfg_generatemoc) + qt4_generate_moc(${_header_FILE} ${_moc_FILE} ) + set_source_files_properties(${_src_FILE} PROPERTIES SKIP_AUTOMOC TRUE) # don't run automoc on this file + list(APPEND ${_sources} ${_moc_FILE}) + endif(_kcfg_generatemoc) + + list(APPEND ${_sources} ${_src_FILE} ${_header_FILE}) + endif(NOT ${_current_FILE} STREQUAL "GENERATE_MOC") + endforeach (_current_FILE) + +endmacro (KDE4_ADD_KCFG_FILES) + + +get_filename_component(KDE4_MODULE_DIR ${CMAKE_CURRENT_LIST_FILE} PATH) + +#create the implementation files from the ui files and add them to the list of sources +#usage: KDE4_ADD_UI_FILES(foo_SRCS ${ui_files}) +macro (KDE4_ADD_UI_FILES _sources ) + foreach (_current_FILE ${ARGN}) + + get_filename_component(_tmp_FILE ${_current_FILE} ABSOLUTE) + get_filename_component(_basename ${_tmp_FILE} NAME_WE) + set(_header ${CMAKE_CURRENT_BINARY_DIR}/ui_${_basename}.h) + + # we need to run uic and replace some things in the generated file + # this is done by executing the cmake script kde4uic.cmake + add_custom_command(OUTPUT ${_header} + COMMAND ${CMAKE_COMMAND} + ARGS + -DKDE4_HEADER:BOOL=ON + -DKDE_UIC_EXECUTABLE:FILEPATH=${QT_UIC_EXECUTABLE} + -DKDE_UIC_FILE:FILEPATH=${_tmp_FILE} + -DKDE_UIC_H_FILE:FILEPATH=${_header} + -DKDE_UIC_BASENAME:STRING=${_basename} + -P ${KDE4_MODULE_DIR}/kde4uic.cmake + MAIN_DEPENDENCY ${_tmp_FILE} + ) + list(APPEND ${_sources} ${_header}) + endforeach (_current_FILE) +endmacro (KDE4_ADD_UI_FILES) + + +#create the implementation files from the ui files and add them to the list of sources +#usage: KDE4_ADD_UI3_FILES(foo_SRCS ${ui_files}) +macro (KDE4_ADD_UI3_FILES _sources ) + + qt4_get_moc_inc_dirs(_moc_INCS) + + foreach (_current_FILE ${ARGN}) + + get_filename_component(_tmp_FILE ${_current_FILE} ABSOLUTE) + get_filename_component(_basename ${_tmp_FILE} NAME_WE) + set(_header ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.h) + set(_src ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.cpp) + set(_moc ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.moc.cpp) + + add_custom_command(OUTPUT ${_header} + COMMAND ${CMAKE_COMMAND} + -DKDE3_HEADER:BOOL=ON + -DKDE_UIC_EXECUTABLE:FILEPATH=${QT_UIC3_EXECUTABLE} + -DKDE_UIC_FILE:FILEPATH=${_tmp_FILE} + -DKDE_UIC_H_FILE:FILEPATH=${_header} + -DKDE_UIC_BASENAME:STRING=${_basename} + -DKDE_UIC_PLUGIN_DIR:FILEPATH="." + -P ${KDE4_MODULE_DIR}/kde4uic.cmake + MAIN_DEPENDENCY ${_tmp_FILE} + ) + +# we need to run uic3 and replace some things in the generated file + # this is done by executing the cmake script kde4uic.cmake + add_custom_command(OUTPUT ${_src} + COMMAND ${CMAKE_COMMAND} + ARGS + -DKDE3_IMPL:BOOL=ON + -DKDE_UIC_EXECUTABLE:FILEPATH=${QT_UIC3_EXECUTABLE} + -DKDE_UIC_FILE:FILEPATH=${_tmp_FILE} + -DKDE_UIC_CPP_FILE:FILEPATH=${_src} + -DKDE_UIC_H_FILE:FILEPATH=${_header} + -DKDE_UIC_BASENAME:STRING=${_basename} + -DKDE_UIC_PLUGIN_DIR:FILEPATH="." + -P ${KDE4_MODULE_DIR}/kde4uic.cmake + MAIN_DEPENDENCY ${_header} + ) + + add_custom_command(OUTPUT ${_moc} + COMMAND ${QT_MOC_EXECUTABLE} + ARGS ${_moc_INCS} ${_header} -o ${_moc} + MAIN_DEPENDENCY ${_header} + ) + list(APPEND ${_sources} ${_src} ${_moc} ) + + endforeach (_current_FILE) +endmacro (KDE4_ADD_UI3_FILES) + +macro (_KDE4_SET_CUSTOM_TARGET_PROPERTY _target_name _property_name _property) + string(REGEX REPLACE "[/ ]" "_" _dir "${CMAKE_CURRENT_SOURCE_DIR}") + set(_kde4_${_dir}_${_target_name}_${_property_name} "${_property}") +endmacro (_KDE4_SET_CUSTOM_TARGET_PROPERTY) + + +macro (_KDE4_GET_CUSTOM_TARGET_PROPERTY _var _target_name _property_name) + string(REGEX REPLACE "[/ ]" "_" _dir "${CMAKE_CURRENT_SOURCE_DIR}") + set(${_var} "${_kde4_${_dir}_${_target_name}_${_property_name}}") +endmacro (_KDE4_GET_CUSTOM_TARGET_PROPERTY) + + +macro (KDE4_MOC_HEADERS _target_NAME) + # if automoc4 from kdesupport has been found, use the macro provided there + automoc4_moc_headers(${_target_NAME} ${ARGN}) +endmacro (KDE4_MOC_HEADERS) + +macro(KDE4_HANDLE_AUTOMOC _target_NAME _SRCS) + # if automoc4 from kdesupport has been found, use the macro provided there + automoc4(${_target_NAME} ${_SRCS}) +endmacro(KDE4_HANDLE_AUTOMOC) + +macro(KDE4_INSTALL_TS_FILES _lang _sdir) + file(GLOB_RECURSE _ts_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${_sdir}/*) + foreach(_current_TS_FILES ${_ts_files}) + string(REGEX MATCH "\\.svn/" _in_svn ${_current_TS_FILES}) + if(NOT _in_svn) + get_filename_component(_subpath ${_current_TS_FILES} PATH) + install(FILES ${_current_TS_FILES} DESTINATION ${LOCALE_INSTALL_DIR}/${_lang}/LC_SCRIPTS/${_subpath}) + endif(NOT _in_svn) + endforeach(_current_TS_FILES) +endmacro(KDE4_INSTALL_TS_FILES) + + +macro (KDE4_CREATE_HANDBOOK _docbook) + get_filename_component(_input ${_docbook} ABSOLUTE) + set(_doc ${CMAKE_CURRENT_BINARY_DIR}/index.cache.bz2) + + #Bootstrap + if (_kdeBootStrapping) + set(_ssheet ${CMAKE_SOURCE_DIR}/kdoctools/customization/kde-chunk.xsl) + set(_bootstrapOption "--srcdir=${CMAKE_SOURCE_DIR}/kdoctools/") + else (_kdeBootStrapping) + set(_ssheet ${KDE4_DATA_INSTALL_DIR}/ksgmltools2/customization/kde-chunk.xsl) + set(_bootstrapOption) + endif (_kdeBootStrapping) + + file(GLOB _docs *.docbook) + add_custom_command(OUTPUT ${_doc} + COMMAND ${KDE4_MEINPROC_EXECUTABLE} --check ${_bootstrapOption} --cache ${_doc} ${_input} + DEPENDS ${_docs} ${_KDE4_MEINPROC_EXECUTABLE_DEP} ${_ssheet} + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + ) + get_filename_component(_targ ${CMAKE_CURRENT_SOURCE_DIR} NAME) + set(_targ "${_targ}-handbook") + add_custom_target(${_targ} ALL DEPENDS ${_doc}) + + if(KDE4_ENABLE_HTMLHANDBOOK) + set(_htmlDoc ${CMAKE_CURRENT_SOURCE_DIR}/index.html) + add_custom_command(OUTPUT ${_htmlDoc} + COMMAND ${KDE4_MEINPROC_EXECUTABLE} --check ${_bootstrapOption} -o ${_htmlDoc} ${_input} + DEPENDS ${_input} ${_KDE4_MEINPROC_EXECUTABLE_DEP} ${_ssheet} + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + ) + add_custom_target(htmlhandbook DEPENDS ${_htmlDoc}) + endif(KDE4_ENABLE_HTMLHANDBOOK) + + set(_args ${ARGN}) + + set(_installDest) + if(_args) + list(GET _args 0 _tmp) + if("${_tmp}" STREQUAL "INSTALL_DESTINATION") + list(GET _args 1 _installDest ) + list(REMOVE_AT _args 0 1) + endif("${_tmp}" STREQUAL "INSTALL_DESTINATION") + endif(_args) + + get_filename_component(dirname ${CMAKE_CURRENT_SOURCE_DIR} NAME_WE) + if(_args) + list(GET _args 0 _tmp) + if("${_tmp}" STREQUAL "SUBDIR") + list(GET _args 1 dirname ) + list(REMOVE_AT _args 0 1) + endif("${_tmp}" STREQUAL "SUBDIR") + endif(_args) + + if(_installDest) + file(GLOB _images *.png) + install(FILES ${_doc} ${_docs} ${_images} DESTINATION ${_installDest}/${dirname}) + # TODO symlinks on non-unix platforms + if (UNIX) + # execute some cmake code on make install which creates the symlink + install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink \"${_installDest}/common\" \"\$ENV{DESTDIR}${_installDest}/${dirname}/common\" )" ) + endif (UNIX) + endif(_installDest) + +endmacro (KDE4_CREATE_HANDBOOK) + + +macro (KDE4_CREATE_MANPAGE _docbook _section) + get_filename_component(_input ${_docbook} ABSOLUTE) + get_filename_component(_base ${_input} NAME) + + string(REGEX REPLACE "\\.${_section}\\.docbook$" "" _base ${_base}) + + set(_doc ${CMAKE_CURRENT_BINARY_DIR}/${_base}.${_section}) + # sometimes we have "man-" prepended + string(REGEX REPLACE "/man-" "/" _outdoc ${_doc}) + + #Bootstrap + if (_kdeBootStrapping) + set(_ssheet "${CMAKE_SOURCE_DIR}/kdoctools/docbook/xsl/manpages/docbook.xsl") + set(_bootstrapOption "--srcdir=${CMAKE_SOURCE_DIR}/kdoctools/") + else (_kdeBootStrapping) + set(_ssheet "${KDE4_DATA_INSTALL_DIR}/ksgmltools2/docbook/xsl/manpages/docbook.xsl") + set(_bootstrapOption) + endif (_kdeBootStrapping) + + add_custom_command(OUTPUT ${_outdoc} + COMMAND ${KDE4_MEINPROC_EXECUTABLE} --stylesheet ${_ssheet} --check ${_bootstrapOption} ${_input} + DEPENDS ${_input} ${_KDE4_MEINPROC_EXECUTABLE_DEP} ${_ssheet} + ) + get_filename_component(_targ ${CMAKE_CURRENT_SOURCE_DIR} NAME) + set(_targ "${_targ}-manpage-${_base}") + add_custom_target(${_targ} ALL DEPENDS "${_outdoc}") + + set(_args ${ARGN}) + + set(_installDest) + if(_args) + list(GET _args 0 _tmp) + if("${_tmp}" STREQUAL "INSTALL_DESTINATION") + list(GET _args 1 _installDest ) + list(REMOVE_AT _args 0 1) + endif("${_tmp}" STREQUAL "INSTALL_DESTINATION") + endif(_args) + + get_filename_component(dirname ${CMAKE_CURRENT_SOURCE_DIR} NAME_WE) + if(_args) + list(GET _args 0 _tmp) + if("${_tmp}" STREQUAL "SUBDIR") + list(GET _args 1 dirname ) + list(REMOVE_AT _args 0 1) + endif("${_tmp}" STREQUAL "SUBDIR") + endif(_args) + + if(_installDest) + install(FILES ${_outdoc} DESTINATION ${_installDest}/man${_section}) + endif(_installDest) +endmacro (KDE4_CREATE_MANPAGE) + + +macro (KDE4_UPDATE_ICONCACHE) + # Update mtime of hicolor icon theme dir. + # We don't always have touch command (e.g. on Windows), so instead create + # and delete a temporary file in the theme dir. + install(CODE " + set(DESTDIR_VALUE \"\$ENV{DESTDIR}\") + if (NOT DESTDIR_VALUE) + file(WRITE \"${ICON_INSTALL_DIR}/hicolor/temp.txt\" \"update\") + file(REMOVE \"${ICON_INSTALL_DIR}/hicolor/temp.txt\") + endif (NOT DESTDIR_VALUE) + ") +endmacro (KDE4_UPDATE_ICONCACHE) + +# a "map" of short type names to the directories +# unknown names should give empty results +# KDE 3 compatibility +set(_KDE4_ICON_GROUP_mime "mimetypes") +set(_KDE4_ICON_GROUP_filesys "places") +set(_KDE4_ICON_GROUP_device "devices") +set(_KDE4_ICON_GROUP_app "apps") +set(_KDE4_ICON_GROUP_action "actions") +# KDE 4 / icon naming specification compatibility +set(_KDE4_ICON_GROUP_mimetypes "mimetypes") +set(_KDE4_ICON_GROUP_places "places") +set(_KDE4_ICON_GROUP_devices "devices") +set(_KDE4_ICON_GROUP_apps "apps") +set(_KDE4_ICON_GROUP_actions "actions") +set(_KDE4_ICON_GROUP_categories "categories") +set(_KDE4_ICON_GROUP_status "status") +set(_KDE4_ICON_GROUP_emblems "emblems") +set(_KDE4_ICON_GROUP_emotes "emotes") +set(_KDE4_ICON_GROUP_animations "animations") +set(_KDE4_ICON_GROUP_intl "intl") + +# a "map" of short theme names to the theme directory +set(_KDE4_ICON_THEME_ox "oxygen") +set(_KDE4_ICON_THEME_cr "crystalsvg") +set(_KDE4_ICON_THEME_lo "locolor") +set(_KDE4_ICON_THEME_hi "hicolor") + + +# only used internally by KDE4_INSTALL_ICONS +macro (_KDE4_ADD_ICON_INSTALL_RULE _install_SCRIPT _install_PATH _group _orig_NAME _install_NAME _l10n_SUBDIR) + + # if the string doesn't match the pattern, the result is the full string, so all three have the same content + if (NOT ${_group} STREQUAL ${_install_NAME} ) + set(_icon_GROUP ${_KDE4_ICON_GROUP_${_group}}) + if(NOT _icon_GROUP) + set(_icon_GROUP "actions") + endif(NOT _icon_GROUP) +# message(STATUS "icon: ${_current_ICON} size: ${_size} group: ${_group} name: ${_name} l10n: ${_l10n_SUBDIR}") + install(FILES ${_orig_NAME} DESTINATION ${_install_PATH}/${_icon_GROUP}/${_l10n_SUBDIR}/ RENAME ${_install_NAME} ) + endif (NOT ${_group} STREQUAL ${_install_NAME} ) + +endmacro (_KDE4_ADD_ICON_INSTALL_RULE) + + +macro (KDE4_INSTALL_ICONS _defaultpath ) + + # the l10n-subdir if language given as second argument (localized icon) + set(_lang ${ARGV1}) + if(_lang) + set(_l10n_SUBDIR l10n/${_lang}) + else(_lang) + set(_l10n_SUBDIR ".") + endif(_lang) + + # first the png icons + file(GLOB _icons *.png) + foreach (_current_ICON ${_icons} ) + # since CMake 2.6 regex matches are stored in special variables CMAKE_MATCH_x, if it didn't match, they are empty + string(REGEX MATCH "^.*/([a-zA-Z]+)([0-9]+)\\-([a-z]+)\\-(.+\\.png)$" _dummy "${_current_ICON}") + set(_type "${CMAKE_MATCH_1}") + set(_size "${CMAKE_MATCH_2}") + set(_group "${CMAKE_MATCH_3}") + set(_name "${CMAKE_MATCH_4}") + + set(_theme_GROUP ${_KDE4_ICON_THEME_${_type}}) + if( _theme_GROUP) + _KDE4_ADD_ICON_INSTALL_RULE(${CMAKE_CURRENT_BINARY_DIR}/install_icons.cmake + ${_defaultpath}/${_theme_GROUP}/${_size}x${_size} + ${_group} ${_current_ICON} ${_name} ${_l10n_SUBDIR}) + endif( _theme_GROUP) + endforeach (_current_ICON) + + # mng icons + file(GLOB _icons *.mng) + foreach (_current_ICON ${_icons} ) + # since CMake 2.6 regex matches are stored in special variables CMAKE_MATCH_x, if it didn't match, they are empty + string(REGEX MATCH "^.*/([a-zA-Z]+)([0-9]+)\\-([a-z]+)\\-(.+\\.mng)$" _dummy "${_current_ICON}") + set(_type "${CMAKE_MATCH_1}") + set(_size "${CMAKE_MATCH_2}") + set(_group "${CMAKE_MATCH_3}") + set(_name "${CMAKE_MATCH_4}") + + set(_theme_GROUP ${_KDE4_ICON_THEME_${_type}}) + if( _theme_GROUP) + _KDE4_ADD_ICON_INSTALL_RULE(${CMAKE_CURRENT_BINARY_DIR}/install_icons.cmake + ${_defaultpath}/${_theme_GROUP}/${_size}x${_size} + ${_group} ${_current_ICON} ${_name} ${_l10n_SUBDIR}) + endif( _theme_GROUP) + endforeach (_current_ICON) + + # and now the svg icons + file(GLOB _icons *.svgz) + foreach (_current_ICON ${_icons} ) + # since CMake 2.6 regex matches are stored in special variables CMAKE_MATCH_x, if it didn't match, they are empty + string(REGEX MATCH "^.*/([a-zA-Z]+)sc\\-([a-z]+)\\-(.+\\.svgz)$" _dummy "${_current_ICON}") + set(_type "${CMAKE_MATCH_1}") + set(_group "${CMAKE_MATCH_2}") + set(_name "${CMAKE_MATCH_3}") + + set(_theme_GROUP ${_KDE4_ICON_THEME_${_type}}) + if( _theme_GROUP) + _KDE4_ADD_ICON_INSTALL_RULE(${CMAKE_CURRENT_BINARY_DIR}/install_icons.cmake + ${_defaultpath}/${_theme_GROUP}/scalable + ${_group} ${_current_ICON} ${_name} ${_l10n_SUBDIR}) + endif( _theme_GROUP) + endforeach (_current_ICON) + + kde4_update_iconcache() + +endmacro (KDE4_INSTALL_ICONS) + + +# For all C++ sources a big source file which includes all the files +# is created. +# This is not done for the C sources, they are just gathered in a separate list +# because they are usually not written by KDE and as such not intended to be +# compiled all-in-one. +macro (KDE4_CREATE_FINAL_FILES _filenameCPP _filesExcludedFromFinalFile ) + set(${_filesExcludedFromFinalFile}) + file(WRITE "${_filenameCPP}" "//autogenerated file\n") + foreach (_current_FILE ${ARGN}) + get_filename_component(_abs_FILE "${_current_FILE}" ABSOLUTE) + # don't include any generated files in the final-file + # because then cmake will not know the dependencies + get_source_file_property(_isGenerated "${_abs_FILE}" GENERATED) + if (_isGenerated) + list(APPEND ${_filesExcludedFromFinalFile} "${_abs_FILE}") + else (_isGenerated) + # only put C++ files in the final-file + if("${_abs_FILE}" MATCHES ".+\\.(cpp|cc|cxx|C)$") + file(APPEND "${_filenameCPP}" "#include \"${_abs_FILE}\"\n") + else("${_abs_FILE}" MATCHES ".+\\.(cpp|cc|cxx|C)$") + list(APPEND ${_filesExcludedFromFinalFile} "${_abs_FILE}") + endif("${_abs_FILE}" MATCHES ".+\\.(cpp|cc|cxx|C)$") + endif (_isGenerated) + endforeach (_current_FILE) + +endmacro (KDE4_CREATE_FINAL_FILES) + +# This macro doesn't set up the RPATH related options for executables anymore, +# since now (wioth cmake 2.6) just the full RPATH is used always for everything. +# It does create wrapper shell scripts for the executables. +# It overrides the defaults set in FindKDE4Internal.cmake. +# For every executable a wrapper script is created, which sets the appropriate +# environment variable for the platform (LD_LIBRARY_PATH on most UNIX systems, +# DYLD_LIBRARY_PATH on OS X and PATH in Windows) so that it points to the built +# but not yet installed versions of the libraries. So if RPATH is disabled, the executables +# can be run via these scripts from the build tree and will find the correct libraries. +# If RPATH is not disabled, these scripts are also used but only for consistency, because +# they don't really influence anything then, because the compiled-in RPATH overrides +# the LD_LIBRARY_PATH env. variable. +macro (KDE4_HANDLE_RPATH_FOR_EXECUTABLE _target_NAME _type) + if (UNIX) + if (APPLE) + set(_library_path_variable "DYLD_LIBRARY_PATH") + else (APPLE) + set(_library_path_variable "LD_LIBRARY_PATH") + endif (APPLE) + + if (APPLE) + # DYLD_LIBRARY_PATH does not work like LD_LIBRARY_PATH + # OSX already has the RPATH in libraries and executables, putting runtime directories in + # DYLD_LIBRARY_PATH actually breaks things + set(_ld_library_path "${LIBRARY_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/:${KDE4_LIB_DIR}") + else (APPLE) + set(_ld_library_path "${LIBRARY_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/:${LIB_INSTALL_DIR}:${KDE4_LIB_DIR}:${QT_LIBRARY_DIR}") + endif (APPLE) + get_target_property(_executable ${_target_NAME} LOCATION ) + + # use add_custom_target() to have the sh-wrapper generated during build time instead of cmake time + add_custom_command(TARGET ${_target_NAME} POST_BUILD + COMMAND ${CMAKE_COMMAND} + -D_filename=${_executable}.shell -D_library_path_variable=${_library_path_variable} + -D_ld_library_path="${_ld_library_path}" -D_executable=${_executable} + -P ${KDE4_MODULE_DIR}/kde4_exec_via_sh.cmake + ) + + macro_additional_clean_files(${_executable}.shell) + + # under UNIX, set the property WRAPPER_SCRIPT to the name of the generated shell script + # so it can be queried and used later on easily + set_target_properties(${_target_NAME} PROPERTIES WRAPPER_SCRIPT ${_executable}.shell) + + else (UNIX) + # under windows, set the property WRAPPER_SCRIPT just to the name of the executable + # maybe later this will change to a generated batch file (for setting the PATH so that the Qt libs are found) + get_target_property(_executable ${_target_NAME} LOCATION ) + set_target_properties(${_target_NAME} PROPERTIES WRAPPER_SCRIPT ${_executable}) + + set(_ld_library_path "${LIBRARY_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}\;${LIB_INSTALL_DIR}\;${KDE4_LIB_DIR}\;${QT_LIBRARY_DIR}") + get_target_property(_executable ${_target_NAME} LOCATION ) + + # use add_custom_target() to have the batch-file-wrapper generated during build time instead of cmake time + add_custom_command(TARGET ${_target_NAME} POST_BUILD + COMMAND ${CMAKE_COMMAND} + -D_filename="${_executable}.bat" + -D_ld_library_path="${_ld_library_path}" -D_executable="${_executable}" + -P ${KDE4_MODULE_DIR}/kde4_exec_via_sh.cmake + ) + + endif (UNIX) +endmacro (KDE4_HANDLE_RPATH_FOR_EXECUTABLE) + + +macro (KDE4_ADD_PLUGIN _target_NAME _with_PREFIX) +#is the first argument is "WITH_PREFIX" then keep the standard "lib" prefix, otherwise set the prefix empty + if (${_with_PREFIX} STREQUAL "WITH_PREFIX") + set(_first_SRC) + else (${_with_PREFIX} STREQUAL "WITH_PREFIX") + set(_first_SRC ${_with_PREFIX}) + endif (${_with_PREFIX} STREQUAL "WITH_PREFIX") + + set(_SRCS ${_first_SRC} ${ARGN}) + + _automoc4_kde4_pre_target_handling(${_target_NAME} _SRCS) + + if (KDE4_ENABLE_FINAL) + kde4_create_final_files(${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_final_cpp.cpp _separate_files ${_SRCS}) + add_library(${_target_NAME} MODULE ${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_final_cpp.cpp ${_separate_files}) + else (KDE4_ENABLE_FINAL) + add_library(${_target_NAME} MODULE ${_SRCS}) + endif (KDE4_ENABLE_FINAL) + + _automoc4_kde4_post_target_handling(${_target_NAME}) + + if (_first_SRC) + set_target_properties(${_target_NAME} PROPERTIES PREFIX "") + endif (_first_SRC) + + if (WIN32) + # for shared libraries/plugins a -DMAKE_target_LIB is required + string(TOUPPER ${_target_NAME} _symbol) + string(REGEX REPLACE "[^_A-Za-z0-9]" "_" _symbol ${_symbol}) + set(_symbol "MAKE_${_symbol}_LIB") + set_target_properties(${_target_NAME} PROPERTIES DEFINE_SYMBOL ${_symbol}) + endif (WIN32) + +endmacro (KDE4_ADD_PLUGIN _target_NAME _with_PREFIX) + + +# this macro is intended to check whether a list of source +# files has the "NOGUI" or "RUN_UNINSTALLED" keywords at the beginning +# in _output_LIST the list of source files is returned with the "NOGUI" +# and "RUN_UNINSTALLED" keywords removed +# if "NOGUI" is in the list of files, the _nogui argument is set to +# "NOGUI" (which evaluates to TRUE in cmake), otherwise it is set empty +# (which evaluates to FALSE in cmake) +# if "RUN_UNINSTALLED" is in the list of files, the _uninst argument is set to +# "RUN_UNINSTALLED" (which evaluates to TRUE in cmake), otherwise it is set empty +# (which evaluates to FALSE in cmake) +# if "TEST" is in the list of files, the _test argument is set to +# "TEST" (which evaluates to TRUE in cmake), otherwise it is set empty +# (which evaluates to FALSE in cmake) +macro(KDE4_CHECK_EXECUTABLE_PARAMS _output_LIST _nogui _uninst _test) + set(${_nogui}) + set(${_uninst}) + set(${_test}) + set(${_output_LIST} ${ARGN}) + list(LENGTH ${_output_LIST} count) + + list(GET ${_output_LIST} 0 first_PARAM) + + set(second_PARAM "NOTFOUND") + if (${count} GREATER 1) + list(GET ${_output_LIST} 1 second_PARAM) + endif (${count} GREATER 1) + + set(remove "NOTFOUND") + + if (${first_PARAM} STREQUAL "NOGUI") + set(${_nogui} "NOGUI") + set(remove 0) + endif (${first_PARAM} STREQUAL "NOGUI") + + if (${first_PARAM} STREQUAL "RUN_UNINSTALLED") + set(${_uninst} "RUN_UNINSTALLED") + set(remove 0) + endif (${first_PARAM} STREQUAL "RUN_UNINSTALLED") + + if (${first_PARAM} STREQUAL "TEST") + set(${_test} "TEST") + set(remove 0) + endif (${first_PARAM} STREQUAL "TEST") + + if (${second_PARAM} STREQUAL "NOGUI") + set(${_nogui} "NOGUI") + set(remove 0;1) + endif (${second_PARAM} STREQUAL "NOGUI") + + if (${second_PARAM} STREQUAL "RUN_UNINSTALLED") + set(${_uninst} "RUN_UNINSTALLED") + set(remove 0;1) + endif (${second_PARAM} STREQUAL "RUN_UNINSTALLED") + + if (${second_PARAM} STREQUAL "TEST") + set(${_test} "TEST") + set(remove 0;1) + endif (${second_PARAM} STREQUAL "TEST") + + + + if (NOT "${remove}" STREQUAL "NOTFOUND") + list(REMOVE_AT ${_output_LIST} ${remove}) + endif (NOT "${remove}" STREQUAL "NOTFOUND") + +endmacro(KDE4_CHECK_EXECUTABLE_PARAMS) + + +macro (KDE4_ADD_KDEINIT_EXECUTABLE _target_NAME ) + + kde4_check_executable_params(_SRCS _nogui _uninst _test ${ARGN}) + + configure_file(${KDE4_MODULE_DIR}/kde4init_dummy.cpp.in ${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_dummy.cpp) + set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_dummy.cpp PROPERTIES SKIP_AUTOMOC TRUE) + # under Windows, build a normal executable and additionally a dummy kdeinit4_foo.lib, whose only purpose on windows is to + # keep the linking logic from the CMakeLists.txt on UNIX working (under UNIX all necessary libs are linked against the kdeinit + # library instead against the executable, under windows we want to have everything in the executable, but for compatibility we have to + # keep the library there- + if(WIN32) + if (MINGW) + list(FIND _SRCS ${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_res.o _res_position) + else(MINGW) + list(FIND _SRCS ${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}.rc _res_position) + endif(MINGW) + if(NOT _res_position EQUAL -1) + list(GET _SRCS ${_res_position} _resourcefile) + list(REMOVE_AT _SRCS ${_res_position}) + endif(NOT _res_position EQUAL -1) + + set(_KDEINIT4_TARGET_NAME_ ${_target_NAME}) + string(REGEX REPLACE "[-]" "_" _KDEINIT4_TARGET_NAME_ "${_KDEINIT4_TARGET_NAME_}") + configure_file(${KDE4_MODULE_DIR}/kde4init_win32lib_dummy.cpp.in ${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_win32lib_dummy.cpp) + add_library(kdeinit_${_target_NAME} STATIC ${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_win32lib_dummy.cpp) + + if (KDE4_ENABLE_FINAL) + kde4_create_final_files(${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_final_cpp.cpp _separate_files ${_SRCS}) + kde4_add_executable(${_target_NAME} "${_nogui}" "${_uninst}" ${CMAKE_CURRENT_BINARY_DIR}/kdeinit_${_target_NAME}_final_cpp.cpp ${_separate_files} ${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_dummy.cpp ${_resourcefile}) + + else (KDE4_ENABLE_FINAL) + kde4_add_executable(${_target_NAME} "${_nogui}" "${_uninst}" ${_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_dummy.cpp ${_resourcefile}) + endif (KDE4_ENABLE_FINAL) + + set_target_properties(kdeinit_${_target_NAME} PROPERTIES OUTPUT_NAME kdeinit4_${_target_NAME}) + + target_link_libraries(${_target_NAME} ${QT_QTMAIN_LIBRARY} kdeinit_${_target_NAME}) + else(WIN32) + _automoc4_kde4_pre_target_handling(kdeinit_${_target_NAME} _SRCS) + + if (KDE4_ENABLE_FINAL) + kde4_create_final_files(${CMAKE_CURRENT_BINARY_DIR}/kdeinit_${_target_NAME}_final_cpp.cpp _separate_files ${_SRCS}) + add_library(kdeinit_${_target_NAME} SHARED ${CMAKE_CURRENT_BINARY_DIR}/kdeinit_${_target_NAME}_final_cpp.cpp ${_separate_files}) + + else (KDE4_ENABLE_FINAL) + add_library(kdeinit_${_target_NAME} SHARED ${_SRCS}) + endif (KDE4_ENABLE_FINAL) + + _automoc4_kde4_post_target_handling(kdeinit_${_target_NAME}) + + set_target_properties(kdeinit_${_target_NAME} PROPERTIES OUTPUT_NAME kdeinit4_${_target_NAME}) + + kde4_add_executable(${_target_NAME} "${_nogui}" "${_uninst}" ${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_dummy.cpp) + target_link_libraries(${_target_NAME} kdeinit_${_target_NAME}) + endif(WIN32) + +endmacro (KDE4_ADD_KDEINIT_EXECUTABLE) + +# add a unit test, which is executed when running make test +# it will be built with RPATH pointing to the build dir +# The targets are always created, but only built for the "all" +# target if the option KDE4_BUILD_TESTS is enabled. Otherwise the rules for the target +# are created but not built by default. You can build them by manually building the target. +# The name of the target can be specified using TESTNAME , if it is not given +# the macro will default to the +macro (KDE4_ADD_UNIT_TEST _test_NAME) + set(_srcList ${ARGN}) + set(_targetName ${_test_NAME}) + if( ${ARGV1} STREQUAL "TESTNAME" ) + set(_targetName ${ARGV2}) + list(REMOVE_AT _srcList 0 1) + endif( ${ARGV1} STREQUAL "TESTNAME" ) + + set(_nogui) + list(GET ${_srcList} 0 first_PARAM) + if( ${first_PARAM} STREQUAL "NOGUI" ) + set(_nogui "NOGUI") + endif( ${first_PARAM} STREQUAL "NOGUI" ) + + kde4_add_executable( ${_test_NAME} TEST ${_srcList} ) + + if(NOT KDE4_TEST_OUTPUT) + set(KDE4_TEST_OUTPUT plaintext) + endif(NOT KDE4_TEST_OUTPUT) + set(KDE4_TEST_OUTPUT ${KDE4_TEST_OUTPUT} CACHE STRING "The output to generate when running the QTest unit tests") + + set(using_qtest "") + foreach(_filename ${_srcList}) + if(NOT using_qtest) + if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${_filename}") + file(READ ${_filename} file_CONTENT) + string(REGEX MATCH "QTEST_(KDE)?MAIN" using_qtest "${file_CONTENT}") + endif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${_filename}") + endif(NOT using_qtest) + endforeach(_filename) + + if(WIN32) + get_target_property( loc ${_targetName} LOCATION ) + # .bat because of rpath handling + set(_executable ${loc}.bat) + else(WIN32) + set(_executable ${EXECUTABLE_OUTPUT_PATH}/${_test_NAME}) + endif(WIN32) + if (Q_WS_MAC AND NOT _nogui) + set(_executable ${EXECUTABLE_OUTPUT_PATH}/${_test_NAME}.app/Contents/MacOS/${_test_NAME}) + else (Q_WS_MAC AND NOT _nogui) + # Use .shell wrapper where available, to use uninstalled libs. + if (UNIX) + set(_executable ${_executable}.shell) + endif (UNIX) + endif (Q_WS_MAC AND NOT _nogui) + + if (using_qtest AND KDE4_TEST_OUTPUT STREQUAL "xml") + #MESSAGE(STATUS "${_targetName} : Using QTestLib, can produce XML report.") + add_test( ${_targetName} ${_executable} -xml -o ${_targetName}.tml) + else (using_qtest AND KDE4_TEST_OUTPUT STREQUAL "xml") + #MESSAGE(STATUS "${_targetName} : NOT using QTestLib, can't produce XML report, please use QTestLib to write your unit tests.") + add_test( ${_targetName} ${_executable} ) + endif (using_qtest AND KDE4_TEST_OUTPUT STREQUAL "xml") + +# add_test( ${_targetName} ${EXECUTABLE_OUTPUT_PATH}/${_test_NAME} -xml -o ${_test_NAME}.tml ) + + if (NOT MSVC_IDE) #not needed for the ide + # if the tests are EXCLUDE_FROM_ALL, add a target "buildtests" to build all tests + if (NOT KDE4_BUILD_TESTS) + get_directory_property(_buildtestsAdded BUILDTESTS_ADDED) + if(NOT _buildtestsAdded) + add_custom_target(buildtests) + set_directory_properties(PROPERTIES BUILDTESTS_ADDED TRUE) + endif(NOT _buildtestsAdded) + add_dependencies(buildtests ${_test_NAME}) + endif (NOT KDE4_BUILD_TESTS) + endif (NOT MSVC_IDE) + +endmacro (KDE4_ADD_UNIT_TEST) + + +macro (KDE4_ADD_EXECUTABLE _target_NAME) + + kde4_check_executable_params( _SRCS _nogui _uninst _test ${ARGN}) + + set(_add_executable_param) + set(_type "GUI") + + # determine additional parameters for add_executable() + # for GUI apps, create a bundle on OSX + if (Q_WS_MAC) + set(_add_executable_param MACOSX_BUNDLE) + endif (Q_WS_MAC) + + # for GUI apps, this disables the additional console under Windows + if (WIN32) + set(_add_executable_param WIN32) + endif (WIN32) + + if (_nogui) + set(_type "NOGUI") + set(_add_executable_param) + endif (_nogui) + + if (_uninst OR _test) + set(_type "RUN_UNINSTALLED ${_type}") + endif (_uninst OR _test) + + if (_test AND NOT KDE4_BUILD_TESTS) + set(_add_executable_param ${_add_executable_param} EXCLUDE_FROM_ALL) + endif (_test AND NOT KDE4_BUILD_TESTS) + + _automoc4_kde4_pre_target_handling(${_target_NAME} _SRCS) + + if (KDE4_ENABLE_FINAL) + kde4_create_final_files(${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_final_cpp.cpp _separate_files ${_SRCS}) + add_executable(${_target_NAME} ${_add_executable_param} ${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_final_cpp.cpp ${_separate_files}) + else (KDE4_ENABLE_FINAL) + add_executable(${_target_NAME} ${_add_executable_param} ${_SRCS}) + endif (KDE4_ENABLE_FINAL) + + _automoc4_kde4_post_target_handling(${_target_NAME}) + + if (_test) + set_target_properties(${_target_NAME} PROPERTIES COMPILE_FLAGS -DKDESRCDIR="\\"${CMAKE_CURRENT_SOURCE_DIR}\\"") + endif (_test) + + kde4_handle_rpath_for_executable(${_target_NAME} ${_type}) + + if (WIN32) + target_link_libraries(${_target_NAME} ${QT_QTMAIN_LIBRARY}) + endif (WIN32) + +endmacro (KDE4_ADD_EXECUTABLE) + + +macro (KDE4_ADD_LIBRARY _target_NAME _lib_TYPE) +#is the first argument is "WITH_PREFIX" then keep the standard "lib" prefix, otherwise set the prefix empty + + set(_first_SRC ${_lib_TYPE}) + set(_add_lib_param) + + if (${_lib_TYPE} STREQUAL "STATIC") + set(_first_SRC) + set(_add_lib_param STATIC) + endif (${_lib_TYPE} STREQUAL "STATIC") + if (${_lib_TYPE} STREQUAL "SHARED") + set(_first_SRC) + set(_add_lib_param SHARED) + endif (${_lib_TYPE} STREQUAL "SHARED") + if (${_lib_TYPE} STREQUAL "MODULE") + set(_first_SRC) + set(_add_lib_param MODULE) + endif (${_lib_TYPE} STREQUAL "MODULE") + + set(_SRCS ${_first_SRC} ${ARGN}) + + _automoc4_kde4_pre_target_handling(${_target_NAME} _SRCS) + + if (KDE4_ENABLE_FINAL) + kde4_create_final_files(${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_final_cpp.cpp _separate_files ${_SRCS}) + add_library(${_target_NAME} ${_add_lib_param} ${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_final_cpp.cpp ${_separate_files}) + else (KDE4_ENABLE_FINAL) + add_library(${_target_NAME} ${_add_lib_param} ${_SRCS}) + endif (KDE4_ENABLE_FINAL) + + _automoc4_kde4_post_target_handling(${_target_NAME}) + + # for shared libraries a -DMAKE_target_LIB is required + string(TOUPPER ${_target_NAME} _symbol) + string(REGEX REPLACE "[^_A-Za-z0-9]" "_" _symbol ${_symbol}) + set(_symbol "MAKE_${_symbol}_LIB") + set_target_properties(${_target_NAME} PROPERTIES DEFINE_SYMBOL ${_symbol}) + + # By default don't add any linked libraries to the "exported" + # link interfaces, so that executables linking against this library + # will not automatically add implicit dependencies to their link list. + # + # This reduces inter-package dependencies and makes it easier to remove + # dependencies of shared libraries without breaking binary compatibility. + if(NOT "${_add_lib_param}" STREQUAL "STATIC") + set_target_properties(${_target_NAME} PROPERTIES LINK_INTERFACE_LIBRARIES "" ) + endif(NOT "${_add_lib_param}" STREQUAL "STATIC") + +endmacro (KDE4_ADD_LIBRARY _target_NAME _lib_TYPE) + + +macro (KDE4_ADD_WIDGET_FILES _sources) + foreach (_current_FILE ${ARGN}) + + get_filename_component(_input ${_current_FILE} ABSOLUTE) + get_filename_component(_basename ${_input} NAME_WE) + set(_source ${CMAKE_CURRENT_BINARY_DIR}/${_basename}widgets.cpp) + set(_moc ${CMAKE_CURRENT_BINARY_DIR}/${_basename}widgets.moc) + + # create source file from the .widgets file + add_custom_command(OUTPUT ${_source} + COMMAND ${KDE4_MAKEKDEWIDGETS_EXECUTABLE} + ARGS -o ${_source} ${_input} + MAIN_DEPENDENCY ${_input} DEPENDS ${_KDE4_MAKEKDEWIDGETS_DEP}) + + # create moc file + qt4_generate_moc(${_source} ${_moc} ) + + list(APPEND ${_sources} ${_source} ${_moc}) + + endforeach (_current_FILE) + +endmacro (KDE4_ADD_WIDGET_FILES) + + +macro(KDE4_REMOVE_OBSOLETE_CMAKE_FILES) +# the files listed here will be removed by remove_obsoleted_cmake_files.cmake, Alex + install(SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/remove_files.cmake ) + set(module_install_dir ${DATA_INSTALL_DIR}/cmake/modules ) + + file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/remove_files.cmake "#generated by cmake, dont edit\n\n") + foreach ( _current_FILE ${ARGN}) + file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/remove_files.cmake "message(STATUS \"Removing ${module_install_dir}/${_current_FILE}\" )\n" ) + file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/remove_files.cmake "exec_program( ${CMAKE_COMMAND} ARGS -E remove ${module_install_dir}/${_current_FILE} OUTPUT_VARIABLE _dummy)\n" ) + endforeach ( _current_FILE) + +endmacro(KDE4_REMOVE_OBSOLETE_CMAKE_FILES) + + +macro(KDE4_NO_ENABLE_FINAL _project_name) + if(KDE4_ENABLE_FINAL) + set(KDE4_ENABLE_FINAL OFF) + remove_definitions(-DKDE_USE_FINAL) + message(STATUS "You used enable-final argument but \"${_project_name}\" doesn't support it. Try to fix compile it and remove KDE4_NO_ENABLE_FINAL macro. Thanks") + + endif(KDE4_ENABLE_FINAL) +endmacro(KDE4_NO_ENABLE_FINAL _project_name) + + +macro(KDE4_CREATE_EXPORTS_HEADER _outputFile _libName) + string(TOUPPER ${_libName} _libNameUpperCase) + string(REGEX REPLACE "[^_A-Za-z0-9]" "_" _libNameUpperCase ${_libNameUpperCase}) + # the next line is is required, because in CMake arguments to macros are not real + # variables, but handled differently. The next line create a real CMake variable, + # so configure_file() will replace it correctly. + set(_libName ${_libName}) + # compared to write(FILE) configure_file() only really writes the file if the + # contents have changed. Otherwise we would have a lot of recompiles. + configure_file(${KDE4_MODULE_DIR}/kde4exportsheader.h.in ${_outputFile}) +endmacro(KDE4_CREATE_EXPORTS_HEADER _outputFile _libName) + + +macro (KDE4_CREATE_HTML_HANDBOOK _docbook) + message(STATUS "KDE4_CREATE_HTML_HANDBOOK() is deprecated. Enable the option KDE4_ENABLE_HTMLHANDBOOK instead, this will give you targets htmlhandbook for creating the html help.") +endmacro (KDE4_CREATE_HTML_HANDBOOK) + + +# adds application icon to target source list +# 'appsources' - the sources of the application +# 'pngfiles' - specifies the list of icon files +# example: KDE4_ADD_WIN32_APP_ICON(myapp_SRCS "pics/cr16-myapp.png;pics/cr32-myapp.png") + +macro (KDE4_ADD_WIN32_APP_ICON appsources) + message(STATUS "KDE4_ADD_WIN32_APP_ICON() is deprecated, use KDE4_ADD_APP_ICON() instead") + if (WIN32) + find_program(PNG2ICO_EXECUTABLE NAMES png2ico) + find_program(WINDRES_EXECUTABLE NAMES windres) + if(MSVC) + set(WINDRES_EXECUTABLE TRUE) + endif(MSVC) + string(REPLACE _SRCS "" appname ${appsources}) + if (PNG2ICO_EXECUTABLE AND WINDRES_EXECUTABLE) + set (_outfilename ${CMAKE_CURRENT_BINARY_DIR}/${appname}) + + # png2ico is found by the above find_program +# message("png2ico ${_outfilename}.ico ${ARGN}") + exec_program(png2ico ARGS ${_outfilename}.ico ${ARGN}) + + # now make rc file for adding it to the sources + file(WRITE ${_outfilename}.rc "IDI_ICON1 ICON DISCARDABLE \"${_outfilename}.ico\"\n") + if (MINGW) + exec_program(windres + ARGS "-i ${_outfilename}.rc -o ${_outfilename}_res.o --include-dir=${CMAKE_CURRENT_SOURCE_DIR}") + list(APPEND ${appsources} ${CMAKE_CURRENT_BINARY_DIR}/${appname}_res.o) + else(MINGW) + list(APPEND ${appsources} ${CMAKE_CURRENT_BINARY_DIR}/${appname}.rc) + endif(MINGW) + endif(PNG2ICO_EXECUTABLE AND WINDRES_EXECUTABLE) + endif(WIN32) +endmacro (KDE4_ADD_WIN32_APP_ICON) + +# adds application icon to target source list + +# this macro adds an application icon to the specified target +# mac osx notes : the application icon is added to a Mac OS X bundle so that Finder and friends show the right thing. +# win32 notes: the application icon(s) are compiled into the application +# there is some workaround in kde4_add_kdeinit_executable to make it possible for those applications as well +# parameters: +# 'appsources' - specifies the list of source files; this has to end in _SRCS or _KDEINIT_SRCS +# (see the replace stuff below) +# 'pattern' - regular expression for searching application icons +# example: KDE4_ADD_APP_ICON( myapp_SRCS "pics/cr*-myapp.png") +# example: KDE4_ADD_APP_ICON( myapp_KDEINIT_SRCS "icons/oxygen/*/apps/myapp.png") + +macro (KDE4_ADD_APP_ICON appsources pattern) + string(REPLACE _KDEINIT_SRCS "" target ${appsources}) + if(${appsources} STREQUAL ${target}) + string(REPLACE _SRCS "" target ${appsources}) + endif(${appsources} STREQUAL ${target}) + + if (WIN32) + find_program(PNG2ICO_EXECUTABLE NAMES png2ico) + find_program(WINDRES_EXECUTABLE NAMES windres) + if(MSVC) + set(WINDRES_EXECUTABLE TRUE) + endif(MSVC) + if (PNG2ICO_EXECUTABLE AND WINDRES_EXECUTABLE) + string(REPLACE "*" "(.*)" pattern_rx "${pattern}") + file(GLOB_RECURSE files "${pattern}") + foreach (it ${files}) + string(REGEX REPLACE "${pattern_rx}" "\\1" fn "${it}") + if (fn MATCHES ".*16.*" ) + list (APPEND _icons ${it}) + endif (fn MATCHES ".*16.*") + if (fn MATCHES ".*32.*" ) + list (APPEND _icons ${it}) + endif (fn MATCHES ".*32.*") + if (fn MATCHES ".*48.*" ) + list (APPEND _icons ${it}) + endif (fn MATCHES ".*48.*") + if (fn MATCHES ".*64.*" ) + list (APPEND _icons ${it}) + endif (fn MATCHES ".*64.*") + if (fn MATCHES ".*128.*" ) + list (APPEND _icons ${it}) + endif (fn MATCHES ".*128.*") + endforeach (it) + if (_icons) + set (_outfilename ${CMAKE_CURRENT_BINARY_DIR}/${target}) + add_custom_command(OUTPUT ${_outfilename}.ico ${_outfilename}.rc + COMMAND ${PNG2ICO_EXECUTABLE} ARGS --rcfile ${_outfilename}.rc ${_outfilename}.ico ${_icons} + DEPENDS ${PNG2ICO_EXECUTABLE} ${_icons} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + ) + if (MINGW) + add_custom_command(OUTPUT ${_outfilename}_res.o + COMMAND ${WINDRES_EXECUTABLE} ARGS -i ${_outfilename}.rc -o ${_outfilename}_res.o --include-dir=${CMAKE_CURRENT_SOURCE_DIR} + DEPENDS ${WINDRES_EXECUTABLE} ${_outfilename}.rc + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + ) + list(APPEND ${appsources} ${_outfilename}_res.o) + else(MINGW) + list(APPEND ${appsources} ${_outfilename}.rc) + endif(MINGW) + else(_icons) + message(STATUS "Unable to find a related icon for target ${target} - application will not have an application icon!") + endif(_icons) + else(PNG2ICO_EXECUTABLE AND WINDRES_EXECUTABLE) + message(STATUS "Unable to find the png2ico or windres utilities - application will not have an application icon!") + endif(PNG2ICO_EXECUTABLE AND WINDRES_EXECUTABLE) + endif(WIN32) + if (Q_WS_MAC) + # first convert image to a tiff using the Mac OS X "sips" utility, + # then use tiff2icns to convert to an icon + find_program(SIPS_EXECUTABLE NAMES sips) + find_program(TIFF2ICNS_EXECUTABLE NAMES tiff2icns) + if (SIPS_EXECUTABLE AND TIFF2ICNS_EXECUTABLE) + file(GLOB_RECURSE files "${pattern}") + # we can only test for the 128-icon like that - we don't use patterns anymore + foreach (it ${files}) + if (it MATCHES ".*128.*" ) + set (_icon ${it}) + endif (it MATCHES ".*128.*") + endforeach (it) + set (_outfilename ${CMAKE_CURRENT_BINARY_DIR}/${target}) + + if (_icon) + + # first, get the basename of our app icon + add_custom_command(OUTPUT ${_outfilename}.icns ${outfilename}.tiff + COMMAND ${SIPS_EXECUTABLE} -s format tiff ${_icon} --out ${outfilename}.tiff + COMMAND ${TIFF2ICNS_EXECUTABLE} ${outfilename}.tiff ${_outfilename}.icns + DEPENDS ${_icon} + ) + + # This will register the icon into the bundle + set(MACOSX_BUNDLE_ICON_FILE ${target}.icns) + + # Append the icns file to the sources list so it will be a dependency to the + # main target + list(APPEND ${appsources} ${_outfilename}.icns) + + # this doesn't seem to work for me - Use manual "install" instead + # TODO: test again with cmake 2.6 ? + # SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/${target}.icns PROPERTIES MACOSX_PACKAGE_LOCATION Resources) + + install(FILES ${_outfilename}.icns DESTINATION ${BIN_INSTALL_DIR}/${target}.app/Contents/Resources/) + + else(_icon) + # TODO - try to scale a non-128 icon...? Try to convert an SVG on the fly? + message(STATUS "Unable to find an 128x128 icon for target ${target} - application will not have an application icon!") + endif(_icon) + + else(SIPS_EXECUTABLE AND TIFF2ICNS_EXECUTABLE) + message(STATUS "Unable to find the sips and tiff2icns utilities - application will not have an application icon!") + endif(SIPS_EXECUTABLE AND TIFF2ICNS_EXECUTABLE) + endif(Q_WS_MAC) +endmacro (KDE4_ADD_APP_ICON) + + +# This macro is only kept around for compatibility, it is not needed/used anymore +# since CMake 2.6.0. With CMake 2.6.0 it is not necessary anymore link libraries again +# ("relink") to change their RPATH. Since this is fast now, they are now always built with +# full RPATH. +# Still keep this macro here, since somebody might use it and so that would break +# if we would just remove it from here. +# What it does now it sets the target properties of the given target the same way as +# they were set by the old version of the macro with the option FULL_RPATH enabled. +# This one may be a candidate for removal. Alex +macro (KDE4_HANDLE_RPATH_FOR_LIBRARY _target_NAME) + message(STATUS "You are using the macro KDE4_HANDLE_RPATH_FOR_LIBRARY(), which is an internal macro and shouldn't be used by external projects. Please remove it.") + if (NOT CMAKE_SKIP_RPATH) + set_target_properties(${_target_NAME} PROPERTIES SKIP_BUILD_RPATH FALSE BUILD_WITH_INSTALL_RPATH FALSE) + endif (NOT CMAKE_SKIP_RPATH) +endmacro (KDE4_HANDLE_RPATH_FOR_LIBRARY) + + +macro(_KDE4_EXPORT_LIBRARY_DEPENDENCIES _append_or_write _filename) + message(FATAL_ERROR "_KDE4_EXPORT_LIBRARY_DEPENDENCIES() was an internal macro and has been removed again. Just remove the code which calls it, there is no substitute.") +endmacro(_KDE4_EXPORT_LIBRARY_DEPENDENCIES) + +macro (_KDE4_TARGET_LINK_INTERFACE_LIBRARIES _target _interface_libs) + message(FATAL_ERROR "_KDE4_TARGET_LINK_INTERFACE_LIBRARIES() doesn't exist anymore. Set the LINK_INTERFACE_LIBRARIES target property instead. See kdelibs/kdecore/CMakeLists.txt for an example.") +endmacro (_KDE4_TARGET_LINK_INTERFACE_LIBRARIES) + +macro (KDE4_TARGET_LINK_INTERFACE_LIBRARIES _target _interface_libs) + message(FATAL_ERROR "KDE4_TARGET_LINK_INTERFACE_LIBRARIES() doesn't exist anymore. Set the LINK_INTERFACE_LIBRARIES target property instead. See kdelibs/kdecore/CMakeLists.txt for an example.") +endmacro (KDE4_TARGET_LINK_INTERFACE_LIBRARIES _target _interface_libs) + +macro (KDE4_INSTALL_HANDBOOK _lang) + message(STATUS "KDE4_INSTALL_HANDBOOK() is deprecated. Remove it please. Now all is done in KDE4_CREATE_HANDBOOK.") +endmacro (KDE4_INSTALL_HANDBOOK ) + +macro (KDE4_SET_CUSTOM_TARGET_PROPERTY) + message(FATAL_ERROR "KDE4_SET_CUSTOM_TARGET_PROPERTY() is deprecated, just use a simple variable instead") +endmacro (KDE4_SET_CUSTOM_TARGET_PROPERTY) + +macro (KDE4_GET_CUSTOM_TARGET_PROPERTY) + message(FATAL_ERROR "KDE4_GET_CUSTOM_TARGET_PROPERTY() is deprecated, just use a simple variable instead") +endmacro (KDE4_GET_CUSTOM_TARGET_PROPERTY) diff --git a/cmake/modules/KDELibs4LibraryTargets-debian.cmake b/cmake/modules/KDELibs4LibraryTargets-debian.cmake new file mode 100644 index 0000000000..dcc08dcb44 --- /dev/null +++ b/cmake/modules/KDELibs4LibraryTargets-debian.cmake @@ -0,0 +1,244 @@ +#---------------------------------------------------------------- +# Generated CMake target import file for configuration "Debian". +#---------------------------------------------------------------- + +# Commands may need to know the format version. +SET(CMAKE_IMPORT_FILE_VERSION 1) + +# Import target "KDE4__kdefakes" for configuration "Debian" +SET_PROPERTY(TARGET KDE4__kdefakes APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBIAN) +SET_TARGET_PROPERTIES(KDE4__kdefakes PROPERTIES + IMPORTED_LOCATION_DEBIAN "/usr/lib/libkdefakes.so.5.2.0" + IMPORTED_SONAME_DEBIAN "libkdefakes.so.5" + ) + +# Import target "KDE4__kdecore" for configuration "Debian" +SET_PROPERTY(TARGET KDE4__kdecore APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBIAN) +SET_TARGET_PROPERTIES(KDE4__kdecore PROPERTIES + IMPORTED_LINK_INTERFACE_LIBRARIES_DEBIAN "/usr/lib/libQtDBus.so;/usr/lib/libQtCore.so" + IMPORTED_LOCATION_DEBIAN "/usr/lib/libkdecore.so.5.2.0" + IMPORTED_SONAME_DEBIAN "libkdecore.so.5" + ) + +# Import target "KDE4__kdeui" for configuration "Debian" +SET_PROPERTY(TARGET KDE4__kdeui APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBIAN) +SET_TARGET_PROPERTIES(KDE4__kdeui PROPERTIES + IMPORTED_LINK_INTERFACE_LIBRARIES_DEBIAN "KDE4__kdecore;/usr/lib/libQtSvg.so;/usr/lib/libQtGui.so" + IMPORTED_LOCATION_DEBIAN "/usr/lib/libkdeui.so.5.2.0" + IMPORTED_SONAME_DEBIAN "libkdeui.so.5" + ) + +# Import target "KDE4__kpty" for configuration "Debian" +SET_PROPERTY(TARGET KDE4__kpty APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBIAN) +SET_TARGET_PROPERTIES(KDE4__kpty PROPERTIES + IMPORTED_LINK_INTERFACE_LIBRARIES_DEBIAN "KDE4__kdecore;/usr/lib/libQtCore.so" + IMPORTED_LOCATION_DEBIAN "/usr/lib/libkpty.so.4.2.0" + IMPORTED_SONAME_DEBIAN "libkpty.so.4" + ) + +# Import target "KDE4__kdesu" for configuration "Debian" +SET_PROPERTY(TARGET KDE4__kdesu APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBIAN) +SET_TARGET_PROPERTIES(KDE4__kdesu PROPERTIES + IMPORTED_LINK_DEPENDENT_LIBRARIES_DEBIAN "KDE4__kdecore;KDE4__kpty" + IMPORTED_LINK_INTERFACE_LIBRARIES_DEBIAN "/usr/lib/libQtCore.so" + IMPORTED_LOCATION_DEBIAN "/usr/lib/libkdesu.so.5.2.0" + IMPORTED_SONAME_DEBIAN "libkdesu.so.5" + ) + +# Import target "KDE4__kjs" for configuration "Debian" +SET_PROPERTY(TARGET KDE4__kjs APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBIAN) +SET_TARGET_PROPERTIES(KDE4__kjs PROPERTIES + IMPORTED_LOCATION_DEBIAN "/usr/lib/libkjs.so.4.2.0" + IMPORTED_SONAME_DEBIAN "libkjs.so.4" + ) + +# Import target "KDE4__kjsapi" for configuration "Debian" +SET_PROPERTY(TARGET KDE4__kjsapi APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBIAN) +SET_TARGET_PROPERTIES(KDE4__kjsapi PROPERTIES + IMPORTED_LINK_DEPENDENT_LIBRARIES_DEBIAN "KDE4__kjs;KDE4__kdecore" + IMPORTED_LOCATION_DEBIAN "/usr/lib/libkjsapi.so.4.2.0" + IMPORTED_SONAME_DEBIAN "libkjsapi.so.4" + ) + +# Import target "KDE4__kjsembed" for configuration "Debian" +SET_PROPERTY(TARGET KDE4__kjsembed APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBIAN) +SET_TARGET_PROPERTIES(KDE4__kjsembed PROPERTIES + IMPORTED_LINK_DEPENDENT_LIBRARIES_DEBIAN "KDE4__kdecore;KDE4__kjs" + IMPORTED_LOCATION_DEBIAN "/usr/lib/libkjsembed.so.4.2.0" + IMPORTED_SONAME_DEBIAN "libkjsembed.so.4" + ) + +# Import target "KDE4__kntlm" for configuration "Debian" +SET_PROPERTY(TARGET KDE4__kntlm APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBIAN) +SET_TARGET_PROPERTIES(KDE4__kntlm PROPERTIES + IMPORTED_LINK_DEPENDENT_LIBRARIES_DEBIAN "KDE4__kdecore" + IMPORTED_LOCATION_DEBIAN "/usr/lib/libkntlm.so.4.2.0" + IMPORTED_SONAME_DEBIAN "libkntlm.so.4" + ) + +# Import target "KDE4__kio" for configuration "Debian" +SET_PROPERTY(TARGET KDE4__kio APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBIAN) +SET_TARGET_PROPERTIES(KDE4__kio PROPERTIES + IMPORTED_LINK_DEPENDENT_LIBRARIES_DEBIAN "KDE4__solid" + IMPORTED_LINK_INTERFACE_LIBRARIES_DEBIAN "KDE4__kdeui;KDE4__kdecore;/usr/lib/libQtNetwork.so;/usr/lib/libQtXml.so;/usr/lib/libQtGui.so" + IMPORTED_LOCATION_DEBIAN "/usr/lib/libkio.so.5.2.0" + IMPORTED_SONAME_DEBIAN "libkio.so.5" + ) + +# Import target "KDE4__solid" for configuration "Debian" +SET_PROPERTY(TARGET KDE4__solid APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBIAN) +SET_TARGET_PROPERTIES(KDE4__solid PROPERTIES + IMPORTED_LINK_DEPENDENT_LIBRARIES_DEBIAN "KDE4__kdecore" + IMPORTED_LOCATION_DEBIAN "/usr/lib/libsolid.so.4.2.0" + IMPORTED_SONAME_DEBIAN "libsolid.so.4" + ) + +# Import target "KDE4__kunittest" for configuration "Debian" +SET_PROPERTY(TARGET KDE4__kunittest APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBIAN) +SET_TARGET_PROPERTIES(KDE4__kunittest PROPERTIES + IMPORTED_LINK_INTERFACE_LIBRARIES_DEBIAN "KDE4__kdecore;/usr/lib/libQtCore.so" + IMPORTED_LOCATION_DEBIAN "/usr/lib/libkunittest.so.4.2.0" + IMPORTED_SONAME_DEBIAN "libkunittest.so.4" + ) + +# Import target "KDE4__kde3support" for configuration "Debian" +SET_PROPERTY(TARGET KDE4__kde3support APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBIAN) +SET_TARGET_PROPERTIES(KDE4__kde3support PROPERTIES + IMPORTED_LINK_DEPENDENT_LIBRARIES_DEBIAN "KDE4__kparts;KDE4__kpty;KDE4__kfile" + IMPORTED_LINK_INTERFACE_LIBRARIES_DEBIAN "KDE4__kio;KDE4__kdeui;KDE4__kdecore;/usr/lib/libQtCore.so;/usr/lib/libQtGui.so;/usr/lib/libQt3Support.so" + IMPORTED_LOCATION_DEBIAN "/usr/lib/libkde3support.so.4.2.0" + IMPORTED_SONAME_DEBIAN "libkde3support.so.4" + ) + +# Import target "KDE4__kfile" for configuration "Debian" +SET_PROPERTY(TARGET KDE4__kfile APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBIAN) +SET_TARGET_PROPERTIES(KDE4__kfile PROPERTIES + IMPORTED_LINK_DEPENDENT_LIBRARIES_DEBIAN "KDE4__kio;KDE4__solid" + IMPORTED_LINK_INTERFACE_LIBRARIES_DEBIAN "KDE4__kdeui;KDE4__kdecore;/usr/lib/libQtGui.so" + IMPORTED_LOCATION_DEBIAN "/usr/lib/libkfile.so.4.2.0" + IMPORTED_SONAME_DEBIAN "libkfile.so.4" + ) + +# Import target "KDE4__knewstuff2" for configuration "Debian" +SET_PROPERTY(TARGET KDE4__knewstuff2 APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBIAN) +SET_TARGET_PROPERTIES(KDE4__knewstuff2 PROPERTIES + IMPORTED_LINK_DEPENDENT_LIBRARIES_DEBIAN "KDE4__kio" + IMPORTED_LINK_INTERFACE_LIBRARIES_DEBIAN "KDE4__kdeui;KDE4__kdecore;/usr/lib/libQtGui.so" + IMPORTED_LOCATION_DEBIAN "/usr/lib/libknewstuff2.so.4.2.0" + IMPORTED_SONAME_DEBIAN "libknewstuff2.so.4" + ) + +# Import target "KDE4__kparts" for configuration "Debian" +SET_PROPERTY(TARGET KDE4__kparts APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBIAN) +SET_TARGET_PROPERTIES(KDE4__kparts PROPERTIES + IMPORTED_LINK_INTERFACE_LIBRARIES_DEBIAN "KDE4__kio;KDE4__kdeui;KDE4__kdecore;/usr/lib/libQtCore.so;/usr/lib/libQtGui.so" + IMPORTED_LOCATION_DEBIAN "/usr/lib/libkparts.so.4.2.0" + IMPORTED_SONAME_DEBIAN "libkparts.so.4" + ) + +# Import target "KDE4__kutils" for configuration "Debian" +SET_PROPERTY(TARGET KDE4__kutils APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBIAN) +SET_TARGET_PROPERTIES(KDE4__kutils PROPERTIES + IMPORTED_LINK_DEPENDENT_LIBRARIES_DEBIAN "KDE4__kio;KDE4__kparts" + IMPORTED_LINK_INTERFACE_LIBRARIES_DEBIAN "KDE4__kdecore;KDE4__kdeui;/usr/lib/libQtGui.so" + IMPORTED_LOCATION_DEBIAN "/usr/lib/libkutils.so.4.2.0" + IMPORTED_SONAME_DEBIAN "libkutils.so.4" + ) + +# Import target "KDE4__threadweaver" for configuration "Debian" +SET_PROPERTY(TARGET KDE4__threadweaver APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBIAN) +SET_TARGET_PROPERTIES(KDE4__threadweaver PROPERTIES + IMPORTED_LINK_INTERFACE_LIBRARIES_DEBIAN "/usr/lib/libQtCore.so" + IMPORTED_LOCATION_DEBIAN "/usr/lib/libthreadweaver.so.4.2.0" + IMPORTED_SONAME_DEBIAN "libthreadweaver.so.4" + ) + +# Import target "KDE4__khtml" for configuration "Debian" +SET_PROPERTY(TARGET KDE4__khtml APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBIAN) +SET_TARGET_PROPERTIES(KDE4__khtml PROPERTIES + IMPORTED_LINK_DEPENDENT_LIBRARIES_DEBIAN "KDE4__ktexteditor" + IMPORTED_LINK_INTERFACE_LIBRARIES_DEBIAN "KDE4__kparts;KDE4__kjs;KDE4__kio;KDE4__kdeui;KDE4__kdecore;/usr/lib/libQtCore.so;/usr/lib/libQtGui.so" + IMPORTED_LOCATION_DEBIAN "/usr/lib/libkhtml.so.5.2.0" + IMPORTED_SONAME_DEBIAN "libkhtml.so.5" + ) + +# Import target "KDE4__ktexteditor" for configuration "Debian" +SET_PROPERTY(TARGET KDE4__ktexteditor APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBIAN) +SET_TARGET_PROPERTIES(KDE4__ktexteditor PROPERTIES + IMPORTED_LINK_DEPENDENT_LIBRARIES_DEBIAN "KDE4__kdecore" + IMPORTED_LINK_INTERFACE_LIBRARIES_DEBIAN "KDE4__kparts" + IMPORTED_LOCATION_DEBIAN "/usr/lib/libktexteditor.so.4.2.0" + IMPORTED_SONAME_DEBIAN "libktexteditor.so.4" + ) + +# Import target "KDE4__kmediaplayer" for configuration "Debian" +SET_PROPERTY(TARGET KDE4__kmediaplayer APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBIAN) +SET_TARGET_PROPERTIES(KDE4__kmediaplayer PROPERTIES + IMPORTED_LINK_INTERFACE_LIBRARIES_DEBIAN "/usr/lib/libQtCore.so;KDE4__kdecore;KDE4__kdeui;KDE4__kio;KDE4__kparts;/usr/lib/libQtGui.so" + IMPORTED_LOCATION_DEBIAN "/usr/lib/libkmediaplayer.so.4.2.0" + IMPORTED_SONAME_DEBIAN "libkmediaplayer.so.4" + ) + +# Import target "KDE4__kimproxy" for configuration "Debian" +SET_PROPERTY(TARGET KDE4__kimproxy APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBIAN) +SET_TARGET_PROPERTIES(KDE4__kimproxy PROPERTIES + IMPORTED_LINK_DEPENDENT_LIBRARIES_DEBIAN "KDE4__kdecore;KDE4__kdeui;KDE4__kio" + IMPORTED_LINK_INTERFACE_LIBRARIES_DEBIAN "/usr/lib/libQtCore.so" + IMPORTED_LOCATION_DEBIAN "/usr/lib/libkimproxy.so.4.2.0" + IMPORTED_SONAME_DEBIAN "libkimproxy.so.4" + ) + +# Import target "KDE4__knotifyconfig" for configuration "Debian" +SET_PROPERTY(TARGET KDE4__knotifyconfig APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBIAN) +SET_TARGET_PROPERTIES(KDE4__knotifyconfig PROPERTIES + IMPORTED_LINK_DEPENDENT_LIBRARIES_DEBIAN "KDE4__kdeui;KDE4__kio" + IMPORTED_LINK_INTERFACE_LIBRARIES_DEBIAN "KDE4__kdecore;/usr/lib/libQtGui.so" + IMPORTED_LOCATION_DEBIAN "/usr/lib/libknotifyconfig.so.4.2.0" + IMPORTED_SONAME_DEBIAN "libknotifyconfig.so.4" + ) + +# Import target "KDE4__kdnssd" for configuration "Debian" +SET_PROPERTY(TARGET KDE4__kdnssd APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBIAN) +SET_TARGET_PROPERTIES(KDE4__kdnssd PROPERTIES + IMPORTED_LINK_DEPENDENT_LIBRARIES_DEBIAN "KDE4__kdeui" + IMPORTED_LINK_INTERFACE_LIBRARIES_DEBIAN "KDE4__kdecore;/usr/lib/libQtCore.so" + IMPORTED_LOCATION_DEBIAN "/usr/lib/libkdnssd.so.4.2.0" + IMPORTED_SONAME_DEBIAN "libkdnssd.so.4" + ) + +# Import target "KDE4__krosscore" for configuration "Debian" +SET_PROPERTY(TARGET KDE4__krosscore APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBIAN) +SET_TARGET_PROPERTIES(KDE4__krosscore PROPERTIES + IMPORTED_LINK_DEPENDENT_LIBRARIES_DEBIAN "KDE4__kdeui" + IMPORTED_LINK_INTERFACE_LIBRARIES_DEBIAN "KDE4__kdecore;/usr/lib/libQtScript.so;/usr/lib/libQtXml.so" + IMPORTED_LOCATION_DEBIAN "/usr/lib/libkrosscore.so.4.2.0" + IMPORTED_SONAME_DEBIAN "libkrosscore.so.4" + ) + +# Import target "KDE4__krossui" for configuration "Debian" +SET_PROPERTY(TARGET KDE4__krossui APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBIAN) +SET_TARGET_PROPERTIES(KDE4__krossui PROPERTIES + IMPORTED_LINK_DEPENDENT_LIBRARIES_DEBIAN "KDE4__krosscore;KDE4__kdecore;KDE4__kdeui;KDE4__kio;KDE4__kparts" + IMPORTED_LOCATION_DEBIAN "/usr/lib/libkrossui.so.4.2.0" + IMPORTED_SONAME_DEBIAN "libkrossui.so.4" + ) + +# Import target "KDE4__plasma" for configuration "Debian" +SET_PROPERTY(TARGET KDE4__plasma APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBIAN) +SET_TARGET_PROPERTIES(KDE4__plasma PROPERTIES + IMPORTED_LINK_DEPENDENT_LIBRARIES_DEBIAN "KDE4__kio;KDE4__kfile;KDE4__knewstuff2;KDE4__threadweaver;KDE4__solid" + IMPORTED_LINK_INTERFACE_LIBRARIES_DEBIAN "KDE4__kdeui;KDE4__kdecore;/usr/lib/libQtGui.so" + IMPORTED_LOCATION_DEBIAN "/usr/lib/libplasma.so.3.0.0" + IMPORTED_SONAME_DEBIAN "libplasma.so.3" + ) + +# Import target "KDE4__nepomuk" for configuration "Debian" +SET_PROPERTY(TARGET KDE4__nepomuk APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBIAN) +SET_TARGET_PROPERTIES(KDE4__nepomuk PROPERTIES + IMPORTED_LINK_INTERFACE_LIBRARIES_DEBIAN "/usr/lib/libQtCore.so;KDE4__kdecore;KDE4__kdeui" + IMPORTED_LOCATION_DEBIAN "/usr/lib/libnepomuk.so.4.2.0" + IMPORTED_SONAME_DEBIAN "libnepomuk.so.4" + ) + +# Commands beyond this point should not need to know the version. +SET(CMAKE_IMPORT_FILE_VERSION) diff --git a/cmake/modules/KDELibs4LibraryTargets.cmake b/cmake/modules/KDELibs4LibraryTargets.cmake new file mode 100644 index 0000000000..b1d4500b9f --- /dev/null +++ b/cmake/modules/KDELibs4LibraryTargets.cmake @@ -0,0 +1,108 @@ +# Generated by CMake 2.6-patch 2 + +IF("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.5) + MESSAGE(FATAL_ERROR "CMake >= 2.6.0 required") +ENDIF("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.5) +CMAKE_POLICY(PUSH) +CMAKE_POLICY(VERSION 2.6) +#---------------------------------------------------------------- +# Generated CMake target import file. +#---------------------------------------------------------------- + +# Commands may need to know the format version. +SET(CMAKE_IMPORT_FILE_VERSION 1) + +# Create imported target KDE4__kdefakes +ADD_LIBRARY(KDE4__kdefakes SHARED IMPORTED) + +# Create imported target KDE4__kdecore +ADD_LIBRARY(KDE4__kdecore SHARED IMPORTED) + +# Create imported target KDE4__kdeui +ADD_LIBRARY(KDE4__kdeui SHARED IMPORTED) + +# Create imported target KDE4__kpty +ADD_LIBRARY(KDE4__kpty SHARED IMPORTED) + +# Create imported target KDE4__kdesu +ADD_LIBRARY(KDE4__kdesu SHARED IMPORTED) + +# Create imported target KDE4__kjs +ADD_LIBRARY(KDE4__kjs SHARED IMPORTED) + +# Create imported target KDE4__kjsapi +ADD_LIBRARY(KDE4__kjsapi SHARED IMPORTED) + +# Create imported target KDE4__kjsembed +ADD_LIBRARY(KDE4__kjsembed SHARED IMPORTED) + +# Create imported target KDE4__kntlm +ADD_LIBRARY(KDE4__kntlm SHARED IMPORTED) + +# Create imported target KDE4__kio +ADD_LIBRARY(KDE4__kio SHARED IMPORTED) + +# Create imported target KDE4__solid +ADD_LIBRARY(KDE4__solid SHARED IMPORTED) + +# Create imported target KDE4__kunittest +ADD_LIBRARY(KDE4__kunittest SHARED IMPORTED) + +# Create imported target KDE4__kde3support +ADD_LIBRARY(KDE4__kde3support SHARED IMPORTED) + +# Create imported target KDE4__kfile +ADD_LIBRARY(KDE4__kfile SHARED IMPORTED) + +# Create imported target KDE4__knewstuff2 +ADD_LIBRARY(KDE4__knewstuff2 SHARED IMPORTED) + +# Create imported target KDE4__kparts +ADD_LIBRARY(KDE4__kparts SHARED IMPORTED) + +# Create imported target KDE4__kutils +ADD_LIBRARY(KDE4__kutils SHARED IMPORTED) + +# Create imported target KDE4__threadweaver +ADD_LIBRARY(KDE4__threadweaver SHARED IMPORTED) + +# Create imported target KDE4__khtml +ADD_LIBRARY(KDE4__khtml SHARED IMPORTED) + +# Create imported target KDE4__ktexteditor +ADD_LIBRARY(KDE4__ktexteditor SHARED IMPORTED) + +# Create imported target KDE4__kmediaplayer +ADD_LIBRARY(KDE4__kmediaplayer SHARED IMPORTED) + +# Create imported target KDE4__kimproxy +ADD_LIBRARY(KDE4__kimproxy SHARED IMPORTED) + +# Create imported target KDE4__knotifyconfig +ADD_LIBRARY(KDE4__knotifyconfig SHARED IMPORTED) + +# Create imported target KDE4__kdnssd +ADD_LIBRARY(KDE4__kdnssd SHARED IMPORTED) + +# Create imported target KDE4__krosscore +ADD_LIBRARY(KDE4__krosscore SHARED IMPORTED) + +# Create imported target KDE4__krossui +ADD_LIBRARY(KDE4__krossui SHARED IMPORTED) + +# Create imported target KDE4__plasma +ADD_LIBRARY(KDE4__plasma SHARED IMPORTED) + +# Create imported target KDE4__nepomuk +ADD_LIBRARY(KDE4__nepomuk SHARED IMPORTED) + +# Load information for each installed configuration. +GET_FILENAME_COMPONENT(_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) +FILE(GLOB CONFIG_FILES "${_DIR}/KDELibs4LibraryTargets-*.cmake") +FOREACH(f ${CONFIG_FILES}) + INCLUDE(${f}) +ENDFOREACH(f) + +# Commands beyond this point should not need to know the version. +SET(CMAKE_IMPORT_FILE_VERSION) +CMAKE_POLICY(POP) diff --git a/cmake/modules/KDELibs4ToolsTargets-debian.cmake b/cmake/modules/KDELibs4ToolsTargets-debian.cmake new file mode 100644 index 0000000000..513f572886 --- /dev/null +++ b/cmake/modules/KDELibs4ToolsTargets-debian.cmake @@ -0,0 +1,27 @@ +#---------------------------------------------------------------- +# Generated CMake target import file for configuration "Debian". +#---------------------------------------------------------------- + +# Commands may need to know the format version. +SET(CMAKE_IMPORT_FILE_VERSION 1) + +# Import target "KDE4__kconfig_compiler" for configuration "Debian" +SET_PROPERTY(TARGET KDE4__kconfig_compiler APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBIAN) +SET_TARGET_PROPERTIES(KDE4__kconfig_compiler PROPERTIES + IMPORTED_LOCATION_DEBIAN "/usr/bin/kconfig_compiler" + ) + +# Import target "KDE4__meinproc4" for configuration "Debian" +SET_PROPERTY(TARGET KDE4__meinproc4 APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBIAN) +SET_TARGET_PROPERTIES(KDE4__meinproc4 PROPERTIES + IMPORTED_LOCATION_DEBIAN "/usr/bin/meinproc4" + ) + +# Import target "KDE4__makekdewidgets" for configuration "Debian" +SET_PROPERTY(TARGET KDE4__makekdewidgets APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBIAN) +SET_TARGET_PROPERTIES(KDE4__makekdewidgets PROPERTIES + IMPORTED_LOCATION_DEBIAN "/usr/bin/makekdewidgets" + ) + +# Commands beyond this point should not need to know the version. +SET(CMAKE_IMPORT_FILE_VERSION) diff --git a/cmake/modules/KDELibs4ToolsTargets.cmake b/cmake/modules/KDELibs4ToolsTargets.cmake new file mode 100644 index 0000000000..a73c9f9b9f --- /dev/null +++ b/cmake/modules/KDELibs4ToolsTargets.cmake @@ -0,0 +1,33 @@ +# Generated by CMake 2.6-patch 2 + +IF("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.5) + MESSAGE(FATAL_ERROR "CMake >= 2.6.0 required") +ENDIF("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.5) +CMAKE_POLICY(PUSH) +CMAKE_POLICY(VERSION 2.6) +#---------------------------------------------------------------- +# Generated CMake target import file. +#---------------------------------------------------------------- + +# Commands may need to know the format version. +SET(CMAKE_IMPORT_FILE_VERSION 1) + +# Create imported target KDE4__kconfig_compiler +ADD_EXECUTABLE(KDE4__kconfig_compiler IMPORTED) + +# Create imported target KDE4__meinproc4 +ADD_EXECUTABLE(KDE4__meinproc4 IMPORTED) + +# Create imported target KDE4__makekdewidgets +ADD_EXECUTABLE(KDE4__makekdewidgets IMPORTED) + +# Load information for each installed configuration. +GET_FILENAME_COMPONENT(_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) +FILE(GLOB CONFIG_FILES "${_DIR}/KDELibs4ToolsTargets-*.cmake") +FOREACH(f ${CONFIG_FILES}) + INCLUDE(${f}) +ENDFOREACH(f) + +# Commands beyond this point should not need to know the version. +SET(CMAKE_IMPORT_FILE_VERSION) +CMAKE_POLICY(POP) diff --git a/cmake/modules/KDELibsDependencies.cmake b/cmake/modules/KDELibsDependencies.cmake new file mode 100644 index 0000000000..20c0a5e0ec --- /dev/null +++ b/cmake/modules/KDELibsDependencies.cmake @@ -0,0 +1,42 @@ +# this file was generated during the kdelibs build process +set(KDE_VERSION_MAJOR 4) +set(KDE_VERSION_MINOR 2) +set(KDE_VERSION_RELEASE 2) +set(KDE_VERSION "4.2.2") +set(KDE_VERSION_STRING "4.2.2 (KDE 4.2.2)") +set(KDE_DEFAULT_HOME ".kde") + +if (NOT KDE4_INSTALL_DIR) + set(KDE4_INSTALL_DIR "/usr") +endif (NOT KDE4_INSTALL_DIR) + +set(KDE4_LIB_INSTALL_DIR "/usr/lib") +set(KDE4_LIBEXEC_INSTALL_DIR "/usr/lib/kde4/libexec") +set(KDE4_INCLUDE_INSTALL_DIR "/usr/include") +set(KDE4_BIN_INSTALL_DIR "/usr/bin") +set(KDE4_SBIN_INSTALL_DIR "/usr/sbin") +set(KDE4_DATA_INSTALL_DIR "/usr/share/kde4/apps") +set(KDE4_HTML_INSTALL_DIR "/usr/share/doc/kde/HTML") +set(KDE4_CONFIG_INSTALL_DIR "/usr/share/kde4/config") +set(KDE4_ICON_INSTALL_DIR "/usr/share/icons") +set(KDE4_KCFG_INSTALL_DIR "/usr/share/kde4/config.kcfg") +set(KDE4_LOCALE_INSTALL_DIR "/usr/share/locale") +set(KDE4_MIME_INSTALL_DIR "/usr/share/mimelnk") +set(KDE4_SOUND_INSTALL_DIR "/usr/share/sounds") +set(KDE4_TEMPLATES_INSTALL_DIR "/usr/share/templates") +set(KDE4_WALLPAPER_INSTALL_DIR "/usr/share/wallpapers") +set(KDE4_KCONF_UPDATE_INSTALL_DIR "/usr/share/kde4/apps/kconf_update") +set(KDE4_AUTOSTART_INSTALL_DIR "/usr/share/autostart") +set(KDE4_XDG_APPS_INSTALL_DIR "/usr/share/applications/kde4") +set(KDE4_XDG_DIRECTORY_INSTALL_DIR "/usr/share/desktop-directories") +set(KDE4_SYSCONF_INSTALL_DIR "/etc") +set(KDE4_MAN_INSTALL_DIR "/usr/share/man") +set(KDE4_INFO_INSTALL_DIR "/usr/share/info") +set(KDE4_DBUS_INTERFACES_DIR "/usr/share/dbus-1/interfaces") +set(KDE4_DBUS_SERVICES_DIR "/usr/share/dbus-1/services") +set(KDE4_SERVICES_INSTALL_DIR "/usr/share/kde4/services") +set(KDE4_SERVICETYPES_INSTALL_DIR "/usr/share/kde4/servicetypes") + +set(KDE4_TARGET_PREFIX KDE4__ ) + + diff --git a/cmake/modules/MacroAddCompileFlags.cmake b/cmake/modules/MacroAddCompileFlags.cmake new file mode 100644 index 0000000000..12038c00cc --- /dev/null +++ b/cmake/modules/MacroAddCompileFlags.cmake @@ -0,0 +1,19 @@ +# - MACRO_ADD_COMPILE_FLAGS(<_target> "flags...") + +# Copyright (c) 2006, Oswald Buddenhagen, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + + +MACRO (MACRO_ADD_COMPILE_FLAGS _target _flg) + + GET_TARGET_PROPERTY(_flags ${_target} COMPILE_FLAGS) + if (_flags) + set(_flags "${_flags} ${_flg}") + else (_flags) + set(_flags "${_flg}") + endif (_flags) + SET_TARGET_PROPERTIES(${_target} PROPERTIES COMPILE_FLAGS "${_flags}") + +ENDMACRO (MACRO_ADD_COMPILE_FLAGS) diff --git a/cmake/modules/MacroAddFileDependencies.cmake b/cmake/modules/MacroAddFileDependencies.cmake new file mode 100644 index 0000000000..9e5536072c --- /dev/null +++ b/cmake/modules/MacroAddFileDependencies.cmake @@ -0,0 +1,20 @@ +# MACRO_ADD_FILE_DEPENDENCIES(<_file> depend_files...) + +# Copyright (c) 2006, Alexander Neundorf, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + + +MACRO (MACRO_ADD_FILE_DEPENDENCIES _file) + + GET_SOURCE_FILE_PROPERTY(_deps ${_file} OBJECT_DEPENDS) + if (_deps) + set(_deps ${_deps} ${ARGN}) + else (_deps) + set(_deps ${ARGN}) + endif (_deps) + + SET_SOURCE_FILES_PROPERTIES(${_file} PROPERTIES OBJECT_DEPENDS "${_deps}") + +ENDMACRO (MACRO_ADD_FILE_DEPENDENCIES) diff --git a/cmake/modules/MacroAddLinkFlags.cmake b/cmake/modules/MacroAddLinkFlags.cmake new file mode 100644 index 0000000000..a10d39eadd --- /dev/null +++ b/cmake/modules/MacroAddLinkFlags.cmake @@ -0,0 +1,18 @@ +# - MACRO_ADD_LINK_FLAGS(<_target> "flags...") + +# Copyright (c) 2006, Oswald Buddenhagen, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +MACRO (MACRO_ADD_LINK_FLAGS _target _flg) + + GET_TARGET_PROPERTY(_flags ${_target} LINK_FLAGS) + if (_flags) + set(_flags "${_flags} ${_flg}") + else (_flags) + set(_flags "${_flg}") + endif (_flags) + SET_TARGET_PROPERTIES(${_target} PROPERTIES LINK_FLAGS "${_flags}") + +ENDMACRO (MACRO_ADD_LINK_FLAGS) diff --git a/cmake/modules/MacroAdditionalCleanFiles.cmake b/cmake/modules/MacroAdditionalCleanFiles.cmake new file mode 100644 index 0000000000..593182fee4 --- /dev/null +++ b/cmake/modules/MacroAdditionalCleanFiles.cmake @@ -0,0 +1,21 @@ +# - MACRO_ADDITIONAL_CLEAN_FILES(files...) +# MACRO_OPTIONAL_FIND_PACKAGE( [QUIT] ) + +# Copyright (c) 2006, Alexander Neundorf, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + + +MACRO (MACRO_ADDITIONAL_CLEAN_FILES) + GET_DIRECTORY_PROPERTY(_tmp_DIR_PROPS ADDITIONAL_MAKE_CLEAN_FILES ) + + if (_tmp_DIR_PROPS) + set(_tmp_DIR_PROPS ${_tmp_DIR_PROPS} ${ARGN}) + else (_tmp_DIR_PROPS) + set(_tmp_DIR_PROPS ${ARGN}) + endif (_tmp_DIR_PROPS) + + SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${_tmp_DIR_PROPS}") +ENDMACRO (MACRO_ADDITIONAL_CLEAN_FILES) + diff --git a/cmake/modules/MacroAppendIf.cmake b/cmake/modules/MacroAppendIf.cmake new file mode 100644 index 0000000000..86fe014ac9 --- /dev/null +++ b/cmake/modules/MacroAppendIf.cmake @@ -0,0 +1,22 @@ +# MACRO_APPEND_IF(CONDITION VAR VALUE1...VALUEN ) +# This convenience macro appends the values VALUE1 up to VALUEN to the list +# given in VAR, but only if the variable CONDITION is TRUE: +# +# usage example: +# IF(SOMELIB_FOUND) +# SET(my_sources ${my_sources} somefile.c someotherfile.c) +# ENDIF(SOMELIB_FOUND) +# +# becomes: +# MACRO_APPEND_IF(SOMELIB_FOUND my_sources somefile.c someotherfile.c) + +# Copyright (c) 2006, Alexander Neundorf, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +macro(macro_append_if _cond _list) + if(${_cond}) + list(APPEND ${_list} ${ARGN}) + endif(${_cond}) +endmacro(macro_append_if _cond _list) diff --git a/cmake/modules/MacroBoolTo01.cmake b/cmake/modules/MacroBoolTo01.cmake new file mode 100644 index 0000000000..63b9852660 --- /dev/null +++ b/cmake/modules/MacroBoolTo01.cmake @@ -0,0 +1,20 @@ +# MACRO_BOOL_TO_01( VAR RESULT0 ... RESULTN ) +# This macro evaluates its first argument +# and sets all the given vaiables either to 0 or 1 +# depending on the value of the first one + +# Copyright (c) 2006, Alexander Neundorf, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + + +MACRO(MACRO_BOOL_TO_01 FOUND_VAR ) + FOREACH (_current_VAR ${ARGN}) + IF(${FOUND_VAR}) + SET(${_current_VAR} 1) + ELSE(${FOUND_VAR}) + SET(${_current_VAR} 0) + ENDIF(${FOUND_VAR}) + ENDFOREACH(_current_VAR) +ENDMACRO(MACRO_BOOL_TO_01) diff --git a/cmake/modules/MacroEnsureOutOfSourceBuild.cmake b/cmake/modules/MacroEnsureOutOfSourceBuild.cmake new file mode 100644 index 0000000000..cb26e0c328 --- /dev/null +++ b/cmake/modules/MacroEnsureOutOfSourceBuild.cmake @@ -0,0 +1,20 @@ +# - MACRO_ENSURE_OUT_OF_SOURCE_BUILD() +# MACRO_ENSURE_OUT_OF_SOURCE_BUILD() +# Call this macro in your project if you want to enforce out-of-source builds. +# If an in-source build is detected, it will abort with the given error message. +# This macro works in any of the CMakeLists.txt of your project, but the recommended +# location to call this is close to the beginning of the top level CMakeLists.txt + +# Copyright (c) 2006, Alexander Neundorf, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +MACRO (MACRO_ENSURE_OUT_OF_SOURCE_BUILD _errorMessage) + + STRING(COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" insource) + IF(insource) + MESSAGE(FATAL_ERROR "${_errorMessage}") + ENDIF(insource) + +ENDMACRO (MACRO_ENSURE_OUT_OF_SOURCE_BUILD) diff --git a/cmake/modules/MacroEnsureVersion.cmake b/cmake/modules/MacroEnsureVersion.cmake new file mode 100644 index 0000000000..6797e5b7db --- /dev/null +++ b/cmake/modules/MacroEnsureVersion.cmake @@ -0,0 +1,117 @@ +# This file defines the following macros for developers to use in ensuring +# that installed software is of the right version: +# +# MACRO_ENSURE_VERSION - test that a version number is greater than +# or equal to some minimum +# MACRO_ENSURE_VERSION_RANGE - test that a version number is greater than +# or equal to some minimum and less than some +# maximum +# MACRO_ENSURE_VERSION2 - deprecated, do not use in new code +# + +# MACRO_ENSURE_VERSION +# This macro compares version numbers of the form "x.y.z" or "x.y" +# MACRO_ENSURE_VERSION( FOO_MIN_VERSION FOO_VERSION_FOUND FOO_VERSION_OK) +# will set FOO_VERSION_OK to true if FOO_VERSION_FOUND >= FOO_MIN_VERSION +# Leading and trailing text is ok, e.g. +# MACRO_ENSURE_VERSION( "2.5.31" "flex 2.5.4a" VERSION_OK) +# which means 2.5.31 is required and "flex 2.5.4a" is what was found on the system + +# Copyright (c) 2006, David Faure, +# Copyright (c) 2007, Will Stephenson +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +# MACRO_ENSURE_VERSION_RANGE +# This macro ensures that a version number of the form +# "x.y.z" or "x.y" falls within a range defined by +# min_version <= found_version < max_version. +# If this expression holds, FOO_VERSION_OK will be set TRUE +# +# Example: MACRO_ENSURE_VERSION_RANGE3( "0.1.0" ${FOOCODE_VERSION} "0.7.0" FOO_VERSION_OK ) +# +# This macro will break silently if any of x,y,z are greater than 100. +# +# Copyright (c) 2007, Will Stephenson +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +# NORMALIZE_VERSION +# Helper macro to convert version numbers of the form "x.y.z" +# to an integer equal to 10^4 * x + 10^2 * y + z +# +# This macro will break silently if any of x,y,z are greater than 100. +# +# Copyright (c) 2006, David Faure, +# Copyright (c) 2007, Will Stephenson +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +# CHECK_RANGE_INCLUSIVE_LOWER +# Helper macro to check whether x <= y < z +# +# Copyright (c) 2007, Will Stephenson +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + + +MACRO(NORMALIZE_VERSION _requested_version _normalized_version) + STRING(REGEX MATCH "[^0-9]*[0-9]+\\.[0-9]+\\.[0-9]+.*" _threePartMatch "${_requested_version}") + if (_threePartMatch) + # parse the parts of the version string + STRING(REGEX REPLACE "[^0-9]*([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" _major_vers "${_requested_version}") + STRING(REGEX REPLACE "[^0-9]*[0-9]+\\.([0-9]+)\\.[0-9]+.*" "\\1" _minor_vers "${_requested_version}") + STRING(REGEX REPLACE "[^0-9]*[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" _patch_vers "${_requested_version}") + else (_threePartMatch) + STRING(REGEX REPLACE "([0-9]+)\\.[0-9]+" "\\1" _major_vers "${_requested_version}") + STRING(REGEX REPLACE "[0-9]+\\.([0-9]+)" "\\1" _minor_vers "${_requested_version}") + set(_patch_vers "0") + endif (_threePartMatch) + + # compute an overall version number which can be compared at once + MATH(EXPR ${_normalized_version} "${_major_vers}*10000 + ${_minor_vers}*100 + ${_patch_vers}") +ENDMACRO(NORMALIZE_VERSION) + +MACRO(MACRO_CHECK_RANGE_INCLUSIVE_LOWER _lower_limit _value _upper_limit _ok) + if (${_value} LESS ${_lower_limit}) + set( ${_ok} FALSE ) + elseif (${_value} EQUAL ${_lower_limit}) + set( ${_ok} TRUE ) + elseif (${_value} EQUAL ${_upper_limit}) + set( ${_ok} FALSE ) + elseif (${_value} GREATER ${_upper_limit}) + set( ${_ok} FALSE ) + else (${_value} LESS ${_lower_limit}) + set( ${_ok} TRUE ) + endif (${_value} LESS ${_lower_limit}) +ENDMACRO(MACRO_CHECK_RANGE_INCLUSIVE_LOWER) + +MACRO(MACRO_ENSURE_VERSION requested_version found_version var_too_old) + NORMALIZE_VERSION( ${requested_version} req_vers_num ) + NORMALIZE_VERSION( ${found_version} found_vers_num ) + + if (found_vers_num LESS req_vers_num) + set( ${var_too_old} FALSE ) + else (found_vers_num LESS req_vers_num) + set( ${var_too_old} TRUE ) + endif (found_vers_num LESS req_vers_num) + +ENDMACRO(MACRO_ENSURE_VERSION) + +MACRO(MACRO_ENSURE_VERSION2 requested_version2 found_version2 var_too_old2) + MACRO_ENSURE_VERSION( ${requested_version2} ${found_version2} ${var_too_old2}) +ENDMACRO(MACRO_ENSURE_VERSION2) + +MACRO(MACRO_ENSURE_VERSION_RANGE min_version found_version max_version var_ok) + NORMALIZE_VERSION( ${min_version} req_vers_num ) + NORMALIZE_VERSION( ${found_version} found_vers_num ) + NORMALIZE_VERSION( ${max_version} max_vers_num ) + + MACRO_CHECK_RANGE_INCLUSIVE_LOWER( ${req_vers_num} ${found_vers_num} ${max_vers_num} ${var_ok}) +ENDMACRO(MACRO_ENSURE_VERSION_RANGE) + + diff --git a/cmake/modules/MacroLibrary.cmake b/cmake/modules/MacroLibrary.cmake new file mode 100644 index 0000000000..a467d84022 --- /dev/null +++ b/cmake/modules/MacroLibrary.cmake @@ -0,0 +1,19 @@ +# - include MacroLibrary offers a collection of macros which extend the built-in cmake commands + +# Copyright (c) 2006, Alexander Neundorf, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +INCLUDE(MacroOptionalFindPackage) +INCLUDE(MacroOptionalAddSubdirectory) +INCLUDE(MacroAdditionalCleanFiles) +INCLUDE(MacroAddFileDependencies) +INCLUDE(MacroAddCompileFlags) +INCLUDE(MacroAddLinkFlags) +INCLUDE(MacroAppendIf) +INCLUDE(MacroEnsureOutOfSourceBuild) +INCLUDE(MacroBoolTo01) +INCLUDE(MacroPushRequiredVars) +INCLUDE(MacroLogFeature) +INCLUDE(MacroWriteBasicCMakeVersionFile) diff --git a/cmake/modules/MacroLogFeature.cmake b/cmake/modules/MacroLogFeature.cmake new file mode 100644 index 0000000000..11861b9571 --- /dev/null +++ b/cmake/modules/MacroLogFeature.cmake @@ -0,0 +1,125 @@ +# This file defines the Feature Logging macros. +# +# MACRO_LOG_FEATURE(VAR FEATURE DESCRIPTION URL [REQUIRED [MIN_VERSION [COMMENTS]]]) +# Logs the information so that it can be displayed at the end +# of the configure run +# VAR : TRUE or FALSE, indicating whether the feature is supported +# FEATURE: name of the feature, e.g. "libjpeg" +# DESCRIPTION: description what this feature provides +# URL: home page +# REQUIRED: TRUE or FALSE, indicating whether the featue is required +# MIN_VERSION: minimum version number. empty string if unneeded +# COMMENTS: More info you may want to provide. empty string if unnecessary +# +# MACRO_DISPLAY_FEATURE_LOG() +# Call this to display the collected results. +# Exits CMake with a FATAL error message if a required feature is missing +# +# Example: +# +# INCLUDE(MacroLogFeature) +# +# FIND_PACKAGE(JPEG) +# MACRO_LOG_FEATURE(JPEG_FOUND "libjpeg" "Support JPEG images" "http://www.ijg.org" TRUE "3.2a" "") +# ... +# MACRO_DISPLAY_FEATURE_LOG() + +# Copyright (c) 2006, Alexander Neundorf, +# Copyright (c) 2006, Allen Winter, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +IF (NOT _macroLogFeatureAlreadyIncluded) + SET(_file ${CMAKE_BINARY_DIR}/MissingRequirements.txt) + IF (EXISTS ${_file}) + FILE(REMOVE ${_file}) + ENDIF (EXISTS ${_file}) + + SET(_file ${CMAKE_BINARY_DIR}/EnabledFeatures.txt) + IF (EXISTS ${_file}) + FILE(REMOVE ${_file}) + ENDIF (EXISTS ${_file}) + + SET(_file ${CMAKE_BINARY_DIR}/DisabledFeatures.txt) + IF (EXISTS ${_file}) + FILE(REMOVE ${_file}) + ENDIF (EXISTS ${_file}) + + SET(_macroLogFeatureAlreadyIncluded TRUE) +ENDIF (NOT _macroLogFeatureAlreadyIncluded) + + +MACRO(MACRO_LOG_FEATURE _var _package _description _url ) # _required _minvers _comments) + + SET(_required "${ARGV4}") + SET(_minvers "${ARGV5}") + SET(_comments "${ARGV6}") + + IF (${_var}) + SET(_LOGFILENAME ${CMAKE_BINARY_DIR}/EnabledFeatures.txt) + ELSE (${_var}) + IF (${_required} MATCHES "[Tt][Rr][Uu][Ee]") + SET(_LOGFILENAME ${CMAKE_BINARY_DIR}/MissingRequirements.txt) + ELSE (${_required} MATCHES "[Tt][Rr][Uu][Ee]") + SET(_LOGFILENAME ${CMAKE_BINARY_DIR}/DisabledFeatures.txt) + ENDIF (${_required} MATCHES "[Tt][Rr][Uu][Ee]") + ENDIF (${_var}) + + SET(_logtext "+ ${_package}") + + IF (NOT ${_var}) + IF (${_minvers} MATCHES ".*") + SET(_logtext "${_logtext}, ${_minvers} or higher") + ENDIF (${_minvers} MATCHES ".*") + SET(_logtext "${_logtext}: ${_description} <${_url}>") + IF (${_comments} MATCHES ".*") + SET(_logtext "${_logtext}\n${_comments}") + ENDIF (${_comments} MATCHES ".*") +# SET(_logtext "${_logtext}\n") #double-space missing features? + ENDIF (NOT ${_var}) + FILE(APPEND "${_LOGFILENAME}" "${_logtext}\n") + +ENDMACRO(MACRO_LOG_FEATURE) + + +MACRO(MACRO_DISPLAY_FEATURE_LOG) + + SET(_file ${CMAKE_BINARY_DIR}/MissingRequirements.txt) + IF (EXISTS ${_file}) + FILE(READ ${_file} _requirements) + MESSAGE(STATUS "\n-----------------------------------------------------------------------------\n-- The following REQUIRED packages could NOT be located on your system.\n-- Please install them before continuing this software installation.\n-----------------------------------------------------------------------------\n${_requirements}-----------------------------------------------------------------------------") + FILE(REMOVE ${_file}) + MESSAGE(FATAL_ERROR "Exiting: Missing Requirements") + ENDIF (EXISTS ${_file}) + + SET(_summary "\n") + + SET(_elist 0) + SET(_file ${CMAKE_BINARY_DIR}/EnabledFeatures.txt) + IF (EXISTS ${_file}) + SET(_elist 1) + FILE(READ ${_file} _enabled) + FILE(REMOVE ${_file}) + SET(_summary "${_summary}-----------------------------------------------------------------------------\n-- The following external packages were located on your system.\n-- This installation will have the extra features provided by these packages.\n${_enabled}") + ENDIF (EXISTS ${_file}) + + SET(_dlist 0) + SET(_file ${CMAKE_BINARY_DIR}/DisabledFeatures.txt) + IF (EXISTS ${_file}) + SET(_dlist 1) + FILE(READ ${_file} _disabled) + FILE(REMOVE ${_file}) + SET(_summary "${_summary}-----------------------------------------------------------------------------\n-- The following OPTIONAL packages could NOT be located on your system.\n-- Consider installing them to enable more features from this software.\n${_disabled}") + ELSE (EXISTS ${_file}) + IF (${_elist}) + SET(_summary "${_summary}Congratulations! All external packages have been found.\n") + ENDIF (${_elist}) + ENDIF (EXISTS ${_file}) + + IF (${_elist} OR ${_dlist}) + SET(_summary "${_summary}-----------------------------------------------------------------------------\n") + ENDIF (${_elist} OR ${_dlist}) + MESSAGE(STATUS "${_summary}") + +ENDMACRO(MACRO_DISPLAY_FEATURE_LOG) diff --git a/cmake/modules/MacroOptionalAddSubdirectory.cmake b/cmake/modules/MacroOptionalAddSubdirectory.cmake new file mode 100644 index 0000000000..32e25141d4 --- /dev/null +++ b/cmake/modules/MacroOptionalAddSubdirectory.cmake @@ -0,0 +1,31 @@ +# - MACRO_OPTIONAL_ADD_SUBDIRECTORY() combines ADD_SUBDIRECTORY() with an OPTION() +# MACRO_OPTIONAL_ADD_SUBDIRECTORY( ) +# If you use MACRO_OPTIONAL_ADD_SUBDIRECTORY() instead of ADD_SUBDIRECTORY(), +# this will have two effects +# 1 - CMake will not complain if the directory doesn't exist +# This makes sense if you want to distribute just one of the subdirs +# in a source package, e.g. just one of the subdirs in kdeextragear. +# 2 - If the directory exists, it will offer an option to skip the +# subdirectory. +# This is useful if you want to compile only a subset of all +# directories. + +# Copyright (c) 2007, Alexander Neundorf, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + + +MACRO (MACRO_OPTIONAL_ADD_SUBDIRECTORY _dir ) + GET_FILENAME_COMPONENT(_fullPath ${_dir} ABSOLUTE) + IF(EXISTS ${_fullPath}) + SET(_DEFAULT_OPTION_VALUE TRUE) + IF(DISABLE_ALL_OPTIONAL_SUBDIRS AND NOT DEFINED BUILD_${_dir}) + SET(_DEFAULT_OPTION_VALUE FALSE) + ENDIF(DISABLE_ALL_OPTIONAL_SUBDIRS AND NOT DEFINED BUILD_${_dir}) + OPTION(BUILD_${_dir} "Build directory ${_dir}" ${_DEFAULT_OPTION_VALUE}) + IF(BUILD_${_dir}) + ADD_SUBDIRECTORY(${_dir}) + ENDIF(BUILD_${_dir}) + ENDIF(EXISTS ${_fullPath}) +ENDMACRO (MACRO_OPTIONAL_ADD_SUBDIRECTORY) diff --git a/cmake/modules/MacroOptionalDependPackage.cmake b/cmake/modules/MacroOptionalDependPackage.cmake new file mode 100644 index 0000000000..1a6df36a7a --- /dev/null +++ b/cmake/modules/MacroOptionalDependPackage.cmake @@ -0,0 +1,22 @@ +# Search if cmake module is installed in computer +# cmake will not fail but signal that we must install depend package before. +# add as previously name of cmake module "_name" and define package needed "_module_needed" +# if return DEPEND_PACKAGE_${_name} + +# Copyright (c) 2007, Montel Laurent +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + + +MACRO (MACRO_OPTIONAL_DEPEND_PACKAGE _name _module_needed) + set(_packagename Find${_name}.cmake) + find_file(_PACKAGE_DEPEND_FOUND ${_packagename} PATHS ${CMAKE_MODULE_PATH} ) + if(NOT _PACKAGE_DEPEND_FOUND) + MESSAGE(STATUS "cmake package ${_packagename} was not found. This package needs ${_module_needed} to be compile all program") + set(DEPEND_PACKAGE_${_name} FALSE) + else(NOT _PACKAGE_DEPEND_FOUND) + set(DEPEND_PACKAGE_${_name} TRUE) + endif(NOT _PACKAGE_DEPEND_FOUND) +ENDMACRO (MACRO_OPTIONAL_DEPEND_PACKAGE) + diff --git a/cmake/modules/MacroOptionalFindPackage.cmake b/cmake/modules/MacroOptionalFindPackage.cmake new file mode 100644 index 0000000000..816cdb7e87 --- /dev/null +++ b/cmake/modules/MacroOptionalFindPackage.cmake @@ -0,0 +1,28 @@ +# - MACRO_OPTIONAL_FIND_PACKAGE() combines FIND_PACKAGE() with an OPTION() +# MACRO_OPTIONAL_FIND_PACKAGE( [QUIT] ) +# This macro is a combination of OPTION() and FIND_PACKAGE(), it +# works like FIND_PACKAGE(), but additionally it automatically creates +# an option name WITH_, which can be disabled via the cmake GUI. +# or via -DWITH_=OFF +# The standard _FOUND variables can be used in the same way +# as when using the normal FIND_PACKAGE() + +# Copyright (c) 2006, Alexander Neundorf, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + + +MACRO (MACRO_OPTIONAL_FIND_PACKAGE _name ) + OPTION(WITH_${_name} "Search for ${_name} package" ON) + if (WITH_${_name}) + FIND_PACKAGE(${_name} ${ARGN}) + else (WITH_${_name}) + set(${_name}_FOUND) + set(${_name}_INCLUDE_DIR) + set(${_name}_INCLUDES) + set(${_name}_LIBRARY) + set(${_name}_LIBRARIES) + endif (WITH_${_name}) +ENDMACRO (MACRO_OPTIONAL_FIND_PACKAGE) + diff --git a/cmake/modules/MacroPushRequiredVars.cmake b/cmake/modules/MacroPushRequiredVars.cmake new file mode 100644 index 0000000000..650b566eed --- /dev/null +++ b/cmake/modules/MacroPushRequiredVars.cmake @@ -0,0 +1,47 @@ +# this module defines two macros: +# MACRO_PUSH_REQUIRED_VARS() +# and +# MACRO_POP_REQUIRED_VARS() +# use these if you call cmake macros which use +# any of the CMAKE_REQUIRED_XXX variables +# +# Usage: +# MACRO_PUSH_REQUIRED_VARS() +# SET(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} -DSOME_MORE_DEF) +# CHECK_FUNCTION_EXISTS(...) +# MACRO_POP_REQUIRED_VARS() + +# Copyright (c) 2006, Alexander Neundorf, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +MACRO(MACRO_PUSH_REQUIRED_VARS) + + IF(NOT DEFINED _PUSH_REQUIRED_VARS_COUNTER) + SET(_PUSH_REQUIRED_VARS_COUNTER 0) + ENDIF(NOT DEFINED _PUSH_REQUIRED_VARS_COUNTER) + + MATH(EXPR _PUSH_REQUIRED_VARS_COUNTER "${_PUSH_REQUIRED_VARS_COUNTER}+1") + + SET(_CMAKE_REQUIRED_INCLUDES_SAVE_${_PUSH_REQUIRED_VARS_COUNTER} ${CMAKE_REQUIRED_INCLUDES}) + SET(_CMAKE_REQUIRED_DEFINITIONS_SAVE_${_PUSH_REQUIRED_VARS_COUNTER} ${CMAKE_REQUIRED_DEFINITIONS}) + SET(_CMAKE_REQUIRED_LIBRARIES_SAVE_${_PUSH_REQUIRED_VARS_COUNTER} ${CMAKE_REQUIRED_LIBRARIES}) + SET(_CMAKE_REQUIRED_FLAGS_SAVE_${_PUSH_REQUIRED_VARS_COUNTER} ${CMAKE_REQUIRED_FLAGS}) +ENDMACRO(MACRO_PUSH_REQUIRED_VARS) + +MACRO(MACRO_POP_REQUIRED_VARS) + +# don't pop more than we pushed + IF("${_PUSH_REQUIRED_VARS_COUNTER}" GREATER "0") + + SET(CMAKE_REQUIRED_INCLUDES ${_CMAKE_REQUIRED_INCLUDES_SAVE_${_PUSH_REQUIRED_VARS_COUNTER}}) + SET(CMAKE_REQUIRED_DEFINITIONS ${_CMAKE_REQUIRED_DEFINITIONS_SAVE_${_PUSH_REQUIRED_VARS_COUNTER}}) + SET(CMAKE_REQUIRED_LIBRARIES ${_CMAKE_REQUIRED_LIBRARIES_SAVE_${_PUSH_REQUIRED_VARS_COUNTER}}) + SET(CMAKE_REQUIRED_FLAGS ${_CMAKE_REQUIRED_FLAGS_SAVE_${_PUSH_REQUIRED_VARS_COUNTER}}) + + MATH(EXPR _PUSH_REQUIRED_VARS_COUNTER "${_PUSH_REQUIRED_VARS_COUNTER}-1") + ENDIF("${_PUSH_REQUIRED_VARS_COUNTER}" GREATER "0") + +ENDMACRO(MACRO_POP_REQUIRED_VARS) + diff --git a/cmake/modules/MacroWriteBasicCMakeVersionFile.cmake b/cmake/modules/MacroWriteBasicCMakeVersionFile.cmake new file mode 100644 index 0000000000..6f9e418983 --- /dev/null +++ b/cmake/modules/MacroWriteBasicCMakeVersionFile.cmake @@ -0,0 +1,22 @@ +# MACRO_WRITE_BASIC_CMAKE_VERSION_FILE( _filename _major _minor _patch) +# Writes a file for use as ConfigVersion.cmake file to <_filename>. +# See the documentation of FIND_PACKAGE() for details on this. +# _filename is the output filename, it should be in the build tree. +# _major is the major version number of the project to be installed +# _minor is the minor version number of the project to be installed +# _patch is the patch version number of the project to be installed +# + +# Copyright (c) 2008, Alexander Neundorf, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +get_filename_component(_currentListFileDir ${CMAKE_CURRENT_LIST_FILE} PATH) + +function(MACRO_WRITE_BASIC_CMAKE_VERSION_FILE _filename _major _minor _patch) + set(PROJECT_VERSION_MAJOR ${_major}) + set(PROJECT_VERSION_MINOR ${_minor}) + set(PROJECT_VERSION_PATCH ${_patch}) + configure_file(${_currentListFileDir}/BasicFindPackageVersion.cmake.in "${_filename}" @ONLY) +endfunction(MACRO_WRITE_BASIC_CMAKE_VERSION_FILE _major _minor _patch) diff --git a/cmake/modules/NepomukMacros.cmake b/cmake/modules/NepomukMacros.cmake new file mode 100644 index 0000000000..14acd2bbfa --- /dev/null +++ b/cmake/modules/NepomukMacros.cmake @@ -0,0 +1,67 @@ +# This file contains the following macros: +# +# NEPOMUK_GENERATE_FROM_ONTOLOGY +# Parameters: +# ontofile - Path to the NRL ontology defining the resources to be generated. +# targetdir - Folder to which the generated sources should be written. +# out_headers - Variable which will be filled with the names of all generated headers. +# out_sources - Variable which will be filled with the names of all generated sources. +# out_includes - Variable which will be filled with complete include statements of all +# generated resource classes. +# +# In addition to the parameters an arbitrary number of template filenames can be set as arguments +# +# In case of success NEPOMUK_RESOURCES_GENERATED is true, otherwise false + +# (C) 2007 Sebastian Trueg + + +macro(NEPOMUK_GENERATE_FROM_ONTOLOGY ontofile targetdir out_headers out_sources out_includes) + + # init + set(NEPOMUK_RESOURCES_GENERATED false) + + find_program(RCGEN nepomuk-rcgen PATHS ${KDE4_BIN_INSTALL_DIR} ${BIN_INSTALL_DIR} NO_DEFAULT_PATH) + + if(NOT RCGEN) + + message(STATUS "Failed to find the Nepomuk source generator" ) + + else(NOT RCGEN) + + FILE(TO_NATIVE_PATH ${RCGEN} RCGEN) + + execute_process( + COMMAND ${RCGEN} --listheaders --prefix ${targetdir}/ --ontologies ${ontofile} + OUTPUT_VARIABLE ${out_headers} + RESULT_VARIABLE rcgen_result + ) + + # If the first call succeeds it is very very likely that the rest will, too + if(${rcgen_result} EQUAL 0) + + execute_process( + COMMAND ${RCGEN} --listsources --prefix ${targetdir}/ --ontologies ${ontofile} + OUTPUT_VARIABLE ${out_sources} + ) + + execute_process( + COMMAND ${RCGEN} --listincludes --ontologies ${ontofile} + OUTPUT_VARIABLE ${out_includes} + ) + + execute_process( + COMMAND ${RCGEN} --writeall --templates ${ARGN} --target ${targetdir}/ --ontologies ${ontofile} + ) + + set(NEPOMUK_RESOURCES_GENERATED true) + + else(${rcgen_result} EQUAL 0) + + message(STATUS "Failed to generate Nepomuk resource classes.") + + endif(${rcgen_result} EQUAL 0) + + endif(NOT RCGEN) + +endmacro(NEPOMUK_GENERATE_FROM_ONTOLOGY) diff --git a/cmake/modules/PythonCompile.py b/cmake/modules/PythonCompile.py new file mode 100644 index 0000000000..af859a2237 --- /dev/null +++ b/cmake/modules/PythonCompile.py @@ -0,0 +1,4 @@ +# By Simon Edwards +# This file is in the public domain. +import py_compile +py_compile.main() diff --git a/cmake/modules/PythonMacros.cmake b/cmake/modules/PythonMacros.cmake new file mode 100644 index 0000000000..4ae5a3c72a --- /dev/null +++ b/cmake/modules/PythonMacros.cmake @@ -0,0 +1,62 @@ +# Python macros +# ~~~~~~~~~~~~~ +# Copyright (c) 2007, Simon Edwards +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. +# +# This file defines the following macros: +# +# PYTHON_INSTALL (SOURCE_FILE DESINATION_DIR) +# Install the SOURCE_FILE, which is a Python .py file, into the +# destination directory during install. The file will be byte compiled +# and both the .py file and .pyc file will be installed. + +GET_FILENAME_COMPONENT(PYTHON_MACROS_MODULE_PATH ${CMAKE_CURRENT_LIST_FILE} PATH) + +MACRO(PYTHON_INSTALL SOURCE_FILE DESINATION_DIR) + + FIND_FILE(_python_compile_py PythonCompile.py PATHS ${CMAKE_MODULE_PATH}) + + ADD_CUSTOM_TARGET(compile_python_files ALL) + + # Install the source file. + INSTALL(FILES ${SOURCE_FILE} DESTINATION ${DESINATION_DIR}) + + # Byte compile and install the .pyc file. + GET_FILENAME_COMPONENT(_absfilename ${SOURCE_FILE} ABSOLUTE) + GET_FILENAME_COMPONENT(_filename ${SOURCE_FILE} NAME) + GET_FILENAME_COMPONENT(_filenamebase ${SOURCE_FILE} NAME_WE) + GET_FILENAME_COMPONENT(_basepath ${SOURCE_FILE} PATH) + + if(WIN32) + string(REGEX REPLACE ".:/" "/" _basepath "${_basepath}") + endif(WIN32) + + SET(_bin_py ${CMAKE_CURRENT_BINARY_DIR}/${_basepath}/${_filename}) + SET(_bin_pyc ${CMAKE_CURRENT_BINARY_DIR}/${_basepath}/${_filenamebase}.pyc) + + FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${_basepath}) + + SET(_message "-DMESSAGE=Byte-compiling ${_bin_py}") + + GET_FILENAME_COMPONENT(_abs_bin_py ${_bin_py} ABSOLUTE) + IF(_abs_bin_py STREQUAL ${_absfilename}) # Don't copy the file onto itself. + ADD_CUSTOM_COMMAND( + TARGET compile_python_files + COMMAND ${CMAKE_COMMAND} -E echo ${message} + COMMAND ${PYTHON_EXECUTABLE} ${_python_compile_py} ${_bin_py} + DEPENDS ${_absfilename} + ) + ELSE(_abs_bin_py STREQUAL ${_absfilename}) + ADD_CUSTOM_COMMAND( + TARGET compile_python_files + COMMAND ${CMAKE_COMMAND} -E echo ${message} + COMMAND ${CMAKE_COMMAND} -E copy ${_absfilename} ${_bin_py} + COMMAND ${PYTHON_EXECUTABLE} ${_python_compile_py} ${_bin_py} + DEPENDS ${_absfilename} + ) + ENDIF(_abs_bin_py STREQUAL ${_absfilename}) + + INSTALL(FILES ${_bin_pyc} DESTINATION ${DESINATION_DIR}) +ENDMACRO(PYTHON_INSTALL) diff --git a/cmake/modules/SIPMacros.cmake b/cmake/modules/SIPMacros.cmake new file mode 100644 index 0000000000..eb5ea06ca6 --- /dev/null +++ b/cmake/modules/SIPMacros.cmake @@ -0,0 +1,113 @@ +# Macros for SIP +# ~~~~~~~~~~~~~~ +# Copyright (c) 2007, Simon Edwards +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. +# +# SIP website: http://www.riverbankcomputing.co.uk/sip/index.php +# +# This file defines the following macros: +# +# ADD_SIP_PYTHON_MODULE (MODULE_NAME MODULE_SIP [library1, libaray2, ...]) +# Specifies a SIP file to be built into a Python module and installed. +# MODULE_NAME is the name of Python module including any path name. (e.g. +# os.sys, Foo.bar etc). MODULE_SIP the path and filename of the .sip file +# to process and compile. libraryN are libraries that the Python module, +# which is typically a shared library, should be linked to. The built +# module will also be install into Python's site-packages directory. +# +# The behaviour of the ADD_SIP_PYTHON_MODULE macro can be controlled by a +# number of variables: +# +# SIP_INCLUDES - List of directories which SIP will scan through when looking +# for included .sip files. (Corresponds to the -I option for SIP.) +# +# SIP_TAGS - List of tags to define when running SIP. (Corresponds to the -t +# option for SIP.) +# +# SIP_CONCAT_PARTS - An integer which defines the number of parts the C++ code +# of each module should be split into. Defaults to 8. (Corresponds to the +# -j option for SIP.) +# +# SIP_DISABLE_FEATURES - List of feature names which should be disabled +# running SIP. (Corresponds to the -x option for SIP.) +# +# SIP_EXTRA_OPTIONS - Extra command line options which should be passed on to +# SIP. + +SET(SIP_INCLUDES) +SET(SIP_TAGS) +SET(SIP_CONCAT_PARTS 8) +SET(SIP_DISABLE_FEATURES) +SET(SIP_EXTRA_OPTIONS) + +MACRO(ADD_SIP_PYTHON_MODULE MODULE_NAME MODULE_SIP) + + SET(EXTRA_LINK_LIBRARIES ${ARGN}) + + STRING(REPLACE "." "/" _x ${MODULE_NAME}) + GET_FILENAME_COMPONENT(_parent_module_path ${_x} PATH) + GET_FILENAME_COMPONENT(_child_module_name ${_x} NAME) + + GET_FILENAME_COMPONENT(_module_path ${MODULE_SIP} PATH) + GET_FILENAME_COMPONENT(_abs_module_sip ${MODULE_SIP} ABSOLUTE) + + # We give this target a long logical target name. + # (This is to avoid having the library name clash with any already + # install library names. If that happens then cmake dependancy + # tracking get confused.) + STRING(REPLACE "." "_" _logical_name ${MODULE_NAME}) + SET(_logical_name "python_module_${_logical_name}") + + FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${_module_path}) # Output goes in this dir. + + SET(_sip_includes) + FOREACH (_inc ${SIP_INCLUDES}) + GET_FILENAME_COMPONENT(_abs_inc ${_inc} ABSOLUTE) + LIST(APPEND _sip_includes -I ${_abs_inc}) + ENDFOREACH (_inc ) + + SET(_sip_tags) + FOREACH (_tag ${SIP_TAGS}) + LIST(APPEND _sip_tags -t ${_tag}) + ENDFOREACH (_tag) + + SET(_sip_x) + FOREACH (_x ${SIP_DISABLE_FEATURES}) + LIST(APPEND _sip_x -x ${_x}) + ENDFOREACH (_x ${SIP_DISABLE_FEATURES}) + + SET(_message "-DMESSAGE=Generating CPP code for module ${MODULE_NAME}") + SET(_sip_output_files) + FOREACH(CONCAT_NUM RANGE 0 ${SIP_CONCAT_PARTS} ) + IF( ${CONCAT_NUM} LESS ${SIP_CONCAT_PARTS} ) + SET(_sip_output_files ${_sip_output_files} ${CMAKE_CURRENT_BINARY_DIR}/${_module_path}/sip${_child_module_name}part${CONCAT_NUM}.cpp ) + ENDIF( ${CONCAT_NUM} LESS ${SIP_CONCAT_PARTS} ) + ENDFOREACH(CONCAT_NUM RANGE 0 ${SIP_CONCAT_PARTS} ) + + IF(NOT WIN32) + SET(TOUCH_COMMAND touch) + ELSE(NOT WIN32) + SET(TOUCH_COMMAND echo) + # instead of a touch command, give out the name and append to the files + # this is basically what the touch command does. + FOREACH(filename ${_sip_output_files}) + FILE(APPEND filename "") + ENDFOREACH(filename ${_sip_output_files}) + ENDIF(NOT WIN32) + ADD_CUSTOM_COMMAND( + OUTPUT ${_sip_output_files} + COMMAND ${CMAKE_COMMAND} -E echo ${message} + COMMAND ${TOUCH_COMMAND} ${_sip_output_files} + COMMAND ${SIP_EXECUTABLE} ${_sip_tags} ${_sip_x} ${SIP_EXTRA_OPTIONS} -j ${SIP_CONCAT_PARTS} -c ${CMAKE_CURRENT_BINARY_DIR}/${_module_path} ${_sip_includes} ${_abs_module_sip} + DEPENDS ${_abs_module_sip} ${SIP_EXTRA_FILES_DEPEND} + ) + + ADD_LIBRARY(${_logical_name} SHARED ${_sip_output_files} ) + TARGET_LINK_LIBRARIES(${_logical_name} ${PYTHON_LIBRARY}) + TARGET_LINK_LIBRARIES(${_logical_name} ${EXTRA_LINK_LIBRARIES}) + SET_TARGET_PROPERTIES(${_logical_name} PROPERTIES PREFIX "" OUTPUT_NAME ${_child_module_name}) + + INSTALL(TARGETS ${_logical_name} DESTINATION "${PYTHON_SITE_PACKAGES_DIR}/${_parent_module_path}") + +ENDMACRO(ADD_SIP_PYTHON_MODULE) diff --git a/cmake/modules/Win32Macros.cmake b/cmake/modules/Win32Macros.cmake new file mode 100644 index 0000000000..e5a3655b01 --- /dev/null +++ b/cmake/modules/Win32Macros.cmake @@ -0,0 +1,47 @@ +# win32 macros +# +# ADDEXPLORERWRAPPER(project) +# +# Exists only under Win32 ! +# +# addExplorerWrapper creates batch files for fast access +# to the build environment from the win32 explorer. +# +# For mingw and nmake projects it opens a command shell, +# for Visual Studio IDE's (at least tested with VS 8 2005) it +# opens the related .sln file with paths setting specified at +# configure time. + +# Copyright (c) 2006-2007, Ralf Habacker +# +# Redistribution and use is allowed according to the terms of the BSD license. + + +if (WIN32) + # + MACRO (addExplorerWrapper _projectname) + # write explorer wrappers + get_filename_component(CMAKE_BIN_PATH ${CMAKE_COMMAND} PATH) + set (ADD_PATH "${CMAKE_BIN_PATH}") + + if (QT_QMAKE_EXECUTABLE) + get_filename_component(QT_BIN_PATH ${QT_QMAKE_EXECUTABLE} PATH) + set (ADD_PATH "${ADD_PATH};${QT_BIN_PATH}") + endif (QT_QMAKE_EXECUTABLE) + + # add here more pathes + + if (MINGW) + get_filename_component(MINGW_BIN_PATH ${CMAKE_CXX_COMPILER} PATH) + set (ADD_PATH "${ADD_PATH};${MINGW_BIN_PATH}") + write_file (${CMAKE_BINARY_DIR}/${_projectname}-shell.bat "set PATH=${ADD_PATH};%PATH%\ncmd.exe") + else (MINGW) + if (CMAKE_BUILD_TOOL STREQUAL "nmake") + get_filename_component(VC_BIN_PATH ${CMAKE_CXX_COMPILER} PATH) + write_file (${CMAKE_BINARY_DIR}/${_projectname}-shell.bat "set PATH=${ADD_PATH};%PATH%\ncall \"${VC_BIN_PATH}\\vcvars32.bat\"\ncmd.exe") + else (CMAKE_BUILD_TOOL STREQUAL "nmake") + write_file (${CMAKE_BINARY_DIR}/${_projectname}-sln.bat "set PATH=${ADD_PATH};%PATH%\nstart ${_projectname}.sln") + endif (CMAKE_BUILD_TOOL STREQUAL "nmake") + endif (MINGW) + ENDMACRO (addExplorerWrapper) +endif(WIN32) diff --git a/cmake/modules/check_installed_exports_file.cmake b/cmake/modules/check_installed_exports_file.cmake new file mode 100644 index 0000000000..454d2a0911 --- /dev/null +++ b/cmake/modules/check_installed_exports_file.cmake @@ -0,0 +1,44 @@ +# INSTALL_DIR - set it to the install destination +# INSTALL_PREFIX - set it to CMAKE_INSTALL_PREFIX +# CURRENT_BINARY_DIR - set it to CMAKE_CURRENT_BINARY_DIR +# FILENAME - the filename of the exports file + +# get the absolute install directory, consider absolute and relative paths and also DESTDIR +if(IS_ABSOLUTE "${INSTALL_DIR}") + set(installDir "$ENV{DESTDIR}${INSTALL_DIR}") +else(IS_ABSOLUTE "${INSTALL_DIR}") + set(installDir "$ENV{DESTDIR}${INSTALL_PREFIX}/${INSTALL_DIR}") +endif(IS_ABSOLUTE "${INSTALL_DIR}") + +set(installedExportsFile "${installDir}/${FILENAME}") + + +# if the file already exists at the install location, and if we can +# find the exports file in the build dir, read both, and if their contents differ, +# remove all configuration-specific exports files from the install dir, since +# they may create conflicts if the new targets have been added/targets have been +# removed/ targets have been renamed/ the namespace for the exported targets has changed +if(EXISTS "${installedExportsFile}") + if (${INSTALL_DIR} MATCHES "^(/)(.+)$") + set(binaryDirExportFileDir "_${CMAKE_MATCH_2}") + set(binaryDirExportsFile "${CURRENT_BINARY_DIR}/CMakeFiles/Export/${binaryDirExportFileDir}/${FILENAME}") + + if(EXISTS "${binaryDirExportsFile}") + file(READ "${installedExportsFile}" installedExportsFileContents) + file(READ "${binaryDirExportsFile}" binaryDirExportsFileContents) + + if(NOT "${installedExportsFileContents}" STREQUAL "${binaryDirExportsFileContents}") + + if("${FILENAME}" MATCHES "^(.+)(\\.cmake)$") + message(STATUS "Installed and new ${FILENAME} differ, removing installed ${CMAKE_MATCH_1}-*.cmake files") + file(GLOB files "${installDir}/${CMAKE_MATCH_1}-*.cmake") + file(REMOVE ${files}) + endif("${FILENAME}" MATCHES "^(.+)(\\.cmake)$") +# else(NOT "${installedExportsFileContents}" STREQUAL "${binaryDirExportsFileContents}") +# message(STATUS "FILES are the same") + endif(NOT "${installedExportsFileContents}" STREQUAL "${binaryDirExportsFileContents}") + + endif(EXISTS "${binaryDirExportsFile}") + endif (${INSTALL_DIR} MATCHES "^(/)(.+)$") + +endif(EXISTS "${installedExportsFile}") diff --git a/cmake/modules/cmake-modules-styleguide.txt b/cmake/modules/cmake-modules-styleguide.txt new file mode 100644 index 0000000000..10e65dc009 --- /dev/null +++ b/cmake/modules/cmake-modules-styleguide.txt @@ -0,0 +1,115 @@ +This is a copy of the file CMake/Modules/readme.txt from cmake cvs. +Please adhere to the guidelines given below when writing cmake modules +for KDE. + +Some additional guidelines for use in KDE: +-indent using 2, 3 or 4 spaces, not tabs +-use all-lower-case for commands, except if the rest of the file uses +consistently all-upper-case for commands + +Alex + +---------------------------------------------------------------------- + +Note to authors of FindXXX.cmake files + +We would like all FindXXX.cmake files to produce consistent variable names. + +Please use the following consistent variable names for general use. + +XXX_INCLUDE_DIRS The final set of include directories listed in one variable for use by client code. This should not be a cache entry. +XXX_LIBRARIES The libraries to link against to use XXX. These should include full paths. This should not be a cache entry. +XXX_DEFINITIONS Definitions to use when compiling code that uses XXX. This really shouldn't include options such as (-DHAS_JPEG)that a client source-code file uses to decide whether to #include +XXX_EXECUTABLE Where to find the XXX tool. +XXX_YYY_EXECUTABLE Where to find the YYY tool that comes with XXX. +XXX_LIBRARY_DIRS Optionally, the final set of library directories listed in one variable for use by client code. This should not be a cache entry. +XXX_ROOT_DIR Where to find the base directory of XXX. +XXX_VERSION_YY Expect Version YY if true. Make sure at most one of these is ever true. +XXX_WRAP_YY If False, do not try to use the relevent CMake wrapping command. +XXX_YY_FOUND If False, optional YY part of XXX sytem is not available. +XXX_FOUND Set to false, or undefined, if we haven't found, or don't want to use XXX. +XXX_RUNTIME_LIBRARY_DIRS Optionally, the runtime library search path for use when running an executable linked to shared libraries. + The list should be used by user code to create the PATH on windows or LD_LIBRARY_PATH on unix. + This should not be a cache entry. +XXX_VERSION_STRING A human-readable string containing the version of the package found, if any. +XXX_VERSION_MAJOR The major version of the package found, if any. +XXX_VERSION_MINOR The minor version of the package found, if any. +XXX_VERSION_PATCH The patch version of the package found, if any. + +You do not have to provide all of the above variables. You should provide XXX_FOUND under most circumstances. If XXX is a library, then XXX_LIBRARIES, should also be defined, and XXX_INCLUDE_DIRS should usually be defined (I guess libm.a might be an exception) + +The following names should not usually be used in CMakeLists.txt files, but they may be usefully modified in users' CMake Caches to control stuff. + +XXX_LIBRARY Name of XXX Library. A User may set this and XXX_INCLUDE_DIR to ignore to force non-use of XXX. +XXX_YY_LIBRARY Name of YY library that is part of the XXX system. It may or may not be required to use XXX. +XXX_INCLUDE_DIR Where to find xxx.h, etc. (XXX_INCLUDE_PATH was considered bad because a path includes an actual filename.) +XXX_YY_INCLUDE_DIR Where to find xxx_yy.h, etc. + +For tidiness's sake, try to keep as many options as possible out of the cache, leaving at least one option which can be used to disable use of the module, or locate a not-found library (e.g. XXX_ROOT_DIR). For the same reason, mark most cache options as advanced. + +If you need other commands to do special things then it should still begin with XXX_. This gives a sort of namespace effect and keeps things tidy for the user. You should put comments describing all the exported settings, plus descriptions of any the users can use to control stuff. + +You really should also provide backwards compatibility any old settings that were actually in use. Make sure you comment them as deprecated, so that no-one starts using them. + +To correctly document a module, create a comment block at the top with # comments. There are three types of comments that can be in the block: + +1. The brief description of the module, this is done by: +# - a small description + +2. A paragraph of text. This is done with all text that has a single +space between the # and the text. To create a new paragraph, just +put a # with no text on the line. + +3. A verbatim line. This is done with two spaces between the # and the text. + +For example: + +# - This is a cool module +# This module does really cool stuff. +# It can do even more than you think. +# +# It even needs to paragraphs to tell you about it. +# And it defines the following variables: +# VAR_COOL - this is great isn't it? +# VAR_REALLY_COOL - cool right? +# + +To have a .cmake file in this directory NOT show up in the +modules documentation, you should start the file with a blank +line. + +A FindXXX.cmake module will typically be loaded by the command + + FIND_PACKAGE(XXX [major[.minor[.patch]]] [EXACT] + [QUIET] [REQUIRED [components...]]) + +If any version numbers are given to the command it will set the +variable XXX_FIND_VERSION to contain the whole version. The variables +XXX_FIND_VERSION_MAJOR, XXX_FIND_VERSION_MINOR, and +XXX_FIND_VERSION_PATCH will be set to contain the corresponding +portions of the version number. The variable XXX_FIND_VERSION_EXACT +will indicate whether an exact version is requested. +If the find module supports versioning it should locate a version of +the package that is compatible with the version requested. If a +compatible version of the package cannot be found the module should +not report success. The version of the package found should be stored +in the version variables named above. + +If the QUIET option is given to the command it will set the variable +XXX_FIND_QUIETLY to true before loading the FindXXX.cmake module. If +this variable is set the module should not complain about not being +able to find the package. If the +REQUIRED option is given to the command it will set the variable +XXX_FIND_REQUIRED to true before loading the FindXXX.cmake module. If +this variable is set the module should issue a FATAL_ERROR if the +package cannot be found. For each package-specific component, say +YYY, listed after the REQUIRED option a variable XXX_FIND_REQUIRED_YYY +to true. The set of components listed will also be specified in a +XXX_FIND_COMPONENTS variable. This can be used by the FindXXX.cmake +module to determine which sub-components of the package must be found. +If neither the QUIET nor REQUIRED options are given then the +FindXXX.cmake module should look for the package and complain without +error if the module is not found. + +To get this behaviour you can use the FIND_PACKAGE_HANDLE_STANDARD_ARGS() +macro, as an example see FindJPEG.cmake. diff --git a/cmake/modules/config-alsa.h.cmake b/cmake/modules/config-alsa.h.cmake new file mode 100644 index 0000000000..fb9cb8ca67 --- /dev/null +++ b/cmake/modules/config-alsa.h.cmake @@ -0,0 +1,34 @@ +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_LINUX_AWE_VOICE_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_AWE_VOICE_H 1 + +/* Define to 1 if you have the + header file. */ +#cmakedefine HAVE__USR_SRC_SYS_GNU_I386_ISA_SOUND_AWE_VOICE_H 1 + +/* Define to 1 if you have the + header file. */ +#cmakedefine HAVE__USR_SRC_SYS_I386_ISA_SOUND_AWE_VOICE_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_AWE_VOICE_H 1 + +/* Define if you have libasound.so.2 (required for ALSA 0.9.x support) */ +#cmakedefine HAVE_LIBASOUND2 1 + +/* Define if libasound has snd_pcm_resume() */ +#cmakedefine HAVE_SND_PCM_RESUME 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_ALSA_ASOUNDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_ASOUNDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_SOUNDCARD_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_MACHINE_SOUNDCARD_H 1 diff --git a/cmake/modules/kde4_cmake_uninstall.cmake.in b/cmake/modules/kde4_cmake_uninstall.cmake.in new file mode 100644 index 0000000000..36dd9ba8e6 --- /dev/null +++ b/cmake/modules/kde4_cmake_uninstall.cmake.in @@ -0,0 +1,22 @@ +IF(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt") + MESSAGE(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_BINARY_DIR@/install_manifest.txt\"") +ENDIF(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt") + +FILE(READ "@CMAKE_BINARY_DIR@/install_manifest.txt" files) +STRING(REGEX REPLACE "\n" ";" files "${files}") +FOREACH(file ${files}) + MESSAGE(STATUS "Uninstalling \"${file}\"") + IF(EXISTS "${file}") + EXEC_PROGRAM( + "@CMAKE_COMMAND@" ARGS "-E remove \"${file}\"" + OUTPUT_VARIABLE rm_out + RETURN_VALUE rm_retval + ) + IF("${rm_retval}" STREQUAL 0) + ELSE("${rm_retval}" STREQUAL 0) + MESSAGE(FATAL_ERROR "Problem when removing \"${file}\"") + ENDIF("${rm_retval}" STREQUAL 0) + ELSE(EXISTS "${file}") + MESSAGE(STATUS "File \"${file}\" does not exist.") + ENDIF(EXISTS "${file}") +ENDFOREACH(file) diff --git a/cmake/modules/kde4_exec_via_sh.cmake b/cmake/modules/kde4_exec_via_sh.cmake new file mode 100644 index 0000000000..6b826ff06b --- /dev/null +++ b/cmake/modules/kde4_exec_via_sh.cmake @@ -0,0 +1,31 @@ + +# Copyright (c) 2006, Alexander Neundorf, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + + +if (UNIX) + +file(WRITE "${_filename}" +"#!/bin/sh +# created by cmake, don't edit, changes will be lost + +${_library_path_variable}=${_ld_library_path}\${${_library_path_variable}:+:\$${_library_path_variable}} \"${_executable}\" \"$@\" +") + +# make it executable +# since this is only executed on UNIX, it is safe to call chmod +exec_program(chmod ARGS ug+x \"${_filename}\" OUTPUT_VARIABLE _dummy ) + +else (UNIX) + +file(TO_NATIVE_PATH "${_ld_library_path}" win_path) + +file(WRITE "${_filename}" +" +set PATH=${win_path};$ENV{PATH} +\"${_executable}\" %* +") + +endif (UNIX) diff --git a/cmake/modules/kde4automoc.files.in b/cmake/modules/kde4automoc.files.in new file mode 100644 index 0000000000..011c52a39e --- /dev/null +++ b/cmake/modules/kde4automoc.files.in @@ -0,0 +1,4 @@ +MOC_INCLUDES: +@_moc_incs@ +SOURCES: +@_moc_files@ diff --git a/cmake/modules/kde4init_dummy.cpp.in b/cmake/modules/kde4init_dummy.cpp.in new file mode 100644 index 0000000000..f0cd348884 --- /dev/null +++ b/cmake/modules/kde4init_dummy.cpp.in @@ -0,0 +1,3 @@ +extern "C" int kdemain(int argc, char* argv[]); +extern "C" int kdeinitmain(int argc, char* argv[]) { return kdemain(argc,argv); } +int main(int argc, char* argv[]) { return kdemain(argc,argv); } diff --git a/cmake/modules/kde4init_win32lib_dummy.cpp.in b/cmake/modules/kde4init_win32lib_dummy.cpp.in new file mode 100644 index 0000000000..0aa704bc37 --- /dev/null +++ b/cmake/modules/kde4init_win32lib_dummy.cpp.in @@ -0,0 +1,5 @@ +/* dummy file, used by KDE4_ADD_KDEINIT_EXECUTABLE() under Windows, + * so that the created static library is not completely empty */ + +extern "C" int kdeinit_${_KDEINIT4_TARGET_NAME_}_dummy(void) { return 42; } + diff --git a/cmake/modules/kde4uic.cmake b/cmake/modules/kde4uic.cmake new file mode 100644 index 0000000000..0e2a33c90e --- /dev/null +++ b/cmake/modules/kde4uic.cmake @@ -0,0 +1,55 @@ + +# Copyright (c) 2006, Alexander Neundorf, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +#using a ui3 file with uic3 +if (KDE3_IMPL) + + EXECUTE_PROCESS(COMMAND ${KDE_UIC_EXECUTABLE} + -nounload -tr tr2i18n + -impl ${KDE_UIC_H_FILE} + ${KDE_UIC_FILE} + OUTPUT_VARIABLE _uic_CONTENTS + ERROR_QUIET + ) +endif (KDE3_IMPL) + + +if (KDE3_HEADER) + + EXECUTE_PROCESS(COMMAND ${KDE_UIC_EXECUTABLE} + -nounload -tr tr2i18n + ${KDE_UIC_FILE} + OUTPUT_VARIABLE _uic_CONTENTS + ERROR_QUIET + ) + set(KDE_UIC_CPP_FILE ${KDE_UIC_H_FILE}) +endif (KDE3_HEADER) + +# the kde4 branch +if (KDE4_HEADER) + + EXECUTE_PROCESS(COMMAND ${KDE_UIC_EXECUTABLE} + -tr tr2i18n + ${KDE_UIC_FILE} + OUTPUT_VARIABLE _uic_CONTENTS + ERROR_QUIET + ) + + set(KDE_UIC_CPP_FILE ${KDE_UIC_H_FILE}) +endif (KDE4_HEADER) + + +#replace tr218n("") with QString::null to avoid warning from KLocale +STRING(REGEX REPLACE "tr2i18n\\(\"\"\\)" "QString::null" _uic_CONTENTS "${_uic_CONTENTS}" ) +STRING(REGEX REPLACE "tr2i18n\\(\"\", \"\"\\)" "QString::null" _uic_CONTENTS "${_uic_CONTENTS}" ) +#replace image15_data with img15_filename to make enable_final work +STRING(REGEX REPLACE "image([0-9]+)_data" "img\\1_${KDE_UIC_BASENAME}" _uic_CONTENTS "${_uic_CONTENTS}") +#fixup include guard +STRING(REGEX REPLACE "#ifndef " "#ifndef UI_" _uic_CONTENTS "${_uic_CONTENTS}") +STRING(REGEX REPLACE "#define " "#define UI_" _uic_CONTENTS "${_uic_CONTENTS}") + +FILE(WRITE ${KDE_UIC_CPP_FILE} "#include \n#include \n\n${_uic_CONTENTS}\n") + diff --git a/cmake/summary.cmake b/cmake/summary.cmake new file mode 100644 index 0000000000..5c2c6f199e --- /dev/null +++ b/cmake/summary.cmake @@ -0,0 +1,49 @@ +# cmake/modules/summary.cmake +# +# Copyright (C) 2008 Werner Smekal +# +# Macro for outputting all the most important CMake variables for haru + +# ======================================================================= +# print summary of configuration to screen +# ======================================================================= + +macro(summary) +set(_output_results " +Summary of CMake build system results for the haru library + +Install location variables which can be set by the user: +CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX} +CMAKE_INSTALL_EXEC_PREFIX ${CMAKE_INSTALL_EXEC_PREFIX} +CMAKE_INSTALL_BINDIR ${CMAKE_INSTALL_BINDIR} +CMAKE_INSTALL_LIBDIR ${CMAKE_INSTALL_LIBDIR} +CMAKE_INSTALL_INCLUDEDIR ${CMAKE_INSTALL_INCLUDEDIR} + +Other important CMake variables: + +CMAKE_SYSTEM_NAME: ${CMAKE_SYSTEM_NAME} +UNIX: ${UNIX} +WIN32: ${WIN32} +APPLE: ${APPLE} +MSVC: ${MSVC} (MSVC_VERSION: ${MSVC_VERSION}) +MINGW: ${MINGW} +MSYS: ${MSYS} +CYGWIN: ${CYGWIN} +BORLAND: ${BORLAND} +WATCOM: ${WATCOM} + +CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE} +CMAKE_C_COMPILER CMAKE_C_FLAGS: ${CMAKE_C_COMPILER} ${CMAKE_C_FLAGS} + +Library options: +LIBHARU_SHARED: ${LIBHARU_SHARED} +LIBHARU_STATIC: ${LIBHARU_STATIC} +LIBHARU_EXAMPLES: ${LIBHARU_EXAMPLES} +DEVPAK: ${DEVPAK} + +Optional libraries: +HAVE_LIBZ: ${HAVE_LIBZ} +HAVE_LIBPNG: ${HAVE_LIBPNG} +") +message("${_output_results}") +endmacro(summary) diff --git a/config/CMakeLists.txt b/config/CMakeLists.txt new file mode 100644 index 0000000000..d55582ad50 --- /dev/null +++ b/config/CMakeLists.txt @@ -0,0 +1,79 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/rose_edg_required_macros_and_functions.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/rose_edg_required_macros_and_functions.h) + + +########### install files ############### + +install(FILES rose_stdarg.h rose_varargs.h rose-g++-headerfilefixup.h rose_specific_cdefs.h DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +## DQ (9/3/2006): Reorganized the lists of EXTRA_DIST and include_HEADERS. +## DQ (9/2/2006): Removed most of these files since I don't think that these are really required +#include_HEADERS = \ +# rose_stdarg.h \ +# rose_varargs.h \ +# rose-g++-headerfilefixup.h \ +# rose_specific_cdefs.h +# +## DQ (9/3/2006): Reorganized the lists of EXTRA_DIST and include_HEADERS. +## Note that without the file: config.guess, depend, install-sh, and dirincludes; +## the configuration will exit and the backend specific compiler header file are not built. +## DQ (10/22/2003) Support for GNU header file processing (including STL header file processing) +#EXTRA_DIST = \ +# Makefile.for.ROSE.includes.and.libs \ +# QMTest_makefile.inc \ +# gnu-3.x-headerfile-fixup.pl \ +# rose_edg_required_macros_and_functions.h.in \ +# config.guess \ +# depend \ +# install-sh \ +# dirincludes \ +# create_system_headers \ +# macro_names_to_remove \ +# cleanConfigGuessOutput \ +# get_compiler_header_dirs +# +## DQ (9/3/2006): I think that if we have config.guess, depend, install-sh, and dirincludes; then we don't need "missing" +## missing +# +## DQ (9/2/2006): These appear to only be required for development versions or ROSe (in CVS) +## RV (9/12/2005): Removed 'mkinstalldirs', unnecessary with recent AutoTools versions. +#FILES_NOT_REQUIRED_FOR_DISTRIBUTIONS = \ +# acx_libxml2.m4 \ +# choose-backend-compiler.m4 \ +# compiler-defs.m4 \ +# EDG.m4 \ +# enable-rosehpct.m4 \ +# generate-backend-compiler-specific-headers.m4 \ +# qrose.m4 \ +# ROSE.m4 \ +# support-doxygen.m4 \ +# support-insure.m4 \ +# support-maple.m4 \ +# support-mysql.m4 \ +# support-omp.m4 \ +# support-gcc-omp.m4 \ +# support-purify.m4 \ +# support-rpath.m4 \ +# support-sqlite.m4 \ +# support-visualization.m4 \ +# use_edg_source_code.m4 \ +# wave.m4 \ +# config.guess \ +# depend \ +# install-sh \ +# dirincludes \ +# create_system_headers +# +## DQ (9/2/2006): I don't think these are required except in the development version of ROSE +#REMOVED_FROM_EXTRA_DIST = \ +# enable-rosehpct.m4 \ +# acx_libxml2.m4 +# diff --git a/config/rose_edg_required_macros_and_functions.h.cmake b/config/rose_edg_required_macros_and_functions.h.cmake new file mode 100644 index 0000000000..92da945632 --- /dev/null +++ b/config/rose_edg_required_macros_and_functions.h.cmake @@ -0,0 +1,679 @@ +/* JJW (12/8/2008): Do not include these definitions for EDG 3.10 */ +#ifndef ROSE_USE_NEW_EDG_INTERFACE + +/* Must use C style comments so that "--edg:old_c" options will work! */ +/* DQ (7/13/2006): Undefine these before defining them to avoid warnings. */ +/* DQ (12/23/2006): Let EDG define this if possible, but we reset it for 64 bit systems + where either EDG does not get it correct or we don't setup EDG correctly! +#undef __SIZE_TYPE__ +*/ +#undef __VERSION__ + +// $REPLACE_ME_WITH_MACRO_DEFINITIONS +#define __DBL_MIN_EXP__ (-1021) +#define __FLT_MIN__ 1.17549435e-38F +#define __DEC64_DEN__ 0.000000000000001E-383DD +#define __CHAR_BIT__ 8 +#define __WCHAR_MAX__ 2147483647 +#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1 +#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1 +#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1 +#define __DBL_DENORM_MIN__ 4.9406564584124654e-324 +#define __FLT_EVAL_METHOD__ 2 +#define __unix__ 1 +#define __DBL_MIN_10_EXP__ (-307) +#define __FINITE_MATH_ONLY__ 0 +#define __DEC64_MAX_EXP__ 384 +#define __SHRT_MAX__ 32767 +#define __LDBL_MAX__ 1.18973149535723176502e+4932L +#define __UINTMAX_TYPE__ long long unsigned int +#define __linux 1 +#define __DEC32_EPSILON__ 1E-6DF +#define __unix 1 +#define __LDBL_MAX_EXP__ 16384 +#define __linux__ 1 +#define __SCHAR_MAX__ 127 +#define __DBL_DIG__ 15 +#define _FORTIFY_SOURCE 2 +#define __SIZEOF_INT__ 4 +#define __SIZEOF_POINTER__ 4 +#define __USER_LABEL_PREFIX__ +#define __LDBL_HAS_INFINITY__ 1 +#define __FLT_EPSILON__ 1.19209290e-7F +#define __LDBL_MIN__ 3.36210314311209350626e-4932L +#define __DEC32_MAX__ 9.999999E96DF +#define __SIZEOF_LONG__ 4 +#define __DECIMAL_DIG__ 21 +#define __gnu_linux__ 1 +#define __LDBL_HAS_QUIET_NAN__ 1 +#define __GXX_RTTI 1 +#define __FLT_HAS_DENORM__ 1 +#define __SIZEOF_LONG_DOUBLE__ 12 +#define __DBL_MAX__ 1.7976931348623157e+308 +#define __DBL_HAS_INFINITY__ 1 +#define __DEC32_MIN_EXP__ (-95) +#define __LDBL_HAS_DENORM__ 1 +#define __DEC128_MAX__ 9.999999999999999999999999999999999E6144DL +#define __DEC32_MIN__ 1E-95DF +#define __DEPRECATED 1 +#define __DBL_MAX_EXP__ 1024 +#define __DEC128_EPSILON__ 1E-33DL +#define __LONG_LONG_MAX__ 9223372036854775807LL +#define __SIZEOF_SIZE_T__ 4 +#define __SIZEOF_WINT_T__ 4 +#define __GXX_ABI_VERSION 1002 +#define __FLT_MIN_EXP__ (-125) +#define __DBL_MIN__ 2.2250738585072014e-308 +#define __FLT_MIN_10_EXP__ (-37) +#define __DECIMAL_BID_FORMAT__ 1 +#define __DEC128_MIN__ 1E-6143DL +#define __REGISTER_PREFIX__ +#define __DBL_HAS_DENORM__ 1 +#define __NO_INLINE__ 1 +#define __i386 1 +#define __FLT_MANT_DIG__ 24 +#define __VERSION__ "4.3.3" +#define __DEC64_EPSILON__ 1E-15DD +#define __DEC128_MIN_EXP__ (-6143) +#define __i486__ 1 +#define unix 1 +#define __i386__ 1 +#define __SIZE_TYPE__ unsigned int +#define __DEC32_DEN__ 0.000001E-95DF +#define __ELF__ 1 +#define __FLT_RADIX__ 2 +#define __LDBL_EPSILON__ 1.08420217248550443401e-19L +#define __SIZEOF_PTRDIFF_T__ 4 +#define __FLT_HAS_QUIET_NAN__ 1 +#define __FLT_MAX_10_EXP__ 38 +#define __LONG_MAX__ 2147483647L +#define __FLT_HAS_INFINITY__ 1 +#define __DEC64_MAX__ 9.999999999999999E384DD +#define __DEC64_MANT_DIG__ 16 +#define __DEC32_MAX_EXP__ 96 +#define linux 1 +#define __DEC128_DEN__ 0.000000000000000000000000000000001E-6143DL +#define __EXCEPTIONS 1 +#define __LDBL_MANT_DIG__ 64 +#define __DBL_HAS_QUIET_NAN__ 1 +#define __WCHAR_TYPE__ int +#define __SIZEOF_FLOAT__ 4 +#define __DEC64_MIN_EXP__ (-383) +#define __FLT_DIG__ 6 +#define __INT_MAX__ 2147483647 +#define __i486 1 +#define __FLT_MAX_EXP__ 128 +#define __DBL_MANT_DIG__ 53 +#define __DEC64_MIN__ 1E-383DD +#define __WINT_TYPE__ unsigned int +#define __SIZEOF_SHORT__ 2 +#define __LDBL_MIN_EXP__ (-16381) +#define __LDBL_MAX_10_EXP__ 4932 +#define __DBL_EPSILON__ 2.2204460492503131e-16 +#define __SIZEOF_WCHAR_T__ 4 +#define __DEC_EVAL_METHOD__ 2 +#define __INTMAX_MAX__ 9223372036854775807LL +#define __FLT_DENORM_MIN__ 1.40129846e-45F +#define __FLT_MAX__ 3.40282347e+38F +#define __SIZEOF_DOUBLE__ 8 +#define __INTMAX_TYPE__ long long int +#define i386 1 +#define __DEC128_MAX_EXP__ 6144 +#define __DEC32_MANT_DIG__ 7 +#define __DBL_MAX_10_EXP__ 308 +#define __LDBL_DENORM_MIN__ 3.64519953188247460253e-4951L +#define __STDC__ 1 +#define __PTRDIFF_TYPE__ int +#define __DEC128_MANT_DIG__ 34 +#define __LDBL_MIN_10_EXP__ (-4931) +#define __SIZEOF_LONG_LONG__ 8 +#define __LDBL_DIG__ 18 +#define __GNUC_GNU_INLINE__ 1 +#define _GNU_SOURCE 1 + +/* DQ (7/11/2009): fix emacs coloring... with a '$' */ + +/* Turn on use of restrict in EDG front-end using --edg:restrict */ +#ifdef __GNUC__ +/* for GNU g++ */ +#define restrict __restrict__ +#endif + +/* DQ (6/12/2005): Permit this to be optionally commented out because it makes it hard to + look at the AST merging graphs. The ROSE-IR graphs will now filter nodes associated + with declarations from this file (marked as front-end specific). +*/ +#if 0 +#define SKIP_ROSE_BUILTIN_DECLARATIONS +#endif + +/* This macro can be defined using "-DSKIP_ROSE_BUILTIN_DECLARATIONS" to avoid ROSE + builtin functions required for compatability with the user selected backend compiler +*/ +#ifndef SKIP_ROSE_BUILTIN_DECLARATIONS + +#ifndef ROSE_CPP_MODE + #error "Macro ROSE_CPP_MODE should have been defined ROSE_CPP_MODE == 0 for C and C99 and ROSE_CPP_MODE == 1 for C++" +#endif + +/* PC (9/25/2006): Define __builtin_va_start to the EDG expected symbol + __builtin_stdarg_start */ +#define __builtin_va_start __builtin_stdarg_start + +/* Outside strict ISO C mode (-ansi, -std=c89 or -std=c99), the functions _exit, alloca, + bcmp, bzero, dcgettext, dgettext, dremf, dreml, drem, exp10f, exp10l, exp10, ffsll, + ffsl, ffs, fprintf_unlocked, fputs_unlocked, gammaf, gammal, gamma, gettext, index, + isascii, j0f, j0l, j0, j1f, j1l, j1, jnf, jnl, jn, mempcpy, pow10f, pow10l, pow10, + printf_unlocked, rindex, scalbf, scalbl, scalb, signbit, signbitf, signbitl, + significandf, significandl, significand, sincosf, sincosl, sincos, stpcpy, strdup, + strfmon, toascii, y0f, y0l, y0, y1f, y1l, y1, ynf, ynl and yn may be handled as + built-in functions. All these functions have corresponding versions prefixed with + __builtin_, which may be used even in strict C89 mode. +*/ +/* extern void _exit ( int Status); */ + +/* The ISO C99 functions _Exit, acoshf, acoshl, acosh, asinhf, asinhl, asinh, atanhf, + atanhl, atanh, cabsf, cabsl, cabs, cacosf, cacoshf, cacoshl, cacosh, cacosl, cacos, + cargf, cargl, carg, casinf, casinhf, casinhl, casinh, casinl, casin, catanf, catanhf, + catanhl, catanh, catanl, catan, cbrtf, cbrtl, cbrt, ccosf, ccoshf, ccoshl, ccosh, + ccosl, ccos, cexpf, cexpl, cexp, cimagf, cimagl, cimag, conjf, conjl, conj, copysignf, + copysignl, copysign, cpowf, cpowl, cpow, cprojf, cprojl, cproj, crealf, creall, creal, + csinf, csinhf, csinhl, csinh, csinl, csin, csqrtf, csqrtl, csqrt, ctanf, ctanhf, + ctanhl, ctanh, ctanl, ctan, erfcf, erfcl, erfc, erff, erfl, erf, exp2f, exp2l, exp2, + expm1f, expm1l, expm1, fdimf, fdiml, fdim, fmaf, fmal, fmaxf, fmaxl, fmax, fma, fminf, + fminl, fmin, hypotf, hypotl, hypot, ilogbf, ilogbl, ilogb, imaxabs, isblank, iswblank, + lgammaf, lgammal, lgamma, llabs, llrintf, llrintl, llrint, llroundf, llroundl, + llround, log1pf, log1pl, log1p, log2f, log2l, log2, logbf, logbl, logb, lrintf, + lrintl, lrint, lroundf, lroundl, lround, nearbyintf, nearbyintl, nearbyint, + nextafterf, nextafterl, nextafter, nexttowardf, nexttowardl, nexttoward, remainderf, + remainderl, remainder, remquof, remquol, remquo, rintf, rintl, rint, roundf, roundl, + round, scalblnf, scalblnl, scalbln, scalbnf, scalbnl, scalbn, snprintf, tgammaf, + tgammal, tgamma, truncf, truncl, trunc, vfscanf, vscanf, vsnprintf and vsscanf are + handled as built-in functions except in strict ISO C90 mode (-ansi or -std=c89). +*/ +/* extern void _Exit ( int Status); */ +double __builtin_copysign (double __builtin__x, double __builtin__y); +float __builtin_copysignf (float __builtin__x, float __builtin__y); +long double __builtin_copysignl (long double __builtin__x, long double __builtin__y); + +/* There are also built-in versions of the ISO C99 functions acosf, acosl, asinf, asinl, + atan2f, atan2l, atanf, atanl, ceilf, ceill, cosf, coshf, coshl, cosl, expf, expl, + fabsf, fabsl, floorf, floorl, fmodf, fmodl, frexpf, frexpl, ldexpf, ldexpl, log10f, + log10l, logf, logl, modfl, modf, powf, powl, sinf, sinhf, sinhl, sinl, sqrtf, sqrtl, + tanf, tanhf, tanhl and tanl that are recognized in any mode since ISO C90 reserves + these names for the purpose to which ISO C99 puts them. All these functions have + corresponding versions prefixed with __builtin_. +*/ + +/* DQ (4/12/2005): Required to compile the gnu version 3.4.3 cmath header file. Defined +// as functions instead of macros to avoid constant propagation issues. +*/ +float __builtin_acosf (float __builtin__x); +long double __builtin_acosl (long double __builtin__x); +float __builtin_asinf (float __builtin__x); +long double __builtin_asinl (long double __builtin__x); +float __builtin_atanf (float __builtin__x); +long double __builtin_atanl (long double __builtin__x); +float __builtin_atan2f (float __builtin__x,float __builtin__y); +long double __builtin_atan2l (long double __builtin__x,long double __builtin__y); +float __builtin_ceilf (float __builtin__x); +long double __builtin_ceill (long double __builtin__x); +float __builtin_coshf (float __builtin__x); +long double __builtin_coshl (long double __builtin__x); +float __builtin_floorf (float __builtin__x); +long double __builtin_floorl (long double __builtin__x); +float __builtin_fmodf (float __builtin__x,float __builtin__y); +long double __builtin_fmodl (long double __builtin__x,long double __builtin__y); +float __builtin_frexpf (float __builtin__x,int *__builtin__y); +long double __builtin_frexpl (long double __builtin__x,int *__builtin__y); +float __builtin_ldexpf (float __builtin__x,float __builtin__y); +long double __builtin_ldexpl (long double __builtin__x,long double __builtin__y); +float __builtin_log10f (float __builtin__x); +long double __builtin_log10l (long double __builtin__x); +float __builtin_modff (float __builtin__x,float *__builtin__y); +long double __builtin_modfl (long double __builtin__x,long double *__builtin__y); +float __builtin_powf (float __builtin__x,float __builtin__y); +long double __builtin_powl (long double __builtin__x,long double __builtin__y); +float __builtin_sinhf (float __builtin__x); +long double __builtin_sinhl (long double __builtin__x); +float __builtin_tanf (float __builtin__x); +long double __builtin_tanl (long double __builtin__x); +float __builtin_tanhf (float __builtin__x); +long double __builtin_tanhl (long double __builtin__x); + +/* DQ (5/15/2006): Suggested by Christian Biesinger (working with Markus Schordan) */ +long double __builtin_powil (long double __builtin__x, int __builtin__i); +double __builtin_powi (double __builtin__x, int __builtin__i); +float __builtin_powif (float __builtin__x, int __builtin__i); + + +/* The ISO C94 functions iswalnum, iswalpha, iswcntrl, iswdigit, iswgraph, iswlower, + iswprint, iswpunct, iswspace, iswupper, iswxdigit, towlower and towupper are handled + as built-in functions except in strict ISO C90 mode (-ansi or -std=c89). +*/ + +/* The ISO C90 functions abort, abs, acos, asin, atan2, atan, calloc, ceil, cosh, cos, + exit, exp, fabs, floor, fmod, fprintf, fputs, frexp, fscanf, isalnum, isalpha, + iscntrl, isdigit, isgraph, islower, isprint, ispunct, isspace, isupper, isxdigit, + tolower, toupper, labs, ldexp, log10, log, malloc, memcmp, memcpy, memset, modf, pow, + printf, putchar, puts, scanf, sinh, sin, snprintf, sprintf, sqrt, sscanf, strcat, + strchr, strcmp, strcpy, strcspn, strlen, strncat, strncmp, strncpy, strpbrk, strrchr, + strspn, strstr, tanh, tan, vfprintf, vprintf and vsprintf are all recognized as + built-in functions unless -fno-builtin is specified (or -fno-builtin-function is + specified for an individual function). All of these functions have corresponding + versions prefixed with __builtin_. +*/ + + +/* DQ (7/29/2005): declarations for builtin functions used by GNU, but +// already defined in EDG (it seems that we can provide declarations for +// them explicitly). These should be marked as compiler generated in +// the AST. +*/ +char * __builtin_strchr (const char *__builtin__s, int __builtin__c); +char * __builtin_strrchr(const char *__builtin__s, int __builtin__c); +char * __builtin_strpbrk(const char *__builtin__s, const char *__builtin__accept); +char * __builtin_strstr (const char *__builtin__haystack, const char *__builtin__needle); +float __builtin_nansf (const char *__builtin__x); +double __builtin_nans (const char *__builtin__x); +long double __builtin_nansl (const char *__builtin__x); +double __builtin_fabs (double __builtin__x); +float __builtin_fabsf (float __builtin__x); +long double __builtin_fabsl (long double __builtin__x); +float __builtin_cosf (float __builtin__x); +long double __builtin_cosl (long double __builtin__x); +float __builtin_sinf (float __builtin__x); +long double __builtin_sinl (long double __builtin__x); +float __builtin_sqrtf (float __builtin__x); +long double __builtin_sqrtl (long double __builtin__x); + +/* GCC provides built-in versions of the ISO C99 floating point comparison macros that + avoid raising exceptions for unordered operands. They have the same names as the + standard macros ( isgreater, isgreaterequal, isless, islessequal, islessgreater, and + isunordered) , with __builtin_ prefixed. We intend for a library implementor to be + able to simply #define each standard macro to its built-in equivalent. + +DQ (6/19/2007): These might required math.h to be included. +*/ +# ifndef __builtin_isgreater +# define __builtin_isgreater(x, y) \ + (__extension__ \ + ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y); \ + !isunordered (__x, __y) && __x > __y; })) +# endif + +/* Return nonzero value if X is greater than or equal to Y. */ +# ifndef __builtin_isgreaterequal +# define __builtin_isgreaterequal(x, y) \ + (__extension__ \ + ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y); \ + !isunordered (__x, __y) && __x >= __y; })) +# endif + +/* Return nonzero value if X is less than Y. */ +# ifndef __builtin_isless +# define __builtin_isless(x, y) \ + (__extension__ \ + ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y); \ + !isunordered (__x, __y) && __x < __y; })) +# endif + +/* Return nonzero value if X is less than or equal to Y. */ +# ifndef __builtin_islessequal +# define __builtin_islessequal(x, y) \ + (__extension__ \ + ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y); \ + !isunordered (__x, __y) && __x <= __y; })) +# endif + +/* Return nonzero value if either X is less than Y or Y is less than X. */ +# ifndef __builtin_islessgreater +# define __builtin_islessgreater(x, y) \ + (__extension__ \ + ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y); \ + !isunordered (__x, __y) && (__x < __y || __y < __x); })) +# endif + +/* Return nonzero value if arguments are unordered. */ +# ifndef __builtin_isunordered +# define __builtin_isunordered(u, v) \ + (__extension__ \ + ({ __typeof__(u) __u = (u); __typeof__(v) __v = (v); \ + fpclassify (__u) == FP_NAN || fpclassify (__v) == FP_NAN; })) +# endif + +/* int __builtin_isgreater(x,y) isgreater(x,y); +int __builtin_isgreaterequal(x,y) isgreaterequal(x,y); +int __builtin_isless(x,y) isless(x,y); +int __builtin_islessequal(x,y) islessequal(x,y); +int __builtin_islessgreater(x,y) islessgreater(x,y); +int __builtin_isunordered(x,y) isunordered(x,y); +*/ + +/* GNU also supports a few other types of builtin functions: */ +void * __builtin_return_address (unsigned int level); +void * __builtin_frame_address (unsigned int level); + +/* Additional builtin functions that take or return types as arguments +(described at http://gcc.gnu.org/onlinedocs/gcc-4.0.3/gcc/Other-Builtins.html). +There are more difficult to reproduce except as macros that define them away: + +int __builtin_types_compatible_p (type1, type2); +type __builtin_choose_expr (const_exp, exp1, exp2); +int __builtin_constant_p (exp); + +DQ (6/19/2007): The definitions below are not correct, but should be portable, +they will only be a problem is the resulting code is unparsed directly from +the AST. The detection of the use of these macros in the near future will help +make this safer. +*/ + +/* This is not a correct test, but it is a weak form of equivalence that is portable */ +#define __builtin_types_compatible_p(T1,T2) (sizeof(T1)==sizeof(T2)) +/* This is not correct, but it should be portable */ +#define __builtin_choose_expr(exp,T1,T2) (T1) +/* This is not correct, but it should be portable, make it always return false for now */ +#define __builtin_constant_p(exp) (0) + + +/* Additional builtin functions: +(also from http://gcc.gnu.org/onlinedocs/gcc-4.0.3/gcc/Other-Builtins.html): + */ + +long __builtin_expect (long __builtin__exp, long __builtin__c); +void __builtin_prefetch (const void *__builtin__addr, ...); +double __builtin_huge_val (void); +float __builtin_huge_valf (void); +long double __builtin_huge_vall (void); +double __builtin_inf (void); +float __builtin_inff (void); +long double __builtin_infl (void); +double __builtin_nan (const char *__builtin__str); +float __builtin_nanf (const char *__builtin__str); +long double __builtin_nanl (const char *__builtin__str); +double __builtin_nans (const char *__builtin__str); +float __builtin_nansf (const char *__builtin__str); +long double __builtin_nansl (const char *__builtin__str); +/* DQ (6/19/2007): Commented out because in interferred with existing + builtin function defined as int __builtin_ffs (int __builtin__x); in EDG. +int __builtin_ffs (unsigned int __builtin__x); */ +int __builtin_clz (unsigned int __builtin__x); +int __builtin_ctz (unsigned int __builtin__x); +int __builtin_popcount (unsigned int __builtin__x); +int __builtin_parity (unsigned int __builtin__x); +int __builtin_ffsl (unsigned long __builtin__x); +int __builtin_clzl (unsigned long __builtin__x); +int __builtin_ctzl (unsigned long __builtin__x); +int __builtin_popcountl (unsigned long __builtin__x); +int __builtin_parityl (unsigned long __builtin__x); +int __builtin_ffsll (unsigned long long __builtin__x); +int __builtin_clzll (unsigned long long __builtin__x); +int __builtin_ctzll (unsigned long long __builtin__x); +int __builtin_popcountll (unsigned long long __builtin__x); +int __builtin_parityll (unsigned long long __builtin__x); +double __builtin_powi (double __builtin__x, int __builtin__y); +float __builtin_powif (float __builtin__x, int __builtin__y); +long double __builtin_powil (long double __builtin__x, int __builtin__y); + + +/* DQ (6/19/2007): I think these defines can be eliminated now in favor of the + builtin function prototypes. + DQ (8/20/2006): Let the builtin values be equal to the largest possible values. + DQ (5/20/2006): These should be defined to be appropriate values or defined as + function prototypes as others are below. These can't be functions because they + are used to initialize static const variables. + +#define __builtin_huge_valf() __FLT_MAX__ +#define __builtin_nanf(string) 0 +#define __builtin_huge_val() __DBL_MAX__ +#define __builtin_nan(string) 0 +#define __builtin_huge_vall() __LDBL_MAX__ +#define __builtin_nanl(string) 0 +*/ + +/* DQ and Liao (7/11/2009) Added macros to define away new GNU C++ extension (not required for newer EDG 4.0 use */ +// Only for GCC 4.3.0 and above +#if __GNUC__ > 4 || \ + (__GNUC__ == 4 && (__GNUC_MINOR__ > 3 || \ + (__GNUC_MINOR__ == 3 && \ + __GNUC_PATCHLEVEL__ >= 0))) + +#define __has_nothrow_assign sizeof +#define __has_nothrow_copy sizeof +#define __has_nothrow_constructor sizeof +#define __has_trivial_assign sizeof +#define __has_trivial_copy sizeof +#define __has_trivial_constructor sizeof +#define __has_trivial_destructor sizeof +#define __has_virtual_destructor sizeof +#define __is_abstract sizeof +//#define __is_base_of (base_type, derived_type) +#define __is_class sizeof +#define __is_empty sizeof +#define __is_enum sizeof +#define __is_pod sizeof +#define __is_polymorphic sizeof +#define __is_union sizeof +void* __builtin_memmove(void * target, const void * source, unsigned long long nBytes); +void* __builtin_memchr(const void * ptr, int value, unsigned long long num); +void* __builtin_memcpy (void * destination, const void * source, unsigned long long num ); +int __builtin_memcmp ( const void * ptr1, const void * ptr2, unsigned long long num ); +// changed it in edg 3.3/src/sys_predef.c instead since va_list is not declared here +//int __builtin_vsnprintf(char *str, unsigned long long size, const char *format, va_list ap); + +#endif +/* +Target specific builtin functions are available at: + http://gcc.gnu.org/onlinedocs/gcc-4.0.3/gcc/Target-Builtins.html + * Alpha Built-in Functions + * ARM Built-in Functions + * Blackfin Built-in Functions + * FR-V Built-in Functions + * X86 Built-in Functions + * MIPS Paired-Single Support + * PowerPC AltiVec Built-in Functions + * SPARC VIS Built-in Functions +*/ + +/* +Required builtin function as supported by Intel (gnu builtin functions supported by Intel +C++ compiler). I am not sure if we should include anything special specific to this, it +appears to be a subset of the more complete handling above. + +__builtin_abs +__builtin_labs +__builtin_cos +__builtin_cosf +__builtin_fabs +__builtin_fabsf +__builtin_memcmp +__builtin_memcpy +__builtin_sin +__builtin_sinf +__builtin_sqrt +__builtin_sqrtf +__builtin_strcmp +__builtin_strlen +__builtin_strncmp +__builtin_abort +__builtin_prefetch +__builtin_constant_p +__builtin_printf +__builtin_fprintf +__builtin_fscanf +__builtin_scanf +__builtin_fputs +__builtin_memset +__builtin_strcat +__builtin_strcpy +__builtin_strncpy +__builtin_exit +__builtin_strchr +__builtin_strspn +__builtin_strcspn +__builtin_strstr +__builtin_strpbrk +__builtin_strrchr +__builtin_strncat +__builtin_alloca +__builtin_ffs +__builtin_index +__builtin_rindex +__builtin_bcmp +__builtin_bzero +__builtin_sinl +__builtin_cosl +__builtin_sqrtl +__builtin_fabsl +__builtin_frame_address (IA-32 only) +__builtin_return_address (IA-32 only) +*/ + +/* DQ (6/19/2007): For handling of offsetof macro we can't build a function +prototype so EDG provides a mechanism to support this (from the basics.h +header file). However, we can use the one defined in the GNU header files is +we only handle the __offsetof__ macro (so define it way). Then the builtin +function is just defined as being the offsetof macro. +*/ +#define __offsetof__ +/* +// DQ (2/9/2008): Don't define __builtin_offsetof in terms of offsetof since this +// causes a recursively defined marco on Fedora Core relase 4, though it works +// fine on Red Hat Enterprise release 9. New definition taken from common +// implementation of offset, but modified to address specific case of where C++ +// defines a operator&() which can be a problem for the more common definition. +// This definition is used to defin the __builtin_offsetof +// #define __builtin_offsetof(t,memb) offsetof(t,memb) +// #define __builtin_offsetof(t,memb) ((size_t)&(((t *)0)->memb)) +*/ +#ifndef __cplusplus +#define __builtin_offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) +#else +/* The cast to "char &" below avoids problems with user-defined "operator &", which can appear in a POD type. */ +#define __builtin_offsetof(TYPE, MEMBER) \ + (__offsetof__ (reinterpret_cast \ + (&reinterpret_cast \ + (static_cast (0)->MEMBER)))) +#endif + +/* matching else for SKIP_ROSE_BUILTIN_DECLARATIONS */ +#else + +/* When compiling using -DSKIP_ROSE_BUILTIN_DECLARATIONS we need to have a variable + defined in this faile so that we can locate the file in the AST and obtain the + absolute path of this front-end specific header file. This allows us to mark + all IR nodes in the AST as being front-end specific if they originate from this + header file. The following variable guarentees that a variable declaration from + this file will exist when -DSKIP_ROSE_BUILTIN_DECLARATIONS is used. The + -DSKIP_ROSE_BUILTIN_DECLARATIONS option is typically used to reduce the size of + the AST and permit visualization of the whole AST using DOT (which can't layout + a graph containing too many IR nodes). + */ +int __frontend_specific_variable_to_provide_header_file_path; + +/* matching endif for SKIP_ROSE_BUILTIN_DECLARATIONS */ +#endif + +/* DQ (10/30/2005): Added to allow compilation of g++ +complex header, but this is likely the wrong thing to do. +This allows us to compile C++ code that uses the complex header file +but it turns "__complex__ double x" into just "double x". All this +is because the "__complex__" keyword is not supported in EDG. Not +too much of a problem except that it means that the member function: + complex(_ComplexT __z) : _M_value(__z) { } +needs to be specified using the "explicit" keyword. Note that +none of this is required in g++ or icc, just in our version of +ROSE using the g++ header files (because __complex__ is not +defined in EDG and the only thing to map it to is "", I think). + +The following solution does NOT work. Replacing + typedef __complex__ double _ComplexT; +with + typedef complex _ComplexT; +in the complex header file. + +The following solution does work. Replacing + complex(_ComplexT __z) : _M_value(__z) { } +with + explicit complex(_ComplexT __z) : _M_value(__z) { } +in the complex header file. It is not a great solution +and it would have to be done in the configuration of ROSE +to the complex header file. It would also fool any analysis +of the complex class into thinking that the internal type +was just float or double for complex or complex. + */ + +/* DQ (8/22/2006): + EDG does not appear to support __complex__ as a keyword. + Thus we have to define it to white space to permit codes using + __complex__ to be compiled. This appears to work fine, but + we are likely to confuse an analysis that depends upon recognizing + complex types. + + Note that _Complex is a C99 type, also fequently recognised by C + compilers, so for non C++ codes we can translate __complex__ to + _Complex +*/ +/* #ifdef __cplusplus */ +#if ROSE_CPP_MODE +/* C++ case is different because the header files will define a complex type (see hdrs1/complex) */ + + #define __complex__ + #define __real__ + #define __imag__ + +/* DQ (9/26/2006): Plum Hall uses this for C++ code, but I think that we have define it away */ + #define _Complex +#else +/* This works for both C and C99 modes */ + #define __complex__ _Complex + #define __real__ + #define __imag__ +#endif + +/* gcc uses the C99 name _Complex_I in , but our EDG doesn't handle + the GCC extension that they define it to. */ +#define _Complex_I __I__ +/* Disable inclusion of complex.h on Linux */ +#define _COMPLEX_H +/* Disable inclusion of complex.h on Mac OS X */ +#define __COMPLEX__ + +/* Defined this to avoid warnings (e.g. test2001_11.C) from 3.4.6 systems header files. */ +#define __weakref__(NAME) + +/* DQ (6/19/2007): I think we can comment this out now, since it is better defined above! + DQ (1/31/2007): GNU modifier required to handle code using the offsetof macro in C++ g++ 3.4 and greater */ +/* #define __offsetof__ */ + +#if 0 +/* DQ (7/11/2009) Added macros to define away new GNU C++ extension (not required for newer EDG 4.0 use */ +#define __has_nothrow_assign (type) +#define __has_nothrow_copy (type) +#define __has_nothrow_constructor (type) +#define __has_trivial_assign (type) +#define __has_trivial_copy (type) +#define __has_trivial_constructor (type) +#define __has_trivial_destructor (type) +#define __has_virtual_destructor (type) +#define __is_abstract (type) +#define __is_base_of (base_type, derived_type) +#define __is_class (type) +#define __is_empty (type) +#define __is_enum (type) +#define __is_pod (type) +#define __is_polymorphic (type) +#define __is_union (type) +#endif + +/* + DQ (7/15/2009): Added support for MS Windows Code + It might be that this file in included too late when using WINE. + */ +#ifdef USE_ROSE_WINDOWS_ANALYSIS_SUPPORT + #define __builtin_ms_va_list __builtin_va_list + #define __ms_va_list va_list +#endif + + +#endif // !ROSE_USE_NEW_EDG_INTERFACE diff --git a/demo/CMakeLists.txt b/demo/CMakeLists.txt new file mode 100644 index 0000000000..e761195de1 --- /dev/null +++ b/demo/CMakeLists.txt @@ -0,0 +1,284 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + +add_subdirectory(qrose) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#SUBDIRS = qrose +# +## Demo of binary executable functionality. See binaryTests/Makefile.am for the complete list. +## This demo does not require Qt. +#demo_1: +# $(MAKE) -C $(top_builddir)/tests/roseTests/binaryTests demos +# @echo "End of demo_1" +# +## These demos require QT to support the QRose work used for the GUI in several ROSE tools +## that are a part of this demo. +#if ROSE_USE_QT +# +#INCLUDES = $(ROSE_INCLUDES) +# +## There are no executables built as part of this demo (so far) +#noinst_PROGRAMS = +# +#TESTCODES_REQUIRED_TO_PASS = +# +#TESTCODE_CURRENTLY_FAILING = +# +## ****************************************************** +## Standard Makefile Content +## ****************************************************** +# +## This rule will run all the demos in sequence, the user should exit each program to +## proceed to the next part of each demo or the next demo To configure ROSE to run the +## demo requires some optional support, Expected configure line: +## /configure --with-boost= --with-qt= --with-sqlite3= --with-dwarf= --enable-assembly-semantics +## At present there is only a binary analysis demo, there will be other demos in the future. +#demo: +# $(MAKE) demo_binary_analysis +# +# +## This is demo specific to binary anslysis support in ROSE. +#demo_binary_analysis_A: +# $(MAKE) demo_1 +# sleep 10 +# $(MAKE) demo_2 +# sleep 10 +# $(MAKE) demo_3 +# sleep 10 +# $(MAKE) demo_4 +# sleep 10 +# $(MAKE) demo_5 +# sleep 10 +# $(MAKE) demo_6 +# sleep 10 +# +#demo_binary_analysis_B: +# $(MAKE) demo_7a +# sleep 10 +# $(MAKE) demo_7b +# sleep 10 +# $(MAKE) demo_8a +# sleep 10 +# $(MAKE) demo_8b +# sleep 10 +# $(MAKE) demo_9 +# sleep 10 +# $(MAKE) demo_10 +# sleep 10 +# +#demo_binary_analysis_C: +# $(MAKE) demo_11 +# sleep 10 +# $(MAKE) demo_12 +# sleep 10 +# $(MAKE) demo_13 +# sleep 10 +# $(MAKE) demo_14 +# @echo "End of binary_analysis demos" +# +# +#if DQ_DEVELOPER_TESTS +## This demo shows the handling of different formats (ELF and PE) and different instruction sets (ARM, PowerPC, x86). +#demo_2: demo_2_test +# $${EDITOR:-emacs} $(top_builddir)/developersScratchSpace/Dan/Disassembler_tests/asm_code_samples_gcc.exe.dump +# @echo "End of demo_2" +# +#demo_2_test: +# cd $(top_builddir)/developersScratchSpace/Dan/Disassembler_tests && $(MAKE) demo_binary_file_format_Linux +# cd $(top_builddir)/developersScratchSpace/Dan/Disassembler_tests && $(MAKE) demo_with_instructions_Linux +# cd $(top_builddir)/developersScratchSpace/Dan/Disassembler_tests && $(MAKE) demo_binary_file_format_PE +# cd $(top_builddir)/developersScratchSpace/Dan/Disassembler_tests && $(MAKE) demo_with_instructions_PE +# cd $(top_builddir)/developersScratchSpace/Dan/Disassembler_tests && $(MAKE) demo_binary_file_format_ARM +# cd $(top_builddir)/developersScratchSpace/Dan/Disassembler_tests && $(MAKE) demo_with_instructions_ARM +#endif +# +## This demo shows the generation of a few different forms of analysis on binaries +#demo_3: demo_3_test +# @echo "Run callgraph analysis, control flow analysis, and data flow analysis" +# cd $(top_builddir)/projects/BinQ; $(MAKE) demo_withoutAnalysisRunInBatchMode; +# cd $(top_builddir)/projects/BinQ; zgrviewer callgraph.dot & +# cd $(top_builddir)/projects/BinQ; zgrviewer cfg.dot & +# cd $(top_builddir)/projects/BinQ; zgrviewer dfg.dot & +# @echo "End of demo_3" +# +#demo_3_test: +# cd $(top_builddir)/projects/BinQ; $(MAKE) demo_show_source_code; +# +## Example of buffer overflow detector +#demo_4: +# cd $(top_builddir)/projects/BinQ; $(MAKE) demo_withAnalysisRunInBatchMode +# @echo "End of demo_4" +# +## Need another demo 2.5) Build a binary and test the forbidden function analysis +# +## Something that might require type analysis +#demo_5: +# cd $(top_builddir)/projects/BinQ; $(MAKE) demo_rted_example +# @echo "End of demo_5" +# +## Comparing ROSE vs. IDAPro (on same 32-bit example) +#demo_6: +# cd $(top_builddir)/projects/BinQ; $(MAKE) demo_rose_vs_IDAPro +# @echo "End of demo_6" +# +## Running Compass in ASCII mode (non-stripped binary) +#demo_7a: +# cd $(top_builddir)/projects/compass/tools/compass; $(MAKE) demo_small +# @echo "End of demo_7a" +# +## Running Compass in ASCII mode (stripped binary) +#demo_7b: +# cd $(top_builddir)/projects/compass/tools/compass; $(MAKE) demo_linux +# @echo "End of demo_7b" +# +## Running Compass in GUI mode (on a source code) +#demo_8a: +# cd $(top_builddir)/projects/compass/tools/compass; $(MAKE) demo_compassGUI_source +# @echo "End of demo_8a" +# +## Running Compass in GUI mode (on a binary; note output sent to terminal at present) +#demo_8b: +# cd $(top_builddir)/projects/compass/tools/compass; $(MAKE) demo_compassGUI_binary +# @echo "End of demo_8b" +# +## This tests the construction of a new checker for Compass (to be submitted to Compass). +## Note that this demo removes a checker directory (relative to the source tree) and then rebuilds it. +## To make this safer we do it in two steps to avoid using "-r" with rm. +#demo_9: +# @echo "Remove existing checker: $(top_srcdir)/../CompassCheckers/demoBufferOverflowCheckerTest" +# mkdir -p $(top_srcdir)/../CompassCheckers/demoBufferOverflowCheckerTest +# rm -f $(top_srcdir)/../CompassCheckers/demoBufferOverflowCheckerTest/* +# rmdir $(top_srcdir)/../CompassCheckers/demoBufferOverflowCheckerTest +# cd $(top_srcdir)/../CompassCheckers; $(top_srcdir)/projects/compass/src/compass_scripts/gen_checker.sh demo buffer overflow checker test +# @echo "Built checker directory $(top_srcdir)/../CompassCheckers/demoBufferOverflowCheckerTest" +# @echo "End of demo_9" +# +## The demo shows the translation of a binary into a low level representation to support general +## instrcution set independent analysis. Also demonstrated disassemble and semantic analysis of +## PowerPC instruction set. The semantic analysis of binaries is supported for x86 and PowerPC +## (but not yet for ARM). +#demo_10: +# cd $(top_builddir)/projects/assemblyToSourceAst; $(MAKE) ppc-check +# @echo "End of demo_10" +# +#if DQ_DEVELOPER_TESTS +## Demonstrate edit graph work to support binary comparision on binary file format (related to binary diff on instructions) +#demo_11a: +# cd $(top_builddir)/developersScratchSpace/Dan/astEquivalence_tests; $(MAKE) demoSourceEquivalence +# cd $(top_builddir)/developersScratchSpace/Dan/astEquivalence_tests; $(MAKE) demoBinaryEquivalence +# @echo "End of demo_11a" +#endif +# +## Demonstrate AST diff using BinQ on binary instructions (only on the instructions) +#demo_11b: +# cd $(top_builddir)/projects/BinQ; $(MAKE) demo_diff +# @echo "End of demo_11b" +# +## Using Compass with large projects (the trick is to click: regenerate, select all, and refresh). +#demo_12: +# cd $(top_builddir)/projects/compass/tools/compass/gui; $(MAKE) demo +# @echo "End of demo_12" +# +#if DQ_DEVELOPER_TESTS +## Static binary rewriting +#demo_13: +# cd $(top_builddir)/developersScratchSpace/Dan/translator_tests; $(MAKE) demo +# @echo "End of demo_13" +#endif +# +## Template for more rules... +## demo_15: +## cd $(top_builddir)/; $(MAKE) xxx +## @echo "End of demo_15" +# +# +# +# +# +# +# +# +#testProgram_1: $(srcdir)/testProgram.c +# gcc -g -o testProgram_1 $(srcdir)/testProgram.c +# +#testProgram_2: $(srcdir)/testProgram.c +# gcc -o testProgram_2 $(srcdir)/testProgram.c +# +## Test of astEquivalence on Binary Executable +#testBinaryEquivalence: astDiff testProgram_1 testProgram_2 +# ./astDiff -rose:read_executable_file_format_only testProgram_1 testProgram_2 +# +## Test of astEquivalence on Source Code +#testSourceEquivalence: astDiff $(srcdir)/testProgram.c $(srcdir)/testProgram_alt.c +# cat $(srcdir)/testProgram.c $(srcdir)/testProgram_alt.c +# ./astDiff $(srcdir)/testProgram.c $(srcdir)/testProgram_alt.c +# +#testBoost: shortestPathBoostExample +# ./shortestPathBoostExample +# +## This demo generates the edit graph for two similar source code files +## and displays the generated visualization of the graph using zgrviewer. +#demoSourceEquivalence: testSourceEquivalence +# zgrviewer output.dot & +# +## This demo generates the edit graph for two similar binary files (one +## compiled with debug and the other without), and displays a pre-generated +## image of a visualization of the a quadrant of the whole graph (takes +## 20+ minutes to layout in dot so the image has been pre-computed). +#demoBinaryEquivalence: testBinaryEquivalence +# eog $(srcdir)/astEquivalenceGraphForBinaryCode3.png & +# +# +# +## ****************************************************** +## Standard Makefile Content +## ****************************************************** +# +#if DQ_DEVELOPER_TESTS +#check-local: +# @echo "ROSE demo." +# @$(MAKE) $(PASSING_TEST_Objects) +# @echo "Testing demos..." +# make demo_2_test +# make demo_3_test +## make demo_10 +## make demo_13 +# @echo "****************************************************************************" +# @echo "******** ROSE/demo: make check rule complete (terminated normally) *********" +# @echo "****************************************************************************" +#else +#check-local: +# @echo "ROSE demo (skipping demos 2, 11a and 13 which referenced the developersScratchSpace directory)." +# @$(MAKE) $(PASSING_TEST_Objects) +# @echo "Testing demos..." +# make demo_3_test +## make demo_10 +# @echo "****************************************************************************" +# @echo "******** ROSE/demo: make check rule complete (terminated normally) *********" +# @echo "****************************************************************************" +#endif +#else +#check-local: +# @echo "\nROSE demo requires Qt configure option (at least), Demo NOT run. To run these reconfigure ROSE (see manual)" +# @echo "***********************************************************************************************************************************************************" +# @echo "**************************************************************** make check not run here: DEMO ************************************************************" +# @echo "*** Expected configure line: <...>/configure --with-boost= --with-qt= --with-sqlite3= --with-dwarf= --enable-assembly-semantics ***" +# @echo "***********************************************************************************************************************************************************" +#endif +# +#EXTRA_DIST = demo.txt +# +## There should be no temporary files generated as part of the demo (in this directory). +#clean-local: +# rm -f *.o +# diff --git a/demo/qrose/CMakeLists.txt b/demo/qrose/CMakeLists.txt new file mode 100644 index 0000000000..1fda1a59ac --- /dev/null +++ b/demo/qrose/CMakeLists.txt @@ -0,0 +1,109 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + +set(t1_window_SRCS t1_window.C) + +kde4_add_executable(t1_window ${t1_window_SRCS}) + +target_link_libraries(t1_window ${KDE4_KDECORE_LIBS}) + + +########### next target ############### + +set(t2_layout_SRCS t2_layout.C) + +kde4_add_executable(t2_layout ${t2_layout_SRCS}) + +target_link_libraries(t2_layout ${KDE4_KDECORE_LIBS}) + + +########### next target ############### + +set(t3_buttons_SRCS t3_buttons.C) + +kde4_add_executable(t3_buttons ${t3_buttons_SRCS}) + +target_link_libraries(t3_buttons ${KDE4_KDECORE_LIBS}) + + +########### next target ############### + +set(t4_events_SRCS t4_events.C) + +kde4_add_executable(t4_events ${t4_events_SRCS}) + +target_link_libraries(t4_events ${KDE4_KDECORE_LIBS}) + + +########### next target ############### + +set(t5_components_SRCS t5_components.C) + +kde4_add_executable(t5_components ${t5_components_SRCS}) + +target_link_libraries(t5_components ${KDE4_KDECORE_LIBS}) + + +########### next target ############### + +set(t6_query1_SRCS t6_query1.C) + +kde4_add_executable(t6_query1 ${t6_query1_SRCS}) + +target_link_libraries(t6_query1 ${KDE4_KDECORE_LIBS}) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/src/roseExtensions/qtWidgets/Make.inc +# +#if ROSE_USE_QT +# +##INCLUDES = $(ROSE_INCLUDES) $(QT_INCLUDES) +# +##METASOURCES = auto +# +#noinst_PROGRAMS = t1_window t2_layout t3_buttons t4_events t5_components t6_query1 +#if ROSE_WITH_ROSEQT +#noinst_PROGRAMS += t7_qtcompat +#endif +# +#t1_window_SOURCES = t1_window.C +#t2_layout_SOURCES = t2_layout.C +#t3_buttons_SOURCES = t3_buttons.C +#t4_events_SOURCES = t4_events.C +#t5_components_SOURCES = t5_components.C +#t6_query1_SOURCES = t6_query1.C +# +#if ROSE_WITH_ROSEQT +#t7_qtcompat_SOURCES = t7_qtcompat.C +#endif +# +#t1_window_LDADD = $(ROSE_LIBS) $(QT_LDFLAGS) $(QROSE_LDFLAGS) +#t2_layout_LDADD = $(ROSE_LIBS) $(QT_LDFLAGS) $(QROSE_LDFLAGS) +#t3_buttons_LDADD = $(ROSE_LIBS) $(QT_LDFLAGS) $(QROSE_LDFLAGS) +#t4_events_LDADD = $(ROSE_LIBS) $(QT_LDFLAGS) $(QROSE_LDFLAGS) +#t5_components_LDADD = $(ROSE_LIBS) $(QT_LDFLAGS) $(QROSE_LDFLAGS) +#t6_query1_LDADD = $(ROSE_LIBS) $(QT_LDFLAGS) $(QROSE_LDFLAGS) +#if ROSE_WITH_ROSEQT +#t7_qtcompat_LDADD = $(ROSE_LIBS) $(QT_LDFLAGS) $(QROSE_LDFLAGS) $(top_builddir)/src/roseExtensions/qtWidgets/libRoseQtWidgets.la +#endif +# +#EXTRA_DIST = test.C icons.h +# +#all-local: test.C +# cp -f $(srcdir)/test.C . +# +#clean: +# rm -f *.C *.o t* +# +#endif +# diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt new file mode 100644 index 0000000000..f68f0994b4 --- /dev/null +++ b/docs/CMakeLists.txt @@ -0,0 +1,38 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + +add_subdirectory(Rose) + +message(STATUS "${CMAKE_CURRENT_SOURCE_DIR}: skipped subdir $(DEVELOPER_DISTRIBUTION_DIRECTORY)") + +########### install files ############### + + + + +#original Makefile.am contents follow: + +# +## DQ (7/24/2008): Only the developer version needs the test directory specific to Doxygen support +## JJW (8/3/2008): This line will be removed in binary distributions +#DEVELOPER_DISTRIBUTION_DIRECTORY = testDoxygen +# +## Later we will add ROSETTA documentation here ... +## SUBDIRS = Rose Rosetta testDoxygen +# +## DQ (9/11/2006): Removed Rosetta directory, an internal tool not documented +## within ROSE for use externally. +## SUBDIRS = Rose Rosetta testDoxygen +## SUBDIRS = Rose testDoxygen +#SUBDIRS = Rose $(DEVELOPER_DISTRIBUTION_DIRECTORY) +# +## New rule to simplify generation of documentation (we want to avoid using the +## automake generated "docs" rule because the generation of documentation is +## dependent upon separate tools which the user might not have available +## (true for bothe the LaTeX and html documentation). +## documentation: +#docs: +# @echo " Generate all possible documentation cd Rose; make documentation;" +# @cd Rose; $(MAKE) docs; +# +#EXTRA_DIST = diff --git a/docs/Rose/CMakeLists.txt b/docs/Rose/CMakeLists.txt new file mode 100644 index 0000000000..5f58c16f27 --- /dev/null +++ b/docs/Rose/CMakeLists.txt @@ -0,0 +1,314 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + +add_subdirectory(Tutorial) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +#include $(top_srcdir)/projects/compass/src/compassSupport/compass_dirs.inc +# +## When debugging latex documentation skip using the --interaction=batchmode option +## PDFLATEX = env TEXINPUTS=$(srcdir):$(top_srcdir)/tests:.: pdflatex --interaction=batchmode +#PDFLATEX = env TEXINPUTS=$(srcdir):$(top_srcdir)/tests:.: pdflatex +# +## Later we will add ROSETTA documentation here ... +#SUBDIRS = Tutorial +# +## Macros and code fragements that the Sage source code depends upon +## (this is where most of the documentation goes) +#SOURCE_FOR_SAGE_GENERATED_CODE = \ +# $(top_srcdir)/src/ROSETTA/Grammar/*.code \ +# $(top_srcdir)/src/ROSETTA/Grammar/*.macro +# +## Use Cxx_Grammar.h as a representative for all the generated source code +## that Doxygen will use and make sure that it has been generated before +## we try to generate the doxygen documentation from it. +#SAGE_GENERATED_CODE = $(top_builddir)/src/frontend/SageIII/Cxx_Grammar.h +# +## Name the Sage tag file used by Doxygen +#SAGE_DOXYGEN_TAG_FILE = $(top_builddir)/docs/Rose/SageIntermediateForm/sageDoxygen.tags +# +## Representative files from generated Doxygen documentation +## (This must be a single file to avoid spawning more than one parallel job when using parallel make) +#SageDoxygenDocumentation = $(top_builddir)/docs/Rose/SageIntermediateForm/html/index.html +# +#RoseDoxygenDocumentation = $(top_builddir)/docs/Rose/ROSE_WebPages/ROSE_HTML_Reference/index.html +# +## What the generation of doxygen output for Sage depends upon +#SageDocsDependencies = \ +# sage.cfg \ +# $(SAGE_GENERATED_CODE) \ +# $(top_builddir)/src/frontend/SageIII/sage.docs \ +# $(top_srcdir)/src/frontend/SageIII/sageClasses.docs +# +## What the generation of doxygen output for Rose depends upon +#RoseDocsDependencies = \ +# rose.cfg \ +# $(top_builddir)/rose.docs \ +# $(top_builddir)/src/frontend/SageIII/sage.docs \ +# $(top_srcdir)/src/frontend/Open64/documentation.docs \ +# $(top_srcdir)/src/frontend/SageIII/sage.docs.in \ +# $(top_srcdir)/src/extra.docs \ +# $(top_srcdir)/src/util/commandlineProcessing/commandlineProcessingDocumentation.docs \ +# $(top_srcdir)/src/util/stringSupport/stringSupportDocumentation.docs \ +# $(top_srcdir)/src/util/utilDocumentation.docs \ +# $(top_srcdir)/src/midend/astQuery/QueryLib.docs \ +# $(top_srcdir)/src/midend/astRewriteMechanism/ASTRewrite.docs \ +# $(top_srcdir)/src/midend/astProcessing/AstProcessing.docs \ +# $(top_srcdir)/src/backend/unparser/unparser.docs \ +# $(top_srcdir)/src/3rdPartyLibraries/MSTL/MSTL.docs \ +# $(top_srcdir)/src/roseExtensions/roseHPCToolkit/docs/roseHPCToolkit.docs \ +# $(top_srcdir)/rose.docs.in +# +## If the generated sage source code is older than the code used to +## generate the sage source code then regenerate the sage source code +## by calling make in the ROSE/ROSETTA directory. +#$(SAGE_GENERATED_CODE): $(SOURCE_FOR_SAGE_GENERATED_CODE) +# cd $(top_builddir)/src/ROSETTA; $(MAKE) +# +## The tag file is generated by Doxygen using the sage-docs rule +## $(SAGE_DOXYGEN_TAG_FILE): sage-docs +# +#SAGE_MAINPAGE_DOCUMENTATION = $(top_builddir)/src/frontend/SageIII/sage.docs +#ROSE_MAINPAGE_DOCUMENTATION = $(top_builddir)/rose.docs +# +## Build rule to update rose.docs in ROSE/src/frontend/SageIII directory +#$(ROSE_MAINPAGE_DOCUMENTATION): $(top_srcdir)/rose.docs.in +# cd $(top_builddir); $(MAKE) rose.docs +# +## A more complex dependence is defined that requires the sage.tag file +#$(RoseDoxygenDocumentation): $(RoseDocsDependencies) $(ROSE_MAINPAGE_DOCUMENTATION) rose.cfg +# cd $(top_builddir)/src/frontend/SageIII; $(MAKE) sage.docs +# doxygen rose.cfg +# +## DQ (7/11/2009): Added rule to force generation of Doxygen documentation. +#doxygen_docs: $(RoseDocsDependencies) $(ROSE_MAINPAGE_DOCUMENTATION) rose.cfg +# cd $(top_builddir)/src/frontend/SageIII; $(MAKE) sage.docs +# doxygen rose.cfg +# +## We can't specify the source directory to latex so we have to build +## links to the files in the source directory. Other ideas? +#latexFiles = preface.tex acknowledgments.tex introduction.tex \ +# designOfRose.tex preprocessorDesign.tex examples.tex \ +# loopTransformDoc.tex mm.tex lu.tex \ +# tridvpk.tex appendix.tex glossary.tex bibliography.tex \ +# rose-processing-phases.pdf testing.tex \ +# writingYourFirstTranslator.tex overviewOfRose.tex \ +# developersAppendix.tex astMerge.tex installRose.tex \ +# binaryAnalysis.tex demo.tex OpenMPsupport.tex UPCsupport.tex +# +## DQ (3/4/2009): Removed requirements.tex since it is not longer used. +## requirements.tex +# +#roseDirectoryMap.pdf: Makefile +# $(top_srcdir)/scripts/lsdot $(top_srcdir) --format=ps --exclude='CVS\|\.svn\|autom4te.cache\|developersScratchSpace\|testDoxygen\|ckpt\|compass' --basename -o=roseDirectoryMap.ps; +## convert -geometry 5000 roseDirectoryMap.ps roseDirectoryMap.pdf +# w=`grep '^%%BoundingBox: [0-9]' roseDirectoryMap.ps | awk '{print $$4*10;}'` ; \ +# h=`grep '^%%BoundingBox: [0-9]' roseDirectoryMap.ps | awk '{print $$5*10;}'` ; \ +# ps2pdf -g$${w}x$${h} roseDirectoryMap.ps roseDirectoryMap.pdf +# +#if USE_ROSE_IN_BUILD_TREE_VAR +#SET_ROSE_IN_BUILD_TREE=env ROSE_IN_BUILD_TREE=$(top_builddir) +#else +#SET_ROSE_IN_BUILD_TREE= +#endif +# +## Generate output from the --help commandline option for use in documentation +#roseHelpOutput.txt: +# if (test -x $(top_builddir)/src/testSharedRoseLib); then \ +# env ROSE_IN_BUILD_TREE=$(top_builddir) $(top_builddir)/src/testSharedRoseLib --help >& roseHelpOutput.txt; \ +# $(SET_ROSE_IN_BUILD_TREE) $(top_builddir)/src/testSharedRoseLib --help >& roseHelpOutput.txt; \ +# else \ +# echo "--help option output is not available (build ROSE, then rebuild documentation)." > roseHelpOutput.txt; \ +# fi; +# +## Generate sample output for inclusion into documentation +#roseCommandline.txt: +# echo "exampleTranslator roseTestProgram.C" >& roseCommandline.txt; +# +## Generate an example of the output from running a test program +#roseExecutionOutput.txt: +# if (test -x $(top_builddir)/src/testSharedRoseLib); then \ +# echo "int main() { int x=0; return x; }" > roseTestProgram.C; \ +# $(SET_ROSE_IN_BUILD_TREE) $(top_builddir)/src/testSharedRoseLib roseTestProgram.C >& roseExecutionOutput.txt; \ +# else \ +# echo "Execution output is not available (build ROSE, then rebuild documentation)." > roseExecutionOutput.txt; \ +# fi; +# +#roseConfigureOptions.txt: $(top_srcdir)/configure +# if test -x $(top_srcdir)/configure; then \ +# $(top_srcdir)/configure --help >& roseConfigureOptions.txt; \ +# else \ +# echo "Execution output is not available (build ROSE, then rebuild documentation)." > roseConfigureOptions.txt; \ +# fi +## Build smaller versions of this file (so it fits onto two separate pages) +# split -80 roseConfigureOptions.txt roseConfigureOptions. +# +#latexDependences = \ +# roseDirectoryMap.pdf \ +# roseHelpOutput.txt \ +# roseCommandline.txt \ +# roseExecutionOutput.txt \ +# roseConfigureOptions.txt \ +# rosePlatformPrerequisites.txt \ +# rosePlatformConfigureOptions.txt +# +#html-local: AvailableDocumentation.docs $(RoseDoxygenDocumentation) $(PACKAGE_NAME)-$(PACKAGE_VERSION)-HTML-Docs.tar.gz +# +#footer.html: footer.html.in +#leftmenu.html: leftmenu.html.in +#AvailableDocumentation.docs: AvailableDocumentation.docs.in +## Liao, 6/11/2008. Added a new directory (Projects) for various ROSE projects +## compass_build_tooldir=$(top_builddir)/projects/compass/tools +#COMPASS_MANUAL = $(compass_build_tooldir)/compass/doc/compass.pdf +#$(COMPASS_MANUAL): +# cd $(compass_build_tooldir)/compass/doc && $(MAKE) docs +# +## Liao, 8/6/2009. tutorial for autotuning +#AUTOTUNING_MANUAL = $(top_builddir)/projects/autoTuning/doc/autoTuning.pdf +#$(AUTOTUNING_MANUAL): +# cd $(top_builddir)/projects/autoTuning/doc && $(MAKE) docs +# +## Liao, 8/11/2009. QROSE Manual +#QROSE_MANUAL = $(top_srcdir)/src/3rdPartyLibraries/qrose/docs/QROSE.pdf +# +#HASKELLPORT_APIDOCS = $(top_builddir)/projects/haskellport/dist/doc/html/rose +#$(HASKELLPORT_APIDOCS): +# $(MAKE) -C$(top_builddir)/projects/haskellport docs +# +## DQ (9/15/2009): This appears to be a problem for Mac OSX +#RoseQtDoc: +#if !OS_MACOSX +# @echo "Skipping doxygen processing of roseQtWidgets.doxygen (failing in OSX)" +## doxygen roseQtWidgets.doxygen +#endif +# +#make-web-pages: $(RoseDoxygenDocumentation) $(PACKAGE_NAME)-$(PACKAGE_VERSION)-UserManual.pdf ROSE_InstallationInstructions.pdf ROSE_DeveloperInstructions.pdf ROSE_DemoGuide.pdf footer.html leftmenu.html $(COMPASS_MANUAL) $(AUTOTUNING_MANUAL) $(HASKELLPORT_APIDOCS) RoseQtDoc +# cd Tutorial; $(MAKE) make-web-pages +# mkdir -p ROSE_WebPages +# mkdir -p ROSE_WebPages/ROSE_HTML_Reference; +# cp -f $(srcdir)/compass_rose.gif ROSE_WebPages/compass_rose.gif +# cp -f $(srcdir)/header.html ROSE_WebPages/header.html +# cp -f leftmenu.html ROSE_WebPages/leftmenu.html +# cp -f footer.html ROSE_WebPages/footer.html +# cp -f $(srcdir)/rose.html ROSE_WebPages/rose.html +# cp -f $(srcdir)/rose.html ROSE_WebPages/index.html +# cp -f $(srcdir)/projects.html ROSE_WebPages/projects.html +# cp -f $(srcdir)/documents.html ROSE_WebPages/documents.html +# cp -f $(srcdir)/news.html ROSE_WebPages/news.html +# cp -f $(srcdir)/regressionTest.html ROSE_WebPages/regressionTest.html +# cp -f $(COMPASS_MANUAL) ROSE_WebPages/ +# cp -f $(AUTOTUNING_MANUAL) ROSE_WebPages/ +# cp -f $(QROSE_MANUAL) ROSE_WebPages/ +# mkdir -p ROSE_WebPages/ROSE_HaskellAPI +# cp -fr $(HASKELLPORT_APIDOCS)/* ROSE_WebPages/ROSE_HaskellAPI/ +## cp -r $(top_srcdir)/ROSE_ResearchPapers ROSE_WebPages/ROSE_ResearchPapers +# cp -fr $(top_srcdir)/ROSE_ResearchPapers ROSE_WebPages/ +# cp -f ROSE_InstallationInstructions.pdf ROSE_WebPages/ROSE_InstallationInstructions.pdf +# cp -f ROSE_DeveloperInstructions.pdf ROSE_WebPages/ROSE_DeveloperInstructions.pdf +# cp -f ROSE_DemoGuide.pdf ROSE_WebPages/ROSE_DemoGuide.pdf +# mkdir -p ROSE_WebPages/ROSE_UserManual +# cp -f $(srcdir)/WEB_DOCS_README ROSE_WebPages +# cp -f $(PACKAGE_NAME)-$(PACKAGE_VERSION)-UserManual.pdf ROSE_WebPages/ROSE_UserManual/$(PACKAGE_NAME)-$(PACKAGE_VERSION)-UserManual.pdf +## add a copy without version number as a permanent URL for external reference by +## https://outreach.scidac.gov/docman/index.php?group_id=24&selected_doc_group_id=29&language_id=1 +# cp -f $(PACKAGE_NAME)-$(PACKAGE_VERSION)-UserManual.pdf ROSE_WebPages/ROSE_UserManual/ROSE-UserManual.pdf +# +## Upload web pages to the LBL server +#copyWebPages: make-web-pages +## cd ROSE_WebPages; rsync -avz * quinlan1@cmg-1:/green_dev/www/casc/rose +## Liao, 7/13/2009, must ensure the file permissions here +# cd ROSE_WebPages; chmod -R a+rx *; rsync -avz * liaoch@web-dev.nersc.gov:/www/host/rosecompiler +## scp $(PACKAGE_NAME)-$(PACKAGE_VERSION)-HTML-Docs.tar.gz quinlan1@cmg-1.llnl.gov:/green_dev/www/casc/rose +# +#copyWebPagesPanas: make-web-pages +# cd ROSE_WebPages; rsync -avz * panas2@web-dev.nersc.gov:/www/host/rosecompiler +# +#$(PACKAGE_NAME)-$(PACKAGE_VERSION)-HTML-Docs.tar.gz: make-web-pages +# tar -zcf $(PACKAGE_NAME)-$(PACKAGE_VERSION)-HTML-Docs.tar.gz ROSE_WebPages +# +## Simpler rule +#latex-docs: pdf +# +## simpler target for building manual only +#manual: $(PACKAGE_NAME)-$(PACKAGE_VERSION)-UserManual.pdf +# +#pdf-local: $(PACKAGE_NAME)-$(PACKAGE_VERSION)-UserManual.pdf ROSE_InstallationInstructions.pdf ROSE_DeveloperInstructions.pdf ROSE_DemoGuide.pdf +# +## DQ (9/9/2009): Added generated list of NMI compile farm platform prerequisites for ROSE documentation (ROSE_InstallationInstructions.pdf) +#rosePlatformPrerequisites.txt: +# cd $(top_srcdir)/scripts/nmiBuildAndTestFarm/build_configs; grep -r PREREQS * | grep -v svn | grep minimal_default | grep -v minimal_default~ | grep -v "#" | sed 's/\/minimal_default:PREREQS=/ : /' >& rosePlatformPrerequisites.txt +# mv $(top_srcdir)/scripts/nmiBuildAndTestFarm/build_configs/rosePlatformPrerequisites.txt . +# +## DQ (9/29/2009): Added generated list of NMI compile farm platform configure options for ROSE documentation (ROSE_InstallationInstructions.pdf) +#rosePlatformConfigureOptions.txt: +# cd $(top_srcdir)/scripts/nmiBuildAndTestFarm/build_configs; grep -r CONFIGURE_OPTIONS * | grep -v svn | grep minimal_default | grep -v minimal_default~ | grep -v "#" | sed 's/\/minimal_default:CONFIGURE_OPTIONS=/ : /' >& rosePlatformConfigureOptions.txt +# mv $(top_srcdir)/scripts/nmiBuildAndTestFarm/build_configs/rosePlatformConfigureOptions.txt . +# +#ROSE_InstallationInstructions.pdf: $(latexFiles) $(latexDependences) ROSE_InstallationInstructions.tex +# $(PDFLATEX) ROSE_InstallationInstructions.tex && \ +# $(PDFLATEX) ROSE_InstallationInstructions.tex && \ +# $(PDFLATEX) ROSE_InstallationInstructions.tex +# +#ROSE_DeveloperInstructions.pdf: $(latexFiles) $(latexDependences) ROSE_DeveloperInstructions.tex +# $(PDFLATEX) ROSE_DeveloperInstructions.tex && \ +# $(PDFLATEX) ROSE_DeveloperInstructions.tex && \ +# $(PDFLATEX) ROSE_DeveloperInstructions.tex +# +## DQ (1/18/2009): Added support for demo guide to support running and +## presenting information from demos of different parts of ROSE. +#ROSE_DemoGuide.pdf: $(latexFiles) $(latexDependences) ROSE_DemoGuide.tex +# $(PDFLATEX) ROSE_DemoGuide.tex && \ +# $(PDFLATEX) ROSE_DemoGuide.tex && \ +# $(PDFLATEX) ROSE_DemoGuide.tex +# +## DQ (7/25/2004): Need to include manual.tex and reference.tex since they are build from +## manual.tex.in and reference.tex.in +#$(PACKAGE_NAME)-$(PACKAGE_VERSION)-UserManual.pdf: manual.tex gettingStarted.tex $(latexFiles) $(latexDependences) +# $(PDFLATEX) manual.tex && \ +# $(PDFLATEX) manual.tex && \ +# $(PDFLATEX) manual.tex && \ +# mv -f manual.pdf $(PACKAGE_NAME)-$(PACKAGE_VERSION)-UserManual.pdf +# +##docs: html-docs latex-docs +#docs: latex-docs html-docs +# +#html-docs: html +# +#EXTRA_DIST = \ +# WEB_DOCS_README AvailableDocumentation.docs.in \ +# sage.cfg.in rose.cfg.in roseQtWidgets.doxygen.in \ +# fixme.sty acknowledgments.tex bothlevel.c \ +# bibliography.tex examples.tex fd-docs.tex overviewOfRose.tex pre-docs.tex loopTransformDoc.tex \ +# mm.tex preprocessorDesign.tex tridvpk.tex writingYourFirstTranslator.tex appendix.tex \ +# developersAppendix.tex designOfRose.tex FAQ.tex glossary.tex introduction.tex lu.tex \ +# preface.tex rose-processing-phases.pdf compass_rose.gif SageIII.tex QueryLibrary.tex \ +# AstRewrite.tex ProgramAnalysis.tex AstProcessing.tex testing.tex astMerge.tex installRose.tex \ +# roseExecutionOutput.txt roseHelpOutput.txt asm_code_samples_gcc.pdf +# +## DQ (3/4/2009): Removed requirements.tex since it is not longer used. +## requirements.tex +# +#clean-web-pages: +## DQ (9/15/2009): wrong syntax for chmod, at least on OSX. +## test ! -d ROSE_WebPages || (test -d ROSE_WebPages && ( chmod +w -R ROSE_WebPages )) +# test ! -d ROSE_WebPages || (test -d ROSE_WebPages && ( chmod -R +w ROSE_WebPages )) +# rm -rf ROSE_WebPages +# +#clean-local: clean-web-pages +# +#CLEANFILES = roseDoxygen.tags SageIntermediateForm *.log *.aux *.dvi \ +# AstProcessing AstRewrite *.gz a.out roseDirectoryMap.ps roseDirectoryMap.pdf \ +# $(PACKAGE_NAME)-$(PACKAGE_VERSION)-UserManual.pdf ROSE_InstallationInstructions.pdf \ +# rose.cfg roseCommandline.txt roseConfigureOptions* roseExecutionOutput.txt \ +# roseHelpOutput.txt rose_roseTestProgram.C roseTestProgram.C sage.cfg \ +# $(PACKAGE_NAME)-$(PACKAGE_VERSION)-HTML-Docs.tar.gz footer.html \ +# AvailableDocumentation.docs leftmenu.html rosePlatformPrerequisites.txt \ +# rosePlatformConfigureOptions.txt diff --git a/docs/Rose/Tutorial/CMakeLists.txt b/docs/Rose/Tutorial/CMakeLists.txt new file mode 100644 index 0000000000..2182c70cb6 --- /dev/null +++ b/docs/Rose/Tutorial/CMakeLists.txt @@ -0,0 +1,78 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +## When debugging latex documentation skip using the --interaction=batchmode option +##PDFLATEX = env TEXINPUTS=$(srcdir):$(srcdir)/..:$(top_srcdir)/tests:.: pdflatex --interaction=batchmode +#PDFLATEX = env TEXINPUTS=$(srcdir):$(srcdir)/..:$(top_srcdir)/tests:.: pdflatex +# +## We can't specify the source directory to latex so we have to build +## links to the files in the source directory. Other ideas? +## I have been unable to have the links be built unless I build them all the file. +#latexFiles = \ +# introduction.tex ASTGraphGenerator.tex AST_PDF_Generator.tex \ +# identityTranslator.tex queryLibraryExample.tex abstractHandle.tex \ +# traversal.tex loopRecognition.tex typeInfoFromFunctionParameters.tex resolveOverloadedFunction.tex \ +# templateParameter.tex instrumentationExample.tex addVariableDeclaration.tex \ +# addAssignmentStmt.tex addExpression.tex\ +# addFunctionDeclaration.tex buildCFG.tex parallelChecker.tex defuseAnalysis.tex \ +# binaryAnalysis.tex buildCG.tex classHierarchyGraph.tex loopOptimization.tex inliner.tex outliner.tex \ +# parser-docs.tex codeCoverage.tex globalVariableHandling.tex scopeInformation.tex sideeffect-docs.tex \ +# tauInstrumentation.tex templateSupport.tex dataBaseSupport.tex recognitionOfAbstractions.tex \ +# debuggingSupport.tex commandlineProcessing.tex customGraphs.tex tutorialMakefile.tex wrapup.tex \ +# appendix.tex astFileIO.tex uniqueNames.tex wholeGraphAST.tex addingComments.tex \ +# partialRedundancyElimination.tex codeGenerationFormatControl.tex copyHelp.tex \ +# roseHPCT.tex sharedMemoryTraversals.tex distributedMemoryTraversals.tex bugSeeding.tex \ +# modifiers.tex howToContribute.tex virtualCFG.tex binaryConstruction.tex reductionRecognition.tex \ +# haskell.tex +# +## This is an evolving list, but these are a few of the required files +#generatedCodeExamples = \ +# $(top_builddir)/tutorial/inputCode_ASTGraphGenerator.ps \ +# $(top_builddir)/tutorial/rose_inputCode_AddFunctionDeclaration.C \ +# $(top_builddir)/tutorial/rose_inputCode_AddFunctionDeclaration2.C \ +# $(top_builddir)/tutorial/rose_inputCode_AddFunctionDeclaration3.C \ +# $(top_builddir)/tutorial/rose_inputCode_IdentityTranslator.C \ +# $(top_builddir)/tutorial/rose_inputCode_AddVariableDeclaration.C \ +# $(top_builddir)/tutorial/rose_inputCode_AddVariableDeclaration2.C \ +# $(top_builddir)/tutorial/rose_transformation_inputCode_InstrumentationTranslator1.C \ +# $(top_builddir)/tutorial/rose_inputCode_ExampleDebugging.C \ +# $(top_builddir)/tutorial/codeCoverage.out \ +# $(top_builddir)/tutorial/vcfg.pdf \ +# $(top_builddir)/tutorial/rose_inputCode_inlineTransformations.C \ +# $(top_builddir)/tutorial/roseHPCT/profiled.out +# +#$(generatedCodeExamples): +# cd $(top_builddir)/tutorial; $(MAKE) docs +# +#latex-docs: pdf +# +#TUTORIAL_NAME = $(PACKAGE_NAME)-$(PACKAGE_VERSION)-Tutorial.pdf +# +#pdf-local: $(TUTORIAL_NAME) +# +#make-web-pages: $(TUTORIAL_NAME) +# mkdir -p ../ROSE_WebPages/ROSE_Tutorial +# cp -fp $(TUTORIAL_NAME) ../ROSE_WebPages/ROSE_Tutorial/ +## a copy without version number as a permanent URL used for external references, Liao +# cp -fp $(TUTORIAL_NAME) ../ROSE_WebPages/ROSE_Tutorial/ROSE-Tutorial.pdf +# +#$(TUTORIAL_NAME): tutorial.tex gettingStarted.tex $(latexFiles) +# cd $(top_builddir)/tutorial; $(MAKE) docs +# $(PDFLATEX) tutorial.tex && \ +# $(PDFLATEX) tutorial.tex && \ +# $(PDFLATEX) tutorial.tex && \ +# mv tutorial.pdf $(TUTORIAL_NAME) +# +#docs: pdf +# +#EXTRA_DIST = $(latexFiles) +# +#CLEANFILES = *.out *.log *.aux *.lof *.toc *.dvi *.ps *.pdf *.gz diff --git a/docs/Rosetta/CMakeLists.txt b/docs/Rosetta/CMakeLists.txt new file mode 100644 index 0000000000..d559f3a812 --- /dev/null +++ b/docs/Rosetta/CMakeLists.txt @@ -0,0 +1,28 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +########################################################################################### +## This makefile is unfinished and does not yet generate Doxygen documentation for Rosetta. +########################################################################################### +# +## Regenerate the doxygen output if the dependent source code is newer +#$(RosettaDoxygenDocumentation): $(RosettaDocsDependencies) $(ROSETTA_MAINPAGE_DOCUMENTATION) +# @echo "Generate documentation for Rosetta (used within ROSE to generate Sage III) (using Doxygen)" +# doxygen rosetta.cfg +# +## Makefile rules called by user (Makefile's public interface) +#rosetta-docs: $(RosettaDoxygenDocumentation) +# +## Makefile rule called by automake (using dist or install rules) +#docs: +# @echo "Skipping the creation of documentation within the docs rule (for now)." +# +# diff --git a/docs/testDoxygen/CMakeLists.txt b/docs/testDoxygen/CMakeLists.txt new file mode 100644 index 0000000000..bebbc8edab --- /dev/null +++ b/docs/testDoxygen/CMakeLists.txt @@ -0,0 +1,59 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +## This directory is for experimentation with ideas specific to +## how we can use Doxygen to better document the ROSE project. +# +#if DQ_DEVELOPER_TESTS +# +#logo: +## Copy the logo file to the this directory +# mkdir -p ROSE_HTML_Reference +## Copy to the current directory where doxygen will be run so that doxygen +## can copy it to the where it will put the web pages (./ROSE_HTML_Reference) +# cp @top_srcdir@/docs/Rose/compass_rose.gif . +# +## DQ (8/29/2008): +## Added support to build (in the ROSE/docs/Rose directory) the AvailableDocumentation.docs +## file from the AvailableDocumentation.docs.in (as required by the generated test.cfg in +## this directory. +#AvailableDocumentation.docs: +# cd ../Rose; $(MAKE) AvailableDocumentation.docs +# +#docs: logo copyPublications test.cfg AvailableDocumentation.docs +# doxygen test.cfg +# +## DQ (5/8/2005): Added custon headers and footers for HTML generated documentation +## See use of HTML_HEADER and HTML_FOOTER in test.cfg.in file +## DIST_EXTRA = htmlHeaderFile.html htmlFooterFile.html test.cfg.in +#EXTRA_DIST = htmlHeaderFile.html htmlFooterFile.html test.cfg.in +# +## DQ (1/25/2006): Renamed clean rule since we don't want "make clean" +## at the top level directory to always remove this documentation. +#cleandocs: +# rm -rf ROSE_HTML_Reference ROSE_ResearchPapers test.cfg *.ps *.gif +# +## This allows us to test the development of the +## documentation specific to the publications page. +#copyPublications: +# mkdir -p ROSE_ResearchPapers +# cp -r $(top_srcdir)/ROSE_ResearchPapers/*.pdf ROSE_ResearchPapers +# +## This copies the experimental version of the documentation to the +## location where it will permanently reside in the source tree. +#copyDocumentation: +# cp $(srcdir)/*.docs $(top_srcdir)/src/frontend/SageIII/docs +# +#else +# +#EXTRA_DIST = +# +#endif diff --git a/exampleTranslators/AstCopyReplTester/CMakeLists.txt b/exampleTranslators/AstCopyReplTester/CMakeLists.txt new file mode 100644 index 0000000000..95cf654ff4 --- /dev/null +++ b/exampleTranslators/AstCopyReplTester/CMakeLists.txt @@ -0,0 +1,38 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + +set(astCopyReplTest_SRCS astCopyReplTest.C) + +kde4_add_executable(astCopyReplTest ${astCopyReplTest_SRCS}) + +target_link_libraries(astCopyReplTest ${KDE4_KDECORE_LIBS}) + +install(TARGETS astCopyReplTest ${INSTALL_TARGETS_DEFAULT_ARGS}) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#INCLUDES = $(ROSE_INCLUDES) +# +#bin_PROGRAMS = astCopyReplTest +# +#astCopyReplTest_SOURCES = astCopyReplTest.C +# +#LDADD = $(LIBS_WITH_RPATH) $(ROSE_LIBS) +# +#EXTRA_DIST = +#CLEANFILES = +# +#clean-local: +# rm -rf Templates.DB ii_files ti_files +# diff --git a/exampleTranslators/CMakeLists.txt b/exampleTranslators/CMakeLists.txt new file mode 100644 index 0000000000..f675d200ee --- /dev/null +++ b/exampleTranslators/CMakeLists.txt @@ -0,0 +1,30 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + +add_subdirectory(documentedExamples) +add_subdirectory(defaultTranslator) +add_subdirectory(DOTGenerator) +add_subdirectory(PDFGenerator) +add_subdirectory(AstCopyReplTester) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#SUBDIRS = \ +# documentedExamples \ +# defaultTranslator \ +# DOTGenerator \ +# PDFGenerator \ +# AstCopyReplTester +# +## DQ (9/11/2008): We can add these later but these are older QRose examples. +## Current examples are in developersScratchSpace/Dan/QRose_tests. +## graphicalUserInterfaceExamples +# diff --git a/exampleTranslators/DOTGenerator/CMakeLists.txt b/exampleTranslators/DOTGenerator/CMakeLists.txt new file mode 100644 index 0000000000..12ac09508c --- /dev/null +++ b/exampleTranslators/DOTGenerator/CMakeLists.txt @@ -0,0 +1,96 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + +set(dotGenerator_SRCS dotGenerator.C) + +kde4_add_executable(dotGenerator ${dotGenerator_SRCS}) + +target_link_libraries(dotGenerator ${KDE4_KDECORE_LIBS}) + +install(TARGETS dotGenerator ${INSTALL_TARGETS_DEFAULT_ARGS}) + + +########### next target ############### + +set(dotGeneratorWholeASTGraph_SRCS dotGeneratorWholeASTGraph.C) + +kde4_add_executable(dotGeneratorWholeASTGraph ${dotGeneratorWholeASTGraph_SRCS}) + +target_link_libraries(dotGeneratorWholeASTGraph ${KDE4_KDECORE_LIBS}) + +install(TARGETS dotGeneratorWholeASTGraph ${INSTALL_TARGETS_DEFAULT_ARGS}) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#INCLUDES = $(ROSE_INCLUDES) +# +#bin_PROGRAMS = dotGenerator dotGeneratorWholeASTGraph +# +#dotGenerator_SOURCES = dotGenerator.C +# +#dotGeneratorWholeASTGraph_SOURCES = dotGeneratorWholeASTGraph.C +# +#LDADD = $(LIBS_WITH_RPATH) $(ROSE_LIBS) +# +## changes to the templates in ../src/midend/astRewriteMechanism/rewriteTreeTraversal.C +## should force several files using those templates to be recompiled. +## Express this explicitly: +## dotGenerator.o: $(top_builddir)/src/midend/astRewriteMechanism/rewriteTreeTraversal.o +# +#EXTRA_DIST = $(TESTCODES) +# +#CLEANFILES = testdot_01.C.Preorder.dot testdot_01.C.Postorder.dot testdot_01.C.TopDown.dot testdot_01.C.BottomUp.dot testdot_01.C.TopDownBottomUp.dot +# +#clean-local: +# rm -rf Templates.DB ii_files ti_files rose_*.C *.pdf +# +#check-local: +# rm -f testdot_01.o +# $(MAKE) $(TEST_Objects) +# +#TESTCODES = \ +# testdot_01.C +# +## Build the list of object files +#TEST_Objects = ${TESTCODES:.C=.o} +# +#ROSE_FLAGS = +# +## This rule generates a dependency that forces the "make check" +## test to always compile the test code +#FORCE_TEST_CODES_TO_RUN: +# +#$(TEST_Objects): $(TESTCODES) FORCE_TEST_CODES_TO_RUN dotGenerator +# : remove this so that we can force the examples to be run +# rm -f $(TEST_Objects) +# ./dotGenerator -I$(srcdir) $(ROSE_FLAGS) $(INCLUDES) -c $(srcdir)/$(@:.o=.C) +# : remove this so that we can force the examples to be run +# rm -f $(TEST_Objects) +# ./dotGeneratorWholeASTGraph -I$(srcdir) $(ROSE_FLAGS) $(INCLUDES) -c $(srcdir)/$(@:.o=.C) +# : remove this so that we can force the examples to be run +# rm -f $(TEST_Objects) +# +## DQ (1/4/2008): Required to cleanup for make distcheck +#distclean-local: +# rm -rf *.dot +# +# +# +# +# +# +# +# +# +# diff --git a/exampleTranslators/PDFGenerator/CMakeLists.txt b/exampleTranslators/PDFGenerator/CMakeLists.txt new file mode 100644 index 0000000000..f671d638e7 --- /dev/null +++ b/exampleTranslators/PDFGenerator/CMakeLists.txt @@ -0,0 +1,39 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + +set(pdfGenerator_SRCS pdfGenerator.C) + +kde4_add_executable(pdfGenerator ${pdfGenerator_SRCS}) + +target_link_libraries(pdfGenerator ${KDE4_KDECORE_LIBS}) + +install(TARGETS pdfGenerator ${INSTALL_TARGETS_DEFAULT_ARGS}) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#INCLUDES = $(ROSE_INCLUDES) +# +#bin_PROGRAMS = pdfGenerator +# +#pdfGenerator_SOURCES = pdfGenerator.C +# +#LDADD = $(LIBS_WITH_RPATH) $(ROSE_LIBS) +# +#EXTRA_DIST = +#CLEANFILES = +# +#clean-local: +# rm -rf *.o pdfGenerator Templates.DB ii_files ti_files +# +# diff --git a/exampleTranslators/defaultTranslator/CMakeLists.txt b/exampleTranslators/defaultTranslator/CMakeLists.txt new file mode 100644 index 0000000000..59a85c7bfa --- /dev/null +++ b/exampleTranslators/defaultTranslator/CMakeLists.txt @@ -0,0 +1,38 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + +set(defaultTranslator_SRCS defaultTranslator.C) + +kde4_add_executable(defaultTranslator ${defaultTranslator_SRCS}) + +target_link_libraries(defaultTranslator ${KDE4_KDECORE_LIBS}) + +install(TARGETS defaultTranslator ${INSTALL_TARGETS_DEFAULT_ARGS}) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#INCLUDES = $(ROSE_INCLUDES) +# +#bin_PROGRAMS = defaultTranslator +# +#defaultTranslator_SOURCES = defaultTranslator.C +# +#LDADD = $(LIBS_WITH_RPATH) $(ROSE_LIBS) +# +#EXTRA_DIST = +#CLEANFILES = +# +#clean-local: +# rm -rf Templates.DB ii_files ti_files +# diff --git a/exampleTranslators/documentedExamples/AstRewriteExamples/CMakeLists.txt b/exampleTranslators/documentedExamples/AstRewriteExamples/CMakeLists.txt new file mode 100644 index 0000000000..1377c53e7d --- /dev/null +++ b/exampleTranslators/documentedExamples/AstRewriteExamples/CMakeLists.txt @@ -0,0 +1,42 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + +set(astRewriteExample1_SRCS astRewriteExample1.C) + +kde4_add_executable(astRewriteExample1 ${astRewriteExample1_SRCS}) + +target_link_libraries(astRewriteExample1 ${KDE4_KDECORE_LIBS}) + +install(TARGETS astRewriteExample1 ${INSTALL_TARGETS_DEFAULT_ARGS}) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#INCLUDES = $(ROSE_INCLUDES) +# +## DQ (3/21/2009): fails to compile under Cygwin. +#if !ROSE_BUILD_OS_IS_CYGWIN +#bin_PROGRAMS = astRewriteExample1 +#astRewriteExample1_SOURCES = astRewriteExample1.C +#endif +# +#LDADD = $(LIBS_WITH_RPATH) $(ROSE_LIBS) +# +## DQ this file is used in the ROSE User Manual so we need it here +#EXTRA_DIST = inputRewrite1.C exampleRewrite1.C +# +#CLEANFILES = +# +#clean-local: +# rm -rf Templates.DB ii_files ti_files +# diff --git a/exampleTranslators/documentedExamples/CMakeLists.txt b/exampleTranslators/documentedExamples/CMakeLists.txt new file mode 100644 index 0000000000..aa42824e8f --- /dev/null +++ b/exampleTranslators/documentedExamples/CMakeLists.txt @@ -0,0 +1,28 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + +add_subdirectory(simpleTranslatorExamples) +add_subdirectory(AstRewriteExamples) +add_subdirectory(dataBaseExamples) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#SUBDIRS = \ +# simpleTranslatorExamples \ +# AstRewriteExamples \ +# dataBaseExamples +# +## DQ (1/2/2007): Most of these examples have been moved to the ROSE/tutorial directory. +## And additional problem is that the absolute paths for the files exceed 100 characters +## which is a posix limit not enforced by GNU tar 1.14 (2004) and so it is a hard limit +## for us. +## astProcessingExamples +# diff --git a/exampleTranslators/documentedExamples/astProcessingExamples/CMakeLists.txt b/exampleTranslators/documentedExamples/astProcessingExamples/CMakeLists.txt new file mode 100644 index 0000000000..5c9d15afee --- /dev/null +++ b/exampleTranslators/documentedExamples/astProcessingExamples/CMakeLists.txt @@ -0,0 +1,18 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + +add_subdirectory(printVars) +add_subdirectory(printLoopInfo) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#SUBDIRS = \ +# printVars printLoopInfo diff --git a/exampleTranslators/documentedExamples/astProcessingExamples/printLoopInfo/CMakeLists.txt b/exampleTranslators/documentedExamples/astProcessingExamples/printLoopInfo/CMakeLists.txt new file mode 100644 index 0000000000..404fe8fb96 --- /dev/null +++ b/exampleTranslators/documentedExamples/astProcessingExamples/printLoopInfo/CMakeLists.txt @@ -0,0 +1,67 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + +set(printLoopInfo_SRCS printLoopInfo.C LoopNestingInfoProcessing.C) + +kde4_add_executable(printLoopInfo ${printLoopInfo_SRCS}) + +target_link_libraries(printLoopInfo ${KDE4_KDECORE_LIBS}) + +install(TARGETS printLoopInfo ${INSTALL_TARGETS_DEFAULT_ARGS}) + + +########### install files ############### + +install(FILES LoopNestingInfoProcessing.h DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#INCLUDES = $(ROSE_INCLUDES) +# +#bin_PROGRAMS = printLoopInfo +# +#printLoopInfo_SOURCES = printLoopInfo.C LoopNestingInfoProcessing.C +#printLoopInfo_DEPENDENCIES = $(ROSE_LIBS_WITH_PATH) +# +#LDADD = $(LIBS_WITH_RPATH) $(ROSE_LIBS) +# +## testing (generate output, dot file, pdf file) +# +#TESTCODES = testInput1.C +# +#include_HEADERS = LoopNestingInfoProcessing.h +#EXTRA_DIST = $(TESTCODES) +# +#CLEANFILES = testInput1.C.dot testInput1.C.pdf +# +#TEST_Objects = ${TESTCODES:.C=.o} +# +## DQ (10/23/2004): This test code appears to generate an infinit loop when used with the printLoopInfo code! +## I'm not clear on how to fix this so for now let's just skip the tests and hope that the documentation does +## not require it. Need to let Markus know, since this is likely his code, I think. +## It generates the following error: "PDFlib memory error: Couldn't reallocate memory in pdf_check_stream!" +#check-local: +# rm -f testInput1.o +# @echo "SKIPPING TEST CODES RUN BY \"make check\" rule in exampleTranslators/documentedExamples/astProcessingExamples/printLoopInfo directory ..." +## $(MAKE) $(TEST_Objects) +# +## This rule generates a dependency that forces the "make check" +## test to always compile the test code +#FORCE_TEST_CODES_TO_RUN: +# +#$(TEST_Objects): $(TESTCODES) FORCE_TEST_CODES_TO_RUN printLoopInfo +# : remove this so that we can force the examples to be run +# rm -f $(TEST_Objects) +# ./printLoopInfo -I$(srcdir) $(ROSE_FLAGS) -DHAVE_CONFIG_H $(INCLUDES) -c $(srcdir)/$(@:.o=.C) +# : remove this so that we can force the examples to be run +# rm -f $(TEST_Objects) +# +#clean-local: +# rm -rf Templates.DB ii_files ti_files diff --git a/exampleTranslators/documentedExamples/astProcessingExamples/printVars/CMakeLists.txt b/exampleTranslators/documentedExamples/astProcessingExamples/printVars/CMakeLists.txt new file mode 100644 index 0000000000..1f97dd7886 --- /dev/null +++ b/exampleTranslators/documentedExamples/astProcessingExamples/printVars/CMakeLists.txt @@ -0,0 +1,62 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + +set(printVars_SRCS printVars.C MyTraversal.C) + +kde4_add_executable(printVars ${printVars_SRCS}) + +target_link_libraries(printVars ${KDE4_KDECORE_LIBS}) + +install(TARGETS printVars ${INSTALL_TARGETS_DEFAULT_ARGS}) + + +########### install files ############### + +install(FILES MyTraversal.h DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#INCLUDES = $(ROSE_INCLUDES) +# +#bin_PROGRAMS = printVars +# +#printVars_SOURCES = printVars.C MyTraversal.C +#printVars_DEPENDENCIES = $(ROSE_LIBS_WITH_PATH) +# +#LDADD = $(LIBS_WITH_RPATH) $(ROSE_LIBS) +# +## testing (generate output, dot file, pdf file) +# +#TESTCODES = testInput1.C +# +#include_HEADERS = MyTraversal.h +#EXTRA_DIST = $(TESTCODES) +# +#CLEANFILES = testInput1.C.dot +# +#TEST_Objects = ${TESTCODES:.C=.o} +# +#check-local: +# rm -f testInput1.o +# $(MAKE) $(TEST_Objects) +# +## This rule generates a dependency that forces the "make check" +## test to always compile the test code +#FORCE_TEST_CODES_TO_RUN: +# +#$(TEST_Objects): $(TESTCODES) FORCE_TEST_CODES_TO_RUN printVars +# : remove this so that we can force the examples to be run +# rm -f $(TEST_Objects) +# ./printVars -I$(srcdir) $(ROSE_FLAGS) -DHAVE_CONFIG_H $(INCLUDES) -c $(srcdir)/$(@:.o=.C) +# : remove this so that we can force the examples to be run +# rm -f $(TEST_Objects) +# +#clean-local: +# rm -rf Templates.DB ii_files ti_files diff --git a/exampleTranslators/documentedExamples/dataBaseExamples/CMakeLists.txt b/exampleTranslators/documentedExamples/dataBaseExamples/CMakeLists.txt new file mode 100644 index 0000000000..a9310f651a --- /dev/null +++ b/exampleTranslators/documentedExamples/dataBaseExamples/CMakeLists.txt @@ -0,0 +1,55 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +#include ../../../config/Makefile.for.ROSE.includes.and.libs +# +#INCLUDES = $(ROSE_INCLUDES) +# +## bin_PROGRAMS = customtable_example \ +## databasegraph_example \ +## rosedb_example \ +## simplecallgraph_example +# +## objectFile_DEPENDENCIES = \ +## $(top_builddir)/src/librose.a \ +## $(top_builddir)/EDG/src/libedg.a +# +## customtable_example_SOURCES = customtable_example.C +## customtable_example_DEPENDENCIES = $(objectFile_DEPENDENCIES) +# +## databasegraph_example_SOURCES = databasegraph_example.C +## databasegraph_example_DEPENDENCIES = $(objectFile_DEPENDENCIES) +# +## rosedb_example_SOURCES = rosedb_example.C +## rosedb_example_DEPENDENCIES = $(objectFile_DEPENDENCIES) +# +## simplecallgraph_example_SOURCES = simplecallgraph_example.C +## simplecallgraph_example_DEPENDENCIES = $(objectFile_DEPENDENCIES) +# +### linker needs to know about STL +### By adding the -ptr. on the link line we should be able to avoid +### specifying the Templates.DB/*.o file explicitly on the link line +### LDFLAGS = @STL_INCLUDES@ +# +#LDADD = $(ROSE_LIBS) +# +## If the purify linker is enabled, AUX_LINKER will be set by configure. +## These are now set in the ROSE SUPPORT PURIFY configure macro +## CCLD = $(AUX_LINKER) $(CC) +## CXXLD = $(AUX_LINKER) $(CXX) +# +#EXTRA_DIST = customtable_example.C rosedb_example.C databasegraph_example.C simplecallgraph_example.C +# +#CLEANFILES = +# +#clean-local: +# rm -rf Templates.DB ii_files ti_files +# diff --git a/exampleTranslators/documentedExamples/simpleTranslatorExamples/CMakeLists.txt b/exampleTranslators/documentedExamples/simpleTranslatorExamples/CMakeLists.txt new file mode 100644 index 0000000000..c054526835 --- /dev/null +++ b/exampleTranslators/documentedExamples/simpleTranslatorExamples/CMakeLists.txt @@ -0,0 +1,58 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + +set(identityTranslator_SRCS identityTranslator.C) + +kde4_add_executable(identityTranslator ${identityTranslator_SRCS}) + +target_link_libraries(identityTranslator ${KDE4_KDECORE_LIBS}) + +install(TARGETS identityTranslator ${INSTALL_TARGETS_DEFAULT_ARGS}) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#INCLUDES = $(ROSE_INCLUDES) +# +#all: exampleMakefile +# +#bin_PROGRAMS = identityTranslator +# +#identityTranslator_SOURCES = identityTranslator.C +# +#LDADD = $(LIBS_WITH_RPATH) $(ROSE_LIBS) +# +##EXTRA_DIST = testCode.C AST-dot1.ps AST-pdf2.pdf +#EXTRA_DIST = testCode.C AST-pdf2.pdf +#CLEANFILES = +# +#clean-local: +# rm -rf Templates.DB ii_files ti_files exampleTranslator exampleTranslatorMultiLib rose_* a.out +# +## Compile everything with -g (compiler's debug flag) +## AM_CPPFLAGS = -g +# +#installcheck: +# rm -f identityTranslator identityTranslator.o +# @echo "Testing build using installed libraries ..." +#if USE_ROSE_IN_BUILD_TREE_VAR +# unset ROSE_IN_BUILD_TREE; $(MAKE) -f exampleMakefile # This must be done in a single shell +#else +# $(MAKE) -f exampleMakefile # This must be done in a single shell +#endif +# @echo "Testing executable built using installed libraries ..." +#if USE_ROSE_IN_BUILD_TREE_VAR +# unset ROSE_IN_BUILD_TREE; $(MAKE) -f exampleMakefile check +#else +# $(MAKE) -f exampleMakefile check +#endif diff --git a/exampleTranslators/graphicalUserInterfaceExamples/CMakeLists.txt b/exampleTranslators/graphicalUserInterfaceExamples/CMakeLists.txt new file mode 100644 index 0000000000..067bacd3ec --- /dev/null +++ b/exampleTranslators/graphicalUserInterfaceExamples/CMakeLists.txt @@ -0,0 +1,21 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + +add_subdirectory(slicing) +add_subdirectory(attributes) +add_subdirectory(query) +add_subdirectory(layout) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#SUBDIRS = slicing attributes query layout +# +#EXTRA_DIST = test_01.cpp diff --git a/exampleTranslators/graphicalUserInterfaceExamples/attributes/CMakeLists.txt b/exampleTranslators/graphicalUserInterfaceExamples/attributes/CMakeLists.txt new file mode 100644 index 0000000000..85b8ca36b0 --- /dev/null +++ b/exampleTranslators/graphicalUserInterfaceExamples/attributes/CMakeLists.txt @@ -0,0 +1,74 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + +set(attributes_SRCS attrib.cpp) + +kde4_add_executable(attributes ${attributes_SRCS}) + +target_link_libraries(attributes ${KDE4_KDECORE_LIBS}) + +install(TARGETS attributes ${INSTALL_TARGETS_DEFAULT_ARGS}) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#if ROSE_USE_QROSE +#bin_PROGRAMS = attributes +# +#attributes_SOURCES = attrib.cpp +# +## Use the names of the libraries as the list of dependences +#attributes_DEPENDENCIES = $(ROSE_LIBS_WITH_PATH) +# +## Use names set in ROSE/config/Makefile.for.ROSE.includes.and.libs +#INCLUDES = $(ROSE_INCLUDES) +#LDADD = $(LIBS_WITH_RPATH) $(ROSE_LIBS) +# +# +#EXTRA_DIST = $(TESTCODES) +# +#CLEANFILES = +# +#clean-local: +# rm -rf Templates.DB ii_files ti_files rose_*.C +# +#check-local: +# rm -f test_01.o +# $(MAKE) $(TEST_Objects) +# +#TESTCODES = +## test_01.cpp +# +## Build the list of object files +#TEST_Objects = ${TESTCODES:.C=.o} +# +#ROSE_FLAGS = +# +## This rule generates a dependency that forces the "make check" +## test to always compile the test code +#FORCE_TEST_CODES_TO_RUN: +# +#$(TEST_Objects): $(TESTCODES) FORCE_TEST_CODES_TO_RUN attributes +# : remove this so that we can force the examples to be run +# rm -f $(TEST_Objects) +## DQ (8/13/2005): I have commented out these test since they don't terminate +## automatically and as a result are difficult to handle with the "make check" rule. +# echo "testing of attributes GUI commented out since it won't terminate automatically" +## ./attributes -I$(srcdir) $(ROSE_FLAGS) -c $(srcdir)/../$(@:.o=.C) +# : remove this so that we can force the examples to be run +# rm -f $(TEST_Objects) +# +#test: attributes +# ./attributes -I$(srcdir) $(ROSE_FLAGS) -c $(srcdir)/../test_01.cpp +#endif +# diff --git a/exampleTranslators/graphicalUserInterfaceExamples/layout/CMakeLists.txt b/exampleTranslators/graphicalUserInterfaceExamples/layout/CMakeLists.txt new file mode 100644 index 0000000000..e21dd3e4a3 --- /dev/null +++ b/exampleTranslators/graphicalUserInterfaceExamples/layout/CMakeLists.txt @@ -0,0 +1,73 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + +set(layout_SRCS layout.cpp) + +kde4_add_executable(layout ${layout_SRCS}) + +target_link_libraries(layout ${KDE4_KDECORE_LIBS}) + +install(TARGETS layout ${INSTALL_TARGETS_DEFAULT_ARGS}) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#if ROSE_USE_QROSE +#bin_PROGRAMS = layout +# +#layout_SOURCES = layout.cpp +# +## Use the names of the libraries as the list of dependences +#layout_DEPENDENCIES = $(ROSE_LIBS_WITH_PATH) +# +## Use names set in ROSE/config/Makefile.for.ROSE.includes.and.libs +#INCLUDES = $(ROSE_INCLUDES) +#LDADD = $(LIBS_WITH_RPATH) $(ROSE_LIBS) +# +# +#EXTRA_DIST = $(TESTCODES) +# +#CLEANFILES = +# +#clean-local: +# rm -rf Templates.DB ii_files ti_files rose_*.C +# +#check-local: +# rm -f test_01.o +# $(MAKE) $(TEST_Objects) +# +#TESTCODES = +## test_01.cpp +# +## Build the list of object files +#TEST_Objects = ${TESTCODES:.C=.o} +# +#ROSE_FLAGS = +# +## This rule generates a dependency that forces the "make check" +## test to always compile the test code +#FORCE_TEST_CODES_TO_RUN: +# +#$(TEST_Objects): $(TESTCODES) FORCE_TEST_CODES_TO_RUN layout +# : remove this so that we can force the examples to be run +# rm -f $(TEST_Objects) +## DQ (8/13/2005): I have commented out these test since they don't terminate +## automatically and as a result are difficult to handle with the "make check" rule. +# echo "testing of layout GUI commented out since it won't terminate automatically" +## ./layout -I$(srcdir) $(ROSE_FLAGS) -c $(srcdir)/../$(@:.o=.C) +# : remove this so that we can force the examples to be run +# rm -f $(TEST_Objects) +# +#test: layout +# ./layout -I$(srcdir) $(ROSE_FLAGS) -c $(srcdir)/../test_01.cpp +#endif diff --git a/exampleTranslators/graphicalUserInterfaceExamples/query/CMakeLists.txt b/exampleTranslators/graphicalUserInterfaceExamples/query/CMakeLists.txt new file mode 100644 index 0000000000..8992c57097 --- /dev/null +++ b/exampleTranslators/graphicalUserInterfaceExamples/query/CMakeLists.txt @@ -0,0 +1,74 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + +set(query_SRCS query.cpp) + +kde4_add_executable(query ${query_SRCS}) + +target_link_libraries(query ${KDE4_KDECORE_LIBS}) + +install(TARGETS query ${INSTALL_TARGETS_DEFAULT_ARGS}) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#if ROSE_USE_QROSE +#bin_PROGRAMS = query +# +#query_SOURCES = query.cpp +# +## Use the names of the libraries as the list of dependences +#query_DEPENDENCIES = $(ROSE_LIBS_WITH_PATH) +# +## Use names set in ROSE/config/Makefile.for.ROSE.includes.and.libs +#INCLUDES = $(ROSE_INCLUDES) +#LDADD = $(LIBS_WITH_RPATH) $(ROSE_LIBS) +# +# +#EXTRA_DIST = $(TESTCODES) +# +#CLEANFILES = +# +#clean-local: +# rm -rf Templates.DB ii_files ti_files rose_*.C +# +#check-local: +# rm -f test_01.o +# $(MAKE) $(TEST_Objects) +# +#TESTCODES = +## test_01.cpp +# +## Build the list of object files +#TEST_Objects = ${TESTCODES:.C=.o} +# +#ROSE_FLAGS = +# +## This rule generates a dependency that forces the "make check" +## test to always compile the test code +#FORCE_TEST_CODES_TO_RUN: +# +#$(TEST_Objects): $(TESTCODES) FORCE_TEST_CODES_TO_RUN query +# : remove this so that we can force the examples to be run +# rm -f $(TEST_Objects) +## DQ (8/13/2005): I have commented out these test since they don't terminate +## automatically and as a result are difficult to handle with the "make check" rule. +# echo "testing of query GUI commented out since it won't terminate automatically" +## ./query -I$(srcdir) $(ROSE_FLAGS) -c $(srcdir)/../$(@:.o=.C) +# : remove this so that we can force the examples to be run +# rm -f $(TEST_Objects) +# +#test: query +# ./query -I$(srcdir) $(ROSE_FLAGS) -c $(srcdir)/../test_01.cpp +#endif +# diff --git a/exampleTranslators/graphicalUserInterfaceExamples/slicing/CMakeLists.txt b/exampleTranslators/graphicalUserInterfaceExamples/slicing/CMakeLists.txt new file mode 100644 index 0000000000..3501b8164e --- /dev/null +++ b/exampleTranslators/graphicalUserInterfaceExamples/slicing/CMakeLists.txt @@ -0,0 +1,73 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + +set(slicing_SRCS slicing.cpp) + +kde4_add_executable(slicing ${slicing_SRCS}) + +target_link_libraries(slicing ${KDE4_KDECORE_LIBS}) + +install(TARGETS slicing ${INSTALL_TARGETS_DEFAULT_ARGS}) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#if ROSE_USE_QROSE +#bin_PROGRAMS = slicing +# +#slicing_SOURCES = slicing.cpp +# +## Use the names of the libraries as the list of dependences +#slicing_DEPENDENCIES = $(ROSE_LIBS_WITH_PATH) +# +## Use names set in ROSE/config/Makefile.for.ROSE.includes.and.libs +#INCLUDES = $(ROSE_INCLUDES) +#LDADD = $(LIBS_WITH_RPATH) $(ROSE_LIBS) +# +#EXTRA_DIST = $(TESTCODES) +# +#CLEANFILES = +# +#clean-local: +# rm -rf Templates.DB ii_files ti_files rose_*.C +# +#check-local: +# rm -f test_01.o +# $(MAKE) $(TEST_Objects) +# +#TESTCODES = +## test_01.cpp +# +## Build the list of object files +#TEST_Objects = ${TESTCODES:.C=.o} +# +#ROSE_FLAGS = +# +## This rule generates a dependency that forces the "make check" +## test to always compile the test code +#FORCE_TEST_CODES_TO_RUN: +# +#$(TEST_Objects): $(TESTCODES) FORCE_TEST_CODES_TO_RUN slicing +# : remove this so that we can force the examples to be run +# rm -f $(TEST_Objects) +## DQ (8/13/2005): I have commented out these test since they don't terminate +## automatically and as a result are difficult to handle with the "make check" rule. +# echo "testing of slicing GUI commented out since it won't terminate automatically" +## ./slicing -I$(srcdir) $(ROSE_FLAGS) -c $(srcdir)/../$(@:.o=.C) +# : remove this so that we can force the examples to be run +# rm -f $(TEST_Objects) +# +#test: slicing +# ./slicing -I$(srcdir) $(ROSE_FLAGS) -c $(srcdir)/../test_01.cpp +#endif +# diff --git a/projects/bugSeeding/CMakeLists.txt b/projects/bugSeeding/CMakeLists.txt new file mode 100644 index 0000000000..60cf8df634 --- /dev/null +++ b/projects/bugSeeding/CMakeLists.txt @@ -0,0 +1,97 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + +set(bugSeeding_SRCS + bugSeeding.C + bugSeedingSupport.C + bugSeedingAttributes.C + bufferOverFlowSecurityFlaw.C) + +kde4_add_executable(bugSeeding ${bugSeeding_SRCS}) + +target_link_libraries(bugSeeding ${KDE4_KDECORE_LIBS}) + +install(TARGETS bugSeeding ${INSTALL_TARGETS_DEFAULT_ARGS}) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#PDFLATEX = env TEXINPUTS=$(srcdir):$(top_srcdir)/docs/Rose:.: pdflatex --interaction=batchmode +# +#INCLUDES = $(ROSE_INCLUDES) +# +# +#bin_PROGRAMS = bugSeeding +# +#bugSeeding_SOURCES = bugSeeding.C bugSeedingSupport.C bugSeedingAttributes.C bufferOverFlowSecurityFlaw.C +# +## bugSeeding_HEADERS = bugSeeding.h bugSeedingSupport.h bugSeedingAttributes.h bufferOverFlowSecurityFlaw.h +# +#LDADD = $(LIBS_WITH_RPATH) $(ROSE_LIBS) +# +#clean-local: +# rm -f *.o *~ bugSeeding bugSeeding.tex rose_*.C *.log *.aux *.out *.dot *.pdf +# rm -rf examples +# +#EXTRA_DIST = introduction.tex design.tex appendix.tex \ +# bugSeeding.h bugSeedingSupport.h bugSeedingAttributes.h \ +# cloneGrainularity.h vulnerabilityDetection.h \ +# bufferOverFlowSecurityFlaw.h inputCode_bufferOverflow_arrayIndexing.C +# +# +#docFiles = \ +# inputCode_bufferOverflow_arrayIndexing_C_before.pdf \ +# inputCode_bufferOverflow_arrayIndexing_C_afterCloneGeneration.pdf \ +# inputCode_bufferOverflow_arrayIndexing_C_afterIdentificationOfVulnerabilities.pdf \ +# inputCode_bufferOverflow_arrayIndexing_C_afterSeedingOfSecurityFlaws.pdf +# +#docs: bugSeeding.tex testBufferOverflow_arrayIndexing $(docFiles) +# $(PDFLATEX) bugSeeding.tex +# +#testBufferOverflow_arrayIndexing: bugSeeding +# ./bugSeeding -rose:verbose 0 -c $(srcdir)/inputCode_bufferOverflow_arrayIndexing.C +# +#inputCode_bufferOverflow_arrayIndexing_C_before.pdf: inputCode_bufferOverflow_arrayIndexing.C_before.dot +# @echo "Generate postscript file (default name: test.pdf) from dot file ..." +# $(top_srcdir)/scripts/dotgenLetterPDF inputCode_bufferOverflow_arrayIndexing.C_before.dot inputCode_bufferOverflow_arrayIndexing_C_before.pdf +# +#inputCode_bufferOverflow_arrayIndexing_C_afterCloneGeneration.pdf: inputCode_bufferOverflow_arrayIndexing.C_afterCloneGeneration.dot +# @echo "Generate postscript file (default name: test.pdf) from dot file ..." +# $(top_srcdir)/scripts/dotgenLetterPDF inputCode_bufferOverflow_arrayIndexing.C_afterCloneGeneration.dot inputCode_bufferOverflow_arrayIndexing_C_afterCloneGeneration.pdf +# +#inputCode_bufferOverflow_arrayIndexing_C_afterIdentificationOfVulnerabilities.pdf: inputCode_bufferOverflow_arrayIndexing.C_afterIdentificationOfVulnerabilities.dot +# @echo "Generate postscript file (default name: test.pdf) from dot file ..." +# $(top_srcdir)/scripts/dotgenLetterPDF inputCode_bufferOverflow_arrayIndexing.C_afterIdentificationOfVulnerabilities.dot inputCode_bufferOverflow_arrayIndexing_C_afterIdentificationOfVulnerabilities.pdf +# +#inputCode_bufferOverflow_arrayIndexing_C_afterSeedingOfSecurityFlaws.pdf: inputCode_bufferOverflow_arrayIndexing.C_afterSeedingOfSecurityFlaws.dot +# @echo "Generate postscript file (default name: test.pdf) from dot file ..." +## $(top_srcdir)/scripts/dotgenLetterPDF inputCode_bufferOverflow_arrayIndexing.C_afterSeedingOfSecurityFlaws.dot inputCode_bufferOverflow_arrayIndexing_C_afterSeedingOfSecurityFlaws.pdf +# $(top_srcdir)/scripts/dotgenLetterPDF inputCode_bufferOverflow_arrayIndexing.C_afterSeedingOfSecurityFlaws.dot inputCode_bufferOverflow_arrayIndexing_C_afterSeedingOfSecurityFlaws.pdf +# +# +#dotFiles = \ +# inputCode_bufferOverflow_arrayIndexing.C_before.dot \ +# inputCode_bufferOverflow_arrayIndexing.C_afterCloneGeneration.dot \ +# inputCode_bufferOverflow_arrayIndexing.C_afterIdentificationOfVulnerabilities.dot \ +# inputCode_bufferOverflow_arrayIndexing.C_afterSeedingOfSecurityFlaws.dot +# +#$(dotFiles) : testBufferOverflow_arrayIndexing +# +#check-local: testBufferOverflow_arrayIndexing +# +#copy: +# rm -rf examples +# mkdir examples +# cp $(srcdir)/*.[hC] examples +# cp *.dot examples +# cp *.pdf examples diff --git a/projects/compass/CMakeLists.txt b/projects/compass/CMakeLists.txt new file mode 100644 index 0000000000..dabbe5420f --- /dev/null +++ b/projects/compass/CMakeLists.txt @@ -0,0 +1,24 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + +add_subdirectory(src) +add_subdirectory(tools) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#SUBDIRS = src tools +# +#EXTRA_DIST = extensions +# +#check-local: +# @echo "***************************************************************************" +# @echo "****** ROSE/projects/compass: make check rule complete (terminated normally) ******" +# @echo "***************************************************************************" diff --git a/projects/compass/src/CMakeLists.txt b/projects/compass/src/CMakeLists.txt new file mode 100644 index 0000000000..0d2b0e4dc8 --- /dev/null +++ b/projects/compass/src/CMakeLists.txt @@ -0,0 +1,19 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + +add_subdirectory(compassSupport) +add_subdirectory(util) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#SUBDIRS = compassSupport util +# +#EXTRA_DIST = in compass_scripts tests diff --git a/projects/compass/src/util/CMakeLists.txt b/projects/compass/src/util/CMakeLists.txt new file mode 100644 index 0000000000..de3da8c1ce --- /dev/null +++ b/projects/compass/src/util/CMakeLists.txt @@ -0,0 +1,19 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + +add_subdirectory(C-API) +add_subdirectory(MPIAbstraction) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +## Utility support for Compass-based checkers. +# +#SUBDIRS = C-API MPIAbstraction +# +## eof diff --git a/projects/compass/src/util/MPIAbstraction/CMakeLists.txt b/projects/compass/src/util/MPIAbstraction/CMakeLists.txt new file mode 100644 index 0000000000..dc80a2d636 --- /dev/null +++ b/projects/compass/src/util/MPIAbstraction/CMakeLists.txt @@ -0,0 +1,83 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + +add_subdirectory(alt-mpi-headers) + + +########### next target ############### + + +########### next target ############### + +set(testMPIAbstraction_SRCS testMPIAbstraction.C) + +kde4_add_executable(testMPIAbstraction ${testMPIAbstraction_SRCS}) + +target_link_libraries(testMPIAbstraction ${KDE4_KDECORE_LIBS}) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +##========================================================================== +# +#SUBDIRS = alt-mpi-headers +# +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#INCLUDES = -I$(srcdir) -I$(srcdir)/.. -I$(srcdir)/../../compassSupport \ +# $(ROSE_INCLUDES) +# +##========================================================================== +## Auxiliary library. +# +#noinst_LTLIBRARIES = libMPIAbstraction.la +# +#libMPIAbstraction_la_SOURCES = Recognizer.C Recognizer.h +# +##========================================================================== +## Unit test +# +#noinst_PROGRAMS = testMPIAbstraction +# +#LDADD = libMPIAbstraction.la ../C-API/libC-API.la \ +# $(LIBS_WITH_RPATH) $(ROSE_LIBS) +# +#testMPIAbstraction_SOURCES = testMPIAbstraction.C +# +##========================================================================== +# +#TEST_RUN_FLAGS = --edg:no_warnings -w -rose:verbose 0 -rose:C_only \ +# -I. -Ialt-mpi-headers/include -I$(srcdir)/testCodes \ +# --mpi-api $(srcdir)/MPI.api +# +#test: libMPIAbstraction.la testMPIAbstraction$(EXEEXT) \ +# $(srcdir)/testCodes/is.c \ +# $(srcdir)/testCodes/npbparams.h \ +# $(srcdir)/MPI.api +# @echo "============================================================" +# @echo "Trying to recognize MPI abstractions in 'is.c'..." +# @echo "============================================================" +# ./testMPIAbstraction$(EXEEXT) $(TEST_RUN_FLAGS) \ +# -c $(srcdir)/testCodes/is.c +# @echo "============================================================" +# @echo "Compare to a grep-based search (functions only)..." +# @echo "============================================================" +# @grep -E --line-number 'MPI_[^ ]*[ ]*\(' $(srcdir)/testCodes/is.c +# +#check-local: +# @$(MAKE) test +# @echo "*********************************************************************************************************************" +# @echo "*** ROSE/projects/compass/util/C-API: make check rule complete (terminated normally) ***" +# @echo "*********************************************************************************************************************" +# +#EXTRA_DIST = MPI.api MPI-api.c testCodes +# +#clean-local: +# rm -f *.ti a.out rose_*.c +# +## eof diff --git a/projects/compass/src/util/MPIAbstraction/alt-mpi-headers/CMakeLists.txt b/projects/compass/src/util/MPIAbstraction/alt-mpi-headers/CMakeLists.txt new file mode 100644 index 0000000000..f5f7db859f --- /dev/null +++ b/projects/compass/src/util/MPIAbstraction/alt-mpi-headers/CMakeLists.txt @@ -0,0 +1,75 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + +add_subdirectory(mpich-1.2.7p1) + + +########### next target ############### + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +##========================================================================== +# +#SUBDIRS = mpich-1.2.7p1 +# +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#MPI_ROOT_DIR = $(srcdir)/mpich-1.2.7p1 +#MPI_INC_DIR = $(MPI_ROOT_DIR)/include +#MPI_HDRS = \ +# $(MPI_INC_DIR)/mpi.h \ +# $(MPI_INC_DIR)/mpidefs.h \ +# $(MPI_INC_DIR)/mpi_fortdefs.h \ +# $(MPI_INC_DIR)/mpio.h \ +# $(MPI_INC_DIR)/mpi_errno.h +# +## ALTMPI_OUT_DIR = ./include +## ALTMPI_LIB_OUT_DIR = ./lib +#ALTMPI_OUT_DIR = include +#ALTMPI_LIB_OUT_DIR = lib +# +## The distribution builds the $(ALTMPI_OUT_DIR) and the $(ALTMPI_LIB_OUT_DIR) +## into the source tree (different from the development bversion of ROSE, so +## include the directory for that location as well. +#INCLUDES = -I. -I$(srcdir) -I$(ALTMPI_OUT_DIR) -I$(srcdir)/$(ALTMPI_OUT_DIR) +# +##========================================================================== +# +#ALTMPI_HDRS_MAIN = $(ALTMPI_OUT_DIR)/mpi.h +#ALTMPI_HDRS_OTHERS = \ +# $(ALTMPI_OUT_DIR)/mpidefs.h \ +# $(ALTMPI_OUT_DIR)/mpi_fortdefs.h \ +# $(ALTMPI_OUT_DIR)/mpio.h \ +# $(ALTMPI_OUT_DIR)/mpi_errno.h +#ALTMPI_HDRS = $(ALTMPI_HDRS_MAIN) $(ALTMPI_HDRS_OTHERS) +#ALTMPI_SRCS = $(ALTMPI_LIB_OUT_DIR)/def.c +# +#noinst_LTLIBRARIES = libmpi-alt-defs.la +## libmpi_alt_defs_la_SOURCES = $(ALTMPI_SRCS) $(ALTMPI_HDRS) +#libmpi_alt_defs_la_SOURCES = $(ALTMPI_SRCS) +# +##========================================================================== +# +#$(ALTMPI_HDRS_OTHERS) $(ALTMPI_SRCS): $(ALTMPI_HDRS_MAIN) +# +#$(ALTMPI_HDRS_MAIN): $(MPI_HDRS) $(srcdir)/gen-headers.py +# python $(srcdir)/gen-headers.py \ +# --out-incs=$(ALTMPI_OUT_DIR) \ +# --out-srcs=$(ALTMPI_LIB_OUT_DIR) \ +# $(MPI_ROOT_DIR) +# +##========================================================================== +# +#EXTRA_DIST = gen-headers.py +# +#clean-local: +# rm -f *.ti a.out rose_*.c +# rm -rf $(ALTMPI_OUT_DIR) $(ALTMPI_LIB_OUT_DIR) +# +## eof diff --git a/projects/compass/src/util/MPIAbstraction/alt-mpi-headers/mpich-1.2.7p1/CMakeLists.txt b/projects/compass/src/util/MPIAbstraction/alt-mpi-headers/mpich-1.2.7p1/CMakeLists.txt new file mode 100644 index 0000000000..0d0dfdeb90 --- /dev/null +++ b/projects/compass/src/util/MPIAbstraction/alt-mpi-headers/mpich-1.2.7p1/CMakeLists.txt @@ -0,0 +1,16 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + +add_subdirectory(include) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +#SUBDIRS = include +# +## eof diff --git a/projects/haskellport/CMakeLists.txt b/projects/haskellport/CMakeLists.txt new file mode 100644 index 0000000000..8fd374a6ad --- /dev/null +++ b/projects/haskellport/CMakeLists.txt @@ -0,0 +1,167 @@ + +include_directories(${CMAKE_SOURCE_DIR}/projects/DocumentationGenerator ${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + +set(genStubsAndWrappers_SRCS genStubsAndWrappers.C) + +kde4_add_executable(genStubsAndWrappers ${genStubsAndWrappers_SRCS}) + +target_link_libraries(genStubsAndWrappers ${KDE4_KDECORE_LIBS}) + + +########### next target ############### + +set(rosehswrap_LIB_SRCS WrapROSE.C WrapSage3.C WrapCxxContainers.C) + +kde4_add_library(rosehswrap SHARED ${rosehswrap_LIB_SRCS}) + +target_link_libraries(rosehswrap ${KDE4_KDECORE_LIBS} rose) + +set_target_properties(rosehswrap PROPERTIES VERSION 1.0.0 SOVERSION 1) +install(TARGETS rosehswrap ${INSTALL_TARGETS_DEFAULT_ARGS}) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#NONGENERATED_HSFILES = LICENSE ROSE.hs \ +# Data/DataMc.hs \ +# ROSE/CxxContainers.hs \ +# ROSE/Sage3.hs \ +# ROSE/Sage3/Misc.hs \ +# ROSE/Sage3/Misc.hs-boot \ +# ROSE/Sage3/SYB.hs +# +#TEST_HSFILES = tests/identityTranslator/Main.hs \ +# tests/simplify/Main.hs +# +#TEST_CFILES = tests/simplify/simplifyTest.C +# +#EXTRA_DIST = $(NONGENERATED_HSFILES) sage3.h.C WrapCxxContainers.h $(TEST_HSFILES) $(TEST_CFILES) disabled.html +# +#if USE_HASKELL +# +#INCLUDES = \ +# $(ROSE_INCLUDES) -I$(top_srcdir)/projects/DocumentationGenerator +# +#noinst_PROGRAMS = genStubsAndWrappers +#lib_LTLIBRARIES = librosehswrap.la +# +#SRC_NONGENERATED_HSFILES = $(addprefix $(srcdir)/,$(NONGENERATED_HSFILES)) +# +#LDADD = $(LIBS_WITH_RPATH) $(ROSE_LIBS) -ldl $(LIBLTDL) $(top_builddir)/projects/DocumentationGenerator/libROSEDoxygen.a +# +#genStubsAndWrappers_SOURCES = genStubsAndWrappers.C +# +#ROSE/Sage3/Classes.hs WrapSage3Classes.C rose.cabal: run-genStubsAndWrappers-stamp +# touch -c $@ +# +#headersWithoutLineDirective: $(wildcard $(top_builddir)/src/frontend/SageIII/*.h) +# mkdir -p $@ +# for file in $(top_builddir)/src/frontend/SageIII/*.h ; do \ +# base=`basename $$file` ; \ +# grep -v '^#line' $$file > $@/$$base ; \ +# done +# touch $@ +# +#run-genStubsAndWrappers-stamp: genStubsAndWrappers sage3.h.C rose.cabal.in headersWithoutLineDirective +# mkdir -p ROSE/Sage3/Methods +# ./genStubsAndWrappers -DCAN_NOT_COMPILE_WITH_ROSE=true -rose:collectAllCommentsAndDirectives -isystem headersWithoutLineDirective -IheadersWithoutLineDirective $(ROSE_INCLUDES) -I$(top_builddir) -IheadersWithoutLineDirective $(srcdir)/sage3.h.C +# touch $@ +# +#librosehswrap_la_SOURCES = WrapROSE.C WrapSage3.C WrapCxxContainers.C +#nodist_librosehswrap_la_SOURCES = WrapSage3Classes.C +#librosehswrap_la_LIBADD = $(top_builddir)/src/librose.la +# +#all-local: cabal-build-stamp +# +#install-exec-local: cabal-install-stamp +# +#uninstall-local: cabal-configure-stamp +# -$(GHCBIN)/runghc Setup.hs unregister +# rm -rf $(prefix)/lib/rose-$(PACKAGE_VERSION_NUMERIC) $(prefix)/share/doc/rose-$(PACKAGE_VERSION_NUMERIC) +# +#clean-local: cabal-clean +# rm -rf headersWithoutLineDirective +# rm -f identityTranslator simplify simplifyTest +# rm -f rose_* +# rm -rf WrapSage3Classes.C ROSE/Sage3/Classes.hs ROSE/Sage3/Methods ROSE/Sage3/Methods.hs +# rm -f tests/*/*.o tests/*/*.hi +# if test "x$(srcdir)" != "x." ; then rm -rf Data ROSE tests ; fi +# rm -f sage3.h.ti +# +#cabal-clean: +# if [ -e cabal-configure-stamp ] ; then $(GHCBIN)/runghc Setup.hs clean ; fi +# if test "x$(srcdir)" != "x." ; then rm -f $(NONGENERATED_HSFILES) ; fi +# rm -f run-genStubsAndWrappers-stamp rose.cabal cabal-configure-stamp cabal-build-stamp cabal-install-stamp +# rm -rf checkHome +# +## The distclean-generic rule removes the autoconf generated files, +## including Setup.hs which is used by the cabal-clean rule. This causes +## problems for parallel builds. So we impose a precondition that +## distclean-generic must run after cabal-clean +#distclean-generic: cabal-clean +# -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) +# +#cabal-configure-stamp: ROSE/Sage3/Classes.hs rose.cabal Setup.hs $(SRC_NONGENERATED_HSFILES) librosehswrap.la +# if test "x$(srcdir)" != "x." ; then \ +# for file in $(NONGENERATED_HSFILES) ; do \ +# if test ! $$file -nt $(srcdir)/$$file ; then \ +# dir=`dirname $$file` ; \ +# mkdir -p $$dir ; \ +# cp $(srcdir)/$$file $$dir ; \ +# fi ; \ +# done ; \ +# fi +# $(GHCBIN)/runghc Setup.hs configure $(HS_CONFIG_OPTS) +# touch $@ +# +#cabal-build-stamp: cabal-configure-stamp +# $(GHCBIN)/runghc Setup.hs build +# touch $@ +# +#cabal-install-stamp: cabal-build-stamp +# $(GHCBIN)/runghc Setup.hs install +# touch $@ +# +#docs: cabal-configure-stamp +# $(GHCBIN)/runghc Setup.hs haddock --html-location="http://haskell.org/ghc/docs/latest/html/libraries/\$$pkg/" +# +#check-local: check-identityTranslator check-simplify +# +#checkHome: cabal-build-stamp +# mkdir -p checkHome +# env HOME=checkHome $(GHCBIN)/runghc Setup.hs install --inplace --user +# touch checkHome +# +#identityTranslator: tests/identityTranslator/Main.hs checkHome +# mkdir -p tests/$@ +# env HOME=checkHome $(GHCBIN)/ghc -package rose -o $@ -odir tests/$@ -hidir tests/$@ -i $< +# +#check-identityTranslator: identityTranslator +# ./$< -c $(top_srcdir)/exampleTranslators/documentedExamples/simpleTranslatorExamples/testCode.C +# +#simplify: tests/simplify/Main.hs checkHome +# mkdir -p tests/$@ +# env HOME=checkHome $(GHCBIN)/ghc -package rose -o $@ -odir tests/$@ -hidir tests/$@ -i $< +# +#check-simplify: tests/simplify/simplifyTest.C simplify +# ./simplify -o simplifyTest $< +# ./simplifyTest +# +#else +# +#docs: disabled.html +# @echo "Haskell support disabled, unable to build Haddock docs!" +# mkdir -p dist/doc/html/rose +# cp $< dist/doc/html/rose/index.html +# +#endif diff --git a/rose_config.h.in.cmake b/rose_config.h.in.cmake new file mode 100644 index 0000000000..b5a76350a0 --- /dev/null +++ b/rose_config.h.in.cmake @@ -0,0 +1,732 @@ +/* rose_config.h.in. Generated from configure.in by autoheader. */ + +/* Define to 1 if you have the `argz_append' function. */ +#cmakedefine HAVE_ARGZ_APPEND 1 +/* Define to 1 if you have the `argz_create_sep' function. */ +#cmakedefine HAVE_ARGZ_CREATE_SEP 1 +/* Define to 1 if you have the `argz_insert' function. */ +#cmakedefine HAVE_ARGZ_INSERT 1 +/* Define to 1 if you have the `argz_next' function. */ +#cmakedefine HAVE_ARGZ_NEXT 1 +/* Define to 1 if you have the `argz_stringify' function. */ +#cmakedefine HAVE_ARGZ_STRINGIFY 1 +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_ARGZ_H 1 + +/* define if the Boost library is available */ +#cmakedefine Boost_FOUND +#ifdef Boost_FOUND + #define HAVE_BOOST +#endif + +/* define if the Boost::Date_Time library is available */ +#cmakedefine Boost_DATE_TIME_FOUND +#ifdef Boost_DATE_TIME_FOUND + #define HAVE_BOOST_DATE_TIME +#endif + +/* define if the Boost::Filesystem library is available */ +#cmakedefine Boost_FILESSYSTEM_FOUND +#ifdef Boost_FILESSYSTEM_FOUND + #define HAVE_BOOST_FILESYSTEM +#endif +/* define if the Boost::PROGRAM_OPTIONS library is available */ +#cmakedefine Boost_PROGRAM_OPTIONS_FOUND +#ifdef Boost_PROGRAM_OPTIONS_FOUND + #define HAVE_BOOST_PROGRAM_OPTIONS +#endif + +/* define if the Boost::Regex library is available */ +#cmakedefine Boost_REGEX_FOUND +#ifdef Boost_REGEX_FOUND + #define HAVE_BOOST_REGEX +#endif + +/* define if the Boost::System library is available */ +#cmakedefine Boost_SYSTEM_FOUND +#ifdef Boost_SYSTEM_FOUND + #define HAVE_BOOST_SYSTEM +#endif + +/* define if the Boost::Thread library is available */ +#cmakedefine Boost_THREAD_FOUND +#ifdef Boost_THREAD_FOUND + #define HAVE_BOOST_THREAD +#endif + + +/* define if the Boost::Wave library is available */ +#cmakedefine Boost_WAVE_FOUND +#ifdef Boost_WAVE_FOUND + #define HAVE_BOOST_WAVE + #define USE_ROSE_BOOST_WAVE_SUPPORT +#endif + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_BYTESWAP_H 1 + +/* Define to 1 if you have the `closedir' function. */ +#cmakedefine HAVE_CLOSEDIR 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_CTYPE_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_C_ASM_H 1 + +/* Define to 1 if you have the header file, and it defines `DIR'. */ +#cmakedefine HAVE_DIRENT_H 1 + +/* Whether and -ldl contain dladdr() */ +#cmakedefine HAVE_DLADDR + +/* Define if you have the GNU dld library. */ +//AS Seems unnecessary +/* #undef HAVE_DLD */ + +/* Define to 1 if you have the header file. */ +//AS Seems unnecessary +/* #undef HAVE_DLD_H */ + +/* Define to 1 if you have the `dlerror' function. */ +#cmakedefine HAVE_DLERROR 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_DLFCN_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_DL_H 1 + +/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ +#cmakedefine HAVE_DOPRNT 1 + +/* Define if you have the _dyld_func_lookup function. */ +#cmakedefine HAVE_DYLD + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_ERRNO_H 1 + +/* Define to 1 if the system has the type `error_t'. */ +//AS seems unnecessary. ROSE does not use it +//#define HAVE_ERROR_T 1 + +/* Use explicit template instantiation. */ +//AS FIXME: Need to have a check for this +#define HAVE_EXPLICIT_TEMPLATE_INSTANTIATION + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_FFI_H 1 + +/* Define to 1 if you have the `getcwd' function. */ +#cmakedefine HAVE_GETCWD 1 + +/* Define to 1 if you have the `gethrtime' function. */ +#cmakedefine HAVE_GETHRTIME 1 + +/* Define to 1 if you have the `getpagesize' function. */ +#cmakedefine HAVE_GETPAGESIZE 1 + +/* Define to 1 if you have the `getwd' function. */ +#cmakedefine HAVE_GETWD 1 + +/* Define to 1 if hrtime_t is defined in */ +#cmakedefine HAVE_HRTIME_T 1 + +/* Define to 1 if you have the `index' function. */ +#cmakedefine HAVE_INDEX 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_INTRINSICS_H + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_INTTYPES_H 1 + + +#cmakedefine HAVE_IO_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_LIMITS_H 1 +#cmakedefine HAVE_LOCALE_H 1 +#cmakedefine HAVE_PROCESS_H 1 +#cmakedefine HAVE_STDLIB_H 1 +#cmakedefine HAVE_SYS_STAT_H 1 +#cmakedefine HAVE_SYS_TIME_H 1 +#cmakedefine HAVE_SYS_TYPES_H 1 +#cmakedefine HAVE_SYS_UTIME_H 1 +#cmakedefine HAVE_SYS_SOCKET_H 1 +#cmakedefine HAVE_UNISTD_H 1 +#cmakedefine HAVE_INTTYPES_H 1 +#cmakedefine HAVE_UTIME_H 1 +#cmakedefine HAVE_STRING_H 1 +#cmakedefine HAVE_STRINGS_H 1 +#cmakedefine HAVE_ISTREAM 1 +#cmakedefine HAVE_OSTREAM 1 +#cmakedefine HAVE_IOS 1 +#cmakedefine HAVE_LOCALE 1 +#cmakedefine HAVE_OPEN 1 +#cmakedefine HAVE_CHMOD 1 +#cmakedefine HAVE_CLOSE 1 +#cmakedefine HAVE_DCGETTEXT 1 +#cmakedefine HAVE_POPEN 1 +#cmakedefine HAVE_PCLOSE 1 +#cmakedefine HAVE__OPEN 1 +#cmakedefine HAVE__CLOSE 1 +#cmakedefine HAVE__POPEN 1 +#cmakedefine HAVE__PCLOSE 1 +#cmakedefine HAVE_GETPID 1 +#cmakedefine HAVE__GETPID 1 +#cmakedefine HAVE_GETTEXT 1 +#cmakedefine HAVE_MKDIR 1 +#cmakedefine HAVE__MKDIR 1 +#cmakedefine HAVE_PUTENV 1 +#cmakedefine HAVE_MKTEMP 1 +#cmakedefine HAVE_MKSTEMP 1 +#cmakedefine HAVE_STRERROR 1 +#cmakedefine HAVE_STD_COUNT 1 +#cmakedefine HAVE_ASPRINTF 1 +#cmakedefine HAVE_WPRINTF 1 +#cmakedefine HAVE_SNPRINTF 1 +#cmakedefine HAVE_POSIX_PRINTF 1 +#cmakedefine HAVE_FCNTL 1 +#cmakedefine HAVE_INTMAX_T 1 +#cmakedefine HAVE_INTTYPES_H_WITH_UINTMAX 1 +#cmakedefine HAVE_DECL_ISTREAMBUF_ITERATOR 1 +#cmakedefine CXX_GLOBAL_CSTD 1 +#cmakedefine HAVE_GETCWD 1 +#cmakedefine HAVE_STPCPY 1 +#cmakedefine HAVE_STRCASECMP 1 +#cmakedefine HAVE_STRDUP 1 +#cmakedefine HAVE_STRTOUL 1 +#cmakedefine HAVE___FSETLOCKING 1 +#cmakedefine HAVE_MEMPCPY 1 +#cmakedefine HAVE___ARGZ_COUNT 1 +#cmakedefine HAVE___ARGZ_NEXT 1 +#cmakedefine HAVE___ARGZ_STRINGIFY 1 +#cmakedefine HAVE_SETLOCALE 1 +#cmakedefine HAVE_TSEARCH 1 +#cmakedefine HAVE_GETEGID 1 +#cmakedefine HAVE_GETGID 1 +#cmakedefine HAVE_GETUID 1 +#cmakedefine HAVE_WCSLEN 1 +#cmakedefine HAVE_MKFIFO 1 +#cmakedefine HAVE_WPRINTF 1 +/* Define to 1 if long double works and has more range or precision than + double. */ +#cmakedefine HAVE_LONG_DOUBLE 1 +#cmakedefine HAVE_LONG_LONG 1 +#cmakedefine HAVE_WCHAR_T 1 +#cmakedefine HAVE_WINT_T 1 +#cmakedefine HAVE_STDINT_H_WITH_UINTMAX 1 +#cmakedefine HAVE_LC_MESSAGES 1 +#cmakedefine HAVE_SSTREAM 1 +#cmakedefine HAVE_ARGZ_H 1 +#cmakedefine SIZEOF_WCHAR_T_IS_2 1 +#cmakedefine SIZEOF_WCHAR_T_IS_4 1 + + +/* Major version number of backend C++ compiler. */ +//AS FIXME +#define BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER 4 + +/* Minor version number of backend C++ compiler. */ +//AS FIXME + +#define BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER 1 + +/* Name of backend C++ compiler excluding path (used to select code generation + options). */ +//AS FIXME + +#define BACKEND_CXX_COMPILER_NAME_WITHOUT_PATH "g++" + +/* Name of backend C++ compiler including path (may or may not explicit + include path; used to call backend). */ +//AS FIXME + +#define BACKEND_CXX_COMPILER_NAME_WITH_PATH "g++" + +/* Name of backend C compiler including path (may or may not explicit include + path; used to call backend). */ +//AS FIXME + +#define BACKEND_C_COMPILER_NAME_WITH_PATH "gcc" + +/* Major version number of backend Fortran compiler. */ +//AS FIXME + +#define BACKEND_FORTRAN_COMPILER_MAJOR_VERSION_NUMBER 4 + +/* Minor version number of backend Fortran compiler. */ +//AS FIXME + +#define BACKEND_FORTRAN_COMPILER_MINOR_VERSION_NUMBER 1 + +/* Name of backend Fortran compiler including path (may or may not explicit + include path; used to call backend). */ +//AS FIXME + +#define BACKEND_FORTRAN_COMPILER_NAME_WITH_PATH "gfortran" + + +/* Internal EDG specific consistency tests. */ +//AS FIXME +#define CHECKING 1 + + +/* Define if building universal (internal helper macro) */ +#undef AC_APPLE_UNIVERSAL_BUILD + +/* Internal EDG specific consistency tests. */ +//AS FIXME + +#undef CHECKING + +/* Include path for backend C++ compiler. */ +//AS FIXME +#define CXX_INCLUDE_STRING {"g++_HEADERS", "g++_HEADERS/hdrs", "g++_HEADERS/hdrs1", "g++_HEADERS/hdrs2", "g++_HEADERS/hdrs3", "g++_HEADERS/hdrs4", "g++_HEADERS/hdrs5", "/usr/include"} + +/* -D options to hand to EDG C++ front-end. */ +//AS FIXME + +#define CXX_SPEC_DEF {"-D__GNUG__=4", "-D__GNUC__=4", "-D__GNUC_MINOR__=1", "-D__GNUC_PATCHLEVEL__=2", "--preinclude", "rose_edg_required_macros_and_functions.h"} + +/* Include path for backend C compiler. */ +//AS FIXME + +#define C_INCLUDE_STRING {"gcc_HEADERS", "gcc_HEADERS/hdrs", "gcc_HEADERS/hdrs1", "gcc_HEADERS/hdrs2", "/usr/include"} + + +/* Controls use of ROSE support for Binary SQL. */ +#undef HASH_ROSE_USE_BINARYSQL + + +/* Define to 1 if you have the `clock_gettime' function. */ +#cmakedefine HAVE_CLOCK_GETTIME 1 + + +/* Define to 1 if you have the `dl' library (-ldl). */ +#cmakedefine HAVE_LIBDL 1 + +/* Define if libdlloader will be built on this platform */ +//AS FIXME +#undef HAVE_LIBDLLOADER + + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_MACHINE_ENDIAN_H 1 + +/* Define to 1 if you have the `mach_absolute_time' function. */ +#cmakedefine HAVE_MACH_ABSOLUTE_TIME 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_MACH_MACH_TIME_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_MACH_O_DYLD_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_MEMORY_H 1 + +/* Define to 1 if you have the `mktime' function. */ +#cmakedefine HAVE_MKTIME 1 + +/* Define to 1 if you have a working `mmap' system call. */ +#cmakedefine HAVE_MMAP 1 + +/* Define to 1 if MySQL libraries are available */ +#cmakedefine MYSQL_FOUND +#ifdef MYSQL_FOUND + #define HAVE_MYSQL +#endif + + +/* Define to 1 if you have the header file, and it defines `DIR'. */ +#cmakedefine HAVE_NDIR_H 1 + +/* Define to 1 if you have the `opendir' function. */ +#cmakedefine HAVE_OPENDIR 1 + +/* Define if libtool can extract symbol lists from object files. */ +//AS irrelevant as we are not using libtool +//#cmakedefine HAVE_PRELOADED_SYMBOLS + +/* Define to 1 if you have the `readdir' function. */ +#cmakedefine HAVE_READDIR 1 + +/* Define to 1 if you have the `read_real_time' function. */ +#cmakedefine HAVE_READ_REAL_TIME 1 + +/* Define if you have the shl_load function. */ +#cmakedefine HAVE_SHL_LOAD 1 + +/* Have the SQLITE3 library */ +#cmakedefine SQLITE3_FOUND +#ifdef HAVE_SQLITE3 + #define HAVE_SQLITE3 +#endif + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_STDLIB_H 1 + +/* Define to 1 if you have the `strcoll' function and it is properly defined. + */ +#cmakedefine HAVE_STRCOLL 1 + +/* Define to 1 if you have the `strcspn' function. */ +#cmakedefine HAVE_STRCSPN 1 + +/* Define to 1 if you have the `strerror' function. */ +#cmakedefine HAVE_STRERROR 1 + +/* Define to 1 if you have the `strftime' function. */ +#cmakedefine HAVE_STRFTIME 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_STRING_H 1 + +/* Define to 1 if you have the `strlcat' function. */ +#cmakedefine HAVE_STRLCAT 1 + +/* Define to 1 if you have the `strlcpy' function. */ +#cmakedefine HAVE_STRLCPY 1 + +/* Define to 1 if you have the `strspn' function. */ +#cmakedefine HAVE_STRSPN 1 + +/* Define to 1 if you have the `strstr' function. */ +#cmakedefine HAVE_STRSTR 1 + +/* Define to 1 if you have the `strtod' function. */ +#cmakedefine HAVE_STRTOD + +/* Define to 1 if you have the `strtol' function. */ +#cmakedefine HAVE_STRTOL 1 + +/* Define to 1 if you have the `strtoul' function. */ +#cmakedefine HAVE_STRTOUL 1 + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#cmakedefine HAVE_SYS_DIR_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_DL_H 1 + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#cmakedefine HAVE_SYS_NDIR_H + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_TIME_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the `time_base_to_time' function. */ +#cmakedefine HAVE_TIME_BASE_TO_TIME 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_UNISTD_H 1 + +/* Define to 1 if you have the `vprintf' function. */ +#cmakedefine HAVE_VPRINTF 1 + +/* This value is set to 1 to indicate that the system argz facility works */ +//AS Not quite sure what to do with this +#undef HAVE_WORKING_ARGZ + +/* Define if you have the UNICOS _rtc() intrinsic. */ +//AS Not quite sure what to do with this +#undef HAVE__RTC + +/* Prefix path for use of IDA. */ +//AS Not quite sure what to do with this +#undef IDA_PRO_PATH + +/* Path to JVM executable */ +#define JAVA_JVM_PATH ${JAVA_RUNTIME} + +/* Define if the OS needs help to load dependent libraries for dlopen(). */ +//AS Don't know what to do with this +#undef LTDL_DLOPEN_DEPLIBS + +/* Define to the system default library search path. */ +//AS Don't know what to do with this +#undef LT_DLSEARCH_PATH + +/* The archive extension */ +//AS Don't know what to do with this +#undef LT_LIBEXT + +/* Define to the extension used for runtime loadable modules, say, ".so". */ +//AS Don't know what to do with this +#undef LT_MODULE_EXT + +/* Define to the name of the environment variable that determines the run-time + module search path. */ +//AS Don't know what to do with this +#undef LT_MODULE_PATH_VAR + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +//AS Don't know what to do with this +#undef LT_OBJDIR + +/* Define if dlsym() requires a leading underscore in symbol names. */ +//AS Don't know what to do with this +#undef NEED_USCORE + +/* Name of package */ +//AS Don't know what to do with this +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +//AS Don't know what to do with this +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +//AS Don't know what to do with this +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +//AS Don't know what to do with this +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +//AS Don't know what to do with this +#undef PACKAGE_TARNAME + +/* Define to the version of this package. */ +//AS Don't know what to do with this +#undef PACKAGE_VERSION + +/* Define as the return type of signal handlers (`int' or `void'). */ +//AS Don't know what to do with this +#undef RETSIGTYPE + +/* Location (unquoted) of Boost specified on configure line. */ +#define ROSE_BOOST_PATH ${BOOST_ROOT} + +/* Location of ROSE Compile Tree. */ +#define ROSE_COMPILE_TREE_PATH ${ROSE_TOP_BINARY_DIR} + +/* Variable like LD_LIBRARY_PATH */ +//AS Don't know what to do with this +#undef ROSE_SHLIBPATH_VAR + +/* Whether to use the new EDG version 4.x */ +//AS Don't know what to do with this +#undef ROSE_USE_EDG_VERSION_4 + +/* Whether to use the new interface to EDG */ +//AS Don't know what to do with this +#undef ROSE_USE_NEW_EDG_INTERFACE + +/* Use Valgrind calls in ROSE */ +//AS Don't know what to do with this +#undef ROSE_USE_VALGRIND + +/* Whether to use the new graph IR nodes compatability option with older API + */ +//#undef ROSE_USING_GRAPH_IR_NODES_FOR_BACKWARD_COMPATABILITY + +/* Simple preprocessor as default in ROSE */ +//AS Need configure option to allow wave to be default +#define ROSE_WAVE_DEFAULT false + +/* Location (unquoted) of Wave specified on configure line. */ +//AS Not needed +//#undef ROSE_WAVE_PATH + +/* Control use of SAGE within EDG. */ +//AS Need configure flag to control this variable +#define SAGE_TRANSFORM 1 + + +/* The size of `char', as computed by sizeof. */ +#define SIZEOF_CHAR ${SIZEOF_CHAR} + +/* The size of `double', as computed by sizeof. */ +#define SIZEOF_DOUBLE ${SIZEOF_DOUBLE} + +/* The size of `float', as computed by sizeof. */ +#define SIZEOF_FLOAT ${SIZEOF_FLOAT} + +/* The size of `int', as computed by sizeof. */ +#define SIZEOF_INT ${SIZEOF_INT} + +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG ${SIZEOF_LONG} + +/* The size of `long double', as computed by sizeof. */ +#define SIZEOF_LONG_DOUBLE ${SIZEOF_LONG_DOUBLE} + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG ${SIZEOF_LONG_LONG} + +/* The size of `short', as computed by sizeof. */ +#define SIZEOF_SHORT ${SIZEOF_SHORT} + +/* The size of `void *', as computed by sizeof. */ +#define SIZEOF_VOID_P ${SIZEOF_VOID_P} + +/* Define to 1 if you have the ANSI C header files. */ +#cmakedefine STDC_HEADERS 1 + +/* Define to 1 if you can safely include both and . */ +#cmakedefine TIME_WITH_SYS_TIME 1 + +/* Define to 1 if your declares `struct tm'. */ +#cmakedefine TM_IN_SYS_TIME 1 + +/* Mark that GFORTRAN is available */ +//AS Don't know what to do with this +#undef USE_GFORTRAN_IN_ROSE + +/* Link-time support for Insure. */ +//AS Don't know what to do with this +#undef USE_INSURE + +/* Support for Purify */ +//AS Don't know what to do with this +#undef USE_PURIFY + +/* Support for Purify API (Compiling with the Purify library). */ +//AS Don't know what to do with this +#undef USE_PURIFY_API + +/* Link-time support for Purify. */ +//AS Don't know what to do with this +#undef USE_PURIFY_LINKER + +/* Controls use of ROSE support for bddbddb (Binary decision diagrams (BDD) + BDD-Based Deductive DataBase. */ +//AS Don't know what to do with this +#undef USE_ROSE_BDDBDDB_SUPPORT + +/* Controls use of ROSE support for Dwarf (libdwarf) library. */ +//AS Don't know what to do with this +//#undef USE_ROSE_DWARF_SUPPORT + +/* Controls if EDG Union/Struct debugging support is to be used. */ +//AS Fixme: introduce configure control for this +#define USE_ROSE_EDG_DEBUGGING_SUPPORT 1 + +/* Use of GCC OpenMP in ROSE. */ +//AS Don't know what to do with this +#undef USE_ROSE_GCC_OMP + +/* Controls use of IDA support for disassembling. */ +//AS Don't know what to do with this +#undef USE_ROSE_IDA_SUPPORT + +/* Controls use of ROSE support for Intel Pin Dynamic Instrumentation Package. + */ +//AS Don't know what to do with this +#undef USE_ROSE_INTEL_PIN_SUPPORT + +/* Controls use of ROSE support for Java. */ +#cmakedefine JAVA_RUNTIME +#ifdef JAVA_RUNTIME + #define USE_ROSE_JAVA_SUPPORT +#endif + +/* Controls use of ROSE support for Maple Symbolic Algebra Package. */ +//AS Don't know what to do with this +#undef USE_ROSE_MAPLE_SUPPORT + +/* Controls use of ROSE support for OpenMP Translator targeting Omni RTL. */ +//AS Don't know what to do with this +#undef USE_ROSE_OMNI_OPENMP_SUPPORT + +/* Always enable Fortran support whenever Java and gfortran are present */ +//AS don't know what to do with this +#undef USE_ROSE_OPEN_FORTRAN_PARSER_SUPPORT + +/* Controls use of ROSE support for PHP. */ +//AS Don't know what to do with this +#undef USE_ROSE_PHP_SUPPORT + +/* Controls use of ROSE support for RTED library. */ +//AS Don't know what to do with this +#undef USE_ROSE_RTED_SUPPORT + +/* Controls use of ROSE support for SSL (libssl -- MD5) library (incompatable + with Java, so disables Fortran support). */ +//AS Don't know what to do with this +#undef USE_ROSE_SSL_SUPPORT + +/* Wine provides access to Windows header files for analysis of windows + applications under Linux. */ +//AS Don't know what to do with this +#undef USE_ROSE_WINDOWS_ANALYSIS_SUPPORT + +/* Controls use of ROSE support for Yices Satisfiability Modulo Theories (SMT) + Solver Package. */ +//AS Don't know what to do with this + +#undef USE_ROSE_YICES_SUPPORT + +/* Support for PURIFY debugging software. */ +//AS Don't know what to do with this + +#undef USING_PURIFY + +/* Version number of package */ +//AS Don't know what to do with this + +#define VERSION "0.9.4" + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +# undef WORDS_BIGENDIAN +# endif +#endif + +/* Define to 1 if the X Window System is missing or not being used. */ +#undef X_DISPLAY_MISSING + +/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a + `char[]'. */ +#undef YYTEXT_POINTER + +/* Define to 1 if type `char' is unsigned and you are not using gcc. */ +#ifndef __CHAR_UNSIGNED__ +# undef __CHAR_UNSIGNED__ +#endif + +/* Define so that glibc/gnulib argp.h does not typedef error_t. */ +#undef __error_t_defined + +/* Define to empty if `const' does not conform to ANSI C. */ +#undef const + +/* Define to a type to use for `error_t' if it is not otherwise available. */ +#undef error_t + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +#undef inline +#endif + +/* Define to `long int' if does not define. */ +#undef off_t + +/* Define to `unsigned int' if does not define. */ +#undef size_t diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt new file mode 100644 index 0000000000..c842816ea2 --- /dev/null +++ b/scripts/CMakeLists.txt @@ -0,0 +1,30 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### install files ############### + +install(FILES $(distributedScripts) DESTINATION ) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +## copy the tools (scripts only) from the source tree to the source destination in the distribution +#distributedScripts = \ +# configure_with_SQL runscript \ +# dotgen \ +# dotgen2 lsdot \ +# check-dist-file dotgenLetter generateDirectoryGraph \ +# libtoolcp \ +# dotgenLetterPDF dotgenLetterPNG \ +# nmiBuildAndTestFarm +# +## scripts put into the distribution +#EXTRA_DIST = README $(distributedScripts) +# +## install the tools in 'bin' (a subsect of EXTRA_DIST) +#bin_SCRIPTS = $(distributedScripts) +# diff --git a/src/3rdPartyLibraries/CMakeLists.txt b/src/3rdPartyLibraries/CMakeLists.txt new file mode 100644 index 0000000000..1da009cfcf --- /dev/null +++ b/src/3rdPartyLibraries/CMakeLists.txt @@ -0,0 +1,24 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + +add_subdirectory(MSTL) +add_subdirectory(libharu-2.1.0) +#add_subdirectory(libharu-200910170404) +add_subdirectory(fortran-parser) +add_subdirectory(antlr-jars) +#add_subdirectory(qrose) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +## This should not depend on ROSE in any way so I don't think we need this +## include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#SUBDIRS = MSTL libharu-2.1.0 fortran-parser antlr-jars qrose +## checkPointLibrary +# diff --git a/src/3rdPartyLibraries/MSTL/CMakeLists.txt b/src/3rdPartyLibraries/MSTL/CMakeLists.txt new file mode 100644 index 0000000000..ff53c06c66 --- /dev/null +++ b/src/3rdPartyLibraries/MSTL/CMakeLists.txt @@ -0,0 +1,52 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + +install(FILES PDFGeneration.h AttributeMechanism.h DOTGeneration.h DOTRepresentation.h Translator.h DOTSubgraphRepresentation.h DOTGraphInterface.h TreeTraversal.h DOTRepresentationImpl.h DOTGenerationImpl.h DOTSubgraphRepresentationImpl.h DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#INCLUDES = $(ROSE_INCLUDES) +# +### The grammar generator (ROSETTA) should use its own template repository +#CXX_TEMPLATE_REPOSITORY_PATH = . +# +#libmstlSources = \ +# PDFGeneration.C DOTGraphInterface.C +# +## lib_LIBRARIES = libmstl.a +## libmstl_a_SOURCES = $(libmstlSources) +# +#noinst_LTLIBRARIES = libmstl.la +#libmstl_la_SOURCES = $(libmstlSources) +# +#clean-local: +# rm -rf Templates.DB ii_files ti_files cxx_templates +# +#distclean-local: +# rm -rf Templates.DB +# +## Some source files are included so that templates can be included +#include_HEADERS = \ +# PDFGeneration.h AttributeMechanism.h DOTGeneration.h DOTRepresentation.h \ +# Translator.h DOTSubgraphRepresentation.h DOTGraphInterface.h TreeTraversal.h \ +# DOTRepresentationImpl.h DOTGenerationImpl.h \ +# DOTSubgraphRepresentationImpl.h +# +#EXTRA_DIST = MSTL.docs +# +# +# +# +# +# +# diff --git a/src/3rdPartyLibraries/antlr-jars/CMakeLists.txt b/src/3rdPartyLibraries/antlr-jars/CMakeLists.txt new file mode 100644 index 0000000000..d692c52060 --- /dev/null +++ b/src/3rdPartyLibraries/antlr-jars/CMakeLists.txt @@ -0,0 +1,19 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### install files ############### + +install(FILES antlr-2.7.7.jar antlr-3.0.1.jar antlr-runtime-3.0.1.jar stringtemplate-3.1b1.jar DESTINATION ${INCLUDE_INSTALL_DIR} ) + + + +#original Makefile.am contents follow: + +#javadir = $(libdir) +# +#dist_java_DATA = \ +# antlr-2.7.7.jar \ +# antlr-3.0.1.jar \ +# antlr-runtime-3.0.1.jar \ +# stringtemplate-3.1b1.jar diff --git a/src/3rdPartyLibraries/checkPointLibrary/CMakeLists.txt b/src/3rdPartyLibraries/checkPointLibrary/CMakeLists.txt new file mode 100644 index 0000000000..4e4e8220f4 --- /dev/null +++ b/src/3rdPartyLibraries/checkPointLibrary/CMakeLists.txt @@ -0,0 +1,122 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + +set(btoc_SRCS $(BTOC_SRCS)) + +add_executable(btoc ${btoc_SRCS}) + +target_link_libraries(btoc ${KDE4_KDECORE_LIBS}) + + +########### next target ############### + +set(restart_SRCS $(RESTART_SRCS)) + +add_executable(restart ${restart_SRCS}) + +target_link_libraries(restart ${KDE4_KDECORE_LIBS}) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +## This should not depend on ROSE in any way so I don't think we need this +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#lib_LIBRARIES = libckpt.so librestart.so +# +#noinst_PROGRAMS = btoc restart +# +### Specifications for building the different parts of the check point library. +#LIB_CKPT_SRCS =\ +# ckpt.c\ +# init.c\ +# mem.c\ +# signals.c\ +# ckptclt.c\ +# sockaddr.c\ +# util.c\ +# config.c\ +# fd.c\ +# elfckpt.c \ +# wraprestart.c +# +#LIB_RESTART_SRCS = safe.c +# +#RESTART_SRCS =\ +# restartmain.c\ +# restart.c\ +# mem.c\ +# util.c\ +# ckptclt.c\ +# sockaddr.c\ +# wrapsafe.c\ +# elfrestart.c +# +#CKPT_SRCS =\ +# ckptmain.c\ +# wrapckpt.c\ +# hijack.c\ +# refun.c\ +# util.c +# +#CKPTSRV_SRCS =\ +# ckptsrv.c\ +# util.c\ +# sockaddr.c +#BTOC_SRCS = btoc.c +#TEST_SRCS = foo.c +# +#wrapsafe.c: btoc librestart.so +# ./btoc librestart < librestart.so > wrapsafe.c +# +#wraprestart.c: btoc restart +# ./btoc restartbin < restart > wraprestart.c +# +#wrapckpt.c: btoc libckpt.so +# ./btoc libckpt < libckpt.so > wrapckpt.c +# +#libckpt_so_SOURCES = $(LIB_CKPT_SRCS) +## libckpt_so_DEPENDENCIES = $(LIB_CKPT_SRCS) +# +#librestart_so_SOURCES = $(LIB_RESTART_SRCS) +# +#restart_SOURCES = $(RESTART_SRCS) +#btoc_SOURCES = $(BTOC_SRCS) +# +#restart_LDFLAGS = -Xlinker --script=$(srcdir)/restart.script +# +# +# +#libckpt.a: $(libckpt_a_OBJECTS) +# -rm -f $@ +# $(CXX_STATIC_LIB_UPDATE) $@ $(libckpt_a_OBJECTS) +# test -f $@ || exit 1 +# +#libckpt.so: $(libckpt_so_OBJECTS) +# -rm -f $@ +# $(CXX_SHARED_LIB_UPDATE) $@ -nostartfiles $(libckpt_so_OBJECTS) +# test -f $@ || exit 1 +# +## librestart.a: $(librestart_a_OBJECTS) +## -rm -f $@ +## $(CXX_STATIC_LIB_UPDATE) $@ $(librestart_a_OBJECTS) +## test -f $@ || exit 1 +# +##librestart.so: $(librestart_so_OBJECTS) +## -rm -f $@ +## $(CXX_SHARED_LIB_UPDATE) $@ $(librestart_so_OBJECTS) +## test -f $@ || exit 1 +# +#noinst_HEADERS = ckpt.h ckptimpl.h cs.h sys.h +# +## include_HEADERS = +# +# diff --git a/src/3rdPartyLibraries/fortran-parser/CMakeLists.txt b/src/3rdPartyLibraries/fortran-parser/CMakeLists.txt new file mode 100644 index 0000000000..c38ce95bbb --- /dev/null +++ b/src/3rdPartyLibraries/fortran-parser/CMakeLists.txt @@ -0,0 +1,115 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### install files ############### + +install(FILES OpenFortranParser.jar DESTINATION ${INCLUDE_INSTALL_DIR} ) + + + +#original Makefile.am contents follow: + +## Copyright (c) 2005, 2006 Los Alamos National Security, LLC. This +## material was produced under U.S. Government contract DE- +## AC52-06NA25396 for Los Alamos National Laboratory (LANL), which is +## operated by the Los Alamos National Security, LLC (LANS) for the +## U.S. Department of Energy. The U.S. Government has rights to use, +## reproduce, and distribute this software. NEITHER THE GOVERNMENT NOR +## LANS MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR ASSUMES ANY +## LIABILITY FOR THE USE OF THIS SOFTWARE. If software is modified to +## produce derivative works, such modified software should be clearly +## marked, so as not to confuse it with the version available from +## LANL. +# +## Additionally, this program and the accompanying materials are made +## available under the terms of the Eclipse Public License v1.0 which +## accompanies this distribution, and is available at +## http://www.eclipse.org/legal/epl-v10.html +# +## Edited for ROSE by Jeremiah Willcock +# +#OFP_INSTALL_DIR=@prefix@ +#OFP_ROOT_DIR=@top_srcdir@/src/3rdPartyLibraries/fortran-parser +#OFP_SRC_DIR=$(OFP_ROOT_DIR)/src +#OFP_FRONT_DIR=$(OFP_SRC_DIR)/fortran/ofp +#OFP_PARSER_DIR=$(OFP_FRONT_DIR)/parser +#OFP_C_DIR=$(OFP_FRONT_DIR)/parser/c +#OFP_JNI_DIR=$(OFP_C_DIR)/jni +#OFP_TOOLS_DIR=$(OFP_SRC_DIR)/fortran/tools +# +#OFP_JARFILE=OpenFortranParser.jar +#OFP_C_ACTION_SO=libfortran_ofp_parser_c_jni_FortranParserActionJNI.so +# +#OFP_CLASSPATH=-classpath @CLASSPATH@:./build:. +#OFP_JFLAGS=$(OFP_CLASSPATH) +# +#javadir=$(libdir) +# +#JARFILE=$(OFP_JARFILE) +# +#java-stuff: +# -mkdir build +# -mkdir build/fortran +# $(JAVAC) $(OFP_CLASSPATH) -d build $(srcdir)/src/fortran/ofp/parser/java/IActionEnums.java +# $(JAVAC) $(OFP_CLASSPATH) -d build $(srcdir)/src/fortran/ofp/parser/java/IFortranParserAction.java +# $(JAVA) $(OFP_CLASSPATH) org.antlr.Tool -lib $(srcdir)/src/fortran/ofp/parser/ -fo . $(srcdir)/src/fortran/ofp/parser/FortranLexer.g +# sed "s/LexerLexer/Lexer/g" FortranLexerLexer.java > FortranLexer.java +# rm FortranLexerLexer.java +# $(JAVA) $(OFP_CLASSPATH) org.antlr.Tool -fo . $(srcdir)/src/fortran/ofp/parser/FortranParser.g +# sed "s/ParserParser/Parser/g" FortranParserParser.java > FortranParser.java +# rm FortranParserParser.java FortranLexer.tokens FortranParser.tokens +# -mkdir tmp +# cp $(srcdir)/src/fortran/ofp/parser/java/IFortranParserAction.java tmp/ +# cp $(srcdir)/src/fortran/ofp/parser/java/makNull.pl tmp/ +# cd tmp; $(PERL) ./makNull.pl +# $(JAVAC) $(OFP_CLASSPATH) -d build $(srcdir)/src/fortran/ofp/FrontEnd.java FortranLexer.java FortranParser.java tmp/FortranParserActionNull.java $(srcdir)/src/fortran/ofp/parser/java/*.java $(srcdir)/src/fortran/tools/*.java +# $(JAVA) $(OFP_CLASSPATH) fortran.tools.GenRuleStackTrace +# $(JAVAC) $(OFP_CLASSPATH) -d build RuleStackTrace.java +# $(JAVAC) $(OFP_CLASSPATH) -d build $(srcdir)/src/fortran/ofp/parser/java/*.java +# -mkdir tmp/java +# -mkdir tmp/c +# cp $(srcdir)/src/fortran/ofp/parser/java/IFortranParserAction.java $(srcdir)/src/fortran/ofp/parser/java/IActionEnums.java tmp/java/ +# cp $(srcdir)/src/fortran/ofp/parser/java2c.pl tmp/ +# cd tmp; $(PERL) ./java2c.pl +# $(JAVA) $(OFP_CLASSPATH) fortran.tools.ToC +# $(JAVAC) $(OFP_CLASSPATH) -d build FortranParserActionJNI.java +# $(JAVA) $(OFP_CLASSPATH) fortran.tools.CFiles header +# -rm OpenFortranParser.jar +# $(JAR) cf OpenFortranParser.jar -C build fortran/ +# touch java-stuff +# +## lib_LTLIBRARIES = libfortran_ofp_parser_c_jni_FortranParserActionJNI.la +#if ROSE_USE_OPEN_FORTRAN_PARSER +#java_DATA = OpenFortranParser.jar +#c_actions_jni.c: java-stuff +#OpenFortranParser.jar: java-stuff +#else +#java_DATA = +#endif +# +## libfortran_ofp_parser_c_jni_FortranParserActionJNI_la_SOURCES = c_actions_jni.c +## libfortran_ofp_parser_c_jni_FortranParserActionJNI_la_CPPFLAGS = -I. -I./tmp/c -I$(srcdir)/src/fortran/ofp/parser/c -I$(srcdir)/src/fortran/ofp/parser/c/jni +# +#CLEANFILES = java-stuff OpenFortranParser.jar c_actions_jni.c FortranParserActionJNI.java RuleStackTrace.java FortranLexer.java FortranParser.java FortranParserAction.h +# +#EXTRA_DIST = INSTALL README get_antlr.sh config src tests +# +#clean-local: +# rm -rf build/ tmp/ +# +# +#copy_as_before_fix: +# cp $(srcdir)/src/fortran/ofp/parser/FortranLexer.g.beforeFix $(srcdir)/src/fortran/ofp/parser/FortranLexer.g +# cp $(srcdir)/src/fortran/ofp/parser/FortranParser.g.beforeFix $(srcdir)/src/fortran/ofp/parser/FortranParser.g +# cp $(srcdir)/src/fortran/ofp/parser/java/FortranLexicalPrepass.java.beforeFix $(srcdir)/src/fortran/ofp/parser/java/FortranLexicalPrepass.java +# cp $(srcdir)/src/fortran/ofp/parser/java/FortranTokenStream.java.beforeFix $(srcdir)/src/fortran/ofp/parser/java/FortranTokenStream.java +# cp $(srcdir)/src/fortran/ofp/FrontEnd.java.beforeFix $(srcdir)/src/fortran/ofp/FrontEnd.java +# +#copy_as_after_fix: +# cp $(srcdir)/src/fortran/ofp/parser/FortranLexer.g.afterFix $(srcdir)/src/fortran/ofp/parser/FortranLexer.g +# cp $(srcdir)/src/fortran/ofp/parser/FortranParser.g.afterFix $(srcdir)/src/fortran/ofp/parser/FortranParser.g +# cp $(srcdir)/src/fortran/ofp/parser/java/FortranLexicalPrepass.java.afterFix $(srcdir)/src/fortran/ofp/parser/java/FortranLexicalPrepass.java +# cp $(srcdir)/src/fortran/ofp/parser/java/FortranTokenStream.java.afterFix $(srcdir)/src/fortran/ofp/parser/java/FortranTokenStream.java +# cp $(srcdir)/src/fortran/ofp/FrontEnd.java.afterFix $(srcdir)/src/fortran/ofp/FrontEnd.java +# diff --git a/src/3rdPartyLibraries/fortran-parser/src/CMakeLists.txt b/src/3rdPartyLibraries/fortran-parser/src/CMakeLists.txt new file mode 100644 index 0000000000..cd6f1d11ee --- /dev/null +++ b/src/3rdPartyLibraries/fortran-parser/src/CMakeLists.txt @@ -0,0 +1,14 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + +add_subdirectory(fortran) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +#SUBDIRS=fortran diff --git a/src/3rdPartyLibraries/fortran-parser/src/fortran/CMakeLists.txt b/src/3rdPartyLibraries/fortran-parser/src/fortran/CMakeLists.txt new file mode 100644 index 0000000000..125490f079 --- /dev/null +++ b/src/3rdPartyLibraries/fortran-parser/src/fortran/CMakeLists.txt @@ -0,0 +1,15 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + +add_subdirectory(tools) +add_subdirectory(ofp) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +#SUBDIRS=tools ofp diff --git a/src/3rdPartyLibraries/fortran-parser/src/fortran/ofp/CMakeLists.txt b/src/3rdPartyLibraries/fortran-parser/src/fortran/ofp/CMakeLists.txt new file mode 100644 index 0000000000..780a0cb734 --- /dev/null +++ b/src/3rdPartyLibraries/fortran-parser/src/fortran/ofp/CMakeLists.txt @@ -0,0 +1,37 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + +add_subdirectory(parser) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +## Copyright (c) 2005, 2006 Los Alamos National Security, LLC. This +## material was produced under U.S. Government contract DE- +## AC52-06NA25396 for Los Alamos National Laboratory (LANL), which is +## operated by the Los Alamos National Security, LLC (LANS) for the +## U.S. Department of Energy. The U.S. Government has rights to use, +## reproduce, and distribute this software. NEITHER THE GOVERNMENT NOR +## LANS MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR ASSUMES ANY +## LIABILITY FOR THE USE OF THIS SOFTWARE. If software is modified to +## produce derivative works, such modified software should be clearly +## marked, so as not to confuse it with the version available from +## LANL. +# +## Additionally, this program and the accompanying materials are made +## available under the terms of the Eclipse Public License v1.0 which +## accompanies this distribution, and is available at +## http://www.eclipse.org/legal/epl-v10.html +# +#SUBDIRS=parser +# +#java_files_made: FrontEnd.java +# $(JAVAC) $(srcdir)/FrontEnd.java +# touch java_files_made +# +#CLEANFILES = *.class java_files_made diff --git a/src/3rdPartyLibraries/libharu-2.1.0/CMakeLists.txt b/src/3rdPartyLibraries/libharu-2.1.0/CMakeLists.txt new file mode 100644 index 0000000000..6db8221d67 --- /dev/null +++ b/src/3rdPartyLibraries/libharu-2.1.0/CMakeLists.txt @@ -0,0 +1,16 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + +add_subdirectory(src) +#add_subdirectory(include) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +#AUTOMAKE_OPTIONS=foreign no-dependencies +#SUBDIRS=src include diff --git a/src/3rdPartyLibraries/libharu-2.1.0/include/CMakeLists.txt b/src/3rdPartyLibraries/libharu-2.1.0/include/CMakeLists.txt new file mode 100644 index 0000000000..85b41aa349 --- /dev/null +++ b/src/3rdPartyLibraries/libharu-2.1.0/include/CMakeLists.txt @@ -0,0 +1,23 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/hpdf_config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/hpdf_config.h) + + +########### install files ############### + +install(FILES hpdf.h hpdf_annotation.h hpdf_encoder.h hpdf_ext_gstate.h hpdf_mmgr.h hpdf_pages.h hpdf_utils.h hpdf_catalog.h hpdf_consts.h hpdf_encryptdict.h hpdf_fontdef.h hpdf_image.h hpdf_objects.h hpdf_streams.h hpdf_conf.h hpdf_destination.h hpdf_encrypt.h hpdf_font.h hpdf_info.h hpdf_outline.h hpdf_types.h hpdf_doc.h hpdf_error.h hpdf_gstate.h hpdf_list.h hpdf_page_label.h hpdf_u3d.h hpdf_config.h hpdf_version.h DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#AUTOMAKE_OPTIONS = foreign no-dependencies +# +#include_HEADERS = hpdf.h hpdf_annotation.h hpdf_encoder.h hpdf_ext_gstate.h \ +# hpdf_mmgr.h hpdf_pages.h hpdf_utils.h hpdf_catalog.h \ +# hpdf_consts.h hpdf_encryptdict.h hpdf_fontdef.h hpdf_image.h \ +# hpdf_objects.h hpdf_streams.h hpdf_conf.h hpdf_destination.h \ +# hpdf_encrypt.h hpdf_font.h hpdf_info.h hpdf_outline.h hpdf_types.h \ +# hpdf_doc.h hpdf_error.h hpdf_gstate.h hpdf_list.h hpdf_page_label.h \ +# hpdf_u3d.h hpdf_config.h hpdf_version.h diff --git a/src/3rdPartyLibraries/libharu-2.1.0/src/CMakeLists.txt b/src/3rdPartyLibraries/libharu-2.1.0/src/CMakeLists.txt new file mode 100644 index 0000000000..600869d399 --- /dev/null +++ b/src/3rdPartyLibraries/libharu-2.1.0/src/CMakeLists.txt @@ -0,0 +1,98 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ${ROSE_INCLUDES} ) + +#set +set( CMAKE_C_FLAGS " -fexceptions -DHAVE_CONFIG_H -DHPDF_NOZLIB -DHPDF_NOPNGLIB " ) + +########### next target ############### + +set(hpdf_LIB_SRCS + hpdf_annotation.c + hpdf_array.c + hpdf_binary.c + hpdf_boolean.c + hpdf_catalog.c + hpdf_destination.c + hpdf_dict.c + hpdf_doc.c + hpdf_doc_png.c + hpdf_encoder.c + hpdf_encoder_cns.c + hpdf_encoder_cnt.c + hpdf_encoder_jp.c + hpdf_encoder_kr.c + hpdf_encrypt.c + hpdf_encryptdict.c + hpdf_error.c + hpdf_ext_gstate.c + hpdf_font.c + hpdf_font_cid.c + hpdf_fontdef_base14.c + hpdf_fontdef.c + hpdf_fontdef_cid.c + hpdf_fontdef_cns.c + hpdf_fontdef_cnt.c + hpdf_fontdef_jp.c + hpdf_fontdef_kr.c + hpdf_fontdef_tt.c + hpdf_fontdef_type1.c + hpdf_font_tt.c + hpdf_font_type1.c + hpdf_gstate.c + hpdf_image.c + hpdf_image_png.c + hpdf_info.c + hpdf_list.c + hpdf_mmgr.c + hpdf_name.c + hpdf_null.c + hpdf_number.c + hpdf_objects.c + hpdf_outline.c + hpdf_page_label.c + hpdf_page_operator.c + hpdf_pages.c + hpdf_real.c + hpdf_streams.c + hpdf_string.c + hpdf_u3d.c + hpdf_utils.c + hpdf_xref.c) + +add_library(libhpdf SHARED ${hpdf_LIB_SRCS}) + +#target_link_libraries(libhpdf ${KDE4_KDECORE_LIBS}) + +#set_target_properties(hpdf PROPERTIES VERSION 1.0.0 SOVERSION 1) +install(TARGETS libhpdf ${INSTALL_TARGETS_DEFAULT_ARGS}) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +#AUTOMAKE_OPTIONS = foreign no-dependencies +# +#lib_LTLIBRARIES = libhpdf.la +# +#libhpdf_la_SOURCES = hpdf_annotation.c hpdf_array.c hpdf_binary.c hpdf_boolean.c \ +# hpdf_catalog.c hpdf_destination.c hpdf_dict.c hpdf_doc.c \ +# hpdf_doc_png.c hpdf_encoder.c hpdf_encoder_cns.c hpdf_encoder_cnt.c \ +# hpdf_encoder_jp.c hpdf_encoder_kr.c hpdf_encrypt.c hpdf_encryptdict.c \ +# hpdf_error.c hpdf_ext_gstate.c hpdf_font.c hpdf_font_cid.c \ +# hpdf_fontdef_base14.c hpdf_fontdef.c hpdf_fontdef_cid.c \ +# hpdf_fontdef_cns.c hpdf_fontdef_cnt.c hpdf_fontdef_jp.c \ +# hpdf_fontdef_kr.c hpdf_fontdef_tt.c hpdf_fontdef_type1.c \ +# hpdf_font_tt.c hpdf_font_type1.c hpdf_gstate.c hpdf_image.c \ +# hpdf_image_png.c hpdf_info.c hpdf_list.c hpdf_mmgr.c hpdf_name.c \ +# hpdf_null.c hpdf_number.c hpdf_objects.c hpdf_outline.c \ +# hpdf_page_label.c hpdf_page_operator.c hpdf_pages.c hpdf_real.c \ +# hpdf_streams.c hpdf_string.c hpdf_u3d.c hpdf_utils.c hpdf_xref.c +# +#libhpdf_la_LIBADD = @LTLIBOBJS@ +#libhpdf_la_LDFLAGS = -release @VERSION@ +## JJW for ROSE: Added this line to enable building outside source tree +#libhpdf_la_INCLUDES = -I$(top_srcdir)/include diff --git a/src/3rdPartyLibraries/libharu-2.1.0/src/hpdf_streams.c b/src/3rdPartyLibraries/libharu-2.1.0/src/hpdf_streams.c index 03ef929253..b76666d571 100644 --- a/src/3rdPartyLibraries/libharu-2.1.0/src/hpdf_streams.c +++ b/src/3rdPartyLibraries/libharu-2.1.0/src/hpdf_streams.c @@ -26,7 +26,9 @@ // DQ (9/28/2009): The inclusion of "hpdf_config.h" still is not turning ZLIB off, // so try this more drastic action to turn it off (this is a problem for UBUNTU systems). -#define HPDF_NOZLIB +#ifndef HPDF_NOZLIB +#define HPDF_NOZLIB 1 +#endif #ifndef HPDF_NOZLIB #include diff --git a/src/3rdPartyLibraries/libharu-2.1.0/win32/include/hpdf_config.h b/src/3rdPartyLibraries/libharu-2.1.0/win32/include/hpdf_config.h index d4526cdf1a..0b1f46d2da 100644 --- a/src/3rdPartyLibraries/libharu-2.1.0/win32/include/hpdf_config.h +++ b/src/3rdPartyLibraries/libharu-2.1.0/win32/include/hpdf_config.h @@ -48,10 +48,10 @@ #undef HPDF_DEBUG_TRACE /* libpng is not available */ -#undef HPDF_NOPNGLIB +//#undef HPDF_NOPNGLIB /* zlib is not available */ -#undef HPDF_NOZLIB +//#undef HPDF_NOZLIB /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT diff --git a/src/3rdPartyLibraries/qrose/CMakeLists.txt b/src/3rdPartyLibraries/qrose/CMakeLists.txt new file mode 100644 index 0000000000..1e77bdf9c9 --- /dev/null +++ b/src/3rdPartyLibraries/qrose/CMakeLists.txt @@ -0,0 +1,25 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + +add_subdirectory(Framework) +add_subdirectory(Widgets) +add_subdirectory(Components) +add_subdirectory(QRoseLib) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +## the library search path. +# +#SUBDIRS = Framework Widgets Components QRoseLib +# +# +# +# +# +# diff --git a/src/3rdPartyLibraries/qrose/Components/CMakeLists.txt b/src/3rdPartyLibraries/qrose/Components/CMakeLists.txt new file mode 100644 index 0000000000..12168c1597 --- /dev/null +++ b/src/3rdPartyLibraries/qrose/Components/CMakeLists.txt @@ -0,0 +1,26 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + +add_subdirectory(Common) +add_subdirectory(QueryBox) +add_subdirectory(SourceBox) +add_subdirectory(TreeBox) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +## the library search path. +# +#SUBDIRS = Common QueryBox SourceBox TreeBox +# +# +# +# +# +# +# diff --git a/src/3rdPartyLibraries/qrose/Components/Common/CMakeLists.txt b/src/3rdPartyLibraries/qrose/Components/Common/CMakeLists.txt new file mode 100644 index 0000000000..c36d27a48f --- /dev/null +++ b/src/3rdPartyLibraries/qrose/Components/Common/CMakeLists.txt @@ -0,0 +1,38 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + +add_subdirectory(icons) + + +########### next target ############### + + +########### install files ############### + +install(FILES QRAstInfo.h QRCoords.h QRIcons.h QRPixmap.h QRAttribute.h QRoseComponent.h DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#SUBDIRS=icons +# +#if ROSE_USE_QT +# +#INCLUDES = $(ROSE_INCLUDES) $(QT_INCLUDES) +# +#METASOURCES = auto +#include_HEADERS = QRAstInfo.h QRCoords.h QRIcons.h QRPixmap.h QRAttribute.h QRoseComponent.h +# +#noinst_LTLIBRARIES = libqrcommon.la +# +## DQ (2/11/2009): Using nodist_ rule to support specification of files to be built at compile time and not distrivuted in the distribution. +#libqrcommon_la_SOURCES = QRAstInfo.C QRCoords.C QRIcons.C QRPixmap.C QRAttribute.C QRoseComponent.C +# +#CLEANFILES = +# +#endif +# +#EXTRA_DIST = QRAstInfo.h QRCoords.h QRIcons.h QRPixmap.h QRAttribute.h QRoseComponent.h diff --git a/src/3rdPartyLibraries/qrose/Components/Common/icons/CMakeLists.txt b/src/3rdPartyLibraries/qrose/Components/Common/icons/CMakeLists.txt new file mode 100644 index 0000000000..95150f33ac --- /dev/null +++ b/src/3rdPartyLibraries/qrose/Components/Common/icons/CMakeLists.txt @@ -0,0 +1,85 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### install files ############### + +install(FILES cachebroadcast.xpm doquery.xpm method_npublic_decl.xpm source_c.xpm cacheclear.xpm empty.xpm method_npublic_defn.xpm target.xpm cachecollect.xpm func_decl.xpm method_public_decl.xpm typedf.xpm cacheview.xpm func_defn.xpm method_public_defn.xpm var.xpm class_decl.xpm gotoline.xpm no.xpm yes.xpm clear_results.xpm highlight.xpm project.xpm zoomin.xpm default.xpm lookup.xpm setdomain.xpm zoomout.xpm DESTINATION ${INCLUDE_INSTALL_DIR} ) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#if ROSE_USE_QT +# +#INCLUDES = $(ROSE_INCLUDES) $(QT_INCLUDES) +# +# +#METASOURCES = auto +# +#CLEANFILES = +# +#iconsdir = $(prefix)/include/icons +# +#icons_DATA= \ +# cachebroadcast.xpm \ +# doquery.xpm \ +# method_npublic_decl.xpm \ +# source_c.xpm \ +# cacheclear.xpm \ +# empty.xpm \ +# method_npublic_defn.xpm \ +# target.xpm \ +# cachecollect.xpm \ +# func_decl.xpm \ +# method_public_decl.xpm \ +# typedf.xpm \ +# cacheview.xpm \ +# func_defn.xpm \ +# method_public_defn.xpm \ +# var.xpm \ +# class_decl.xpm \ +# gotoline.xpm \ +# no.xpm \ +# yes.xpm \ +# clear_results.xpm \ +# highlight.xpm \ +# project.xpm \ +# zoomin.xpm \ +# default.xpm \ +# lookup.xpm \ +# setdomain.xpm \ +# zoomout.xpm +#endif +# +#EXTRA_DIST = \ +# cachebroadcast.xpm \ +# doquery.xpm \ +# method_npublic_decl.xpm \ +# source_c.xpm \ +# cacheclear.xpm \ +# empty.xpm \ +# method_npublic_defn.xpm \ +# target.xpm \ +# cachecollect.xpm \ +# func_decl.xpm \ +# method_public_decl.xpm \ +# typedf.xpm \ +# cacheview.xpm \ +# func_defn.xpm \ +# method_public_defn.xpm \ +# var.xpm \ +# class_decl.xpm \ +# gotoline.xpm \ +# no.xpm \ +# yes.xpm \ +# clear_results.xpm \ +# highlight.xpm \ +# project.xpm \ +# zoomin.xpm \ +# default.xpm \ +# lookup.xpm \ +# setdomain.xpm \ +# zoomout.xpm diff --git a/src/3rdPartyLibraries/qrose/Components/QueryBox/CMakeLists.txt b/src/3rdPartyLibraries/qrose/Components/QueryBox/CMakeLists.txt new file mode 100644 index 0000000000..4f7bdc8249 --- /dev/null +++ b/src/3rdPartyLibraries/qrose/Components/QueryBox/CMakeLists.txt @@ -0,0 +1,49 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + +install(FILES QRQueryBox.h QRQueryDomain.h QRQueryOp.h QRQueryRange.h DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#if ROSE_USE_QT +# +#INCLUDES = $(ROSE_INCLUDES) $(QT_INCLUDES) +# +##LD_FLAGS = @LIB_ROSE@ @ROSE_LDFLAGS@ @LIB_QT@ @QT_LDFLAGS@ +#METASOURCES = auto +# +#include_HEADERS = QRQueryBox.h QRQueryDomain.h QRQueryOp.h QRQueryRange.h +# +#noinst_LTLIBRARIES = libqrquerybox.la +# +#MOC_SOURCES = moc_QRQueryBox.C +# +#libqrquerybox_la_SOURCES = QRQueryBox.C QRQueryDomain.C QRQueryOp.C QRQueryRange.C +#nodist_libqrquerybox_la_SOURCES = $(MOC_SOURCES) +# +#CLEANFILES = moc_*.C +# +#if QROSE_USE_WINDOWS +#moc_%.C: $(srcdir)/%.h +# $(MOC) -o $@ `cygpath -w $<` -p$(srcdir) +#else +#moc_%.C: $(srcdir)/%.h +# $(MOC) -o $@ $< -frose.h -f$(notdir $<) +#endif +# +#endif +# +#EXTRA_DIST = QRQueryBox.h \ +# QRQueryDomain.h \ +# QRQueryOp.h \ +# QRQueryRange.h diff --git a/src/3rdPartyLibraries/qrose/Components/SourceBox/CMakeLists.txt b/src/3rdPartyLibraries/qrose/Components/SourceBox/CMakeLists.txt new file mode 100644 index 0000000000..05c222bea4 --- /dev/null +++ b/src/3rdPartyLibraries/qrose/Components/SourceBox/CMakeLists.txt @@ -0,0 +1,67 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + +install(FILES QRSourceBox.h DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#if ROSE_USE_QT +# +#INCLUDES = $(ROSE_INCLUDES) $(QT_INCLUDES) +# +##LD_FLAGS = @LIB_ROSE@ @ROSE_LDFLAGS@ @LIB_QT@ @QT_LDFLAGS@ +#METASOURCES = auto +# +#include_HEADERS = QRSourceBox.h +# +#noinst_LTLIBRARIES = libqrsourcebox.la +# +#MOC_SOURCES = moc_markerwidget.C moc_qeditor.C moc_levelwidget.C \ +# moc_linenumberwidget.C moc_q3richtext_px.C moc_QRSourceBox.C +# +#libqrsourcebox_la_SOURCES = cindent.C markerwidget.C q3richtextx.C \ +# QRUnparser.C cpp_colorizer.C paragdata.C \ +# qeditor.C qsourcecolorizer.C levelwidget.C \ +# parenmatcher.C qeditor_indenter.C simple_indent.C \ +# linenumberwidget.C q3richtext_px.C QRSourceBox.C \ +# yyindent.C +# +#nodist_libqrsourcebox_la_SOURCES = $(MOC_SOURCES) +# +#CLEANFILES = moc_*.C +# +#if QROSE_USE_WINDOWS +#moc_%.C: $(srcdir)/%.h +# $(MOC) -o $@ `cygpath -w $<` -p$(srcdir) +#else +#moc_%.C: $(srcdir)/%.h +# $(MOC) -o $@ $< +#endif +# +#endif +# +#EXTRA_DIST = cindent.h \ +# markerwidget.h \ +# qeditor.h \ +# qsourcecolorizer.h \ +# cpp_colorizer.h \ +# paragdata.h \ +# qeditor_indenter.h \ +# simple_indent.h \ +# levelwidget.h \ +# parenmatcher.h \ +# QRSourceBox.h \ +# linenumberwidget.h \ +# q3richtext_px.h \ +# QRUnparser.h +# diff --git a/src/3rdPartyLibraries/qrose/Components/TreeBox/CMakeLists.txt b/src/3rdPartyLibraries/qrose/Components/TreeBox/CMakeLists.txt new file mode 100644 index 0000000000..58034d7899 --- /dev/null +++ b/src/3rdPartyLibraries/qrose/Components/TreeBox/CMakeLists.txt @@ -0,0 +1,50 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + +install(FILES QRTreeBox.h DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#if ROSE_USE_QT +# +#INCLUDES = $(ROSE_INCLUDES) $(QT_INCLUDES) +# +##LD_FLAGS = @LIB_ROSE@ @ROSE_LDFLAGS@ @LIB_QT@ @QT_LDFLAGS@ +#METASOURCES = auto +# +#include_HEADERS = QRTreeBox.h +# +#noinst_LTLIBRARIES = libqrtreebox.la +# +#MOC_SOURCES = moc_QRTreeBox.C +# +#libqrtreebox_la_SOURCES = QRListViewItem.C QRTreeBox.C QRTreeVisitor.C +# +#nodist_libqrtreebox_la_SOURCES = $(MOC_SOURCES) +# +#CLEANFILES = moc_*.C +# +#if QROSE_USE_WINDOWS +#moc_%.C: $(srcdir)/%.h +# $(MOC) -o $@ `cygpath -w $<` -p$(srcdir) +#else +#moc_%.C: $(srcdir)/%.h +# $(MOC) -o $@ $< +#endif +# +#endif +# +#EXTRA_DIST = QRListViewItem.h \ +# QRTreeBox.h \ +# QRTreeVisitor.h +# \ No newline at end of file diff --git a/src/3rdPartyLibraries/qrose/Framework/CMakeLists.txt b/src/3rdPartyLibraries/qrose/Framework/CMakeLists.txt new file mode 100644 index 0000000000..40576dc6ad --- /dev/null +++ b/src/3rdPartyLibraries/qrose/Framework/CMakeLists.txt @@ -0,0 +1,68 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + +install(FILES qrose.h QRMacros.h QRMain.h QRException.h QRTiledWidget.h QRWidgetAccess.h QRWindow.h QRPanel.h QRSpaceWidget.h QRGroup.h DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#if ROSE_USE_QT +# +#INCLUDES = $(ROSE_INCLUDES) $(QT_INCLUDES) +# +# +##LD_FLAGS = @LIB_ROSE@ @ROSE_LDFLAGS@ @LIB_QT@ @QT_LDFLAGS@ +#METASOURCES = auto +#include_HEADERS = qrose.h QRMacros.h QRMain.h QRException.h QRTiledWidget.h QRWidgetAccess.h QRWindow.h QRPanel.h QRSpaceWidget.h QRGroup.h +#noinst_LTLIBRARIES = libqrframework.la +# +#MOC_SOURCES = moc_QRMain_p.C moc_QRWindow.C moc_QRTiledWidget.C moc_QRSpaceWidget.C moc_QRGroup.C +# +## DQ (2/11/2009): Using nodist_ rule to support specification of files to be built at compile time and not distrivuted in the distribution. +#libqrframework_la_SOURCES = QRMain.C QRMain_p.C QRException.C QRTiledWidget.C QRWidgetAccess.C QRWindow.C QRPanel.C QRSpaceWidget.C QRGroup.C +#nodist_libqrframework_la_SOURCES = $(MOC_SOURCES) +# +#CLEANFILES = moc_*.C +# +#if QROSE_USE_WINDOWS +#moc_%.C: $(srcdir)/%.h +# $(MOC) -o $@ `cygpath -w $<` -p$(srcdir) +#else +#moc_%.C: $(srcdir)/%.h +# $(MOC) -o $@ $< +#endif +# +#else +# +## DQ (2/11/2009): If not configured to use Qt then we can't save the $(MOC_SOURCES) files +## MOC_SOURCES = +## CLEANFILES = +## libqrframework_la_SOURCES = +# +## moc_%.C: $(srcdir)/%.h +## touch $< +# +#endif +# +## DQ (2/11/2009): Save the $(MOC_SOURCES) files into the distribution. +#EXTRA_DIST = QRException.h \ +# QRMacros.h \ +# QRMain.h \ +# QRMain_p.h \ +# qrose.h \ +# QRPanel.h \ +# QRSpaceWidget.h \ +# QRTiledWidget.h \ +# QRWidgetAccess.h \ +# QRWindow.h \ +# QRGroup.h +# diff --git a/src/3rdPartyLibraries/qrose/QRoseLib/CMakeLists.txt b/src/3rdPartyLibraries/qrose/QRoseLib/CMakeLists.txt new file mode 100644 index 0000000000..88f167cb2a --- /dev/null +++ b/src/3rdPartyLibraries/qrose/QRoseLib/CMakeLists.txt @@ -0,0 +1,43 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + +set(qrose_LIB_SRCS qroselib.C) + +kde4_add_library(qrose SHARED ${qrose_LIB_SRCS}) + +target_link_libraries(qrose ${KDE4_KDECORE_LIBS} qrframework qrwidgets qrcommon qrquerybox qrsourcebox qrtreebox) + +set_target_properties(qrose PROPERTIES VERSION 1.0.0 SOVERSION 1) +install(TARGETS qrose ${INSTALL_TARGETS_DEFAULT_ARGS}) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#if ROSE_USE_QT +# +#lib_LTLIBRARIES = libqrose.la +#libqrose_la_LIBADD = ../Framework/libqrframework.la \ +# ../Widgets/libqrwidgets.la \ +# ../Components/Common/libqrcommon.la \ +# ../Components/QueryBox/libqrquerybox.la \ +# ../Components/SourceBox/libqrsourcebox.la \ +# ../Components/TreeBox/libqrtreebox.la +# +#libqrose_la_SOURCES = qroselib.C +#if QROSE_USE_MINGW32 +# libqrose_la_LDFLAGS = -no-undefined @QT_LDFLAGS@ +#else +# libqrose_la_LDFLAGS = @QT_LDFLAGS@ +#endif +# +#endif diff --git a/src/3rdPartyLibraries/qrose/Widgets/CMakeLists.txt b/src/3rdPartyLibraries/qrose/Widgets/CMakeLists.txt new file mode 100644 index 0000000000..fc80cbc2c4 --- /dev/null +++ b/src/3rdPartyLibraries/qrose/Widgets/CMakeLists.txt @@ -0,0 +1,59 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + +install(FILES QRButtons.h QRToolBar.h QRTable.h QREdit.h QRSelect.h QRProgress.h QRSeparator.h QRTree.h DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +# +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#if ROSE_USE_QT +# +#INCLUDES = $(ROSE_INCLUDES) $(QT_INCLUDES) +# +##LD_FLAGS = @LIB_ROSE@ @ROSE_LDFLAGS@ @LIB_QT@ @QT_LDFLAGS@ +#METASOURCES = auto +# +#include_HEADERS = QRButtons.h QRToolBar.h QRTable.h QREdit.h QRSelect.h QRProgress.h QRSeparator.h QRTree.h +# +#noinst_LTLIBRARIES = libqrwidgets.la +# +#MOC_SOURCES = moc_QRButtons.C moc_QRToolBar.C moc_QRTable.C moc_QREdit.C moc_QRSelect.C moc_QRProgress.C moc_QRSeparator.C moc_QRSelect_p.C moc_QRTree.C +# +#libqrwidgets_la_SOURCES = QRTable_p.C QREdit_p.C QRProgress_p.C QRSeparator_p.C QRButtons.C QRButtons_p.C QRToolBar.C QRTable.C QREdit.C QRSelect.C QRSelect_p.C QRProgress.C QRSeparator.C QRTree.C +#nodist_libqrwidgets_la_SOURCES = $(MOC_SOURCES) +# +#CLEANFILES = moc_*.C +# +#if QROSE_USE_WINDOWS +#moc_%.C: $(srcdir)/%.h +# $(MOC) -o $@ `cygpath -w $<` -p$(srcdir) +#else +#moc_%.C: $(srcdir)/%.h +# $(MOC) -o $@ $< +#endif +# +#endif +# +#EXTRA_DIST = QRButtons.h \ +# QRButtons_p.h \ +# QREdit_p.h \ +# QRProgress_p.h \ +# QRSelect_p.h \ +# QRSeparator_p.h \ +# QRTable_p.h \ +# QREdit.h \ +# QRProgress.h \ +# QRSelect.h \ +# QRSeparator.h \ +# QRTable.h \ +# QRToolBar.h diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000000..e31afa8e02 --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,469 @@ +set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Ddisc_union=union" ) +set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Ddisc_union=union" ) + +#include_directories( ${ROSE_INCLUDES} ) +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ${Boost_INCLUDE_DIRS} ) + +#set( CMAKE_VERBOSE_MAKEFILE true ) + + + + + + + + +#Headers generated by ROSETTA +set(ROSETTA_HEADERS + ${CMAKE_BINARY_DIR}/src/frontend/SageIII/grammar.h + ${CMAKE_BINARY_DIR}/src/frontend/SageIII/grammarString.h + ${CMAKE_BINARY_DIR}/src/frontend/SageIII/ROSETTA_macros.h + ${CMAKE_BINARY_DIR}/src/frontend/SageIII/terminal.h + ${CMAKE_BINARY_DIR}/src/frontend/SageIII/AST_FILE_IO.h + ${CMAKE_BINARY_DIR}/src/frontend/SageIII/AstSpecificDataManagingClass.h + ${CMAKE_BINARY_DIR}/src/frontend/SageIII/Cxx_GrammarMemoryPoolSupport.h + ${CMAKE_BINARY_DIR}/src/frontend/SageIII/StorageClasses.h + ${CMAKE_BINARY_DIR}/src/frontend/SageIII/AstQueryMemoryPool.h + ${CMAKE_BINARY_DIR}/src/frontend/SageIII/Cxx_Grammar.h + ${CMAKE_BINARY_DIR}/src/frontend/SageIII/Cxx_GrammarTreeTraversalAccessEnums.h + ) + +#source files generated by ROSETTA +set(ROSETTA_SRC + ${CMAKE_BINARY_DIR}/src/frontend/SageIII/AST_FILE_IO.C + ${CMAKE_BINARY_DIR}/src/frontend/SageIII/Cxx_GrammarNewAndDeleteOperators.C + ${CMAKE_BINARY_DIR}/src/frontend/SageIII/Cxx_GrammarTraverseMemoryPool.C + ${CMAKE_BINARY_DIR}/src/frontend/SageIII/Cxx_Grammar.C + ${CMAKE_BINARY_DIR}/src/frontend/SageIII/Cxx_GrammarNewConstructors.C + ${CMAKE_BINARY_DIR}/src/frontend/SageIII/Cxx_GrammarTreeTraversalSuccessorContainer.C + ${CMAKE_BINARY_DIR}/src/frontend/SageIII/Cxx_GrammarCheckingIfDataMembersAreInMemoryPool.C + ${CMAKE_BINARY_DIR}/src/frontend/SageIII/Cxx_GrammarProcessDataMemberReferenceToPointers.C + ${CMAKE_BINARY_DIR}/src/frontend/SageIII/Cxx_GrammarVariantEnumNames.C + ${CMAKE_BINARY_DIR}/src/frontend/SageIII/Cxx_GrammarCopyMemberFunctions.C + ${CMAKE_BINARY_DIR}/src/frontend/SageIII/Cxx_GrammarReturnClassHierarchySubTree.C + ${CMAKE_BINARY_DIR}/src/frontend/SageIII/Cxx_GrammarGetChildIndex.C + ${CMAKE_BINARY_DIR}/src/frontend/SageIII/Cxx_GrammarReturnDataMemberPointers.C + ${CMAKE_BINARY_DIR}/src/frontend/SageIII/StorageClasses.C + ${CMAKE_BINARY_DIR}/src/frontend/SageIII/Cxx_GrammarMemoryPoolSupport.C + ${CMAKE_BINARY_DIR}/src/frontend/SageIII/Cxx_GrammarRTI.C +#Does not seem to be compiled +# ${CMAKE_BINARY_DIR}/src/frontend/SageIII/astFileIO/SourcesOfIRNodesAstFileIOSupport.C + +# ${CMAKE_BINARY_DIR}/src/frontend/SageIII/astFileIO/SourcesOfIRNodesAstFileIOSupport.C + ) + + + + +#Tell cmake that these files are generated by ROSETTA and will only be available at compile time +SET_SOURCE_FILES_PROPERTIES( + ${ROSETTA_SRC} + ${ROSETTA_HEADERS} + PROPERTIES GENERATED 1 + ) + +#Tell cmake that the preprocessor is generated from this source +SET_SOURCE_FILES_PROPERTIES( + ${CMAKE_BINARY_DIR}/src/frontend/SageIII/lex.yy.C + PROPERTIES GENERATED 1 + ) + +#Tell cmake that the ompparser is generated from this source +SET_SOURCE_FILES_PROPERTIES( + ${CMAKE_BINARY_DIR}/src/frontend/SageIII/ompparser.C + ${CMAKE_BINARY_DIR}/src/frontend/SageIII/ompparser.h + ${CMAKE_BINARY_DIR}/src/frontend/SageIII/omp-lex.yy.C + PROPERTIES GENERATED 1 + ) + +#Tell cmake that these files are generated by the binary frontend +SET_SOURCE_FILES_PROPERTIES( + ${CMAKE_BINARY_DIR}/src/frontend/BinaryDisassembly/x86InstructionEnumPrinter.C + ${CMAKE_BINARY_DIR}/src/frontend/BinaryDisassembly/armInstructionEnumPrinter.C + ${CMAKE_BINARY_DIR}/src/frontend/BinaryDisassembly/powerpcInstructionEnumPrinter.C + PROPERTIES GENERATED 1 + ) + +####### SOURCE FILES IN ROSE + +set( STORAGECLASSES_SRC + ${CMAKE_SOURCE_DIR}/src/frontend/SageIII/astFileIO/StorageClassMemoryManagement.C + ) + +#add_library(storageclasses ${STORAGECLASSES_SRC} ) + set(rose_util_src + ${CMAKE_SOURCE_DIR}/src/util/stringSupport/FileNameClassifier.C + ${CMAKE_BINARY_DIR}/src/util/rose_paths.C + ${CMAKE_SOURCE_DIR}/src/util/stringSupport/escape.C + ${CMAKE_SOURCE_DIR}/src/util/graphs/TypedFusion.C + ${CMAKE_SOURCE_DIR}/src/util/graphs/DGBaseGraphImpl.C + ${CMAKE_SOURCE_DIR}/src/util/graphs/TransAnalysis.C + ${CMAKE_SOURCE_DIR}/src/util/graphs/SCCAnalysis.C + ${CMAKE_SOURCE_DIR}/src/util/commandlineProcessing/commandline_processing.C + ${CMAKE_SOURCE_DIR}/src/util/commandlineProcessing/sla++.C + ${CMAKE_SOURCE_DIR}/src/util/processSupport.C + ${CMAKE_SOURCE_DIR}/src/util/support/DirectedGraph.C + ${CMAKE_SOURCE_DIR}/src/util/support/CommandOptions.C + ${CMAKE_SOURCE_DIR}/src/util/support/DAG.C + ${CMAKE_SOURCE_DIR}/src/util/support/VectorCommandOptions.C + ${CMAKE_SOURCE_DIR}/src/util/stringSupport/string_functions.cpp + ${CMAKE_SOURCE_DIR}/src/util/stringSupport/escape.C + + ) + + +set( phpFrontend_SRC + ${CMAKE_SOURCE_DIR}/src/frontend/PHPFrontend/PHPFrontend.C + ) + +set( astFixup_SRC + ${CMAKE_SOURCE_DIR}/src/frontend/SageIII/astFixup/AstFixup.C + ${CMAKE_SOURCE_DIR}/src/frontend/SageIII/astFixup/fixupforGnuBackendCompiler.C + ${CMAKE_SOURCE_DIR}/src/frontend/SageIII/astFixup/fixupInClassDataInitialization.C + ${CMAKE_SOURCE_DIR}/src/frontend/SageIII/astFixup/removeInitializedNamePtr.C + ${CMAKE_SOURCE_DIR}/src/frontend/SageIII/astFixup/fixupDeclarations2.C + ${CMAKE_SOURCE_DIR}/src/frontend/SageIII/astFixup/fixupFunctionDefinitions.C + ${CMAKE_SOURCE_DIR}/src/frontend/SageIII/astFixup/fixupStorageAccessOfForwardTemplateDeclarations.C + ${CMAKE_SOURCE_DIR}/src/frontend/SageIII/astFixup/fixupSourcePositionInformation.C + ${CMAKE_SOURCE_DIR}/src/frontend/SageIII/astFixup/fixupEnumValues.C + ${CMAKE_SOURCE_DIR}/src/frontend/SageIII/astFixup/fixupFriendTemplateDeclarations.C + ) + +set( sage3_SRC + ${CMAKE_SOURCE_DIR}/src/frontend/SageIII/rose_attributes_list.C + ${CMAKE_SOURCE_DIR}/src/frontend/SageIII/attachPreprocessingInfo.C + ${CMAKE_SOURCE_DIR}/src/frontend/SageIII/attachPreprocessingInfoTraversal.C + ${CMAKE_SOURCE_DIR}/src/frontend/SageIII/attributeListMap.C + ${CMAKE_SOURCE_DIR}/src/frontend/SageIII/manglingSupport.C + ${CMAKE_SOURCE_DIR}/src/frontend/SageIII/sageSupport.C + ${CMAKE_SOURCE_DIR}/src/frontend/SageIII/fixupCopy_scopes.C + ${CMAKE_SOURCE_DIR}/src/frontend/SageIII/fixupCopy_symbols.C + ${CMAKE_SOURCE_DIR}/src/frontend/SageIII/fixupCopy_references.C + ${CMAKE_SOURCE_DIR}/src/frontend/SageIII/rtiHelpers.C + ${CMAKE_SOURCE_DIR}/src/frontend/SageIII/OmpAttribute.C + ${CMAKE_SOURCE_DIR}/src/frontend/SageIII/ompFortranParser.C + ${CMAKE_SOURCE_DIR}/src/frontend/SageIII/dwarfSupport.C + ${CMAKE_SOURCE_DIR}/src/frontend/SageIII/rose_graph_support.C + ${CMAKE_BINARY_DIR}/src/frontend/SageIII/lex.yy.C + ${CMAKE_BINARY_DIR}/src/frontend/SageIII/ompparser.C + ${CMAKE_BINARY_DIR}/src/frontend/SageIII/omp-lex.yy.C + ${CMAKE_SOURCE_DIR}/src/frontend/SageIII/omplexer.ll + ${CMAKE_SOURCE_DIR}/src/frontend/SageIII/ompparser.yy + ) + +set(MSTL_SRC + ${CMAKE_SOURCE_DIR}/src/3rdPartyLibraries/MSTL/PDFGeneration.C + ${CMAKE_SOURCE_DIR}/src/3rdPartyLibraries/MSTL/DOTGraphInterface.C + ) + +set(EDG_SAGE_Connection_SRC + ${CMAKE_SOURCE_DIR}/src/frontend/CxxFrontend/EDG_SAGE_Connection/sage_gen_be.C + ${CMAKE_SOURCE_DIR}/src/frontend/CxxFrontend/EDG_SAGE_Connection/wrapperFunctionsForEDG.C + ) + +set(virtualCFG_SRC + ${CMAKE_SOURCE_DIR}/src/frontend/SageIII/virtualCFG/virtualCFG.C + ${CMAKE_SOURCE_DIR}/src/frontend/SageIII/virtualCFG/virtualBinCFG.C + ${CMAKE_SOURCE_DIR}/src/frontend/SageIII/virtualCFG/cfgToDot.C + ${CMAKE_SOURCE_DIR}/src/frontend/SageIII/virtualCFG/memberFunctions.C + ) + +set( binaryFrontend_SRC + ${CMAKE_SOURCE_DIR}/src/frontend/BinaryDisassembly/RoseBin_support.cpp + ${CMAKE_SOURCE_DIR}/src/frontend/BinaryDisassembly/instructionDispatch.cpp + ${CMAKE_SOURCE_DIR}/src/frontend/BinaryDisassembly/x86InstructionEnum.h + ${CMAKE_SOURCE_DIR}/src/frontend/BinaryDisassembly/x86InstructionProperties.h + ${CMAKE_SOURCE_DIR}/src/frontend/BinaryDisassembly/x86InstructionProperties.C + ${CMAKE_BINARY_DIR}/src/frontend/BinaryDisassembly/x86InstructionEnumPrinter.C + ${CMAKE_SOURCE_DIR}/src/frontend/BinaryDisassembly/armInstructionEnum.h + ${CMAKE_BINARY_DIR}/src/frontend/BinaryDisassembly/armInstructionEnumPrinter.C + ${CMAKE_SOURCE_DIR}/src/frontend/BinaryDisassembly/powerpcInstructionEnum.h + ${CMAKE_BINARY_DIR}/src/frontend/BinaryDisassembly/powerpcInstructionEnumPrinter.C + ${CMAKE_SOURCE_DIR}/src/frontend/BinaryDisassembly/powerpcInstructionProperties.h + ${CMAKE_SOURCE_DIR}/src/frontend/BinaryDisassembly/powerpcInstructionProperties.C + ${CMAKE_SOURCE_DIR}/src/frontend/BinaryDisassembly/readTicl.C + ${CMAKE_SOURCE_DIR}/src/frontend/BinaryDisassembly/RoseBin_file.cpp + ${CMAKE_SOURCE_DIR}/src/frontend/BinaryDisassembly/RoseFile.cpp + ${CMAKE_SOURCE_DIR}/src/frontend/BinaryDisassembly/RoseBin_buildTree.cpp + ${CMAKE_SOURCE_DIR}/src/frontend/BinaryDisassembly/RoseBin_IDAPRO_buildTree.cpp + ${CMAKE_SOURCE_DIR}/src/frontend/BinaryDisassembly/AST_BIN_Traversal.C + ) + +set(rose_support_src + ${CMAKE_SOURCE_DIR}/src/roseSupport/transformationSupport.C + ${CMAKE_SOURCE_DIR}/src/roseSupport/optionDeclaration.C + ${CMAKE_SOURCE_DIR}/src/roseSupport/sourceLocationInheritedAttribute.C + ${CMAKE_SOURCE_DIR}/src/roseSupport/roseTranslators.C + ${CMAKE_SOURCE_DIR}/src/roseSupport/utility_functions.C + ${CMAKE_SOURCE_DIR}/src/roseSupport/memoryUsage.C + ) + + +####### ADDING DIRECTORIES +add_subdirectory(util) +add_subdirectory(ROSETTA) +add_subdirectory(frontend) +add_subdirectory(midend) +add_subdirectory(backend) +add_subdirectory(roseSupport) +add_subdirectory(3rdPartyLibraries) +add_subdirectory(roseIndependentSupport) +add_subdirectory(roseExtensions) + + + + +########### next target ############### +set(rose_LIB_SRCS dummyCppFileForLibrose.C ${ROSETTA_SRC} ${sage3_SRC} + ${rose_support_src} + ${binaryFrontend_SRC} + ${EDG_SAGE_Connection_SRC} + ${virtualCFG_SRC} + ${rose_util_src} + ${MSTL_SRC} + ${astFixup_SRC} + ${phpFrontend_SRC} +#${roseDisassemblers_SRC} + ) + +add_library(rose SHARED ${rose_LIB_SRCS}) +#ROSE neeeds ${ROSETTA_HEADERS} and ${ROSETTA_SRC} to be build +add_dependencies(rose ROSETTA OMPPARSER ROSE_PREPROCESSOR ) + +#target_link_libraries(rose ${KDE4_KDECORE_LIBS} m hpdf) +#AS Hack to compile ROSE +#target_link_libraries(rose ${KDE4_KDECORE_LIBS} m hpdf) +#target_link_libraries(rose ${KDE4_KDECORE_LIBS} m ) + +set_target_properties(rose PROPERTIES VERSION 1.0.0 SOVERSION 1) +install(TARGETS rose ${INSTALL_TARGETS_DEFAULT_ARGS}) + +########### next target ############### + +set(testSharedRoseLib_SRCS testRoseLib.C) + +add_executable(testSharedRoseLib ${testSharedRoseLib_SRCS} ) + +target_link_libraries(testSharedRoseLib ${KDE4_KDECORE_LIBS} rose edg33 ${link_with_libraries} ${Boost_LIBRARIES} + libastMerge libsageInterface libastTokenStream + libastHiddenTypeAndDeclarationLists libastVisualization +# rose_support binary_frontend virtualCFG rose_util_lib astFixup + + roseDisassemblers + libsageInterface roseExecFormats midend unparser + libastHiddenTypeAndDeclarationLists roseAsmUnparser libastPostProcessing + libhpdf + ) + +########### install files ############### + +install(FILES rose.h roseInternal.h rose_msvc.h msvc_stdint.h DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#SUBDIRS = util ROSETTA frontend midend backend roseSupport \ +# 3rdPartyLibraries roseIndependentSupport roseExtensions +# +## This lists a large number of directories. If "make install" +## is run then we only need a single directory +#INCLUDES = -Winvalid-pch $(ROSE_INCLUDES) +# +# +## DQ (7/23/2008): New handling of EDG builds a single library instead of two. +## Binary distributions of ROSE store the binary for EDG related code in the source tree. +## JJW (8/3/2008): See src/frontend/CxxFrontend/Makefile.am.forBinaryEDG for +## more information on this process. +#libroseEDGlibraries = frontend/CxxFrontend/libroseEDG.la +# +#libroseBinaryLibraries = \ +# $(top_builddir)/src/frontend/BinaryDisassembly/libbinaryFrontend.la \ +# $(top_builddir)/src/midend/binaryAnalyses/libbinaryMidend.la \ +# $(top_builddir)/src/frontend/Disassemblers/libroseDisassemblers.la \ +# $(top_builddir)/src/frontend/ExecFormats/libroseExecFormats.la \ +# $(top_builddir)/src/backend/asmUnparser/libroseAsmUnparser.la +# +#if ROSE_USE_SQLITE_DATABASE +# +#libroseSqlite3xConnection = \ +# $(top_builddir)/src/roseExtensions/sqlite3x/libRoseSQLite3xDatabase.la +# OPT_SQLITE3_LDFLAGS = $(SQLITE3_LDFLAGS) +#else +# libroseSqlite3xConnection = +# OPT_SQLITE3_LDFLAGS = +#endif +# +#if ROSE_WITH_ROSEQT +#libroseQtExtension = $(top_builddir)/src/roseExtensions/qtWidgets/libRoseQtWidgets.la \ +# $(top_builddir)/src/3rdPartyLibraries/qrose/QRoseLib/libqrose.la +#else +#libroseQtExtension = +#endif +# +## TODO: correct list! +#libroseLibraries = \ +# $(top_builddir)/src/3rdPartyLibraries/MSTL/libmstl.la \ +# $(top_builddir)/src/backend/unparser/libunparse.la \ +# $(top_builddir)/src/backend/unparser/languageIndependenceSupport/libunparseLanguageIndependenceSupport.la \ +# $(top_builddir)/src/backend/unparser/CxxCodeGeneration/libunparseCxx.la \ +# $(top_builddir)/src/backend/unparser/FortranCodeGeneration/libunparseFortran.la \ +# $(top_builddir)/src/backend/unparser/PHPCodeGeneration/libunparsePHP.la \ +# $(top_builddir)/src/backend/unparser/formatSupport/libunparseFormatSupport.la \ +# $(top_builddir)/src/frontend/SageIII/libsage3.la \ +# $(top_builddir)/src/frontend/OpenFortranParser_SAGE_Connection/libroseFortran.la \ +# $(top_builddir)/src/frontend/PHPFrontend/librosePHPFrontend.la \ +# $(libroseEDGlibraries) \ +# $(libroseBinaryLibraries) \ +# $(top_builddir)/src/midend/abstractHandle/libabstractHandle.la \ +# $(top_builddir)/src/midend/astDiagnostics/libastDiagnostics.la \ +# $(top_builddir)/src/midend/astInlining/libastinlining.la \ +# $(top_builddir)/src/midend/astOutlining/libastOutliner.la \ +# $(top_builddir)/src/midend/astProcessing/libastprocessing.la \ +# $(top_builddir)/src/midend/astQuery/libquery.la \ +# $(top_builddir)/src/midend/astRewriteMechanism/librewrite.la \ +# $(top_builddir)/src/midend/astUtil/annotation/libannotation.la \ +# $(top_builddir)/src/midend/astUtil/astInterface/libastInterface.la \ +# $(top_builddir)/src/midend/astUtil/astSupport/libastSupport.la \ +# $(top_builddir)/src/midend/astUtil/symbolicVal/libsymbolicVal.la \ +# $(top_builddir)/src/midend/loopProcessing/computation/libcomputation.la \ +# $(top_builddir)/src/midend/loopProcessing/depGraph/libdepGraph.la \ +# $(top_builddir)/src/midend/loopProcessing/depInfo/libdepInfo.la \ +# $(top_builddir)/src/midend/loopProcessing/driver/libdriver.la \ +# $(top_builddir)/src/midend/loopProcessing/outsideInterface/libarrayOptimization.la \ +# $(top_builddir)/src/midend/loopProcessing/prepostTransformation/libprepostloop.la \ +# $(top_builddir)/src/midend/loopProcessing/slicing/libslicing.la \ +# $(top_builddir)/src/midend/ompLowering/libompLowering.la \ +# $(top_builddir)/src/midend/programAnalysis/CFG/libCFG.la \ +# $(top_builddir)/src/midend/programAnalysis/CallGraphAnalysis/libCallGraph.la \ +# $(top_builddir)/src/midend/programAnalysis/OAWrap/libOAWrap.la \ +# $(top_builddir)/src/midend/programAnalysis/dataflowAnalysis/libdataflowAnalysis.la \ +# $(top_builddir)/src/midend/programAnalysis/defUseAnalysis/libDefUseAnalysis.la \ +# $(top_builddir)/src/midend/programAnalysis/graphAnalysis/libSB_GraphAnalysis.la \ +# $(top_builddir)/src/midend/programAnalysis/pointerAnal/libpointerAnal.la \ +# $(top_builddir)/src/midend/programAnalysis/staticInterproceduralSlicing/libStaticSlicing.la \ +# $(top_builddir)/src/midend/programAnalysis/valuePropagation/libvaluePropagation.la \ +# $(top_builddir)/src/midend/programTransformation/constantFolding/libconstantFolding.la \ +# $(top_builddir)/src/midend/programTransformation/finiteDifferencing/libfiniteDifferencing.la \ +# $(top_builddir)/src/midend/programTransformation/functionCallNormalization/libfunctionCallNormalization.la \ +# $(top_builddir)/src/midend/programTransformation/implicitCodeGeneration/libimplicitCodeGeneration.la \ +# $(top_builddir)/src/midend/programTransformation/partialRedundancyElimination/libpre.la \ +# $(top_builddir)/src/roseSupport/libroseSupport.la \ +# $(top_builddir)/src/util/support/libsupport.la \ +# $(top_builddir)/src/util/graphs/libgraphs.la \ +# $(top_builddir)/src/util/libroseutil.la \ +# $(libroseSqlite3xConnection) \ +# $(libroseQtExtension) +# +# +#EXTRA_DIST = extra.docs +# +## Header files that need to be included in the distribution +#include_HEADERS = \ +# rose.h \ +# roseInternal.h \ +# rose_msvc.h \ +# msvc_stdint.h +# +## DQ (9/22/2006): Because we now use libtool, the shared library is a reference to the separate +## dynamic libraries in each directory and so testMultiRoseLib is redundant with testSharedRoseLib. +## This is true only if we have configured --with-development-libraries, else we have static +## in each directory and we will link with the collection of all static libraries. +## DQ (9/8/2006): The ROSE/docs/Rose/Makefile references the testSharedRoseLib program, so maybe is should be installed? +## bin_PROGRAMS = testSharedRoseLib # testMultiRoseLib +#noinst_PROGRAMS = testSharedRoseLib +# +#all-local: testSharedRoseLib$(EXEEXT) +## Test if programs using ROSE can be run +# @echo "Testing whether a simple program linked against ROSE can be run:" >&2 +# @echo "The translator will be run without any input files, and will print a warning about that; the warning is normal." >&2 +# @./testSharedRoseLib$(EXEEXT) || (echo "You cannot run a program linked against ROSE. Please be sure that your LD_LIBRARY_PATH (Linux) or DYLD_LIBRARY_PATH (Mac OSX) contains the correct libraries (JVM, Boost, librose.so, etc.)." >&2; exit 1) +# +## PC (9/15/2006): force the use of the C++ linker +#LINK = $(CXXLINK) +# +#lib_LTLIBRARIES = librose.la +# +#if ROSE_USE_OPEN_FORTRAN_PARSER +# JAVA_JVM_FLAGS = $(JAVA_JVM_LINK) +#endif +# +#librose_la_SOURCES = dummyCppFileForLibrose.C +#librose_la_LIBADD = $(libroseLibraries) $(JAVA_JVM_FLAGS) $(LIB_QT) -lm $(RT_LIBS) \ +# $(BOOST_LDFLAGS) $(BOOST_DATE_TIME_LIB) \ +# $(BOOST_THREAD_LIB) $(BOOST_FILESYSTEM_LIB) \ +# $(BOOST_PROGRAM_OPTIONS_LIB) $(BOOST_REGEX_LIB) \ +# $(BOOST_SYSTEM_LIB) $(BOOST_SERIALIZATION_LIB) \ +# $(BOOST_WAVE_LIB) \ +# -L$(top_builddir)/src/3rdPartyLibraries/libharu-2.1.0/src -lhpdf \ +# $(OPT_SQLITE3_LDFLAGS) +## librose_la_LDFLAGS = -no-undefined --rpath $(INTEL_PIN_PATH)/intel64/lib-ext +#librose_la_LDFLAGS = -no-undefined +##librose_la_LDFLAGS = $(ROSE_DWARF_LIBS_WITH_PATH) +#librose_la_DEPENDENCIES = $(libroseLibraries) +# +## Build list of all required libraries so that they can be built in parallel +## REQUIRED_LIBS = $(libdir)/libedg.la +#REQUIRED_LIBS = librose.la +# +# +## DQ (3/14/2009): In this file we have to overwrite existing values in LDFLAGS (to build librose.so). +## DQ (3/14/2009): We have to clear the LDFLAGS variable... This is not so great. +#LDFLAGS = +# +#testSharedRoseLib_SOURCES = testRoseLib.C +#testSharedRoseLib_DEPENDENCIES = $(REQUIRED_LIBS) +#testSharedRoseLib_LDADD = $(LIBS_WITH_RPATH) $(ROSE_LIBS) +## testSharedRoseLib_LDFLAGS = $(LIBS_WITH_RPATH) $(ROSE_LIBS) $(ROSE_DWARF_LIBS_WITH_PATH) +## testSharedRoseLib_LDFLAGS = $(LIBS_WITH_RPATH) $(ROSE_LIBS) +## testSharedRoseLib_LDFLAGS = $(ROSE_DWARF_LIBS_WITH_PATH) +# +## AM_LDFLAGS = $(ROSE_LIBS) $(ROSE_DWARF_LIBS_WITH_PATH) +## AM_LDFLAGS = $(ROSE_DWARF_LIBS_WITH_PATH) +## AM_LDFLAGS = +# +#print: +# @echo "libroseLibraries = $(libroseLibraries)" +# @echo "LIBS_WITH_RPATH = $(LIBS_WITH_RPATH)" +# @echo "ROSE_LIBS = $(ROSE_LIBS)" +# @echo "ROSE_DWARF_LIBS_WITH_PATH = $(ROSE_DWARF_LIBS_WITH_PATH)" +# @echo "AM_LDFLAGS = $(AM_LDFLAGS)" +# +## DQ (1/10/2004): remove the librose.a and libedg.a files so that distclean will work cleanly +#clean-local: +# rm -rf *.a *.so testSharedRoseLib testMultiRoseLib $(CXX_TEMPLATE_OBJECTS) Templates.DB ii_files ti_files +# +# +#distclean-local: +# rm -rf *.a *.so testSharedRoseLib testMultiRoseLib Templates.DB +# +#cleanTest: +# rm -rf *.lo testSharedRoseLib testMultiRoseLib +# +## DQ (9/14/2006): These are required! +## Note that uninstall-hook does not work, but uninstall-local does. +#uninstall-local: +# rm -f $(DESTDIR)$(libdir)/libedg.so +# rm -f $(DESTDIR)$(libdir)/librose.so +## rm -f $(libdir)/libedg.so +## rm -f $(libdir)/librose.so +# @echo "************************************************************" +# @echo "**** make uninstall rule complete (terminated normally) ****" +# @echo "************************************************************" +# +# +#rebuildPrelinker: +# rm -f frontend/CxxFrontend/EDG_3.3/util/edg_prelink.lo +# rm -f frontend/SageIII/Cxx_Grammar.lo +# rm -f roseSupport/templateSupport.lo +# $(MAKE) +# +# +# +# +# +# +# +# diff --git a/src/ROSETTA/CMakeLists.txt b/src/ROSETTA/CMakeLists.txt new file mode 100644 index 0000000000..954b9bc0ae --- /dev/null +++ b/src/ROSETTA/CMakeLists.txt @@ -0,0 +1,71 @@ + +project(ROSETTA) + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + +add_subdirectory(src) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#SUBDIRS = src +# +#ACLOCAL = @ACLOCAL@ -I ../config -I ../acmacros +# +#LIBS = @LIBS@ ${ROSETTA_LIBS} +# +#EXTRA_DIST = astNodeList +# +## *********************************************************************** +## Documentation Support +## *********************************************************************** +## Don't build a "docs" rule just yet since the dist rule (which builds distributions) +## will call it to generate documentation and this both causes errors and we don't +## want to test the generation of doxygen just yet (too long of a process). +# +#docs: +# @echo "Skipping the creation of documentation within the docs rule." +# +## sage-docs: +## @echo "Generate documentation for C++ grammar (using Doxygen)" +## mkdir -p ../docs/CxxGrammar +## doxygen $(srcdir)/ROSE_CxxGrammar.cfg +# +#clean-docs: +# @echo Removing generated documentation +# rm -rf docs +# +## DQ (7/4/2004) +## We need this to copy the Grammar directory into the distribution once in +## the distribution it is linked in the compile tree to the source tree. +#dist-hook: docs +## : dist-hook explanations: +## : Copy non-automake-controled items (Grammar) into the distribution directory. +## ln -s Grammar ${distdir} +# for i in Grammar; do \ +# cp -rp ${top_srcdir}/src/ROSETTA/$$i ${distdir} && \ +# rm -rf ${distdir}/$$i/CVS ${distdir}/$$i/*~ ;\ +# done +# +## Purify related flags +## PURIFY_USE_WINDOWS = -windows=yes +## PURIFY_FLAGS = $(PURIFY_USE_WINDOWS) -recursion-depth-limit=40000 -chain-length=12 -first-only=yes -l -at-exit=yes -inuse-at-exit=yes -always-use-cache-dir=yes -cache-dir=/home/dquinlan/tmp +## PURIFY = purify4.5 $(PURIFY_FLAGS) +# +## PURIFY_DIR = `purify4.5 -print-home-dir` +## PURIFY_STUBS = $(PURIFY_DIR)/purify_stubs.a +# +#clean-local: +# rm -rf Templates.DB ii_files ti_files +# +#distclean-local: +# rm -rf Templates.DB +# +## AUTOMAKE_OPTIONS = foreign diff --git a/src/ROSETTA/src/CMakeLists.txt b/src/ROSETTA/src/CMakeLists.txt new file mode 100644 index 0000000000..b84f590fe8 --- /dev/null +++ b/src/ROSETTA/src/CMakeLists.txt @@ -0,0 +1,321 @@ + +include_directories( ${ROSE_INCLUDES} ) +#include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + +set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions -DROSE_AUTOMAKE_ABSOLUTE_PATH_TOP_SRCDIR_DEFINED=\"${CMAKE_SOURCE_DIR}\"" ) + +set(CxxGrammarMetaProgram_SRCS + CxxGrammarMetaProgram.C + grammar.C + grammarString.C + terminal.C + type.C + symbol.C + expression.C + statement.C + support.C + binaryInstruction.C + storageSize.C + visitorSupport.C + poolBasedTraversal.C + node.C + buildAstFileIO.C + buildStorageClasses.C + buildConstructorsWithoutSourcePositionInformation.C + outputClassesAndFields.C) + +set(GRAMMAR_SOURCE_FILES + ${CMAKE_SOURCE_DIR}/src/ROSETTA/Grammar/Statement.code + ${CMAKE_SOURCE_DIR}/src/ROSETTA/Grammar/grammarClassDefinitionMacros.macro + ${CMAKE_SOURCE_DIR}/src/ROSETTA/Grammar/grammarVariantFunctionDefinitionMacros.macro + ${CMAKE_SOURCE_DIR}/src/ROSETTA/Grammar/Common.code + ${CMAKE_SOURCE_DIR}/src/ROSETTA/Grammar/Support.code + ${CMAKE_SOURCE_DIR}/src/ROSETTA/Grammar/grammarConstructorDefinitionMacros.macro + ${CMAKE_SOURCE_DIR}/src/ROSETTA/Grammar/node.macro + ${CMAKE_SOURCE_DIR}/src/ROSETTA/Grammar/Cxx_GlobalDeclarations.macro + ${CMAKE_SOURCE_DIR}/src/ROSETTA/Grammar/Symbol.code + ${CMAKE_SOURCE_DIR}/src/ROSETTA/Grammar/grammarDestructorDefinitionMacros.macro + ${CMAKE_SOURCE_DIR}/src/ROSETTA/Grammar/parserCode.macro + ${CMAKE_SOURCE_DIR}/src/ROSETTA/Grammar/Cxx_Support_Header.macro + ${CMAKE_SOURCE_DIR}/src/ROSETTA/Grammar/Type.code + ${CMAKE_SOURCE_DIR}/src/ROSETTA/Grammar/grammarIsClassNameFunctionDefinitionMacros.macro + ${CMAKE_SOURCE_DIR}/src/ROSETTA/Grammar/parserPrototype.macro + ${CMAKE_SOURCE_DIR}/src/ROSETTA/Grammar/Expression.code + ${CMAKE_SOURCE_DIR}/src/ROSETTA/Grammar/copyMemberFunction.macro + ${CMAKE_SOURCE_DIR}/src/ROSETTA/Grammar/grammarMainClassDeclatationMacros.macro + ${CMAKE_SOURCE_DIR}/src/ROSETTA/Grammar/parserSourceCode.macro + ${CMAKE_SOURCE_DIR}/src/ROSETTA/Grammar/LocatedNode.code + ${CMAKE_SOURCE_DIR}/src/ROSETTA/Grammar/dataMemberAccessFunctions.macro + ${CMAKE_SOURCE_DIR}/src/ROSETTA/Grammar/grammarMainClassParseFunctionSourceCode.macro + ${CMAKE_SOURCE_DIR}/src/ROSETTA/Grammar/Node.code + ${CMAKE_SOURCE_DIR}/src/ROSETTA/Grammar/BinaryInstruction.code + ${CMAKE_SOURCE_DIR}/src/ROSETTA/Grammar/grammarClassDeclarationMacros.macro + ${CMAKE_SOURCE_DIR}/src/ROSETTA/Grammar/grammarMainClassSourceCodeMacros.macro + ${CMAKE_SOURCE_DIR}/src/ROSETTA/Grammar/grammarNewDeleteOperatorMacros.macro + ${CMAKE_SOURCE_DIR}/src/ROSETTA/Grammar/grammarTraverseMemoryPool.macro + ${CMAKE_SOURCE_DIR}/src/ROSETTA/Grammar/grammarCheckingIfDataMembersAreInMemoryPool.macro + ${CMAKE_SOURCE_DIR}/src/ROSETTA/Grammar/grammarStorageClassDeclatationMacros.macro + ${CMAKE_SOURCE_DIR}/src/ROSETTA/Grammar/grammarStorageClassDefinitionMacros.macro + ${CMAKE_SOURCE_DIR}/src/ROSETTA/Grammar/grammarAST_FileIoHeader.code + ${CMAKE_SOURCE_DIR}/src/ROSETTA/Grammar/grammarAST_FileIoSource.code + ${CMAKE_SOURCE_DIR}/src/ROSETTA/Grammar/grammarSourceOfIRNodesAstFileIOSupport.macro + ${CMAKE_SOURCE_DIR}/src/ROSETTA/Grammar/grammarStaticDataManagingClassHeader.macro + ${CMAKE_SOURCE_DIR}/src/ROSETTA/Grammar/grammarStaticDataManagingClassStorageClassHeader.macro + ${CMAKE_SOURCE_DIR}/src/ROSETTA/Grammar/grammarReturnDataMemberPointers.macro + ${CMAKE_SOURCE_DIR}/src/ROSETTA/Grammar/grammarProcessDataMemberReferenceToPointers.macro + ${CMAKE_SOURCE_DIR}/src/ROSETTA/Grammar/grammarGetChildIndex.macro + ../astNodeList + ) + + + +add_executable(CxxGrammarMetaProgram ${CxxGrammarMetaProgram_SRCS} ${rose_util_src}) + +#build ROSETTA +target_link_libraries(CxxGrammarMetaProgram ${KDE4_KDECORE_LIBS} rose_util_lib) + +#Generate the edg-sage connection using ROSETTA +add_custom_command( + OUTPUT ${ROSETTA_HEADERS} ${ROSETTA_SRC} + PRE_BUILD + COMMAND + ${CMAKE_COMMAND} -E copy_directory ${ROSE_TOP_SRC_DIR}/src/ROSETTA/Grammar ${ROSE_TOP_BINARY_DIR}/src/ROSETTA/Grammar + COMMAND + ${CMAKE_COMMAND} -E make_directory ${ROSE_TOP_BINARY_DIR}/src/frontend/SageIII/astFileIO + + COMMAND CxxGrammarMetaProgram ${ROSE_TOP_BINARY_DIR}/src/frontend/SageIII/ + DEPENDS ${GRAMMAR_SOURCE_FILES} + +# COMMENT "Generating files using ROSETTA" +# DEPENDS ${ROSE_TOP_BINARY_DIR}/src/ROSETTA/Grammar CxxGrammarMetaProgram ${ROSE_TOP_BINARY_DIR}/src/frontend/SageIII/astFileIO +# COMMAND CxxGrammarMetaProgram DEPENDS createSymlink CxxGrammarMetaProgram ${GRAMMAR_SOURCE_FILES} + +) + + + +#add_custom_target( ROSETTA ALL DEPENDS ${GENERATED_HEADERS} ${GENERATED_SRC} COMMENT "Generating files" ) + +add_custom_target( ROSETTA ALL DEPENDS ${ROSETTA_HEADERS} ${ROSETTA_SRC} + ${STORAGECLASSES_SRC} ) +#add_custom_target( ROSETTA ALL DEPENDS copy_ROSETTA COMMENT "Generating files" ) + + + +########### install files ############### +#INSTALL(TARGET ${GENERATED_SRC} ${GENERATED_HEADERS} DESTINATION ${CMAKE_BINARY_DIR}/src/frontend/SageIII/ ) + + + +#original Makefile.am contents follow: + + +# +#INCLUDES = $(ROSE_INCLUDES) +# +#EXTRA_DIST = \ +# ROSETTA_macros.h grammar.h grammarString.h terminal.h +# +## Define the template repository path used in the autoconf +## subsitution for various C++ template control variables. +#CXX_TEMPLATE_REPOSITORY_PATH = . +# +#CXX_GRAMMAR_DIR = $(top_builddir)/src/frontend/SageIII +# +#CXX_PREPROC_CODES = $(CXX_GRAMMAR_DIR)/Cxx_Grammar.h +# +## $(CXX_GRAMMAR_DIR)/Cxx_GrammarCheckingIfDataMembersAreInMemoryPool.C +# +#BUILT_SOURCES = $(CXX_PREPROC_CODES) +# +## The generation of the ROSE Grammars depend upon source code from these files +#GRAMMAR_SOURCE_FILES = \ +# ../Grammar/Statement.code \ +# ../Grammar/grammarClassDefinitionMacros.macro \ +# ../Grammar/grammarVariantFunctionDefinitionMacros.macro \ +# ../Grammar/Common.code \ +# ../Grammar/Support.code \ +# ../Grammar/grammarConstructorDefinitionMacros.macro \ +# ../Grammar/node.macro \ +# ../Grammar/Cxx_GlobalDeclarations.macro \ +# ../Grammar/Symbol.code \ +# ../Grammar/grammarDestructorDefinitionMacros.macro \ +# ../Grammar/parserCode.macro \ +# ../Grammar/Cxx_Support_Header.macro \ +# ../Grammar/Type.code \ +# ../Grammar/grammarIsClassNameFunctionDefinitionMacros.macro \ +# ../Grammar/parserPrototype.macro \ +# ../Grammar/Expression.code \ +# ../Grammar/copyMemberFunction.macro \ +# ../Grammar/grammarMainClassDeclatationMacros.macro \ +# ../Grammar/parserSourceCode.macro \ +# ../Grammar/LocatedNode.code \ +# ../Grammar/dataMemberAccessFunctions.macro \ +# ../Grammar/grammarMainClassParseFunctionSourceCode.macro \ +# ../Grammar/Node.code \ +# ../Grammar/BinaryInstruction.code \ +# ../Grammar/grammarClassDeclarationMacros.macro \ +# ../Grammar/grammarMainClassSourceCodeMacros.macro \ +# ../Grammar/grammarNewDeleteOperatorMacros.macro \ +# ../Grammar/grammarTraverseMemoryPool.macro \ +# ../Grammar/grammarCheckingIfDataMembersAreInMemoryPool.macro \ +# ../Grammar/grammarStorageClassDeclatationMacros.macro \ +# ../Grammar/grammarStorageClassDefinitionMacros.macro \ +# ../Grammar/grammarAST_FileIoHeader.code \ +# ../Grammar/grammarAST_FileIoSource.code \ +# ../Grammar/grammarSourceOfIRNodesAstFileIOSupport.macro \ +# ../Grammar/grammarStaticDataManagingClassHeader.macro \ +# ../Grammar/grammarStaticDataManagingClassStorageClassHeader.macro \ +# ../Grammar/grammarReturnDataMemberPointers.macro \ +# ../Grammar/grammarProcessDataMemberReferenceToPointers.macro \ +# ../Grammar/grammarGetChildIndex.macro \ +# ../astNodeList +# +## DQ (4/6/2006): Removed from Jochen's new version +## ../Grammar/grammarConstructorOfStorageClass.macro +# +# +# +## VALGRIND_OPTIONS = -v --num-callers=12 --leak-check=yes --error-limit=no --show-reachable=yes +#VALGRIND_OPTIONS = --tool=memcheck -v --num-callers=30 --leak-check=no --error-limit=no --show-reachable=yes --trace-children=yes --suppressions=$(top_srcdir)/scripts/rose-suppressions-for-valgrind +## VALGRIND = valgrind $(VALGRIND_OPTIONS) +#VALGRIND = +# +## Build the grammar for generating the C++ preprocessor. +#$(CXX_PREPROC_CODES): CxxGrammarMetaProgram$(EXEEXT) $(GRAMMAR_SOURCE_FILES) +## Build a link so that the executable can find the *.code file in ../Grammar +## rm -f Grammar +## ln -s $(top_srcdir)/src/ROSETTA/Grammar Grammar +# $(VALGRIND) ./CxxGrammarMetaProgram +## Files generated by ROSETTA must now be moved to $(CXX_GRAMMAR_DIR) +# rm -f $(CXX_GRAMMAR_DIR)/Cxx_Grammar.h +# mv Cxx_Grammar.h $(CXX_GRAMMAR_DIR)/Cxx_Grammar.h +# rm -f $(CXX_GRAMMAR_DIR)/Cxx_GrammarMemoryPoolSupport.h +# mv Cxx_GrammarMemoryPoolSupport.h $(CXX_GRAMMAR_DIR)/Cxx_GrammarMemoryPoolSupport.h +# rm -f $(CXX_GRAMMAR_DIR)/Cxx_GrammarMemoryPoolSupport.C +# mv Cxx_GrammarMemoryPoolSupport.C $(CXX_GRAMMAR_DIR)/Cxx_GrammarMemoryPoolSupport.C +# rm -f $(CXX_GRAMMAR_DIR)/AstQueryMemoryPool.h +# mv AstQueryMemoryPool.h $(CXX_GRAMMAR_DIR)/AstQueryMemoryPool.h +# rm -f $(CXX_GRAMMAR_DIR)/Cxx_GrammarReturnClassHierarchySubTree.C +# mv Cxx_GrammarReturnClassHierarchySubTree.C $(CXX_GRAMMAR_DIR)/Cxx_GrammarReturnClassHierarchySubTree.C +# rm -f $(CXX_GRAMMAR_DIR)/Cxx_Grammar.C +# mv Cxx_Grammar.C $(CXX_GRAMMAR_DIR)/Cxx_Grammar.C +# rm -f $(CXX_GRAMMAR_DIR)/Cxx_GrammarTreeTraversal.C +# mv Cxx_GrammarTreeTraversalSuccessorContainer.C $(CXX_GRAMMAR_DIR)/Cxx_GrammarTreeTraversalSuccessorContainer.C +# rm -f $(CXX_GRAMMAR_DIR)/Cxx_GrammarRTI.C +# mv Cxx_GrammarRTI.C $(CXX_GRAMMAR_DIR)/Cxx_GrammarRTI.C +# rm -f $(CXX_GRAMMAR_DIR)/Cxx_GrammarTreeTraversalAccessEnums.h +# mv Cxx_GrammarTreeTraversalAccessEnums.h $(CXX_GRAMMAR_DIR)/Cxx_GrammarTreeTraversalAccessEnums.h +# rm -f $(CXX_GRAMMAR_DIR)/Cxx_GrammarVariantEnumNames.C +# mv Cxx_GrammarVariantEnumNames.C $(CXX_GRAMMAR_DIR)/Cxx_GrammarVariantEnumNames.C +# rm -f $(CXX_GRAMMAR_DIR)/Cxx_GrammarNewAndDeleteOperators.C +# mv Cxx_GrammarNewAndDeleteOperators.C $(CXX_GRAMMAR_DIR)/Cxx_GrammarNewAndDeleteOperators.C +# rm -f $(CXX_GRAMMAR_DIR)/Cxx_GrammarCopyMemberFunctions.C +# mv Cxx_GrammarCopyMemberFunctions.C $(CXX_GRAMMAR_DIR)/Cxx_GrammarCopyMemberFunctions.C +# rm -f $(CXX_GRAMMAR_DIR)/Cxx_GrammarTraverseMemoryPool.C +# mv Cxx_GrammarTraverseMemoryPool.C $(CXX_GRAMMAR_DIR)/Cxx_GrammarTraverseMemoryPool.C +# rm -f $(CXX_GRAMMAR_DIR)/Cxx_GrammarCheckingIfDataMembersAreInMemoryPool.C +# mv Cxx_GrammarCheckingIfDataMembersAreInMemoryPool.C $(CXX_GRAMMAR_DIR)/Cxx_GrammarCheckingIfDataMembersAreInMemoryPool.C +# rm -f $(CXX_GRAMMAR_DIR)/astFileIO/AST_FILE_IO.h +## DQ (10/18/2007): Increase available parallelism by putting large files together so that make -jn is more efficient. +## mv AST_FILE_IO.h $(CXX_GRAMMAR_DIR)/astFileIO/AST_FILE_IO.h +# mv AST_FILE_IO.h $(CXX_GRAMMAR_DIR)/AST_FILE_IO.h +# rm -f $(CXX_GRAMMAR_DIR)/astFileIO/AST_FILE_IO.C +## DQ (10/18/2007): Increase available parallelism by putting large files together so that make -jn is more efficient. +## mv AST_FILE_IO.C $(CXX_GRAMMAR_DIR)/astFileIO/AST_FILE_IO.C +# mv AST_FILE_IO.C $(CXX_GRAMMAR_DIR)/AST_FILE_IO.C +# rm -f $(CXX_GRAMMAR_DIR)/astFileIO/StorageClasses.h +## DQ (10/18/2007): Increase available parallelism by putting large files together so that make -jn is more efficient. +## mv StorageClasses.h $(CXX_GRAMMAR_DIR)/astFileIO/StorageClasses.h +# mv StorageClasses.h $(CXX_GRAMMAR_DIR)/StorageClasses.h +# rm -f $(CXX_GRAMMAR_DIR)/astFileIO/StorageClasses.C +## DQ (10/18/2007): Increase available parallelism by putting large files together so that make -jn is more efficient. +## mv StorageClasses.C $(CXX_GRAMMAR_DIR)/astFileIO/StorageClasses.C +# mv StorageClasses.C $(CXX_GRAMMAR_DIR)/StorageClasses.C +# rm -f $(CXX_GRAMMAR_DIR)/Cxx_GrammarReturnDataMemberPointers.C +# mv Cxx_GrammarReturnDataMemberPointers.C $(CXX_GRAMMAR_DIR)/Cxx_GrammarReturnDataMemberPointers.C +## DQ (4/30/2006): Added support for function to return references to IR nodes pointers +# rm -f $(CXX_GRAMMAR_DIR)/Cxx_GrammarProcessDataMemberReferenceToPointers.C +# mv Cxx_GrammarProcessDataMemberReferenceToPointers.C $(CXX_GRAMMAR_DIR)/Cxx_GrammarProcessDataMemberReferenceToPointers.C +## DQ (4/6/2006): Added from Jochen's multifile I/O support +# rm -f $(CXX_GRAMMAR_DIR)/astFileIO/SourcesOfIRNodesAstFileIOSupport.C +# mv SourcesOfIRNodesAstFileIOSupport.C $(CXX_GRAMMAR_DIR)/astFileIO/SourcesOfIRNodesAstFileIOSupport.C +# rm -f $(CXX_GRAMMAR_DIR)/astFileIO/AstSpecificDataManagingClass.h +# mv AstSpecificDataManagingClass.h $(CXX_GRAMMAR_DIR)/astFileIO/AstSpecificDataManagingClass.h +## DQ (11/7/2006): Added support for new forms of constructors (without source position information) +# rm -f $(CXX_GRAMMAR_DIR)/Cxx_GrammarNewConstructors.C +# mv Cxx_GrammarNewConstructors.C $(CXX_GRAMMAR_DIR)/Cxx_GrammarNewConstructors.C +## DQ (3/8/2007): Added support for getChildIndex function +# rm -f $(CXX_GRAMMAR_DIR)/Cxx_GrammarGetChildIndex.C +# mv Cxx_GrammarGetChildIndex.C $(CXX_GRAMMAR_DIR)/Cxx_GrammarGetChildIndex.C +# +#noinst_PROGRAMS = CxxGrammarMetaProgram +#CxxGrammarMetaProgram_SOURCES = \ +# CxxGrammarMetaProgram.C \ +# grammar.C \ +# grammarString.C \ +# terminal.C \ +# type.C \ +# symbol.C \ +# expression.C \ +# statement.C \ +# support.C \ +# binaryInstruction.C \ +# storageSize.C \ +# visitorSupport.C \ +# poolBasedTraversal.C \ +# node.C \ +# buildAstFileIO.C \ +# buildStorageClasses.C \ +# buildConstructorsWithoutSourcePositionInformation.C \ +# outputClassesAndFields.C +# +## buildConstructorsWithoutSourcePositionInformation.o: buildConstructorsWithoutSourcePositionInformation.C +# +#CxxGrammarMetaProgram_LDADD = $(top_builddir)/src/util/libroseutil.la +# +## DQ (9/11/2008): +## The rose_paths.c is built in ROSE/src/util and this dependence causes +## ROSE to rebuild a lot of code each time configure is rerun. Let's see +## if this can be make a little more tolerable for those without larger +## computers working on ROSE (e.g. students). +## CxxGrammarMetaProgram_DEPENDENCIES = $(CxxGrammarMetaProgram_LDADD) +## CxxGrammarMetaProgram_DEPENDENCIES = +## CxxGrammarMetaProgram_DEPENDENCIES = $(CxxGrammarMetaProgram_SOURCES) +# +# +## DQ (7/8/2005): Avoid building Sage III when util changes! +## $(top_builddir)/util/libroseutil.so: +## cd $(top_builddir)/util; $(MAKE) +# +# +## Force recompilation of source files if any of the header files +## are changed (does not work if *.o files are not present). +#$(librosetta_a_OBJECTS): ROSETTA_macros.h grammar.h grammarString.h terminal.h +# +#clean-local: +# rm -rf $(CXX_TEMPLATE_OBJECTS) Templates.DB ii_files ti_files cxx_templates Cxx_Grammar* grammar.dot translationSupport.code +# +#distclean-local: +# rm -rf Cxx_Grammar.h Cxx_Grammar.C Cxx_GrammarTreeTraversal.C Cxx_GrammarTreeTraversalClass.h \ +# Cxx_GrammarTreeTraversalClass.C +# rm -rf grammar.tex grammar.dot +# +# +# +# +# +# +# +# +# +# +# +# +# +# +# +# diff --git a/src/ROSETTA/src/CxxGrammarMetaProgram.C b/src/ROSETTA/src/CxxGrammarMetaProgram.C index 823c0364b3..2f5c697e8d 100644 --- a/src/ROSETTA/src/CxxGrammarMetaProgram.C +++ b/src/ROSETTA/src/CxxGrammarMetaProgram.C @@ -53,10 +53,18 @@ main(int argc, char * argv[]) // First build the C++ grammar + std::string target_directory = "."; + if(argc == 2) + target_directory = std::string(argv[1]); + + // For base level grammar use prefix "Sg" to be compatable with SAGE Grammar sageGrammar ( /* name of grammar */ "Cxx_Grammar", /* Prefix to names */ "Sg", - /* Parent Grammar */ "ROSE_BaseGrammar"); + /* Parent Grammar */ "ROSE_BaseGrammar", + /* No parent Grammar */ NULL, + target_directory + ); // Build the header files and source files representing the // grammar's implementation diff --git a/src/ROSETTA/src/Makefile.am b/src/ROSETTA/src/Makefile.am index 41d688c03b..ff090a6475 100644 --- a/src/ROSETTA/src/Makefile.am +++ b/src/ROSETTA/src/Makefile.am @@ -75,68 +75,7 @@ $(CXX_PREPROC_CODES): CxxGrammarMetaProgram$(EXEEXT) $(GRAMMAR_SOURCE_FILES) # Build a link so that the executable can find the *.code file in ../Grammar # rm -f Grammar # ln -s $(top_srcdir)/src/ROSETTA/Grammar Grammar - $(VALGRIND) ./CxxGrammarMetaProgram -# Files generated by ROSETTA must now be moved to $(CXX_GRAMMAR_DIR) - rm -f $(CXX_GRAMMAR_DIR)/Cxx_Grammar.h - mv Cxx_Grammar.h $(CXX_GRAMMAR_DIR)/Cxx_Grammar.h - rm -f $(CXX_GRAMMAR_DIR)/Cxx_GrammarMemoryPoolSupport.h - mv Cxx_GrammarMemoryPoolSupport.h $(CXX_GRAMMAR_DIR)/Cxx_GrammarMemoryPoolSupport.h - rm -f $(CXX_GRAMMAR_DIR)/Cxx_GrammarMemoryPoolSupport.C - mv Cxx_GrammarMemoryPoolSupport.C $(CXX_GRAMMAR_DIR)/Cxx_GrammarMemoryPoolSupport.C - rm -f $(CXX_GRAMMAR_DIR)/AstQueryMemoryPool.h - mv AstQueryMemoryPool.h $(CXX_GRAMMAR_DIR)/AstQueryMemoryPool.h - rm -f $(CXX_GRAMMAR_DIR)/Cxx_GrammarReturnClassHierarchySubTree.C - mv Cxx_GrammarReturnClassHierarchySubTree.C $(CXX_GRAMMAR_DIR)/Cxx_GrammarReturnClassHierarchySubTree.C - rm -f $(CXX_GRAMMAR_DIR)/Cxx_Grammar.C - mv Cxx_Grammar.C $(CXX_GRAMMAR_DIR)/Cxx_Grammar.C - rm -f $(CXX_GRAMMAR_DIR)/Cxx_GrammarTreeTraversal.C - mv Cxx_GrammarTreeTraversalSuccessorContainer.C $(CXX_GRAMMAR_DIR)/Cxx_GrammarTreeTraversalSuccessorContainer.C - rm -f $(CXX_GRAMMAR_DIR)/Cxx_GrammarRTI.C - mv Cxx_GrammarRTI.C $(CXX_GRAMMAR_DIR)/Cxx_GrammarRTI.C - rm -f $(CXX_GRAMMAR_DIR)/Cxx_GrammarTreeTraversalAccessEnums.h - mv Cxx_GrammarTreeTraversalAccessEnums.h $(CXX_GRAMMAR_DIR)/Cxx_GrammarTreeTraversalAccessEnums.h - rm -f $(CXX_GRAMMAR_DIR)/Cxx_GrammarVariantEnumNames.C - mv Cxx_GrammarVariantEnumNames.C $(CXX_GRAMMAR_DIR)/Cxx_GrammarVariantEnumNames.C - rm -f $(CXX_GRAMMAR_DIR)/Cxx_GrammarNewAndDeleteOperators.C - mv Cxx_GrammarNewAndDeleteOperators.C $(CXX_GRAMMAR_DIR)/Cxx_GrammarNewAndDeleteOperators.C - rm -f $(CXX_GRAMMAR_DIR)/Cxx_GrammarCopyMemberFunctions.C - mv Cxx_GrammarCopyMemberFunctions.C $(CXX_GRAMMAR_DIR)/Cxx_GrammarCopyMemberFunctions.C - rm -f $(CXX_GRAMMAR_DIR)/Cxx_GrammarTraverseMemoryPool.C - mv Cxx_GrammarTraverseMemoryPool.C $(CXX_GRAMMAR_DIR)/Cxx_GrammarTraverseMemoryPool.C - rm -f $(CXX_GRAMMAR_DIR)/Cxx_GrammarCheckingIfDataMembersAreInMemoryPool.C - mv Cxx_GrammarCheckingIfDataMembersAreInMemoryPool.C $(CXX_GRAMMAR_DIR)/Cxx_GrammarCheckingIfDataMembersAreInMemoryPool.C - rm -f $(CXX_GRAMMAR_DIR)/astFileIO/AST_FILE_IO.h -# DQ (10/18/2007): Increase available parallelism by putting large files together so that make -jn is more efficient. -# mv AST_FILE_IO.h $(CXX_GRAMMAR_DIR)/astFileIO/AST_FILE_IO.h - mv AST_FILE_IO.h $(CXX_GRAMMAR_DIR)/AST_FILE_IO.h - rm -f $(CXX_GRAMMAR_DIR)/astFileIO/AST_FILE_IO.C -# DQ (10/18/2007): Increase available parallelism by putting large files together so that make -jn is more efficient. -# mv AST_FILE_IO.C $(CXX_GRAMMAR_DIR)/astFileIO/AST_FILE_IO.C - mv AST_FILE_IO.C $(CXX_GRAMMAR_DIR)/AST_FILE_IO.C - rm -f $(CXX_GRAMMAR_DIR)/astFileIO/StorageClasses.h -# DQ (10/18/2007): Increase available parallelism by putting large files together so that make -jn is more efficient. -# mv StorageClasses.h $(CXX_GRAMMAR_DIR)/astFileIO/StorageClasses.h - mv StorageClasses.h $(CXX_GRAMMAR_DIR)/StorageClasses.h - rm -f $(CXX_GRAMMAR_DIR)/astFileIO/StorageClasses.C -# DQ (10/18/2007): Increase available parallelism by putting large files together so that make -jn is more efficient. -# mv StorageClasses.C $(CXX_GRAMMAR_DIR)/astFileIO/StorageClasses.C - mv StorageClasses.C $(CXX_GRAMMAR_DIR)/StorageClasses.C - rm -f $(CXX_GRAMMAR_DIR)/Cxx_GrammarReturnDataMemberPointers.C - mv Cxx_GrammarReturnDataMemberPointers.C $(CXX_GRAMMAR_DIR)/Cxx_GrammarReturnDataMemberPointers.C -# DQ (4/30/2006): Added support for function to return references to IR nodes pointers - rm -f $(CXX_GRAMMAR_DIR)/Cxx_GrammarProcessDataMemberReferenceToPointers.C - mv Cxx_GrammarProcessDataMemberReferenceToPointers.C $(CXX_GRAMMAR_DIR)/Cxx_GrammarProcessDataMemberReferenceToPointers.C -# DQ (4/6/2006): Added from Jochen's multifile I/O support - rm -f $(CXX_GRAMMAR_DIR)/astFileIO/SourcesOfIRNodesAstFileIOSupport.C - mv SourcesOfIRNodesAstFileIOSupport.C $(CXX_GRAMMAR_DIR)/astFileIO/SourcesOfIRNodesAstFileIOSupport.C - rm -f $(CXX_GRAMMAR_DIR)/astFileIO/AstSpecificDataManagingClass.h - mv AstSpecificDataManagingClass.h $(CXX_GRAMMAR_DIR)/astFileIO/AstSpecificDataManagingClass.h -# DQ (11/7/2006): Added support for new forms of constructors (without source position information) - rm -f $(CXX_GRAMMAR_DIR)/Cxx_GrammarNewConstructors.C - mv Cxx_GrammarNewConstructors.C $(CXX_GRAMMAR_DIR)/Cxx_GrammarNewConstructors.C -# DQ (3/8/2007): Added support for getChildIndex function - rm -f $(CXX_GRAMMAR_DIR)/Cxx_GrammarGetChildIndex.C - mv Cxx_GrammarGetChildIndex.C $(CXX_GRAMMAR_DIR)/Cxx_GrammarGetChildIndex.C + $(VALGRIND) ./CxxGrammarMetaProgram ${top_builddir}/src/frontend/SageIII/ noinst_PROGRAMS = CxxGrammarMetaProgram CxxGrammarMetaProgram_SOURCES = \ diff --git a/src/ROSETTA/src/buildAstFileIO.C b/src/ROSETTA/src/buildAstFileIO.C index bba0fe0f18..40bfa53f62 100644 --- a/src/ROSETTA/src/buildAstFileIO.C +++ b/src/ROSETTA/src/buildAstFileIO.C @@ -27,7 +27,7 @@ Grammar::generateAST_FILE_IOFiles() * methods and variables are static, since the memory pools, we the * class has to work on are static, as well. */ - fstream AST_FILE_IO_HeaderFile ("AST_FILE_IO.h",ios::out) ; + fstream AST_FILE_IO_HeaderFile ( std::string(target_directory+"/AST_FILE_IO.h").c_str(),ios::out) ; std::cout << "Building AST_FILE_IO.h" << std::flush; string header_AST_FILE_IO_CLASS = build_header_AST_FILE_IO_CLASS () ; AST_FILE_IO_HeaderFile << header_AST_FILE_IO_CLASS ; @@ -37,7 +37,7 @@ Grammar::generateAST_FILE_IOFiles() * Hereby, the static member functions are defined and the static * data becomes allocated. */ - fstream AST_FILE_IO_SourceFile ("AST_FILE_IO.C",ios::out) ; + fstream AST_FILE_IO_SourceFile ( std::string(target_directory+"/AST_FILE_IO.C").c_str(),ios::out) ; std::cout << "Building AST_FILE_IO.C" << std::flush; string source_AST_FILE_IO_CLASS = build_source_AST_FILE_IO_CLASS () ; AST_FILE_IO_SourceFile << source_AST_FILE_IO_CLASS ; diff --git a/src/ROSETTA/src/buildStorageClasses.C b/src/ROSETTA/src/buildStorageClasses.C index 1d3240b66d..eb851b4fff 100644 --- a/src/ROSETTA/src/buildStorageClasses.C +++ b/src/ROSETTA/src/buildStorageClasses.C @@ -382,7 +382,7 @@ Grammar::generateStorageClassesFiles() { // Building the file StorageClasses.h - ofstream AstSpecificDataHeaderFile ("AstSpecificDataManagingClass.h") ; + ofstream AstSpecificDataHeaderFile ( std::string(target_directory+"/astFileIO/AstSpecificDataManagingClass.h").c_str()) ; std::cout << "Building StorageClasses header" << std::flush; StringUtility::FileWithLineNumbers readFromFile = readFileWithPos("../Grammar/grammarStaticDataManagingClassHeader.macro"); std::string dataMembers = buildStaticDataMemberListClassEntries(*rootNode); @@ -413,7 +413,7 @@ Grammar::generateStorageClassesFiles() readFromFile = GrammarString::copyEdit(readFromFile,"$REPLACE_STORAGECLASSDATAMEMBERS", dataMembersStorageClass.c_str() ); StorageClassHeaderFile += readFromFile; buildStorageClassHeaderFiles(*rootNode,StorageClassHeaderFile); - Grammar::writeFile(StorageClassHeaderFile, ".", "StorageClasses", ".h"); + Grammar::writeFile(StorageClassHeaderFile, target_directory, "StorageClasses", ".h"); std::cout << "... done " << std::endl; // Building the file StorageClasses.C @@ -513,7 +513,7 @@ Grammar::generateStorageClassesFiles() StorageClassSourceFile << "\n\n"; StorageClassSourceFile << "#endif // STORAGE_CLASSES_H\n"; - Grammar::writeFile(StorageClassSourceFile, ".", "StorageClasses", ".C"); + Grammar::writeFile(StorageClassSourceFile, target_directory, "StorageClasses", ".C"); std::cout << "... done " << std::endl; return; } diff --git a/src/ROSETTA/src/grammar.C b/src/ROSETTA/src/grammar.C index f69f9c2728..e3255049c6 100644 --- a/src/ROSETTA/src/grammar.C +++ b/src/ROSETTA/src/grammar.C @@ -53,7 +53,8 @@ Grammar::Grammar () Grammar::Grammar ( const string& inputGrammarName, const string& inputPrefixName, const string& inputGrammarNameBaseClass, - const Grammar* inputParentGrammar ) + const Grammar* inputParentGrammar, + const string& t_directory) { // The constructor builds a grammar. The inputs are strings: // inputGrammarName -- The name of the grammar (used in the construction of filenames etc.) @@ -66,6 +67,7 @@ Grammar::Grammar ( const string& inputGrammarName, // Intialize some member data // By default the parent grammar is not known + target_directory = t_directory; parentGrammar = NULL; // We want to set the parent grammar as early as possible since the specification of terminals/nonterminals is @@ -126,6 +128,8 @@ Grammar::Grammar ( const string& inputGrammarName, this->astVariantToNodeMap[c] = name; ++c; } + if( !astNodeList.eof() ) + std::cout << "We have the path " << ROSE_AUTOMAKE_ABSOLUTE_PATH_TOP_SRCDIR << std::endl; ROSE_ASSERT (astNodeList.eof()); astNodeList.close(); } @@ -2512,7 +2516,7 @@ Grammar::buildCode () StringUtility::FileWithLineNumbers miscSupport = buildMiscSupportDeclarations (); ROSE_ArrayGrammarHeaderFile += miscSupport; - Grammar::writeFile(ROSE_ArrayGrammarHeaderFile, ".", getGrammarName(), ".h"); + Grammar::writeFile(ROSE_ArrayGrammarHeaderFile, target_directory, getGrammarName(), ".h"); #if 1 // AST SOURCE FILE GENERATION StringUtility::FileWithLineNumbers ROSE_ArrayGrammarSourceFile; @@ -2556,7 +2560,7 @@ Grammar::buildCode () string memoryPoolTraversalSupport = buildMemoryPoolBasedTraversalSupport(); ROSE_ArrayGrammarSourceFile.push_back(StringUtility::StringWithLineNumber(memoryPoolTraversalSupport, "", 1)); - Grammar::writeFile(ROSE_ArrayGrammarSourceFile, ".", getGrammarName(), ".C"); + Grammar::writeFile(ROSE_ArrayGrammarSourceFile, target_directory, getGrammarName(), ".C"); #endif @@ -2582,8 +2586,8 @@ Grammar::buildCode () // ROSE_ASSERT(false); // DQ(10/22/2007): fixed missed variable renaming. - // Grammar::writeFile(ROSE_ArrayGrammarSourceFile, ".", getGrammarName() + "NewAndDeleteOperators", ".C"); - Grammar::writeFile(ROSE_NewAndDeleteOperatorSourceFile, ".", getGrammarName() + "NewAndDeleteOperators", ".C"); + // Grammar::writeFile(ROSE_ArrayGrammarSourceFile, target_directory, getGrammarName() + "NewAndDeleteOperators", ".C"); + Grammar::writeFile(ROSE_NewAndDeleteOperatorSourceFile, target_directory, getGrammarName() + "NewAndDeleteOperators", ".C"); #endif @@ -2603,7 +2607,7 @@ Grammar::buildCode () // printf ("Exiting after building traverse memory pool functions \n"); // ROSE_ASSERT(false); - Grammar::writeFile(ROSE_TraverseMemoryPoolSourceFile, ".", getGrammarName() + "TraverseMemoryPool", ".C"); + Grammar::writeFile(ROSE_TraverseMemoryPoolSourceFile, target_directory, getGrammarName() + "TraverseMemoryPool", ".C"); #endif @@ -2623,7 +2627,7 @@ Grammar::buildCode () // printf ("Exiting after building code to check data members which are pointers to IR nodes \n"); // ROSE_ASSERT(false); - Grammar::writeFile(ROSE_CheckingIfDataMembersAreInMemoryPoolSourceFile, ".", getGrammarName() + "CheckingIfDataMembersAreInMemoryPool", ".C"); + Grammar::writeFile(ROSE_CheckingIfDataMembersAreInMemoryPoolSourceFile, target_directory, getGrammarName() + "CheckingIfDataMembersAreInMemoryPool", ".C"); #endif #if 1 @@ -2632,7 +2636,7 @@ Grammar::buildCode () // generate code for return a list of variants in the class hierarchy subtree // -------------------------------------------- string returnClassHierarchySubTreeFileName = string(getGrammarName()) + "ReturnClassHierarchySubTree.C"; - fstream ROSE_returnClassHierarchySubTreeSourceFile(returnClassHierarchySubTreeFileName.c_str(),ios::out); + fstream ROSE_returnClassHierarchySubTreeSourceFile(std::string(target_directory+"/"+returnClassHierarchySubTreeFileName).c_str(),ios::out); ROSE_ASSERT (ROSE_returnClassHierarchySubTreeSourceFile.good() == true); ROSE_returnClassHierarchySubTreeSourceFile << includeHeaderString; @@ -2653,7 +2657,7 @@ Grammar::buildCode () // generate code for return a list of variants in the class hierarchy subtree // -------------------------------------------- string memoryPoolTraversalFileName = "AstQueryMemoryPool.h"; - fstream ROSE_memoryPoolTraversalSourceFile(memoryPoolTraversalFileName.c_str(),ios::out); + fstream ROSE_memoryPoolTraversalSourceFile(std::string(target_directory+"/"+ memoryPoolTraversalFileName).c_str(),ios::out); ROSE_ASSERT (ROSE_memoryPoolTraversalSourceFile.good() == true); // Now build the source code for the terminals and non-terminals in the grammar @@ -2684,7 +2688,7 @@ Grammar::buildCode () // printf ("Exiting after building code to return data members which are pointers to IR nodes \n"); // ROSE_ASSERT(false); - Grammar::writeFile(ROSE_ReturnDataMemberPointersSourceFile, ".", getGrammarName() + "ReturnDataMemberPointers", ".C"); + Grammar::writeFile(ROSE_ReturnDataMemberPointersSourceFile, target_directory, getGrammarName() + "ReturnDataMemberPointers", ".C"); #endif #if 1 @@ -2702,7 +2706,7 @@ Grammar::buildCode () // printf ("Exiting after building code to return references data members which are pointers to IR nodes \n"); // ROSE_ASSERT(false); - Grammar::writeFile(ROSE_ProcessDataMemberReferenceToPointersSourceFile, ".", getGrammarName() + "ProcessDataMemberReferenceToPointers", ".C"); + Grammar::writeFile(ROSE_ProcessDataMemberReferenceToPointersSourceFile, target_directory, getGrammarName() + "ProcessDataMemberReferenceToPointers", ".C"); #endif #if 1 @@ -2722,7 +2726,7 @@ Grammar::buildCode () // printf ("Exiting after building code to get the child index from any IR node \n"); // ROSE_ASSERT(false); - Grammar::writeFile(ROSE_GetChildIndexSourceFile, ".", getGrammarName() + "GetChildIndex", ".C"); + Grammar::writeFile(ROSE_GetChildIndexSourceFile, target_directory, getGrammarName() + "GetChildIndex", ".C"); #endif #if 1 @@ -2740,7 +2744,7 @@ Grammar::buildCode () // printf ("Exiting after copy member functions \n"); // ROSE_ASSERT(false); - Grammar::writeFile(ROSE_CopyMemberFunctionsSourceFile, ".", getGrammarName() + "CopyMemberFunctions", ".C"); + Grammar::writeFile(ROSE_CopyMemberFunctionsSourceFile, target_directory, getGrammarName() + "CopyMemberFunctions", ".C"); #endif @@ -2758,7 +2762,7 @@ Grammar::buildCode () // Generate the implementations of the tree traversal functions buildTreeTraversalFunctions(*rootNode, ROSE_treeTraversalFunctionsSourceFile); cout << "DONE: buildTreeTraversalFunctions()" << endl; - Grammar::writeFile(ROSE_treeTraversalFunctionsSourceFile, ".", getGrammarName() + "TreeTraversalSuccessorContainer", ".C"); + Grammar::writeFile(ROSE_treeTraversalFunctionsSourceFile, target_directory, getGrammarName() + "TreeTraversalSuccessorContainer", ".C"); //--------------------------------------------------------------------------------------------- // generate what is necessary for SAGE support in AstProcessing classes @@ -2766,7 +2770,7 @@ Grammar::buildCode () cout << "building TreeTraversalAccessEnums ... "; string treeTraversalClassHeaderFileName = getGrammarName(); treeTraversalClassHeaderFileName += "TreeTraversalAccessEnums.h"; - ofstream ROSE_treeTraversalClassHeaderFile(treeTraversalClassHeaderFileName.c_str()); + ofstream ROSE_treeTraversalClassHeaderFile(string(target_directory+"/"+treeTraversalClassHeaderFileName).c_str()); ROSE_ASSERT (ROSE_treeTraversalClassHeaderFile.good() == true); ROSE_treeTraversalClassHeaderFile << "// GENERATED HEADER FILE --- DO NOT MODIFY!" << endl << endl; @@ -2776,7 +2780,7 @@ Grammar::buildCode () // MS: not really needed because of typeid(node).name() // MS: generation of VariantName Strings string variantEnumNamesFileName = string(getGrammarName())+"VariantEnumNames.C"; - ofstream variantEnumNamesFile(variantEnumNamesFileName.c_str()); + ofstream variantEnumNamesFile(string(target_directory+"/"+variantEnumNamesFileName).c_str()); ROSE_ASSERT(variantEnumNamesFile.good() == true); string variantEnumNames=buildVariantEnumNames(); @@ -2792,7 +2796,7 @@ Grammar::buildCode () buildRTIFile(rootNode, rtiFile); cout << "DONE: buildRTIFile" << endl; - Grammar::writeFile(rtiFile, ".", getGrammarName() + "RTI", ".C"); + Grammar::writeFile(rtiFile, target_directory, getGrammarName() + "RTI", ".C"); #if 0 // DQ (11/27/2005): Support for renaming transformations for ROSE project @@ -2825,7 +2829,7 @@ Grammar::buildCode () // printf ("Exiting after building traverse memory pool functions \n"); // ROSE_ASSERT(false); - Grammar::writeFile(ROSE_ConstructorTakingStorageClassSourceFile, ".", "SourcesOfIRNodesAstFileIOSupport", ".C"); + Grammar::writeFile(ROSE_ConstructorTakingStorageClassSourceFile, target_directory+"/astFileIO/", "SourcesOfIRNodesAstFileIOSupport", ".C"); #endif #if 1 // -------------------------------------------- @@ -2836,7 +2840,7 @@ Grammar::buildCode () ROSE_ASSERT (rootNode != NULL); buildStringForMemoryPoolSupport(rootNode,ROSE_MemoryPoolSupportFile); cout << "DONE: buildStringForMemoryPoolSupport()" << endl; - Grammar::writeFile(ROSE_MemoryPoolSupportFile, ".", getGrammarName() + "MemoryPoolSupport", ".h"); + Grammar::writeFile(ROSE_MemoryPoolSupportFile, target_directory, getGrammarName() + "MemoryPoolSupport", ".h"); // -------------------------------------------- // generate code for memory pool support source // -------------------------------------------- @@ -2845,7 +2849,7 @@ Grammar::buildCode () ROSE_ASSERT (rootNode != NULL); buildStringForMemoryPoolSupportSource(rootNode,ROSE_MemoryPoolSupportFile); cout << "DONE: buildStringForMemoryPoolSupportSource()" << endl; - Grammar::writeFile(ROSE_MemoryPoolSupportFile, ".", getGrammarName() + "MemoryPoolSupport", ".C"); + Grammar::writeFile(ROSE_MemoryPoolSupportFile, target_directory, getGrammarName() + "MemoryPoolSupport", ".C"); #endif ///////////////////////////////////////////////////////////////////////////////////////////// @@ -2882,12 +2886,12 @@ Grammar::buildCode () // printf ("Exiting after building code for new constructors without source position information \n"); // ROSE_ASSERT(false); - Grammar::writeFile(ROSE_NewConstructorsSourceFile, ".", getGrammarName() + "NewConstructors", ".C"); + Grammar::writeFile(ROSE_NewConstructorsSourceFile, target_directory, getGrammarName() + "NewConstructors", ".C"); #endif #if 1 string outputClassesAndFieldsSourceFileName = string(getGrammarName()) + "ClassesAndFields.txt"; - ofstream ROSE_outputClassesAndFieldsSourceFile(outputClassesAndFieldsSourceFileName.c_str()); + ofstream ROSE_outputClassesAndFieldsSourceFile(string(target_directory+"/"+outputClassesAndFieldsSourceFileName).c_str()); ROSE_ASSERT (ROSE_outputClassesAndFieldsSourceFile.good() == true); printf ("Calling outputClassesAndFields() \n"); diff --git a/src/ROSETTA/src/grammar.h b/src/ROSETTA/src/grammar.h index bb01b10c7b..bb0cd4afcf 100644 --- a/src/ROSETTA/src/grammar.h +++ b/src/ROSETTA/src/grammar.h @@ -170,6 +170,9 @@ class Grammar std::map astVariantToNodeMap; std::map astVariantToTerminalMap; + //The directory name we should generate the files to + std::string target_directory; + Terminal* rootNode; // This is a pointer to the lower level grammar (every grammar has a lower level grammar except the C++ grammar) @@ -236,7 +239,8 @@ class Grammar Grammar ( const std::string& inputGrammarName, const std::string& inputPrefixName, const std::string& inputGrammarNameBaseClass = "ROSE_BaseGrammar", - const Grammar* parentGrammar = NULL ); + const Grammar* parentGrammar = NULL, + const std::string& t_directory = ""); std::string grammarName; std::string grammarPrefixName; diff --git a/src/backend/CMakeLists.txt b/src/backend/CMakeLists.txt new file mode 100644 index 0000000000..4da505f85c --- /dev/null +++ b/src/backend/CMakeLists.txt @@ -0,0 +1,17 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + +add_subdirectory(unparser) +add_subdirectory(asmUnparser) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +#include ../../config/Makefile.for.ROSE.includes.and.libs +# +#SUBDIRS = unparser asmUnparser diff --git a/src/backend/asmUnparser/CMakeLists.txt b/src/backend/asmUnparser/CMakeLists.txt new file mode 100644 index 0000000000..4fa4a97f2f --- /dev/null +++ b/src/backend/asmUnparser/CMakeLists.txt @@ -0,0 +1,33 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + +set( roseAsmUnparser_SRC + unparseX86Asm.C unparseArmAsm.C unparsePowerpcAsm.C unparseAsm.C + ) + +add_library( roseAsmUnparser ${roseAsmUnparser_SRC} ) +add_dependencies( roseAsmUnparser ROSETTA ) +########### install files ############### + +install(FILES unparseAsm.h DESTINATION src/frontend/PHPFrontend/CMakeLists.txt ) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#INCLUDES = $(ROSE_INCLUDES) +# +## This will cause the dynamic library to be built (as libroseDisassemblers.so) +#noinst_LTLIBRARIES = libroseAsmUnparser.la +# +#libroseAsmUnparser_la_DEPENDENCIES = +#libroseAsmUnparser_la_SOURCES = unparseX86Asm.C unparseArmAsm.C unparsePowerpcAsm.C unparseAsm.C +# +#dist_include_HEADERS = unparseAsm.h +# +#include_HEADERS = diff --git a/src/backend/unparser/CMakeLists.txt b/src/backend/unparser/CMakeLists.txt new file mode 100644 index 0000000000..24a0e581fe --- /dev/null +++ b/src/backend/unparser/CMakeLists.txt @@ -0,0 +1,74 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + +add_subdirectory(CxxCodeGeneration) +add_subdirectory(FortranCodeGeneration) +add_subdirectory(PHPCodeGeneration) +add_subdirectory(languageIndependenceSupport) +add_subdirectory(formatSupport) + + +########### next target ############### + +set( unparser_SRC + ./FortranCodeGeneration/unparseFortran_expressions.C + ./FortranCodeGeneration/unparseFortran_modfile.C + ./FortranCodeGeneration/unparseFortran_statements.C + ./FortranCodeGeneration/unparseFortran_types.C + ./CxxCodeGeneration/unparseCxx_types.C + ./CxxCodeGeneration/unparseCxx_expressions.C + ./CxxCodeGeneration/unparseCxx_statements.C +# ./copy_unparser.C + ./astUnparseAttribute.C + ./unparser.C + ./unparse_sym.C + ./formatSupport/unparseFormatHelp.C + ./formatSupport/unparse_format.C + ./PHPCodeGeneration/unparsePHP.C + ./languageIndependenceSupport/modified_sage_isUnaryOp.C + ./languageIndependenceSupport/unparser_opt.C + ./languageIndependenceSupport/modified_sage.C + ./languageIndependenceSupport/name_qualification_support.C + ./languageIndependenceSupport/unparse_debug.C + ./languageIndependenceSupport/unparseLanguageIndependentConstructs.C + ) + +add_library(unparser ${unparser_SRC}) +add_dependencies( unparser ROSETTA ) +########### install files ############### + +install(FILES $(unparser_headers) DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +## SUBDIRS = CxxCodeGeneration languageIndependenceSupport formatSupport +#SUBDIRS = CxxCodeGeneration FortranCodeGeneration PHPCodeGeneration languageIndependenceSupport formatSupport +# +#INCLUDES = $(ROSE_INCLUDES) +# +## unparser_headers = copy_unparser.h unparser.h unparse_sym.h +#unparser_headers = unparser.h unparse_sym.h astUnparseAttribute.h +#unparser_sources = $(unparser_headers:.h=.C) +# +#noinst_LTLIBRARIES = libunparse.la +# +#libunparse_la_SOURCES = $(unparser_sources) $(unparser_headers) +#libunparse_la_LIBADD = +# +## formatSupport/libunparseFormatSupport.la +## languageIndependenceSupport/libunparseLanguageIndependenceSupport.la +## CxxCodeGeneration/libunparseCxx.la +## FortranCodeGeneration/libunparseFortran.la +# +#include_HEADERS = $(unparser_headers) +# +#clean-local: +# rm -rf Templates.DB ii_files ti_files core +# +#EXTRA_DIST = unparser.docs +# +## eof diff --git a/src/backend/unparser/CxxCodeGeneration/CMakeLists.txt b/src/backend/unparser/CxxCodeGeneration/CMakeLists.txt new file mode 100644 index 0000000000..d51633faca --- /dev/null +++ b/src/backend/unparser/CxxCodeGeneration/CMakeLists.txt @@ -0,0 +1,32 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + +install(FILES $(unparseCxxCodeGeneration_headers) DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#INCLUDES = $(ROSE_INCLUDES) +# +#unparseCxxCodeGeneration_headers = unparseCxx.h unparseCxx_types.h +# +#unparseCxxCodeGeneration_sources = unparseCxx_expressions.C unparseCxx_statements.C unparseCxx_types.C +# +#include_HEADERS = $(unparseCxxCodeGeneration_headers) +# +#noinst_LTLIBRARIES = libunparseCxx.la +# +#libunparseCxx_la_SOURCES = $(unparseCxxCodeGeneration_sources) +# +#clean-local: +# rm -rf ii_files ti_files core +# diff --git a/src/backend/unparser/FortranCodeGeneration/CMakeLists.txt b/src/backend/unparser/FortranCodeGeneration/CMakeLists.txt new file mode 100644 index 0000000000..921406a6a2 --- /dev/null +++ b/src/backend/unparser/FortranCodeGeneration/CMakeLists.txt @@ -0,0 +1,30 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + +install(FILES $(unparseFortranCodeGeneration_headers) DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#INCLUDES = $(ROSE_INCLUDES) +# +#unparseFortranCodeGeneration_headers = unparseFortran.h unparseFortran_types.h unparseFortran_modfile.h +#unparseFortranCodeGeneration_sources = unparseFortran_expressions.C unparseFortran_statements.C unparseFortran_types.C unparseFortran_modfile.C +# +#include_HEADERS = $(unparseFortranCodeGeneration_headers) +# +#noinst_LTLIBRARIES = libunparseFortran.la +# +#libunparseFortran_la_SOURCES = $(unparseFortranCodeGeneration_sources) +# +#clean-local: +# rm -rf ii_files ti_files core diff --git a/src/backend/unparser/PHPCodeGeneration/CMakeLists.txt b/src/backend/unparser/PHPCodeGeneration/CMakeLists.txt new file mode 100644 index 0000000000..bf50d80e7f --- /dev/null +++ b/src/backend/unparser/PHPCodeGeneration/CMakeLists.txt @@ -0,0 +1,32 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + +install(FILES $(unparsePHPCodeGeneration_headers) DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#INCLUDES = $(ROSE_INCLUDES) +# +#unparsePHPCodeGeneration_headers = unparsePHP.h +# +#unparsePHPCodeGeneration_sources = unparsePHP.C +# +#include_HEADERS = $(unparsePHPCodeGeneration_headers) +# +#noinst_LTLIBRARIES = libunparsePHP.la +# +#libunparsePHP_la_SOURCES = $(unparsePHPCodeGeneration_sources) +# +#clean-local: +# rm -rf ii_files ti_files core +# diff --git a/src/backend/unparser/formatSupport/CMakeLists.txt b/src/backend/unparser/formatSupport/CMakeLists.txt new file mode 100644 index 0000000000..d931f26ba0 --- /dev/null +++ b/src/backend/unparser/formatSupport/CMakeLists.txt @@ -0,0 +1,31 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + +install(FILES $(unparseFormat_headers) DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#INCLUDES = $(ROSE_INCLUDES) +# +#unparseFormat_headers = unparse_format.h unparseFormatHelp.h +#unparseFormat_sources = $(unparseFormat_headers:.h=.C) +# +#include_HEADERS = $(unparseFormat_headers) +# +#noinst_LTLIBRARIES = libunparseFormatSupport.la +# +#libunparseFormatSupport_la_SOURCES = $(unparseFormat_sources) +# +#clean-local: +# rm -rf Templates.DB ii_files ti_files core +# diff --git a/src/backend/unparser/languageIndependenceSupport/CMakeLists.txt b/src/backend/unparser/languageIndependenceSupport/CMakeLists.txt new file mode 100644 index 0000000000..5080b99e64 --- /dev/null +++ b/src/backend/unparser/languageIndependenceSupport/CMakeLists.txt @@ -0,0 +1,31 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + +install(FILES $(unparseLanguageIndependenceSupport_headers) DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#INCLUDES = $(ROSE_INCLUDES) +# +#unparseLanguageIndependenceSupport_headers = unparseLanguageIndependentConstructs.h name_qualification_support.h unparser_opt.h modified_sage.h unparse_debug.h +## unparseLanguageIndependenceSupport_sources = $(unparseOpt_headers:.h=.C) modified_sage_isUnaryOp.C +#unparseLanguageIndependenceSupport_sources = unparseLanguageIndependentConstructs.C name_qualification_support.C unparser_opt.C modified_sage.C unparse_debug.C modified_sage_isUnaryOp.C +# +#include_HEADERS = $(unparseLanguageIndependenceSupport_headers) +#noinst_LTLIBRARIES = libunparseLanguageIndependenceSupport.la +# +#libunparseLanguageIndependenceSupport_la_SOURCES = $(unparseLanguageIndependenceSupport_sources) +# +#clean-local: +# rm -rf ii_files ti_files core +# diff --git a/src/frontend/BinaryDisassembly/CMakeLists.txt b/src/frontend/BinaryDisassembly/CMakeLists.txt new file mode 100644 index 0000000000..88b8216c2a --- /dev/null +++ b/src/frontend/BinaryDisassembly/CMakeLists.txt @@ -0,0 +1,266 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### next target ############### + +#BEGIN ***************** GENERATING armInstructionEnumPrinter.C ******************* +FILE(READ x86InstructionEnum.h contents) + +file( REMOVE ${ROSE_TOP_BINARY_DIR}/src/frontend/BinaryDisassembly/x86InstructionEnumPrinter.C ) +file( WRITE ${ROSE_TOP_BINARY_DIR}/src/frontend/BinaryDisassembly/x86InstructionEnumPrinter.C "\#include \"x86InstructionEnum.h\"\n" ) +file( APPEND ${ROSE_TOP_BINARY_DIR}/src/frontend/BinaryDisassembly/x86InstructionEnumPrinter.C "\#include \n" ) + +# Convert file contents into a CMake list (where each element in the list +# is one line of the file) +# +STRING(REGEX REPLACE ";" "\\\\;" contents "${contents}") +STRING(REGEX REPLACE "\n" ";" contents "${contents}") +#STRING(REGEX REPLACE ", *//.*;" ".*,,;" contents "${contents}") + +set(found_first FALSE) + +file( APPEND ${ROSE_TOP_BINARY_DIR}/src/frontend/BinaryDisassembly/x86InstructionEnumPrinter.C "static const char* x86InstructionStrings[] = {\n" ) +foreach(v ${contents}) + if(v MATCHES "arm_unknown_instruction.*" ) + set(found_first TRUE) + endif() + + if( found_first ) + string( REGEX REPLACE ", *//.*" "" v2 ${v} ) + string( REGEX MATCH "[a-zA-Z0-9_]+" v3 ${v2} ) + set(v4 "\"${v3}\",") + string( REGEX REPLACE "_record" "." v4 ${v4} ) + file( APPEND ${ROSE_TOP_BINARY_DIR}/src/frontend/BinaryDisassembly/x86InstructionEnumPrinter.C "${v4}\n" ) + endif() + if( v MATCHES ".*arm_last_instruction.*" ) + break() + endif() +endforeach() + +file( APPEND ${ROSE_TOP_BINARY_DIR}/src/frontend/BinaryDisassembly/x86InstructionEnumPrinter.C "\"\"};\n" ) +file( APPEND ${ROSE_TOP_BINARY_DIR}/src/frontend/BinaryDisassembly/x86InstructionEnumPrinter.C "std::string toString(X86InstructionKind k) {static const int s = sizeof(x86InstructionStrings) / sizeof(*x86InstructionStrings); if ((int)k < 0 || (int)k >= s) return \"\"; else return x86InstructionStrings[(int)k];}\n" ) + +#END ***************** GENERATING x86InstructionEnumPrinter.C ******************* + + +#BEGIN ***************** GENERATING armInstructionEnumPrinter.C ******************* +FILE(READ armInstructionEnum.h contents) + +file( REMOVE ${ROSE_TOP_BINARY_DIR}/src/frontend/BinaryDisassembly/armInstructionEnumPrinter.C ) +file( WRITE ${ROSE_TOP_BINARY_DIR}/src/frontend/BinaryDisassembly/armInstructionEnumPrinter.C "\#include \"armInstructionEnum.h\"\n" ) +file( APPEND ${ROSE_TOP_BINARY_DIR}/src/frontend/BinaryDisassembly/armInstructionEnumPrinter.C "\#include \n" ) + +# Convert file contents into a CMake list (where each element in the list +# is one line of the file) +# +STRING(REGEX REPLACE ";" "\\\\;" contents "${contents}") +STRING(REGEX REPLACE "\n" ";" contents "${contents}") +#STRING(REGEX REPLACE ", *//.*;" ".*,,;" contents "${contents}") + +set(found_first FALSE) + +file( APPEND ${ROSE_TOP_BINARY_DIR}/src/frontend/BinaryDisassembly/armInstructionEnumPrinter.C "static const char* armInstructionStrings[] = {\n" ) +foreach(v ${contents}) + if(v MATCHES "arm_unknown_instruction.*" ) + set(found_first TRUE) + endif() + + if( found_first ) + string( REGEX REPLACE ", *//.*" "" v2 ${v} ) + string( REGEX MATCH "[a-zA-Z0-9_]+" v3 ${v2} ) + set(v4 "\"${v3}\",") + string( REGEX REPLACE "_record" "." v4 ${v4} ) + file( APPEND ${ROSE_TOP_BINARY_DIR}/src/frontend/BinaryDisassembly/armInstructionEnumPrinter.C "${v4}\n" ) + endif() + if( v MATCHES ".*arm_last_instruction.*" ) + break() + endif() +endforeach() + +file( APPEND ${ROSE_TOP_BINARY_DIR}/src/frontend/BinaryDisassembly/armInstructionEnumPrinter.C "\"\"};\n" ) +file( APPEND ${ROSE_TOP_BINARY_DIR}/src/frontend/BinaryDisassembly/armInstructionEnumPrinter.C "std::string toString(ArmInstructionKind k) {static const int s = sizeof(armInstructionStrings) / sizeof(*armInstructionStrings); if ((int)k < 0 || (int)k >= s) return \"\"; else return armInstructionStrings[(int)k];}\n" ) + +#END ***************** GENERATING armInstructionEnumPrinter.C ******************* + +#***************** GENERATING powerpcInstructionEnumPrinter.C ******************* + +FILE(READ powerpcInstructionEnum.h contents) + +file( REMOVE ${ROSE_TOP_BINARY_DIR}/src/frontend/BinaryDisassembly/powerpcInstructionEnumPrinter.C ) +file( WRITE ${ROSE_TOP_BINARY_DIR}/src/frontend/BinaryDisassembly/powerpcInstructionEnumPrinter.C "\#include \"powerpcInstructionEnum.h\"\n" ) +file( APPEND ${ROSE_TOP_BINARY_DIR}/src/frontend/BinaryDisassembly/powerpcInstructionEnumPrinter.C "\#include \n" ) + +# Convert file contents into a CMake list (where each element in the list +# is one line of the file) +# +STRING(REGEX REPLACE ";" "\\\\;" contents "${contents}") +STRING(REGEX REPLACE "\n" ";" contents "${contents}") +#STRING(REGEX REPLACE ", *//.*;" ".*,,;" contents "${contents}") + +set(found_first FALSE) + +file( APPEND ${ROSE_TOP_BINARY_DIR}/src/frontend/BinaryDisassembly/powerpcInstructionEnumPrinter.C "static const char* powerpcInstructionStrings[] = {\n" ) +foreach(v ${contents}) + if(v MATCHES "powerpc_unknown_instruction.*" ) + set(found_first TRUE) + endif() + + if( found_first ) + string( REGEX REPLACE ", *//.*" "" v2 ${v} ) + string( REGEX MATCH "[a-zA-Z0-9_]+" v3 ${v2} ) + set(v4 "\"${v3}\",") + string( REGEX REPLACE "_record" "." v4 ${v4} ) + file( APPEND ${ROSE_TOP_BINARY_DIR}/src/frontend/BinaryDisassembly/powerpcInstructionEnumPrinter.C "${v4}\n" ) + endif() + if( v MATCHES ".*powerpc_last_instruction.*" ) + break() + endif() +endforeach() + +file( APPEND ${ROSE_TOP_BINARY_DIR}/src/frontend/BinaryDisassembly/powerpcInstructionEnumPrinter.C "\"\"};\n" ) +file( APPEND ${ROSE_TOP_BINARY_DIR}/src/frontend/BinaryDisassembly/powerpcInstructionEnumPrinter.C "std::string toString(PowerpcInstructionKind k) {static const int s = sizeof(powerpcInstructionStrings) / sizeof(*powerpcInstructionStrings); if ((int)k < 0 || (int)k >= s) return \"\"; else return powerpcInstructionStrings[(int)k];}\n" ) + +#END ***************** GENERATING powerpcInstructionEnumPrinter.C ******************* + + + + +############### TARGET ############################3 + + + +#add_library( binary_frontend ${binaryFrontend_SRC} ) +#add_dependencies( binary_frontend ROSETTA ) + + + + + +#set( binaryFrontend_SRC RoseBin_support.cpp +# instructionDispatch.cpp +# x86InstructionEnum.h x86InstructionProperties.h +# x86InstructionProperties.C ${CMAKE_BINARY_DIR}/src/frontend/BinaryDisassembly/x86InstructionEnumPrinter.C +# armInstructionEnum.h ${CMAKE_BINARY_DIR}/src/frontend/BinaryDisassembly/armInstructionEnumPrinter.C +# powerpcInstructionEnum.h ${CMAKE_BINARY_DIR}/src/frontend/BinaryDisassembly/powerpcInstructionEnumPrinter.C +# powerpcInstructionProperties.h powerpcInstructionProperties.C +# readTicl.C RoseBin_file.cpp RoseFile.cpp +# RoseBin_buildTree.cpp RoseBin_IDAPRO_buildTree.cpp +# AST_BIN_Traversal.C +# ) + +#kde4_add_library( binaryFrontend ${binaryFrontend_SRC}) + +#install(TARGETS binaryFrontend ${INSTALL_TARGETS_DEFAULT_ARGS}) + + +########### install files ############### + +install(FILES $(BINARY_DISASSEMBLY_HEADER_FILES) DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#INCLUDES = $(ROSE_INCLUDES) #-I$(srcdir)/graph #-I$(srcdir)/analyses #-I$(srcdir)/mysql_include +# +## binarylibdir = $(libdir) +# +## DQ (1/25/2008): I think we need to use DEV_LIB here +## binarylib_LTLIBRARIES = libbinaryDatabase.la libbinaryFrontend.la libbinarydisassembly.la +## TPS (03/13/08) added ROSE_USE_BINARY_SQL, so that binary analysis can be compiled without MySQL +## This will cause the dynamic library to be built (as libbinaryDatabase.so) +#noinst_LTLIBRARIES = libbinaryFrontend.la #libbinarydisassembly.la +#if ROSE_USE_BINARY_SQL +# lib_LTLIBRARIES = libbinaryDatabase.la +#endif +# +#if ROSE_USE_BINARY_SQL +## Isolated part of library that depends on the mysql database +#libbinaryDatabase_la_DEPENDENCIES = +#libbinaryDatabase_la_SOURCES = RoseBin.cpp RoseBin_DB.cpp RoseBin_DB_IDAPRO.cpp +##libbinaryDatabase_la_LIBADD = $(MYSQL_DATABASE_LIBS) -lmysql +#endif +# +## Isolated part of library that is independent of the mysql database +#libbinaryFrontend_la_DEPENDENCIES = +#libbinaryFrontend_la_SOURCES = RoseBin_support.cpp \ +# instructionDispatch.cpp \ +# x86InstructionEnum.h x86InstructionProperties.h \ +# x86InstructionProperties.C x86InstructionEnumPrinter.C \ +# armInstructionEnum.h armInstructionEnumPrinter.C \ +# powerpcInstructionEnum.h powerpcInstructionEnumPrinter.C \ +# powerpcInstructionProperties.h powerpcInstructionProperties.C \ +# readTicl.C RoseBin_file.cpp RoseFile.cpp \ +# RoseBin_buildTree.cpp RoseBin_IDAPRO_buildTree.cpp \ +# AST_BIN_Traversal.C +# +# +#BUILT_SOURCES = x86InstructionEnumPrinter.C armInstructionEnumPrinter.C powerpcInstructionEnumPrinter.C +# +#CLEANFILES = $(BUILT_SOURCES) +# +#x86InstructionEnumPrinter.C: $(srcdir)/x86InstructionEnum.h +# echo '#include "x86InstructionEnum.h"' > x86InstructionEnumPrinter.C +# echo '#include ' >> x86InstructionEnumPrinter.C +# sed -n '/x86_unknown_instruction/,/x86_last_instruction/p' < $(srcdir)/x86InstructionEnum.h | sed 's/ = 0//' | tr -d , | sed 's,^ *,",' | sed 's@$$@",@' | (echo 'static const char* x86InstructionStrings[] = {'; cat; echo '""};') >> x86InstructionEnumPrinter.C +# echo 'std::string toString(X86InstructionKind k) {static const int s = sizeof(x86InstructionStrings) / sizeof(*x86InstructionStrings); if ((int)k < 0 || (int)k >= s) return ""; else return x86InstructionStrings[(int)k];}' >> x86InstructionEnumPrinter.C +# +#armInstructionEnumPrinter.C: $(srcdir)/armInstructionEnum.h +# echo '#include "armInstructionEnum.h"' > armInstructionEnumPrinter.C +# echo '#include ' >> armInstructionEnumPrinter.C +# sed -n '/arm_unknown_instruction/,/arm_last_instruction/p' < $(srcdir)/armInstructionEnum.h | sed 's/ = 0//' | tr -d , | sed 's,^ *,",' | sed 's@$$@",@' | (echo 'static const char* armInstructionStrings[] = {'; cat; echo '""};') >> armInstructionEnumPrinter.C +# echo 'std::string toString(ArmInstructionKind k) {static const int s = sizeof(armInstructionStrings) / sizeof(*armInstructionStrings); if ((int)k < 0 || (int)k >= s) return ""; else return armInstructionStrings[(int)k];}' >> armInstructionEnumPrinter.C +# +#powerpcInstructionEnumPrinter.C: $(srcdir)/powerpcInstructionEnum.h +# echo '#include "powerpcInstructionEnum.h"' > powerpcInstructionEnumPrinter.C +# echo '#include ' >> powerpcInstructionEnumPrinter.C +# sed -n '/powerpc_unknown_instruction/,/powerpc_last_instruction/p' < $(srcdir)/powerpcInstructionEnum.h | sed 's/ = 0//' | sed 's, *//.*,,' | tr -d , | sed 's,^ *,",' | sed 's/_record/./' | sed 's@$$@",@' | (echo 'static const char* powerpcInstructionStrings[] = {'; cat; echo '""};') >> powerpcInstructionEnumPrinter.C +# echo 'std::string toString(PowerpcInstructionKind k) {static const int s = sizeof(powerpcInstructionStrings) / sizeof(*powerpcInstructionStrings); if ((int)k < 0 || (int)k >= s) return ""; else return powerpcInstructionStrings[(int)k];}' >> powerpcInstructionEnumPrinter.C +# +## Make sure these SAGE specific header files are placed into a distribution +#if ROSE_USE_BINARY_SQL +#BINARY_DISASSEMBLY_HEADER_FILES = \ +# RoseBin_buildTree.h RoseBin_DB.h RoseBin_DB_IDAPRO.h \ +# RoseBin.h RoseBin_IDAPRO_branchGraph.h RoseBin_IDAPRO_buildTree.h \ +# RoseBin_IDAPRO_callGraph.h RoseBin_IDAPRO_exprTree.h RoseBin_IDAPRO_substTree.h \ +# RoseBin_support.h MyAstAttribute.h \ +# AST_BIN_Traversal.h \ +# readTicl.h RoseBin_file.h RoseFile.h \ +# RoseBin_abstract.h \ +# x86InstructionEnum.h x86InstructionProperties.h powerpcInstructionProperties.h armInstructionEnum.h powerpcInstructionEnum.h \ +# RoseObj.h +#else +#BINARY_DISASSEMBLY_HEADER_FILES = \ +# RoseBin_IDAPRO_branchGraph.h RoseBin_buildTree.h RoseBin_IDAPRO_buildTree.h \ +# RoseBin_IDAPRO_callGraph.h RoseBin_IDAPRO_exprTree.h RoseBin_IDAPRO_substTree.h \ +# RoseBin_support.h MyAstAttribute.h \ +# AST_BIN_Traversal.h \ +# readTicl.h RoseBin_file.h RoseFile.h \ +# RoseBin_abstract.h \ +# x86InstructionEnum.h x86InstructionProperties.h powerpcInstructionProperties.h armInstructionEnum.h powerpcInstructionEnum.h \ +# readTicl.h RoseBin_file.h RoseFile.h \ +# RoseObj.h +#endif +## DQ (1/19/2008): Removed this file from BINARY_DISASSEMBLY_HEADER_FILES since it is not available +## colorTraversal.h +# +#include_HEADERS = $(BINARY_DISASSEMBLY_HEADER_FILES) +# +#EXTRA_DIST = make-decision-tree.tcl RoseBin_instruction_table_arm RoseBin_instruction_table_x86 #mysql_include +# +## DQ (9/30/2009): Added automake conditional to handle machines where we test and "tclsh" is not availble. +## Rule for maintainers (requires Tcl interpreter) +#$(srcdir)/instructionDispatch.cpp: make-decision-tree.tcl RoseBin_instruction_table_arm RoseBin_instruction_table_x86 +#if ROSE_USE_TCLSH +# cd $(srcdir) && ../../../config/missing --run tclsh ./make-decision-tree.tcl x86 Arm +#else +# echo "Warning: tclsh is not available on this machine." +#endif +# +#clean-local: diff --git a/src/frontend/CMakeLists.txt b/src/frontend/CMakeLists.txt new file mode 100644 index 0000000000..2f57a14ea5 --- /dev/null +++ b/src/frontend/CMakeLists.txt @@ -0,0 +1,37 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + +add_subdirectory(SageIII) +add_subdirectory(CxxFrontend) +#AS Add openfortran parser later +#add_subdirectory(OpenFortranParser_SAGE_Connection) +add_subdirectory(BinaryDisassembly) +add_subdirectory(Disassemblers) +add_subdirectory(ExecFormats) +add_subdirectory(PHPFrontend) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +## Later add EDG_1.4, EDG_3.3, Open64, SAGE_III +## SUBDIRS = SageIII EDG EDG_SAGE_Connection +## SUBDIRS = SageIII EDG EDG_SAGE_Connection Open64_SAGE_Connection BinaryDisassembly +## SUBDIRS = SageIII EDG EDG_SAGE_Connection BinaryDisassembly +## SUBDIRS = SageIII EDG EDG_SAGE_Connection OpenFortranParser_SAGE_Connection BinaryDisassembly ObjdumpDisassembler +## SUBDIRS = SageIII BinaryDisassembly ObjdumpDisassembler OpenFortranParser_SAGE_Connection EDG EDG_SAGE_Connection +#SUBDIRS = SageIII CxxFrontend OpenFortranParser_SAGE_Connection BinaryDisassembly Disassemblers ExecFormats PHPFrontend +# +## Until we revisit this this, we want to include specific documentation that has been put into this directory. +## Note that OpenFortranParser_SAGE_Connection has the newer work to support Fortran in ROSE. This work +## is part of a contract to add Fortran support to ROSE using the Open 64 compiler. It supports a roughly +## Fortran 77 level of details, however it uses IR nodes that have been extended or removed (in a few cases) +## as part of adding the Fortran 2003 support using the Open Fortan Parser. +#EXTRA_DIST = Open64 frontend.docs +# diff --git a/src/frontend/CxxFrontend/CMakeLists.txt b/src/frontend/CxxFrontend/CMakeLists.txt new file mode 100644 index 0000000000..19d444ad1f --- /dev/null +++ b/src/frontend/CxxFrontend/CMakeLists.txt @@ -0,0 +1,66 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + +add_subdirectory(EDG_3.3) +#add_subdirectory(EDG_3.10) +#add_subdirectory(EDG_4.0) +add_subdirectory(EDG_SAGE_Connection) + + +########### next target ############### + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +## The new EDG-Sage connection requires some built header files from EDG 3.10, +## so that directory must be before EDG_SAGE_Connection +## SUBDIRS = EDG_3.3 EDG_3.10 EDG_SAGE_Connection +#SUBDIRS = EDG_3.3 EDG_3.10 EDG_4.0 EDG_SAGE_Connection +# +#EXTRA_DIST = Makefile.am.forBinaryEDG +# +#if ROSE_USE_NEW_EDG_INTERFACE +#if ROSE_USE_EDG_VERSION_4 +#libroseEDGlibraries = EDG_4.0/src/libedg40.la EDG_SAGE_Connection/libnewsage.la +#else +#libroseEDGlibraries = EDG_3.10/src/libedg310.la EDG_SAGE_Connection/libnewsage.la +#endif +#else +#libroseEDGlibraries = EDG_3.3/src/libedg33.la EDG_SAGE_Connection/libsage.la +#endif +# +#noinst_LTLIBRARIES = libroseEDG.la +# +## We need a simple file to seed the generation of the library (mark the library +## as having C++ code) +#libroseEDG_la_SOURCES = dummyCppFileForLibroseEDG.C +#libroseEDG_la_LIBADD = $(libroseEDGlibraries) +#libroseEDG_la_LDFLAGS = -no-undefined +#libroseEDG_la_DEPENDENCIES = $(libroseEDGlibraries) +# +# +#BINARY_EDG_DIRNAME=xxx_trash_xxx +#testEDGBinaryMakefileLogic: +# if test "$(am__untar)" != "false"; then \ +# if test -f $(srcdir)/$(BINARY_EDG_DIRNAME).tar.gz; then \ +# echo "Found $(srcdir)/$(BINARY_EDG_DIRNAME).tar.gz: proceeding to untar file $(BINARY_EDG_DIRNAME).tar.gz" >&2 && \ +# GZIP=$(GZIP_ENV) gunzip -c $(srcdir)/$(BINARY_EDG_DIRNAME).tar.gz | $(am__untar) && \ +# mv $(BINARY_EDG_DIRNAME)/libroseEDG.* . && \ +# mv $(BINARY_EDG_DIRNAME)/.libs . && \ +# rmdir $(BINARY_EDG_DIRNAME)/; \ +# else \ +# echo "There is no binary version of EDG (which should be named $(BINARY_EDG_DIRNAME).tar.gz) in your copy of ROSE -- this should have been caught by configure" >&2 && \ +# exit 1; \ +# fi \ +# else \ +# echo "ERROR: am__untar set to false! (am__untar == $(am__untar)) Can't untar $(BINARY_EDG_DIRNAME).tar.gz) -- this should have been caught by configure" >&2 && \ +# exit 1; \ +# fi +# diff --git a/src/frontend/Disassemblers/CMakeLists.txt b/src/frontend/Disassemblers/CMakeLists.txt new file mode 100644 index 0000000000..9bfd11eed8 --- /dev/null +++ b/src/frontend/Disassemblers/CMakeLists.txt @@ -0,0 +1,48 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + +set(roseDisassemblers_SRC + ${CMAKE_SOURCE_DIR}/src/frontend/Disassemblers/Partitioner.C + ${CMAKE_SOURCE_DIR}/src/frontend/Disassemblers/Disassembler.C + ${CMAKE_SOURCE_DIR}/src/frontend/Disassemblers/DisassemblerArm.C + ${CMAKE_SOURCE_DIR}/src/frontend/Disassemblers/DisassemblerPowerpc.C + ${CMAKE_SOURCE_DIR}/src/frontend/Disassemblers/DisassemblerX86.C + ${CMAKE_SOURCE_DIR}/src/frontend/Disassemblers/Assembler.C + ${CMAKE_SOURCE_DIR}/src/frontend/Disassemblers/AssemblerX86.C + ${CMAKE_SOURCE_DIR}/src/frontend/Disassemblers/AssemblerX86Init.C + ) + +add_library( roseDisassemblers ${roseDisassemblers_SRC} ) +add_dependencies( roseDisassemblers ROSETTA ) + +########### install files ############### + +install(FILES Partitioner.h Disassembler.h DisassemblerArm.h DisassemblerPowerpc.h DisassemblerX86.h Assembler.h AssemblerX86.h AssemblerX86Init.h DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#INCLUDES = $(ROSE_INCLUDES) +# +## This will cause the dynamic library to be built (as libroseDisassemblers.so) +#noinst_LTLIBRARIES = libroseDisassemblers.la +# +#libroseDisassemblers_la_DEPENDENCIES = +# +#libroseDisassemblers_la_SOURCES = \ +# Partitioner.C \ +# Disassembler.C DisassemblerArm.C DisassemblerPowerpc.C DisassemblerX86.C \ +# Assembler.C AssemblerX86.C AssemblerX86Init.C +# +#include_HEADERS = \ +# Partitioner.h \ +# Disassembler.h DisassemblerArm.h DisassemblerPowerpc.h DisassemblerX86.h \ +# Assembler.h AssemblerX86.h AssemblerX86Init.h +# +#dist_include_HEADERS = diff --git a/src/frontend/ExecFormats/CMakeLists.txt b/src/frontend/ExecFormats/CMakeLists.txt new file mode 100644 index 0000000000..61a99d8852 --- /dev/null +++ b/src/frontend/ExecFormats/CMakeLists.txt @@ -0,0 +1,62 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + +set(roseExecFormats_SRC + ${CMAKE_SOURCE_DIR}/src/frontend/ExecFormats/ExecGeneric.C + ${CMAKE_SOURCE_DIR}/src/frontend/ExecFormats/ExecDOS.C + ${CMAKE_SOURCE_DIR}/src/frontend/ExecFormats/ExecELF.C + ${CMAKE_SOURCE_DIR}/src/frontend/ExecFormats/ExecPE.C + ${CMAKE_SOURCE_DIR}/src/frontend/ExecFormats/ExecNE.C + ${CMAKE_SOURCE_DIR}/src/frontend/ExecFormats/ExecLE.C + ${CMAKE_SOURCE_DIR}/src/frontend/ExecFormats/Loader.C + ${CMAKE_SOURCE_DIR}/src/frontend/ExecFormats/LoaderELF.C + ${CMAKE_SOURCE_DIR}/src/frontend/ExecFormats/LoaderELFObj.C + ${CMAKE_SOURCE_DIR}/src/frontend/ExecFormats/LoaderPE.C + ${CMAKE_SOURCE_DIR}/src/frontend/ExecFormats/MemoryMap.C + ${CMAKE_SOURCE_DIR}/src/frontend/ExecFormats/Interpretation.C + ) + +add_library( roseExecFormats ${roseExecFormats_SRC} ) +add_dependencies( roseExecFormats ROSETTA ) + +########### install files ############### + +install(FILES IntelPinSupport.h Loader.h LoaderELF.h LoaderELFObj.h LoaderPE.h MemoryMap.h DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +## Added INTEP PIN support to collect dynamic binary analysis info. +#if ROSE_USE_INTEL_PIN +## Use the path specified on the configuration command line (e.g. --with-Intel_Pin=) +## INTEL_PIN_PATH = @IntelPin_path@ +## INTEL_PIN_LIB_PATHS = -L$(INTEL_PIN_PATH)/intel64/lib -L$(INTEL_PIN_PATH)/extras/xed2-intel64/lib -L$(INTEL_PIN_PATH)/intel64/lib-ext +## INTEL_PIN_INCLUDE_PATHS = -I$(INTEL_PIN_PATH)/source/include -I$(INTEL_PIN_PATH)/source/include/gen -I$(INTEL_PIN_PATH)/extras/xed2-intel64/include +## INTEL_PIN_TOOLS_PATH = $(INTEL_PIN_PATH)/source/tools/SimpleExamples +# +# INTEL_PIN_SUPPORT = IntelPinSupport.C +#endif +# +## INCLUDES = $(ROSE_INCLUDES) +#INCLUDES = $(ROSE_INCLUDES) $(INTEL_PIN_INCLUDE_PATHS) +# +## This will cause the dynamic library to be built (as libroseExecFormats.so) +#noinst_LTLIBRARIES = libroseExecFormats.la +# +#libroseExecFormats_la_DEPENDENCIES = +#libroseExecFormats_la_SOURCES = \ +# $(INTEL_PIN_SUPPORT) \ +# ExecGeneric.C ExecDOS.C ExecELF.C ExecPE.C ExecNE.C ExecLE.C \ +# Loader.C LoaderELF.C LoaderELFObj.C LoaderPE.C \ +# MemoryMap.C Interpretation.C +# +#include_HEADERS = IntelPinSupport.h Loader.h LoaderELF.h LoaderELFObj.h LoaderPE.h MemoryMap.h +# +## Make sure that this is distributed even if ROSE was not configured using: -with-IntelPin= +#EXTRA_DIST = IntelPinSupport.C diff --git a/src/frontend/OpenFortranParser_SAGE_Connection/CMakeLists.txt b/src/frontend/OpenFortranParser_SAGE_Connection/CMakeLists.txt new file mode 100644 index 0000000000..59b0d6e764 --- /dev/null +++ b/src/frontend/OpenFortranParser_SAGE_Connection/CMakeLists.txt @@ -0,0 +1,109 @@ + +include_directories(${CMAKE_SOURCE_DIR}/src/frontend/OpenFortranParser_SAGE_Connection ${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + +set(fortran_ofp_parser_c_jni_FortranParserActionJNI_LIB_SRCS + FortranParserActionROSE.C + token.c + jni_token_funcs.c + c_actions_jni.c) + +add_library(fortran_ofp_parser_c_jni_FortranParserActionJNI SHARED ${fortran_ofp_parser_c_jni_FortranParserActionJNI_LIB_SRCS}) + +target_link_libraries(fortran_ofp_parser_c_jni_FortranParserActionJNI ${KDE4_KDECORE_LIBS}) + +set_target_properties(fortran_ofp_parser_c_jni_FortranParserActionJNI PROPERTIES VERSION 1.0.0 SOVERSION 1) +install(TARGETS fortran_ofp_parser_c_jni_FortranParserActionJNI ${INSTALL_TARGETS_DEFAULT_ARGS}) + + +########### next target ############### + + +########### install files ############### + +install(FILES ActionEnums.h FortranParserAction.h token.h rose_fortran_token_maps.h rose_token_defs.h fortran_support.h jni_token_funcs.h jserver.h ofp.h FortranModuleInfo.h FortranParserState.h DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#INCLUDES = $(ROSE_INCLUDES) -I$(top_srcdir)/src/frontend/OpenFortranParser_SAGE_Connection +# +#EXTRA_DIST = preproc-fortran.ll preproc-fortran-fixed.ll +#DISTCLEANFILES = preproc-fortran.cc preproc-fortran-fixed.cc +# +## DQ (3/14/2009): We have to clear the LDFLAGS variable... This is not so great. +## we now result the LD_LIBRARY_PATH to be set explicitly. +## LDFLAGS = +# +#if ROSE_USE_OPEN_FORTRAN_PARSER +## This shared library is built in the Open Fortran Parser using the command: +## gcc -shared -I/usr/apps/java/jdk1.5.0_11/include -I/usr/apps/java/jdk1.5.0_11/include/linux +## -I../ -fPIC ../token.c jni_token_funcs.c c_actions_jni.c ../FortranParserActionPrint.c +## -o ../../../../build/libparser_java_FortranParserActionJNI.so +## To build a similar library using libtool we indicate that we want an installed +## library (which will then be made into a dynamic shared library). +## lib_LTLIBRARIES = libparser_java_FortranParserActionJNI.la +## lib_LTLIBRARIES = libfortran_ofp_parser_java_FortranParserActionJNI.la +#lib_LTLIBRARIES = libfortran_ofp_parser_c_jni_FortranParserActionJNI.la +#else +#endif +# +## DQ (10/21/2007): build (JJW: either empty or non-empty) lib file so that ROSE/src/Makefile.am need not be conditional on Fortran. +#noinst_LTLIBRARIES = libroseFortran.la +# +#if ROSE_USE_OPEN_FORTRAN_PARSER +#libroseFortran_la_SOURCES = fortran_support.C openFortranParser_main.C jserver.C ofp.C FortranModuleInfo.C FortranParserState.C preproc-fortran.ll preproc-fortran-fixed.ll +#else +## Compile using a function that represents the API of the Open Fortran Parser +#libroseFortran_la_SOURCES = dummy_openFortranParser_main.C +#endif +# +#if ROSE_USE_OPEN_FORTRAN_PARSER +## This file (these c_action() function implementations) need to be in a dynamic +## library so that they can be called by the Java based Open Fortran Parser. +## libparser_java_FortranParserActionJNI_la_SOURCES = FortranParserActionROSE.C token.c jni_token_funcs.c c_actions_jni.c +## libparser_java_FortranParserActionJNI_la_DEPENDENCIES = +## libfortran_ofp_parser_java_FortranParserActionJNI_la_SOURCES = FortranParserActionROSE.C token.c jni_token_funcs.c c_actions_jni.c +## libfortran_ofp_parser_java_FortranParserActionJNI_la_DEPENDENCIES = +#libfortran_ofp_parser_c_jni_FortranParserActionJNI_la_SOURCES = FortranParserActionROSE.C token.c jni_token_funcs.c c_actions_jni.c +# +## To support the Open Fortran Parser we need to build a shared library with a specific name and which will have +## all of the c_action() function implementations. The name to match is: XXX libparser_java_FortranParserActionJNI.so +## As of Feb 18 2008: the name is changed to libfortran_ofp_parser_c_jni_FortranParserActionJNI.so +# +#include_HEADERS = ActionEnums.h FortranParserAction.h token.h rose_fortran_token_maps.h rose_token_defs.h fortran_support.h jni_token_funcs.h jserver.h ofp.h FortranModuleInfo.h FortranParserState.h +# +## openFortranParserMain: $(top_builddir)/rose_paths.h +# +## DQ (9/24/2007): After updating the Open Fortran Parser, there are a number of files that should be copied over to ROSE. +## Note that only the following are used in ROSE: +## 1) token.c and token.h (definition of OFP's tokens) +## 2) FortranParserAction.h (header file of C_action functions) +## 3) ActionEnums.h (enum values used in OFP and queried in ROSE) +## All other files copied to ROSE are used as reference within the development. +## OPEN_FORTRAN_PARSER_PATH=/home/dquinlan/ROSE/OpenFortranParser/fortran-parser +#update: +## cp $(OPEN_FORTRAN_PARSER_PATH)/src/parser/c/token.* $(srcdir) +## cp $(OPEN_FORTRAN_PARSER_PATH)/src/parser/c/jni/jni_token_funcs.* $(srcdir) +## cp $(OPEN_FORTRAN_PARSER_PATH)/src/parser/c/jni/c_actions_jni.c $(srcdir) +## cp $(OPEN_FORTRAN_PARSER_PATH)/src/parser/c/FortranParserAction.h $(srcdir) +## cp $(OPEN_FORTRAN_PARSER_PATH)/src/parser/c/ActionEnums.h $(srcdir) +## cp $(OPEN_FORTRAN_PARSER_PATH)/src/parser/c/FortranParserActionNull.c $(srcdir) +# cp $(OPEN_FORTRAN_PARSER_PATH)/src/fortran/ofp/parser/c/token.* $(srcdir) +# cp $(OPEN_FORTRAN_PARSER_PATH)/src/fortran/ofp/parser/c/FortranParserAction.h $(srcdir) +# cp $(OPEN_FORTRAN_PARSER_PATH)/src/fortran/ofp/parser/c/ActionEnums.h $(srcdir) +# cp $(OPEN_FORTRAN_PARSER_PATH)/src/fortran/ofp/parser/c/FortranParserActionNull.c $(srcdir) +# cp $(OPEN_FORTRAN_PARSER_PATH)/src/fortran/ofp/parser/c/FortranParserActionPrint.c $(srcdir) +# cp $(OPEN_FORTRAN_PARSER_PATH)/src/fortran/ofp/parser/c/jni/jni_token_funcs.* $(srcdir) +# cp $(OPEN_FORTRAN_PARSER_PATH)/src/fortran/ofp/parser/c/jni/c_actions_jni.c $(srcdir) +# cp $(OPEN_FORTRAN_PARSER_PATH)/src/fortran/ofp/parser/java/IFortranParserAction.java $(srcdir) +# +#endif +# +## EXTRA_DIST = FortranParserActionROSE.C token.c jni_token_funcs.c c_actions_jni.c +# diff --git a/src/frontend/PHPFrontend/CMakeLists.txt b/src/frontend/PHPFrontend/CMakeLists.txt new file mode 100644 index 0000000000..e8a9551ff6 --- /dev/null +++ b/src/frontend/PHPFrontend/CMakeLists.txt @@ -0,0 +1,29 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + +install(FILES PHPFrontend.h DESTINATION src/frontend/PHPFrontend/CMakeLists.txt ) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#INCLUDES = $(ROSE_INCLUDES) +# +## This will cause the dynamic library to be built (as librosePHPFrontend.so) +#noinst_LTLIBRARIES = librosePHPFrontend.la +# +#librosePHPFrontend_la_DEPENDENCIES = +#librosePHPFrontend_la_SOURCES = PHPFrontend.C PHPFrontend.h +# +#dist_include_HEADERS = PHPFrontend.h +# +#include_HEADERS = +# diff --git a/src/frontend/SageIII/CMakeLists.txt b/src/frontend/SageIII/CMakeLists.txt new file mode 100644 index 0000000000..197061e3e2 --- /dev/null +++ b/src/frontend/SageIII/CMakeLists.txt @@ -0,0 +1,327 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) +##AS Commented out for simpler build +###add_subdirectory(astFileIO) +add_subdirectory(astMerge) +add_subdirectory(astFixup) +add_subdirectory(astPostProcessing) +add_subdirectory(sageInterface) +add_subdirectory(virtualCFG) +add_subdirectory(astTokenStream) +add_subdirectory(astHiddenTypeAndDeclarationLists) +add_subdirectory(astVisualization) + + +########### next target ############### + +# GENERATING THE ROSE PREPROCESSOR +add_custom_command( + OUTPUT ${CMAKE_BINARY_DIR}/src/frontend/SageIII/lex.yy.C + COMMAND ${FLEX_EXECUTABLE} -t + ${ROSE_TOP_SRC_DIR}/src/frontend/SageIII/preproc-c.ll + > ${CMAKE_BINARY_DIR}/src/frontend/SageIII/lex.yy.C + + DEPENDS ${ROSE_TOP_SRC_DIR}/src/frontend/SageIII/preproc-c.ll +) + +add_custom_target( ROSE_PREPROCESSOR ALL DEPENDS + ${CMAKE_BINARY_DIR}/src/frontend/SageIII/lex.yy.C COMMENT "Generating files for preprocessor" ) + +########### next target ############### + +#GENERATING the OpenMP parser +add_custom_command( + OUTPUT ${CMAKE_BINARY_DIR}/src/frontend/SageIII/omp-lex.yy.C + COMMAND ${FLEX_EXECUTABLE} -t + ${ROSE_TOP_SRC_DIR}/src/frontend/SageIII/omplexer.ll + > ${CMAKE_BINARY_DIR}/src/frontend/SageIII/omp-lex.yy.C + + DEPENDS ${ROSE_TOP_SRC_DIR}/src/frontend/SageIII/omplexer.ll +) + +add_custom_command( + OUTPUT ${CMAKE_BINARY_DIR}/src/frontend/SageIII/ompparser.C + COMMAND ${BISON_EXECUTABLE} + ${ROSE_TOP_SRC_DIR}/src/frontend/SageIII/ompparser.yy -o + ${CMAKE_BINARY_DIR}/src/frontend/SageIII/ompparser.C + DEPENDS ${ROSE_TOP_SRC_DIR}/src/frontend/SageIII/ompparser.yy +) + +#BISON generates a ompparser.H file and we need a ompparser.h file +add_custom_command( + OUTPUT ${CMAKE_BINARY_DIR}/src/frontend/SageIII/ompparser.h + COMMAND + ${CMAKE_COMMAND} -E copy + ${CMAKE_BINARY_DIR}/src/frontend/SageIII/ompparser.H ${CMAKE_BINARY_DIR}/src/frontend/SageIII/ompparser.h + DEPENDS ${CMAKE_BINARY_DIR}/src/frontend/SageIII/ompparser.C + ) + +add_custom_target( OMPPARSER ALL DEPENDS + ${CMAKE_BINARY_DIR}/src/frontend/SageIII/omp-lex.yy.C + ${CMAKE_BINARY_DIR}/src/frontend/SageIII/ompparser.C + ${CMAKE_BINARY_DIR}/src/frontend/SageIII/ompparser.h + COMMENT "Generating files for the omp parser" + ) + + +########### install files ############### + +install(FILES sage3.h rose_attributes_list.h attachPreprocessingInfo.h attachPreprocessingInfoTraversal.h attach_all_info.h manglingSupport.h C++_include_files.h fixupCopy.h general_token_defs.h rtiHelpers.h OmpAttribute.h omp.h dwarfSupport.h omp_lib_kinds.h omp_lib.h DESTINATION ${INCLUDE_INSTALL_DIR}) +install(FILES Cxx_Grammar.h Cxx_GrammarMemoryPoolSupport.h Cxx_GrammarTreeTraversalAccessEnums.h AST_FILE_IO.h StorageClasses.h AstQueryMemoryPool.h astFileIO/AstSpecificDataManagingClass.h DESTINATION ${INCLUDE_INSTALL_DIR} ) + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +## Include the "." to force the current directory to be compiled +## before the subdirectories. +#SUBDIRS = astFileIO astMerge astFixup astPostProcessing sageInterface virtualCFG astTokenStream astHiddenTypeAndDeclarationLists astVisualization +# +## DQ (5/2/2009): This supports the optimization of the new +## Graph IR nodes (makes about 25% improvement, I think). +## ROSE_OPTIMIZATION_LEVEL = -O3 +#ROSE_OPTIMIZATION_LEVEL = +# +## Liao, 3/31/2009, moved the OpenMP parser here +##Liao, 10/27/2008. I decide to parse OpenMP pragma string here +## Bison flags +#AM_YFLAGS = -d +## Flex flags +#AM_LFLAGS = +## avoid unused Flex functions which are automatically generated +#CXXFLAGS+= -DYY_NO_TOP_STATE -DYY_NO_POP_STATE $(ROSE_OPTIMIZATION_LEVEL) +## omplexer.cc needs a header generaetd from ompparser.yy +#omplexer.lo: ompparser.h omplexer.cc +#ompparser.h: ompparser.cc +# +## Force sage.docs to be make by default +## (if sage.docs.in is modified) +#all-local: roseh sage.docs +# +# +## INCLUDES = $(ROSE_INCLUDES) +## INCLUDES = $(ROSE_INCLUDES) -I$(top_srcdir)/src/frontend/EDG_SAGE_Connection -I$(top_srcdir)/src/frontend/EDG/EDG_3.3/src $(WAVE_INCLUDES) +## INCLUDES = $(ROSE_INCLUDES) -I$(top_srcdir)/src/frontend/EDG_SAGE_Connection -I$(top_srcdir)/src/frontend/EDG/EDG_3.3/src +## JJW 6-2-2008: We shouldn't be using anything from EDG outside these two directories +#INCLUDES = $(ROSE_INCLUDES) # -I$(top_srcdir)/src/frontend/EDG_SAGE_Connection -I$(top_srcdir)/src/frontend/EDG/EDG_3.3/src +# +### The grammar generator (ROSETTA) should use its own template repository +#CXX_TEMPLATE_REPOSITORY_PATH = . +# +## Copy the original lex file and the C++ file generated from it to the distribution +## so that users don't have to find an appropriate version of lex (flex). Flex should +## be used by developers so that ANSI C code is generated for g++. This is something +## for developers to worry about in the generation of sufficently portable distributions. +## EXTRA_DIST = preproc.lex preproc.C sageClasses.docs sage.docs.in docs +## EXTRA_DIST = preproc.lex preproc.C astGraphTemplate.C docs +## EXTRA_DIST = preproc.ll docs rtiHelpers.h attributeListMap.h +# +## DQ (9/29/2009): Renamed preproc.ll to preproc-c.ll in SVN. +## This will hopefull avoid a linking problem where multiple files +## are called preproc.o (from here and from EDG). +#EXTRA_DIST = preproc-c.ll docs rtiHelpers.h attributeListMap.h \ +# advanced_preprocessing_hooks.h rose_attributes_list.h dwarfSupport.h \ +# omplexer.cc ompparser.cc ompparser.h +#CLEANFILES = haveRosettaGeneratedSource +# +## DISTCLEANFILES = preproc.cc ompparser.cc ompparser.h omplexer.cc +#DISTCLEANFILES = preproc-c.cc ompparser.cc ompparser.h omplexer.cc +# +# +## DQ (10/18/2007): Added AST_FILE_IO.C StorageClasses.C +## Some source code is generated (call make in ROSE/src/ROSETTA/src to generate these files) +#GENERATED_SOURCE = \ +# Cxx_Grammar.h \ +# Cxx_GrammarRTI.C \ +# Cxx_Grammar.C \ +# Cxx_GrammarMemoryPoolSupport.C \ +# AstQueryMemoryPool.h \ +# Cxx_GrammarReturnClassHierarchySubTree.C \ +# Cxx_GrammarTreeTraversalSuccessorContainer.C \ +# Cxx_GrammarTreeTraversalAccessEnums.h \ +# Cxx_GrammarVariantEnumNames.C \ +# Cxx_GrammarNewAndDeleteOperators.C \ +# Cxx_GrammarCopyMemberFunctions.C \ +# Cxx_GrammarTraverseMemoryPool.C \ +# Cxx_GrammarCheckingIfDataMembersAreInMemoryPool.C \ +# Cxx_GrammarMemoryPoolSupport.h \ +# AST_FILE_IO.h \ +# AST_FILE_IO.C \ +# StorageClasses.h \ +# StorageClasses.C \ +# Cxx_GrammarReturnDataMemberPointers.C \ +# Cxx_GrammarProcessDataMemberReferenceToPointers.C \ +# Cxx_GrammarNewConstructors.C \ +# Cxx_GrammarGetChildIndex.C +# +# +## DQ (4/23/2009): This file depends upon other files +#StorageClasses.lo: $(srcdir)/astFileIO/StorageClassMemoryManagement.C astFileIO/SourcesOfIRNodesAstFileIOSupport.C +# +#haveRosettaGeneratedSource: +# cd $(top_builddir)/src/ROSETTA/src; $(MAKE) +# touch haveRosettaGeneratedSource +# +#force-haveRosettaGeneratedSource: +# -rm Cxx_Grammar.h +# $(MAKE) haveRosettaGeneratedSource +# +#$(GENERATED_SOURCE): haveRosettaGeneratedSource +# +#libsage3Sources = \ +# rose_attributes_list.C \ +# attachPreprocessingInfo.C \ +# attachPreprocessingInfoTraversal.C \ +# attributeListMap.C \ +# manglingSupport.C \ +# sageSupport.C \ +# fixupCopy_scopes.C \ +# fixupCopy_symbols.C \ +# fixupCopy_references.C \ +# rtiHelpers.C \ +# OmpAttribute.C \ +# ompFortranParser.C \ +# dwarfSupport.C \ +# rose_graph_support.C +# +## $(GENERATED_SOURCE) is handled separately +# +## DQ (5/27/2007): Files moved or removed +## generateAST.C +## AstAttributeDOT.C +## astGraph.C +## insert.C +## stripWrapper.C +## grammarBaseClass.C +# +## DQ (12/16/2008): Removed as part of rewrite of CPP and comment handling. +## attach_all_info.C +# +#noinst_LTLIBRARIES = libsage3.la +# +## libsage3_la_SOURCES = $(libsage3Sources) preproc.ll rose_paths.h omplexer.ll ompparser.yy +## libsage3_la_SOURCES = $(libsage3Sources) preproc.ll omplexer.ll ompparser.yy +#libsage3_la_SOURCES = $(libsage3Sources) preproc-c.ll omplexer.ll ompparser.yy +# +## DQ (3/8/2009): I think that the dependence upon $(top_builddir)/rose_config.h +## is what was forcing a lot of files to be compiled after reruning configure. +## nodist_libsage3_la_SOURCES = $(GENERATED_SOURCE) $(top_builddir)/rose_config.h +#nodist_libsage3_la_SOURCES = $(GENERATED_SOURCE) +# +# +#if ROSE_USE_BOOST_WAVE +#libsage3_la_LIBADD = \ +# astFixup/libastFixup.la \ +# astPostProcessing/libastPostProcessing.la \ +# astMerge/libastMerge.la \ +# sageInterface/libsageInterface.la \ +# astTokenStream/libastTokenStream.la \ +# virtualCFG/libvirtualCFG.la \ +# astHiddenTypeAndDeclarationLists/libastHiddenTypeAndDeclarationLists.la \ +# astVisualization/libastVisualization.la +#else +#libsage3_la_LIBADD = \ +# astFixup/libastFixup.la \ +# astPostProcessing/libastPostProcessing.la \ +# astMerge/libastMerge.la \ +# sageInterface/libsageInterface.la \ +# virtualCFG/libvirtualCFG.la \ +# astHiddenTypeAndDeclarationLists/libastHiddenTypeAndDeclarationLists.la \ +# astVisualization/libastVisualization.la +#endif +# +## astFileIO/libastFileIO.la +## astFileIO/libastFileIO.la +# +## $(CXX_TEMPLATE_OBJECTS) +## libsage3_la_DEPENDENCIES = preproc.o $(GENERATED_OBJECTS) astFixup/*.o astPostProcessing/*.o astMerge/*.o astFileIO/*.o sageInterface/*.o virtualCFG/*.o +# +#rose_attributes_list.lo : rose_attributes_list.h +# +#if ROSE_PCH +#if ROSE_MPI +## TPS (11Feb2009): PCH only works when multithreading is off. +## We should not use PCH and MPI together. +#roseh: +# +#else +## DQ (2/11/2009): This is part of the support for Precompiled Headers (PCH) using GNU g++ +#roseh: +## DQ (2/10/2009): Rush for the off switch on precompiled header files, comment out to skip use of PCH. +## TPS (23 Feb 2009): Hardcoded -fpic and -DPIC for now because +## for some reason it is used by most files although not specified on configure +# @echo " COMPILE rose.h.gch" +# @$(CXX) -fPIC -DPIC $(CXXFLAGS) $(CFLAGS) $(CPPFLAGS) -g -o rose.h.gch $(top_srcdir)/src/rose.h -I$(top_builddir) $(ROSE_INCLUDES) +#endif +#else +## default, do nothing. +#roseh: +# +#endif +# +#test_roseh: roseh +# +## DQ (10/18/2007): Added AST_FILE_IO.h StorageClasses.h +## Removed sla.h (redundant with location in src/util/commandlineProcessing/sla.h) +#include_HEADERS = \ +# sage3.h rose_attributes_list.h \ +# attachPreprocessingInfo.h \ +# attachPreprocessingInfoTraversal.h \ +# attach_all_info.h manglingSupport.h C++_include_files.h \ +# fixupCopy.h \ +# general_token_defs.h rtiHelpers.h \ +# OmpAttribute.h omp.h dwarfSupport.h \ +# omp_lib_kinds.h omp_lib.h +# +## DQ (4/5/2009): Moved rose_paths.h to src/util (where the source file is located). +#nodist_include_HEADERS = \ +# Cxx_Grammar.h \ +# Cxx_GrammarMemoryPoolSupport.h \ +# Cxx_GrammarTreeTraversalAccessEnums.h \ +# AST_FILE_IO.h StorageClasses.h \ +# AstQueryMemoryPool.h \ +# astFileIO/AstSpecificDataManagingClass.h +# +#BUILT_SOURCES = $(GENERATED_SOURCE) ompparser.cc ompparser.h omplexer.cc +# +## DQ (9/9/2007): Put C++_include_files.h back into place +## since it is a convinient mechanism to handle included headers +## in the Cxx_Grammar.C file (a ROSETTA generated file). +## DQ (5/27/2007): Files moved or removed +## grammarBaseClass.h +## AstAttributeDOT.h +## astGraph.h +## astGraphTemplate.C +## sageSupport.h +## C++_include_files.h +# +#clean-local: +# rm -rf Templates.DB ii_files ti_files cxx_templates +# rm -rf Cxx_Grammar* AST_FILE_IO.C StorageClasses.C +# rm -rf AST_FILE_IO.h StorageClasses.h AstQueryMemoryPool.h +# rm -rf generated_abstractcppgrammar.atg +# rm -f rose.h.gch +# +#distclean-local: +# rm -rf Templates.DB +# rm -f rose.h.gch +# +#removeHashLineDirectivesFromGeneratedCode: +# cp Cxx_Grammar.h Cxx_Grammar.h.withLineDirectives +# grep -v "#line" Cxx_Grammar.h > Cxx_Grammar.h.withoutLineDirectives +# cp Cxx_Grammar.h.withoutLineDirectives Cxx_Grammar.h +# +# +#testRose: +# /usr/bin/time roseAnalysis -rose:verbose 2 -DHAVE_CONFIG_H -I. -I/home/dquinlan/ROSE/svn-rose/src/frontend/SageIII -I../../.. -I../../../src/frontend/SageIII -I/home/dquinlan/ROSE/svn-rose/src -I/home/dquinlan/ROSE/svn-rose/src/frontend/SageIII -I/home/dquinlan/ROSE/svn-rose/src/frontend/SageIII/astFixup -I/home/dquinlan/ROSE/svn-rose/src/frontend/SageIII/astPostProcessing -I/home/dquinlan/ROSE/svn-rose/src/frontend/SageIII/astMerge -I/home/dquinlan/ROSE/svn-rose/src/frontend/SageIII/astVisualization -I/home/dquinlan/ROSE/svn-rose/src/frontend/SageIII/astFileIO -I/home/dquinlan/ROSE/svn-rose/src/frontend/SageIII/sageInterface -I/home/dquinlan/ROSE/svn-rose/src/frontend/SageIII/virtualCFG -I/home/dquinlan/ROSE/svn-rose/src/frontend/SageIII/astTokenStream -I/home/dquinlan/ROSE/svn-rose/src/frontend/SageIII/astHiddenTypeAndDeclarationLists -I../../../src/frontend/SageIII/astFileIO -I/home/dquinlan/ROSE/svn-rose/src/frontend/OpenFortranParser_SAGE_Connection -I/home/dquinlan/ROSE/svn-rose/src/frontend/PHPFrontend -I/home/dquinlan/ROSE/svn-rose/src/frontend/BinaryDisassembly -I/home/dquinlan/ROSE/svn-rose/src/frontend/Disassemblers -I/home/dquinlan/ROSE/svn-rose/src/frontend/ExecFormats -I/home/dquinlan/ROSE/svn-rose/src/backend/unparser -I/home/dquinlan/ROSE/svn-rose/src/backend/unparser/formatSupport -I/home/dquinlan/ROSE/svn-rose/src/backend/unparser/languageIndependenceSupport -I/home/dquinlan/ROSE/svn-rose/src/backend/unparser/CxxCodeGeneration -I/home/dquinlan/ROSE/svn-rose/src/backend/unparser/FortranCodeGeneration -I/home/dquinlan/ROSE/svn-rose/src/backend/unparser/PHPCodeGeneration -I/home/dquinlan/ROSE/svn-rose/src/backend/asmUnparser -I/home/dquinlan/ROSE/svn-rose/src/util -I/home/dquinlan/ROSE/svn-rose/src/util/support -I/home/dquinlan/ROSE/svn-rose/src/util/graphs -I/home/dquinlan/ROSE/svn-rose/src/util/stringSupport -I/home/dquinlan/ROSE/svn-rose/src/util/commandlineProcessing -I/home/dquinlan/ROSE/svn-rose/src/midend/abstractHandle -I/home/dquinlan/ROSE/svn-rose/src/midend/astDiagnostics -I/home/dquinlan/ROSE/svn-rose/src/midend/astInlining -I/home/dquinlan/ROSE/svn-rose/src/midend/astOutlining -I/home/dquinlan/ROSE/svn-rose/src/midend/astProcessing -I/home/dquinlan/ROSE/svn-rose/src/midend/astQuery -I/home/dquinlan/ROSE/svn-rose/src/midend/astRewriteMechanism -I/home/dquinlan/ROSE/svn-rose/src/midend/astUtil/annotation -I/home/dquinlan/ROSE/svn-rose/src/midend/astUtil/astInterface -I/home/dquinlan/ROSE/svn-rose/src/midend/astUtil/astSupport -I/home/dquinlan/ROSE/svn-rose/src/midend/astUtil/symbolicVal -I/home/dquinlan/ROSE/svn-rose/src/midend/binaryAnalyses -I/home/dquinlan/ROSE/svn-rose/src/midend/binaryAnalyses/dataflowanalyses -I/home/dquinlan/ROSE/svn-rose/src/midend/binaryAnalyses/graph -I/home/dquinlan/ROSE/svn-rose/src/midend/binaryAnalyses/instructionSemantics -I/home/dquinlan/ROSE/svn-rose/src/midend/loopProcessing/computation -I/home/dquinlan/ROSE/svn-rose/src/midend/loopProcessing/depGraph -I/home/dquinlan/ROSE/svn-rose/src/midend/loopProcessing/depInfo -I/home/dquinlan/ROSE/svn-rose/src/midend/loopProcessing/driver -I/home/dquinlan/ROSE/svn-rose/src/midend/loopProcessing/outsideInterface -I/home/dquinlan/ROSE/svn-rose/src/midend/loopProcessing/prepostTransformation -I/home/dquinlan/ROSE/svn-rose/src/midend/ompLowering -I/home/dquinlan/ROSE/svn-rose/src/midend/programAnalysis -I/home/dquinlan/ROSE/svn-rose/src/midend/programAnalysis/CFG -I/home/dquinlan/ROSE/svn-rose/src/midend/programAnalysis/CallGraphAnalysis -I/home/dquinlan/ROSE/svn-rose/src/midend/programAnalysis/OAWrap -I/home/dquinlan/ROSE/svn-rose/src/midend/programAnalysis/dataflowAnalysis -I/home/dquinlan/ROSE/svn-rose/src/midend/programAnalysis/defUseAnalysis -I/home/dquinlan/ROSE/svn-rose/src/midend/programAnalysis/distributedMemoryAnalysis -I/home/dquinlan/ROSE/svn-rose/src/midend/programAnalysis/dominanceAnalysis -I/home/dquinlan/ROSE/svn-rose/src/midend/programAnalysis/graphAnalysis -I/home/dquinlan/ROSE/svn-rose/src/midend/programAnalysis/pointerAnal -I/home/dquinlan/ROSE/svn-rose/src/midend/programAnalysis/staticInterproceduralSlicing -I/home/dquinlan/ROSE/svn-rose/src/midend/programAnalysis/valuePropagation -I/home/dquinlan/ROSE/svn-rose/src/midend/programTransformation/partialRedundancyElimination -I/home/dquinlan/ROSE/svn-rose/src/midend/programTransformation/finiteDifferencing -I/home/dquinlan/ROSE/svn-rose/src/midend/programTransformation/functionCallNormalization -I/home/dquinlan/ROSE/svn-rose/src/midend/programTransformation/constantFolding -I/home/dquinlan/ROSE/svn-rose/src/midend/programTransformation/implicitCodeGeneration -I/home/dquinlan/ROSE/svn-rose/src/midend/programTransformation/runtimeTransformation -I/home/dquinlan/ROSE/svn-rose/src/roseSupport -I/home/dquinlan/ROSE/svn-rose/src/3rdPartyLibraries/MSTL -I/home/dquinlan/ROSE/svn-rose/src/3rdPartyLibraries/libharu-2.1.0/include -I../../../src/3rdPartyLibraries/libharu-2.1.0/include -I/home/dquinlan/ROSE/svn-rose/src/3rdPartyLibraries/qrose/Framework -I/home/dquinlan/ROSE/svn-rose/src/3rdPartyLibraries/qrose/Widgets -I/home/dquinlan/ROSE/svn-rose/projects/dataBase -I/home/dquinlan/ROSE/svn-rose/src/util/graphs -I/home/dquinlan/ROSE/svn-rose/src/midend/astUtil/astInterface -I/home/dquinlan/ROSE/svn-rose/libltdl -I/home/dquinlan/local/boost_1_37_0_installTree-gxx-4.2.2/include/boost-1_37 -DBOOST_REGEX_MATCH_EXTRA -I/usr/apps/java/jdk1.5.0_11/bin/../include -I/usr/apps/java/jdk1.5.0_11/bin/../include/linux -fPIC -DYY_NO_TOP_STATE -DYY_NO_POP_STATE -c Cxx_Grammar.C -fPIC -DPIC -o .libs/Cxx_Grammar.o >& Cxx_Grammar.verbose_output +# +# +# +# +# +# +# +# +# +# diff --git a/src/frontend/SageIII/astFileIO/CMakeLists.txt b/src/frontend/SageIII/astFileIO/CMakeLists.txt new file mode 100644 index 0000000000..68c4289259 --- /dev/null +++ b/src/frontend/SageIII/astFileIO/CMakeLists.txt @@ -0,0 +1,49 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### install files ############### + +install(FILES StorageClassMemoryManagement.h DESTINATION ${INCLUDE_INSTALL_DIR}) +install(FILES AstSpecificDataManagingClass.h DESTINATION ) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#INCLUDES = $(ROSE_INCLUDES) +# +## noinst_LTLIBRARIES = libastFileIO.la +# +## DQ (10/18/2007): These have been moved to the src/frontend/SageIII directory +## to provde greater parallelism to the make -jn parallel make feature. +## libastFileIO_la_SOURCES = AST_FILE_IO.C StorageClasses.C +# +## AST_FILE_IO.lo: StorageClassMemoryManagement.h +#StorageClasses.lo: StorageClassMemoryManagement.h StorageClassMemoryManagement.C AstSpecificDataManagingClass.h +# +#include_HEADERS = \ +# StorageClassMemoryManagement.h +# +## This file is generated +#nodist_include_HEADERS = \ +# AstSpecificDataManagingClass.h +# +#ROSETTA_GENERATED_FILES = AstSpecificDataManagingClass.h SourcesOfIRNodesAstFileIOSupport.C +# +#$(ROSETTA_GENERATED_FILES): rosetta-files-built +# +#rosetta-files-built: +# cd ../../../ROSETTA/src; $(MAKE) +# +## AST_FILE_IO.h +## StorageClasses.h +# +#EXTRA_DIST = StorageClassMemoryManagement.C +# +## DQ (3/28/2006): Remove all generated code +#clean-local: +# rm -rf AST_FILE_IO.h AST_FILE_IO.C StorageClasses.h StorageClasses.C +# rm -rf SourcesOfIRNodesAstFileIOSupport.C AstSpecificDataManagingClass.h diff --git a/src/frontend/SageIII/astFixup/CMakeLists.txt b/src/frontend/SageIII/astFixup/CMakeLists.txt new file mode 100644 index 0000000000..e139b400c4 --- /dev/null +++ b/src/frontend/SageIII/astFixup/CMakeLists.txt @@ -0,0 +1,49 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +#add_library( astFixup ${astFixup_SRC} ) +#add_dependencies( astFixup ROSETTA ) +########### install files ############### + +install(FILES AstFixup.h fixupFunctionDefinitions.h fixupStorageAccessOfForwardTemplateDeclarations.h removeInitializedNamePtr.h fixupforGnuBackendCompiler.h fixupInClassDataInitialization.h fixupTemplateDeclarations.h fixupSourcePositionInformation.h fixupEnumValues.h fixupFriendTemplateDeclarations.h DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#INCLUDES = $(ROSE_INCLUDES) +# +#noinst_LTLIBRARIES = libastFixup.la +# +#libastFixup_la_SOURCES = \ +# AstFixup.C \ +# fixupforGnuBackendCompiler.C \ +# fixupInClassDataInitialization.C \ +# removeInitializedNamePtr.C \ +# fixupDeclarations2.C \ +# fixupFunctionDefinitions.C \ +# fixupStorageAccessOfForwardTemplateDeclarations.C \ +# fixupSourcePositionInformation.C \ +# fixupEnumValues.C \ +# fixupFriendTemplateDeclarations.C +# +#libastFixup_la_LIBADD = +#libastFixup_la_DEPENDENCIES = +# +#include_HEADERS = \ +# AstFixup.h \ +# fixupFunctionDefinitions.h \ +# fixupStorageAccessOfForwardTemplateDeclarations.h \ +# removeInitializedNamePtr.h \ +# fixupforGnuBackendCompiler.h \ +# fixupInClassDataInitialization.h \ +# fixupTemplateDeclarations.h \ +# fixupSourcePositionInformation.h \ +# fixupEnumValues.h \ +# fixupFriendTemplateDeclarations.h diff --git a/src/frontend/SageIII/astFixup/fixupDeclarations2.C b/src/frontend/SageIII/astFixup/fixupDeclarations2.C index 7d261aa9d2..6f2a61a67b 100644 --- a/src/frontend/SageIII/astFixup/fixupDeclarations2.C +++ b/src/frontend/SageIII/astFixup/fixupDeclarations2.C @@ -5,7 +5,6 @@ void fixupTemplateDeclarations( SgNode* node ) { // DQ (7/7/2005): Introduce tracking of performance of ROSE. TimingPerformance timer ("Fixup template declarations:"); - // This simplifies how the traversal is called! FixupTemplateDeclarations astFixupTraversal; diff --git a/src/frontend/SageIII/astHiddenTypeAndDeclarationLists/CMakeLists.txt b/src/frontend/SageIII/astHiddenTypeAndDeclarationLists/CMakeLists.txt new file mode 100644 index 0000000000..e959f60d43 --- /dev/null +++ b/src/frontend/SageIII/astHiddenTypeAndDeclarationLists/CMakeLists.txt @@ -0,0 +1,37 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + +set( libastHiddenTypeAndDeclarationLists_SRC + HiddenList.C HiddenList_Intersection.C HiddenList_Output.C NamespacesAndClassTraversal.C + ) + +add_library( libastHiddenTypeAndDeclarationLists ${libastHiddenTypeAndDeclarationLists_SRC} ) +add_dependencies( libastHiddenTypeAndDeclarationLists ROSETTA ) + +########### install files ############### + +install(FILES HiddenList.h HiddenList_Intersection.h HiddenList_Output.h DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#INCLUDES = $(ROSE_INCLUDES) +# +#noinst_LTLIBRARIES = libastHiddenTypeAndDeclarationLists.la +# +#libastHiddenTypeAndDeclarationLists_la_SOURCES = \ +# HiddenList.C HiddenList_Intersection.C HiddenList_Output.C NamespacesAndClassTraversal.C +# +## HiddenList_main.C HiddenList_Output.C +# +#libastHiddenTypeAndDeclarationLists_la_LIBADD = +#libastHiddenTypeAndDeclarationLists_la_DEPENDENCIES = +# +#include_HEADERS = \ +# HiddenList.h HiddenList_Intersection.h HiddenList_Output.h diff --git a/src/frontend/SageIII/astMerge/CMakeLists.txt b/src/frontend/SageIII/astMerge/CMakeLists.txt new file mode 100644 index 0000000000..0d22ba4d5a --- /dev/null +++ b/src/frontend/SageIII/astMerge/CMakeLists.txt @@ -0,0 +1,46 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### +set( libastMerge_SRC + merge_support.C test_support.C buildMangledNameMap.C buildSetOfFrontendSpecificNodes.C + deleteNodes.C fixupTraversal.C nullifyAST.C buildReplacementMap.C collectAssociateNodes.C + deleteOrphanNodes.C normalizeTypes.C requiredNodes.C merge.C AstFixParentTraversal.C + ) + +add_library( libastMerge ${libastMerge_SRC} ) +add_dependencies( libastMerge ROSETTA ) + +########### install files ############### + +install(FILES buildMangledNameMap.h buildReplacementMap.h collectAssociateNodes.h deleteOrphanNodes.h fixupTraversal.h merge.h merge_support.h nullifyAST.h test_support.h requiredNodes.h astMergeAPI.h AstFixParentTraversal.h DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#INCLUDES = $(ROSE_INCLUDES) +# +## Some source code is generated (call make in ROSE/src/ROSETTA/src to generate these files) +#GENERATED_SOURCE = ../Cxx_Grammar.C ../Cxx_GrammarTreeTraversalSuccessorContainer.C ../Cxx_GrammarRTI.C +#GENERATED_OBJECTS = ../Cxx_Grammar.o ../Cxx_GrammarTreeTraversalSuccessorContainer.o ../Cxx_GrammarRTI.o +# +#$(GENERATED_SOURCE): +# cd $(top_builddir)/src/ROSETTA/src; $(MAKE) +# +#noinst_LTLIBRARIES = libastMerge.la +#libastMerge_la_SOURCES = \ +# merge_support.C test_support.C buildMangledNameMap.C buildSetOfFrontendSpecificNodes.C \ +# deleteNodes.C fixupTraversal.C nullifyAST.C buildReplacementMap.C collectAssociateNodes.C \ +# deleteOrphanNodes.C normalizeTypes.C requiredNodes.C merge.C AstFixParentTraversal.C +# +#libastMerge_la_LIBADD = +#libastMerge_la_DEPENDENCIES = $(GENERATED_SOURCE) +# +#include_HEADERS = \ +# buildMangledNameMap.h buildReplacementMap.h collectAssociateNodes.h deleteOrphanNodes.h \ +# fixupTraversal.h merge.h merge_support.h nullifyAST.h test_support.h requiredNodes.h astMergeAPI.h AstFixParentTraversal.h +# diff --git a/src/frontend/SageIII/astPostProcessing/CMakeLists.txt b/src/frontend/SageIII/astPostProcessing/CMakeLists.txt new file mode 100644 index 0000000000..10135e6ce6 --- /dev/null +++ b/src/frontend/SageIII/astPostProcessing/CMakeLists.txt @@ -0,0 +1,113 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + +set( libastPostProcessing_SRC + astPostProcessing.C + fixupSymbolTables.C + markForOutputInCodeGeneration.C + processTemplateHandlingOptions.C + checkIsModifiedFlag.C + fixupTemplateInstantiations.C + markTemplateInstantiationsForOutput.C + resetParentPointers.C + fixupDefiningAndNondefiningDeclarations.C + markCompilerGenerated.C + markTemplateSpecializationsForOutput.C + resetTemplateNames.C + initializeExplicitScopeData.C + fixupDeclarations.C + markOverloadedTemplateInstantiations.C + markTransformationsForOutput.C + markBackendCompilerSpecificFunctions.C + fixupNullPointers.C + fixupNames.C + fixupTypes.C + fixupConstructorPreinitializationLists.C + propagateHiddenListData.C + resolveFortranReferences.C + insertFortranContainsStatement.C + markLhsValues.C + fixupUseAndUsingDeclarations.C + buildStatementNumbering.C + ) + +add_library( libastPostProcessing ${libastPostProcessing_SRC} ) +add_dependencies( libastPostProcessing ROSETTA ) + + +########### install files ############### + +install(FILES astPostProcessing.h fixupDefiningAndNondefiningDeclarations.h markCompilerGenerated.h markTemplateSpecializationsForOutput.h resetTemplateNames.h checkIsModifiedFlag.h fixupSymbolTables.h markForOutputInCodeGeneration.h processTemplateHandlingOptions.h fixupDeclarations.h fixupTemplateInstantiations.h markTemplateInstantiationsForOutput.h resetParentPointers.h initializeExplicitScopeData.h markOverloadedTemplateInstantiations.h markTransformationsForOutput.h markBackendCompilerSpecificFunctions.h fixupNullPointers.h fixupNames.h fixupTypes.h fixupConstructorPreinitializationLists.h propagateHiddenListData.h resolveFortranReferences.h insertFortranContainsStatement.h markLhsValues.h fixupUseAndUsingDeclarations.h DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#INCLUDES = $(ROSE_INCLUDES) +# +#noinst_LTLIBRARIES = libastPostProcessing.la +# +#libastPostProcessing_la_SOURCES = \ +# astPostProcessing.C \ +# fixupSymbolTables.C \ +# markForOutputInCodeGeneration.C \ +# processTemplateHandlingOptions.C \ +# checkIsModifiedFlag.C \ +# fixupTemplateInstantiations.C \ +# markTemplateInstantiationsForOutput.C \ +# resetParentPointers.C \ +# fixupDefiningAndNondefiningDeclarations.C \ +# markCompilerGenerated.C \ +# markTemplateSpecializationsForOutput.C \ +# resetTemplateNames.C \ +# initializeExplicitScopeData.C \ +# fixupDeclarations.C \ +# markOverloadedTemplateInstantiations.C \ +# markTransformationsForOutput.C \ +# markBackendCompilerSpecificFunctions.C \ +# fixupNullPointers.C \ +# fixupNames.C \ +# fixupTypes.C \ +# fixupConstructorPreinitializationLists.C \ +# propagateHiddenListData.C \ +# resolveFortranReferences.C \ +# insertFortranContainsStatement.C \ +# markLhsValues.C \ +# fixupUseAndUsingDeclarations.C \ +# buildStatementNumbering.C +# +#libastPostProcessing_la_LIBADD = +#libastPostProcessing_la_DEPENDENCIES = +# +#include_HEADERS = \ +# astPostProcessing.h \ +# fixupDefiningAndNondefiningDeclarations.h \ +# markCompilerGenerated.h \ +# markTemplateSpecializationsForOutput.h \ +# resetTemplateNames.h \ +# checkIsModifiedFlag.h \ +# fixupSymbolTables.h \ +# markForOutputInCodeGeneration.h \ +# processTemplateHandlingOptions.h \ +# fixupDeclarations.h \ +# fixupTemplateInstantiations.h \ +# markTemplateInstantiationsForOutput.h \ +# resetParentPointers.h \ +# initializeExplicitScopeData.h \ +# markOverloadedTemplateInstantiations.h \ +# markTransformationsForOutput.h \ +# markBackendCompilerSpecificFunctions.h \ +# fixupNullPointers.h \ +# fixupNames.h \ +# fixupTypes.h \ +# fixupConstructorPreinitializationLists.h \ +# propagateHiddenListData.h \ +# resolveFortranReferences.h \ +# insertFortranContainsStatement.h \ +# markLhsValues.h \ +# fixupUseAndUsingDeclarations.h diff --git a/src/frontend/SageIII/astTokenStream/CMakeLists.txt b/src/frontend/SageIII/astTokenStream/CMakeLists.txt new file mode 100644 index 0000000000..79593cb31e --- /dev/null +++ b/src/frontend/SageIII/astTokenStream/CMakeLists.txt @@ -0,0 +1,39 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + +set( libastTokenStream_SRC + createMap.C doCompleteMapping.C linearizeAST.C unparseMacro.C + ) + +add_library( libastTokenStream ${libastTokenStream_SRC} ) +add_dependencies( libastTokenStream ROSETTA ) + +########### install files ############### + +install(FILES createMap.h doCompleteMapping.h linearizeAST.h unparseMacro.h DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#INCLUDES = $(ROSE_INCLUDES) +# +#if ROSE_USE_BOOST_WAVE +# +#noinst_LTLIBRARIES = libastTokenStream.la +# +#libastTokenStream_la_SOURCES = \ +# createMap.C doCompleteMapping.C linearizeAST.C unparseMacro.C +# +#libastTokenStream_la_LIBADD = +#libastTokenStream_la_DEPENDENCIES = +# +#include_HEADERS = \ +# createMap.h doCompleteMapping.h linearizeAST.h unparseMacro.h +# +#endif diff --git a/src/frontend/SageIII/astVisualization/CMakeLists.txt b/src/frontend/SageIII/astVisualization/CMakeLists.txt new file mode 100644 index 0000000000..6de659def5 --- /dev/null +++ b/src/frontend/SageIII/astVisualization/CMakeLists.txt @@ -0,0 +1,37 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + +set( libastVisualization_SRC astGraph.C AstAttributeDOT.C wholeAST.C copyGraph.C walrus.C ) +add_library( libastVisualization ${libastVisualization_SRC} ) +add_dependencies( libastVisualization ROSETTA ) + +########### install files ############### + +install(FILES AstAttributeDOT.h astGraph.h astGraphTemplateImpl.h wholeAST.h wholeAST_API.h copyGraph.h walrus.h DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#INCLUDES = $(ROSE_INCLUDES) +# +#noinst_LTLIBRARIES = libastVisualization.la +# +## DQ (2/26/2009): Added copyGraph.[hC], also note that copyGraph.C has +## a dependence on a TCLSH script that is located in the scripts directory. +#libastVisualization_la_SOURCES = astGraph.C AstAttributeDOT.C wholeAST.C copyGraph.C walrus.C +# +## colorFilesTraversal.C colorMemoryPoolTraversal.C \ +## customAstDOTGeneration.C customAstDOTGenerationData.C \ +## customMemoryPoolDOTGeneration.C customMemoryPoolDOTGenerationData.C +# +#libastVisualization_la_LIBADD = +#libastVisualization_la_DEPENDENCIES = +# +#include_HEADERS = AstAttributeDOT.h astGraph.h astGraphTemplateImpl.h wholeAST.h wholeAST_API.h copyGraph.h walrus.h +# diff --git a/src/frontend/SageIII/sageInterface/CMakeLists.txt b/src/frontend/SageIII/sageInterface/CMakeLists.txt new file mode 100644 index 0000000000..033a8239e3 --- /dev/null +++ b/src/frontend/SageIII/sageInterface/CMakeLists.txt @@ -0,0 +1,64 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### +set( libsageInterface_SRC + sageInterface.C + sageInterface_asm.C + sageInterface_type.C + generateUniqueName.C + sageBuilder.C + sageBuilderAsm.C + abiStuff.C + ) + +add_library( libsageInterface ${libsageInterface_SRC} ) +add_dependencies( libsageInterface ROSETTA ) + +########### install files ############### + +install(FILES sageInterface.h sageBuilder.h sageBuilderAsm.h endianWrappers.h integerOps.h abiStuff.h DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#INCLUDES = $(ROSE_INCLUDES) +# +#noinst_LTLIBRARIES = libsageInterface.la +#libsageInterface_la_SOURCES = \ +# sageInterface.C \ +# sageInterface_asm.C \ +# sageInterface_type.C \ +# generateUniqueName.C \ +# sageBuilder.C \ +# sageBuilderAsm.C \ +# abiStuff.C +## highLevelInterface.C +# +## buildSetOfFrontendSpecificNodes.C +# +#libsageInterface_la_LIBADD = +#libsageInterface_la_DEPENDENCIES = +# +#include_HEADERS = \ +# sageInterface.h \ +# sageBuilder.h \ +# sageBuilderAsm.h \ +# endianWrappers.h \ +# integerOps.h \ +# abiStuff.h +## highLevelInterface.h +## loopHelpers.h +# +##libsageInterface.la: $(libastFixup_la_OBJECTS) $(libastFixup_la_DEPENDENCIES) +## -rm -f $@ +## $(CXX_SHARED_LIB_UPDATE) $@ $(libastFixup_la_OBJECTS) $(libastFixup_la_LIBADD) +## test -f $@ || exit 1 +# +# +## noinst_PROGRAMS = testForBug +## testForBug_SOURCES = testForBug.C diff --git a/src/frontend/SageIII/virtualCFG/CMakeLists.txt b/src/frontend/SageIII/virtualCFG/CMakeLists.txt new file mode 100644 index 0000000000..cb1046e559 --- /dev/null +++ b/src/frontend/SageIII/virtualCFG/CMakeLists.txt @@ -0,0 +1,43 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +#add_library( virtualCFG ${virtualCFG_SRC} ) +#add_dependencies( virtualCFG ROSETTA ) +########### install files ############### + +install(FILES virtualCFG.h virtualBinCFG.h cfgToDot.h filteredCFG.h filteredCFGImpl.h DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#INCLUDES = $(ROSE_INCLUDES) +# +## Some source code is generated (call make in ROSE/src/ROSETTA/src to generate these files) +#GENERATED_SOURCE = ../Cxx_Grammar.C ../Cxx_GrammarTreeTraversalSuccessorContainer.C ../Cxx_GrammarRTI.C +#GENERATED_OBJECTS = ../Cxx_Grammar.o ../Cxx_GrammarTreeTraversalSuccessorContainer.o ../Cxx_GrammarRTI.o +#$(GENERATED_SOURCE): +# cd $(top_builddir)/src/ROSETTA/src; $(MAKE) +# +#noinst_LTLIBRARIES = libvirtualCFG.la +#libvirtualCFG_la_SOURCES = \ +# virtualCFG.C \ +# virtualBinCFG.C \ +# cfgToDot.C \ +# memberFunctions.C +# +#libvirtualCFG_la_LIBADD = +#libvirtualCFG_la_DEPENDENCIES = $(GENERATED_SOURCE) +# +#include_HEADERS = \ +# virtualCFG.h \ +# virtualBinCFG.h \ +# cfgToDot.h \ +# filteredCFG.h \ +# filteredCFGImpl.h diff --git a/src/midend/CMakeLists.txt b/src/midend/CMakeLists.txt new file mode 100644 index 0000000000..13893daf3c --- /dev/null +++ b/src/midend/CMakeLists.txt @@ -0,0 +1,312 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + +add_subdirectory(abstractHandle) +add_subdirectory(astDiagnostics) +add_subdirectory(astInlining) +add_subdirectory(astOutlining) +add_subdirectory(astProcessing) +add_subdirectory(astQuery) +add_subdirectory(astRewriteMechanism) +add_subdirectory(astUtil) +add_subdirectory(binaryAnalyses) +add_subdirectory(loopProcessing) +add_subdirectory(ompLowering) +add_subdirectory(programAnalysis) +add_subdirectory(programTransformation) +########### next target ############### +set( midend_src +${CMAKE_SOURCE_DIR}/src/midend/astOutlining/NameGenerator.cc +${CMAKE_SOURCE_DIR}/src/midend/astOutlining/Preprocess.cc +${CMAKE_SOURCE_DIR}/src/midend/astOutlining/Outliner.cc +${CMAKE_SOURCE_DIR}/src/midend/astOutlining/Insert.cc +${CMAKE_SOURCE_DIR}/src/midend/astOutlining/NonLocalDecls.cc +${CMAKE_SOURCE_DIR}/src/midend/astOutlining/ExtractIfs.cc +${CMAKE_SOURCE_DIR}/src/midend/astOutlining/Case.cc +${CMAKE_SOURCE_DIR}/src/midend/astOutlining/Block.cc +${CMAKE_SOURCE_DIR}/src/midend/astOutlining/PreprocIfs.cc +${CMAKE_SOURCE_DIR}/src/midend/astOutlining/This.cc +${CMAKE_SOURCE_DIR}/src/midend/astOutlining/Check.cc +${CMAKE_SOURCE_DIR}/src/midend/astOutlining/NonLocalControlFlow.cc +${CMAKE_SOURCE_DIR}/src/midend/astOutlining/ASTtools.cc +${CMAKE_SOURCE_DIR}/src/midend/astOutlining/PrePostTraversal.cc +${CMAKE_SOURCE_DIR}/src/midend/astOutlining/GenerateFunc.cc +${CMAKE_SOURCE_DIR}/src/midend/astOutlining/IfDirectiveContextFinder.cc +${CMAKE_SOURCE_DIR}/src/midend/astOutlining/Jumps.cc +${CMAKE_SOURCE_DIR}/src/midend/astOutlining/IfDirectiveExtractor.cc +${CMAKE_SOURCE_DIR}/src/midend/astOutlining/VarSym.cc +${CMAKE_SOURCE_DIR}/src/midend/astOutlining/PreprocessingInfo.cc +${CMAKE_SOURCE_DIR}/src/midend/astOutlining/PragmaInterface.cc +${CMAKE_SOURCE_DIR}/src/midend/astOutlining/StmtRewrite.cc +${CMAKE_SOURCE_DIR}/src/midend/astOutlining/CollectVars.cc +${CMAKE_SOURCE_DIR}/src/midend/astOutlining/ThisExprs.cc +${CMAKE_SOURCE_DIR}/src/midend/astOutlining/Copy.cc +${CMAKE_SOURCE_DIR}/src/midend/astOutlining/If.cc +${CMAKE_SOURCE_DIR}/src/midend/astOutlining/Transform.cc +${CMAKE_SOURCE_DIR}/src/midend/astOutlining/GenerateCall.cc +#${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/annotationLanguageParser/language-lexer.cc +#${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/annotationLanguageParser/language-parser.cc +#${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/annotationLanguageParser/annotations.cc +#${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/annotationLanguageParser/annvariable.cc +#${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/annotationLanguageParser/structure.cc +#${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/annotationLanguageParser/enum_property.cc +#${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/annotationLanguageParser/procedure.cc +#${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/annotationLanguageParser/set_property.cc +#${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/annotationLanguageParser/pointerrule.cc +#${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/annotationLanguageParser/analyze.cc +#${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/annotationLanguageParser/rule.cc +#${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/annotationLanguageParser/broadway_expr.cc +#${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/annotationLanguageParser/report.cc +${CMAKE_SOURCE_DIR}/src/midend/ompLowering/omp_lowering.cpp +${CMAKE_SOURCE_DIR}/src/midend/binaryAnalyses/RoseBin_CallGraphAnalysis.cpp +${CMAKE_SOURCE_DIR}/src/midend/binaryAnalyses/RoseBin_FlowAnalysis.cpp +${CMAKE_SOURCE_DIR}/src/midend/binaryAnalyses/RoseBin_DataFlowAnalysis.cpp +${CMAKE_SOURCE_DIR}/src/midend/binaryAnalyses/RoseBin_CompareAnalysis.cpp +${CMAKE_SOURCE_DIR}/src/midend/binaryAnalyses/RoseBin_printInstructions.cpp +${CMAKE_SOURCE_DIR}/src/midend/binaryAnalyses/RoseBin_ControlFlowAnalysis.cpp +${CMAKE_SOURCE_DIR}/src/midend/binaryAnalyses/dataflowanalyses/RoseBin_Emulate.cpp +${CMAKE_SOURCE_DIR}/src/midend/binaryAnalyses/dataflowanalyses/RoseBin_DataFlowAbstract.cpp +${CMAKE_SOURCE_DIR}/src/midend/binaryAnalyses/dataflowanalyses/RoseBin_VariableAnalysis.cpp +${CMAKE_SOURCE_DIR}/src/midend/binaryAnalyses/dataflowanalyses/InterruptAnalysis.cpp +${CMAKE_SOURCE_DIR}/src/midend/binaryAnalyses/dataflowanalyses/RoseBin_DefUseAnalysis.cpp +${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/defUseAnalysis/DefUseAnalysisAbstract.cpp +${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/defUseAnalysis/DefUseAnalysis.cpp +${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/defUseAnalysis/GlobalVarAnalysis.cpp +${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/defUseAnalysis/LivenessAnalysis.cpp +${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/defUseAnalysis/dfaToDot.cpp +${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/defUseAnalysis/DefUseAnalysis_perFunction.cpp +#${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/defUseAnalysis/runTest.cpp +${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/graphAnalysis/RoseBin_GmlGraph.cpp +${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/graphAnalysis/RoseBin_Graph.cpp +${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/graphAnalysis/RoseBin_DotGraph.cpp +${CMAKE_SOURCE_DIR}/src/midend/abstractHandle/abstract_handle.cpp +${CMAKE_SOURCE_DIR}/src/midend/abstractHandle/loopAdapter.cpp +${CMAKE_SOURCE_DIR}/src/midend/abstractHandle/roseAdapter.cpp +${CMAKE_SOURCE_DIR}/src/midend/astUtil/astInterface/CPPAstInterface.C +${CMAKE_SOURCE_DIR}/src/midend/astUtil/astInterface/AstInterface.C +${CMAKE_SOURCE_DIR}/src/midend/astUtil/symbolicVal/SymbolicVal.C +${CMAKE_SOURCE_DIR}/src/midend/astUtil/symbolicVal/SymbolicOperator.C +${CMAKE_SOURCE_DIR}/src/midend/astUtil/symbolicVal/SymbolicUnwrapCond.C +${CMAKE_SOURCE_DIR}/src/midend/astUtil/symbolicVal/SymbolicBound.C +${CMAKE_SOURCE_DIR}/src/midend/astUtil/symbolicVal/SymbolicFind.C +${CMAKE_SOURCE_DIR}/src/midend/astUtil/symbolicVal/SymbolicExpr.C +${CMAKE_SOURCE_DIR}/src/midend/astUtil/annotation/OperatorAnnotation.C +${CMAKE_SOURCE_DIR}/src/midend/astUtil/annotation/AnnotIO.C +${CMAKE_SOURCE_DIR}/src/midend/astUtil/annotation/AnnotGen.C +${CMAKE_SOURCE_DIR}/src/midend/astUtil/annotation/AnnotCollect.C +${CMAKE_SOURCE_DIR}/src/midend/astUtil/annotation/AnnotDescriptors.C +${CMAKE_SOURCE_DIR}/src/midend/astUtil/annotation/OperatorDescriptors.C +${CMAKE_SOURCE_DIR}/src/midend/astUtil/annotation/AnnotExpr.C +${CMAKE_SOURCE_DIR}/src/midend/astUtil/annotation/TypeAnnotation.C +${CMAKE_SOURCE_DIR}/src/midend/astUtil/astSupport/ProcessAstTree.C +${CMAKE_SOURCE_DIR}/src/midend/astUtil/astSupport/StmtInfoCollect.C +${CMAKE_SOURCE_DIR}/src/midend/astInlining/isPotentiallyModified.C +${CMAKE_SOURCE_DIR}/src/midend/astInlining/replaceExpressionWithStatement.C +${CMAKE_SOURCE_DIR}/src/midend/astInlining/inliner.C +${CMAKE_SOURCE_DIR}/src/midend/astInlining/inlinerSupport.C +${CMAKE_SOURCE_DIR}/src/midend/loopProcessing/prepostTransformation/PrivatizeScalar.C +${CMAKE_SOURCE_DIR}/src/midend/loopProcessing/prepostTransformation/BreakupStmt.C +${CMAKE_SOURCE_DIR}/src/midend/loopProcessing/prepostTransformation/LoopUnroll.C +${CMAKE_SOURCE_DIR}/src/midend/loopProcessing/computation/LoopTreeTransform.C +${CMAKE_SOURCE_DIR}/src/midend/loopProcessing/computation/LoopTree.C +${CMAKE_SOURCE_DIR}/src/midend/loopProcessing/computation/LoopTreeDummyNode.C +${CMAKE_SOURCE_DIR}/src/midend/loopProcessing/computation/LoopTreeShadow.C +${CMAKE_SOURCE_DIR}/src/midend/loopProcessing/computation/DepCompTransform.C +${CMAKE_SOURCE_DIR}/src/midend/loopProcessing/computation/LoopTreeDepComp.C +${CMAKE_SOURCE_DIR}/src/midend/loopProcessing/computation/LoopTreeLocality.C +${CMAKE_SOURCE_DIR}/src/midend/loopProcessing/slicing/CompSliceDepGraph.C +${CMAKE_SOURCE_DIR}/src/midend/loopProcessing/slicing/DynamicCompSlice.C +${CMAKE_SOURCE_DIR}/src/midend/loopProcessing/slicing/CompSliceLocality.C +${CMAKE_SOURCE_DIR}/src/midend/loopProcessing/slicing/CompSlice.C +${CMAKE_SOURCE_DIR}/src/midend/loopProcessing/slicing/DependenceHoisting.C +${CMAKE_SOURCE_DIR}/src/midend/loopProcessing/depGraph/TransDepGraph.C +${CMAKE_SOURCE_DIR}/src/midend/loopProcessing/depGraph/DepGraphBuild.C +${CMAKE_SOURCE_DIR}/src/midend/loopProcessing/depGraph/LoopAnalysis.C +${CMAKE_SOURCE_DIR}/src/midend/loopProcessing/outsideInterface/ArrayRewrite.C +${CMAKE_SOURCE_DIR}/src/midend/loopProcessing/outsideInterface/ArrayAnnot.C +${CMAKE_SOURCE_DIR}/src/midend/loopProcessing/outsideInterface/ArrayInterface.C +${CMAKE_SOURCE_DIR}/src/midend/loopProcessing/driver/CopyArrayAnal.C +${CMAKE_SOURCE_DIR}/src/midend/loopProcessing/driver/LoopTransformInterface.C +${CMAKE_SOURCE_DIR}/src/midend/loopProcessing/driver/FusionAnal.C +${CMAKE_SOURCE_DIR}/src/midend/loopProcessing/driver/NormalizeCPP.C +${CMAKE_SOURCE_DIR}/src/midend/loopProcessing/driver/InterchangeAnal.C +${CMAKE_SOURCE_DIR}/src/midend/loopProcessing/driver/LoopTransformOptions.C +${CMAKE_SOURCE_DIR}/src/midend/loopProcessing/driver/TransformComputation.C +${CMAKE_SOURCE_DIR}/src/midend/loopProcessing/driver/BlockingAnal.C +${CMAKE_SOURCE_DIR}/src/midend/loopProcessing/driver/TypedFusionImpl.C +${CMAKE_SOURCE_DIR}/src/midend/loopProcessing/depInfo/StmtDepAnal.C +#${CMAKE_SOURCE_DIR}/src/midend/loopProcessing/depInfo/DepTestStatistics.C +#${CMAKE_SOURCE_DIR}/src/midend/loopProcessing/depInfo/PlatoOmegaInterface.C +${CMAKE_SOURCE_DIR}/src/midend/loopProcessing/depInfo/DepInfo.C +${CMAKE_SOURCE_DIR}/src/midend/loopProcessing/depInfo/DepRel.C +${CMAKE_SOURCE_DIR}/src/midend/loopProcessing/depInfo/DepInfoSet.C +${CMAKE_SOURCE_DIR}/src/midend/loopProcessing/depInfo/DomainInfo.C +${CMAKE_SOURCE_DIR}/src/midend/loopProcessing/depInfo/DepEDD.C +${CMAKE_SOURCE_DIR}/src/midend/loopProcessing/depInfo/ReuseAnalysis.C +${CMAKE_SOURCE_DIR}/src/midend/loopProcessing/depInfo/DepInfoAnal.C +${CMAKE_SOURCE_DIR}/src/midend/astProcessing/AstRestructure.C +${CMAKE_SOURCE_DIR}/src/midend/astProcessing/AstProcessing.C +${CMAKE_SOURCE_DIR}/src/midend/astProcessing/AstCombinedSimpleProcessing.C +${CMAKE_SOURCE_DIR}/src/midend/astProcessing/AstNodePtrs.C +${CMAKE_SOURCE_DIR}/src/midend/astProcessing/AstNodeVisitMapping.C +${CMAKE_SOURCE_DIR}/src/midend/astProcessing/AstDOTGeneration.C +${CMAKE_SOURCE_DIR}/src/midend/astProcessing/AstAttributeMechanism.C +${CMAKE_SOURCE_DIR}/src/midend/astProcessing/AstSimpleProcessing.C +${CMAKE_SOURCE_DIR}/src/midend/astProcessing/AstClearVisitFlags.C +${CMAKE_SOURCE_DIR}/src/midend/astProcessing/AstSuccessorsSelectors.C +${CMAKE_SOURCE_DIR}/src/midend/astProcessing/AstPDFGeneration.C +${CMAKE_SOURCE_DIR}/src/midend/astProcessing/AstTextAttributesHandling.C +${CMAKE_SOURCE_DIR}/src/midend/astProcessing/Ast.C +${CMAKE_SOURCE_DIR}/src/midend/astProcessing/AstTraversal.C +${CMAKE_SOURCE_DIR}/src/midend/astProcessing/AstSharedMemoryParallelSimpleProcessing.C +${CMAKE_SOURCE_DIR}/src/midend/astProcessing/AstReverseSimpleProcessing.C +${CMAKE_SOURCE_DIR}/src/midend/astQuery/nodeQueryInheritedAttribute.C +${CMAKE_SOURCE_DIR}/src/midend/astQuery/nameQuery.C +${CMAKE_SOURCE_DIR}/src/midend/astQuery/astQueryInheritedAttribute.C +${CMAKE_SOURCE_DIR}/src/midend/astQuery/numberQueryInheritedAttribute.C +${CMAKE_SOURCE_DIR}/src/midend/astQuery/booleanQuery.C +${CMAKE_SOURCE_DIR}/src/midend/astQuery/booleanQueryInheritedAttribute.C +${CMAKE_SOURCE_DIR}/src/midend/astQuery/numberQuery.C +${CMAKE_SOURCE_DIR}/src/midend/astQuery/astQuery.C +${CMAKE_SOURCE_DIR}/src/midend/astQuery/nameQueryInheritedAttribute.C +#${CMAKE_SOURCE_DIR}/src/midend/astQuery/queryVariant.C +${CMAKE_SOURCE_DIR}/src/midend/astQuery/nodeQuery.C +${CMAKE_SOURCE_DIR}/src/midend/astRewriteMechanism/rewriteLowLevelInterface.C +${CMAKE_SOURCE_DIR}/src/midend/astRewriteMechanism/inputProgram1.C +${CMAKE_SOURCE_DIR}/src/midend/astRewriteMechanism/nodeCollection.C +${CMAKE_SOURCE_DIR}/src/midend/astRewriteMechanism/rewriteDebuggingSupport.C +${CMAKE_SOURCE_DIR}/src/midend/astRewriteMechanism/rewriteHighLevelInterface.C +${CMAKE_SOURCE_DIR}/src/midend/astRewriteMechanism/inputProgram3.C +${CMAKE_SOURCE_DIR}/src/midend/astRewriteMechanism/inputProgram2.C +${CMAKE_SOURCE_DIR}/src/midend/astRewriteMechanism/rewriteMidLevelInterface.C +${CMAKE_SOURCE_DIR}/src/midend/astRewriteMechanism/rewriteSynthesizedAttribute.C +${CMAKE_SOURCE_DIR}/src/midend/astRewriteMechanism/rewriteAccumulatedAttribute.C +${CMAKE_SOURCE_DIR}/src/midend/astRewriteMechanism/rewriteTemplateInstantiations.C +${CMAKE_SOURCE_DIR}/src/midend/astRewriteMechanism/inputProgram4.C +${CMAKE_SOURCE_DIR}/src/midend/astRewriteMechanism/rewriteTypeDeclaration.C +${CMAKE_SOURCE_DIR}/src/midend/astRewriteMechanism/rewriteASTFragementString.C +${CMAKE_SOURCE_DIR}/src/midend/programTransformation/implicitCodeGeneration/defaultFunctionGenerator.C +${CMAKE_SOURCE_DIR}/src/midend/programTransformation/implicitCodeGeneration/destructorCallAnnotator.C +${CMAKE_SOURCE_DIR}/src/midend/programTransformation/implicitCodeGeneration/analysisUtils.C +${CMAKE_SOURCE_DIR}/src/midend/programTransformation/implicitCodeGeneration/shortCircuitingTransformation.C +${CMAKE_SOURCE_DIR}/src/midend/programTransformation/partialRedundancyElimination/expressionTreeEqual.C +${CMAKE_SOURCE_DIR}/src/midend/programTransformation/partialRedundancyElimination/controlFlowGraph.C +${CMAKE_SOURCE_DIR}/src/midend/programTransformation/partialRedundancyElimination/pre.C +${CMAKE_SOURCE_DIR}/src/midend/programTransformation/constantFolding/constantFolding.C +${CMAKE_SOURCE_DIR}/src/midend/programTransformation/functionCallNormalization/FunctionNormalization.C +${CMAKE_SOURCE_DIR}/src/midend/programTransformation/finiteDifferencing/finiteDifferencing.C +${CMAKE_SOURCE_DIR}/src/midend/programTransformation/finiteDifferencing/patternRewrite.C +${CMAKE_SOURCE_DIR}/src/midend/binaryAnalyses/GraphAlgorithms.C +${CMAKE_SOURCE_DIR}/src/midend/binaryAnalyses/binary_analysis.C +#${CMAKE_SOURCE_DIR}/src/midend/binaryAnalyses/libraryIdentification/libraryIdentification_writer.C +#${CMAKE_SOURCE_DIR}/src/midend/binaryAnalyses/libraryIdentification/libraryIdentification_reader.C +#${CMAKE_SOURCE_DIR}/src/midend/binaryAnalyses/libraryIdentification/functionIdentification.C +${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/valuePropagation/ValueAnnot.C +${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/valuePropagation/ValuePropagate.C +${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/OAWrap/OAWrap.C +${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/OAWrap/SAGE2OA.C +#${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/proceduralSlicing/SlicingInfo.C +#${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/sideEffectAnalysis/sideEffect.C +${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/CallGraphAnalysis/CallGraphDB.C +${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/CallGraphAnalysis/CallGraph.C +#${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/CallGraphAnalysis/callgraph_example.C +${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/CallGraphAnalysis/ClassHierarchyGraph.C +#${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/OpenAnalysis/CFG/OARIFG.C +#${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/OpenAnalysis/CFG/TarjanIntervals.C +#${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/OpenAnalysis/CFG/CFG.C +#${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/OpenAnalysis/CallGraph/CallGraph.C +#${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/OpenAnalysis/Utils/BaseGraph.C +#${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/OpenAnalysis/Utils/Tree.C +#${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/OpenAnalysis/Utils/DGraph.C +#${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/OpenAnalysis/Utils/UnionFindUniverse.C +#${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/OpenAnalysis/Utils/Graph.C +#${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/OpenAnalysis/Utils/trtest.C +#${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/OpenAnalysis/Utils/grtest.C +#${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/OpenAnalysis/SSA/DomTree.C +#${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/OpenAnalysis/SSA/SSA.C +#${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/OpenAnalysis/SSA/Phi.C +#${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/staticInterproceduralSlicing/createFDG.C +#${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/staticInterproceduralSlicing/testCDG.C +#${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/staticInterproceduralSlicing/generateSFCFG.C +#${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/staticInterproceduralSlicing/printDUC.C +#${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/staticInterproceduralSlicing/createDDG.C +${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/staticInterproceduralSlicing/MergedDependenceGraph.C +${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/staticInterproceduralSlicing/ControlFlowGraph.C +#${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/staticInterproceduralSlicing/multiPassTest.C +#${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/staticInterproceduralSlicing/newControlDependenceGraph.C +#${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/staticInterproceduralSlicing/testDDG.C +#${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/staticInterproceduralSlicing/testSlicing.C +${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/staticInterproceduralSlicing/FunctionDependenceGraph.C +${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/staticInterproceduralSlicing/ControlDependenceGraph.C +#${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/staticInterproceduralSlicing/generateSFBDT.C +#${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/staticInterproceduralSlicing/createSDG.C +#${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/staticInterproceduralSlicing/generateSFDT.C +${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/staticInterproceduralSlicing/DependenceGraph.C +${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/staticInterproceduralSlicing/EDefUse.C +${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/staticInterproceduralSlicing/DataDependenceGraph.C +#${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/staticInterproceduralSlicing/generateSFDF.C +${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/staticInterproceduralSlicing/SlicingInfo.C +#${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/staticInterproceduralSlicing/slice.C +${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/staticInterproceduralSlicing/CreateSlice.C +${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/staticInterproceduralSlicing/CreateSliceSet.C +#${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/staticInterproceduralSlicing/newDU.C +#${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/staticInterproceduralSlicing/testSDG.C +${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/staticInterproceduralSlicing/SystemDependenceGraph.C +#${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/staticInterproceduralSlicing/createCDG.C +${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/staticInterproceduralSlicing/DefUseExtension.C +#${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/distributedMemoryAnalysis/functionNames.C +#${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/distributedMemoryAnalysis/DistributedMemoryAnalysis.C +${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/CFG/CFG_OA.C +${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/CFG/CFG_ROSE.C +${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/pointerAnal/PtrAnalCFG.C +${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/pointerAnal/PtrAnal.C +#${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/CallGraphAnalysisMySQL/Callgraph.C +#${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/CallGraphAnalysisMySQL/callgraph_example.C +#${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/CallGraphAnalysisMySQL/Classhierarchy.C +${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/dataflowAnalysis/DataFlowAnalysis.C +${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/dataflowAnalysis/ReachingDefinition.C +${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/dataflowAnalysis/DefUseChain.C +${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/graphAnalysis/SB_Graph.C +${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/graphAnalysis/CallGraphAnalysis.C +${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/graphAnalysis/RoseSrc_CallGraphAnalysis.C +#${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/dominatorTreesAndDominanceFrontiers/ControlFlowGraph.C +#${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/dominatorTreesAndDominanceFrontiers/DominanceFrontier.C +#${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/dominatorTreesAndDominanceFrontiers/DominatorTree.C +${CMAKE_SOURCE_DIR}/src/midend/astDiagnostics/AstConsistencyTests.C +${CMAKE_SOURCE_DIR}/src/midend/astDiagnostics/AstWarnings.C +${CMAKE_SOURCE_DIR}/src/midend/astDiagnostics/AstPerformance.C +${CMAKE_SOURCE_DIR}/src/midend/astDiagnostics/AstStatistics.C +) + +add_library( midend ${midend_src} ) +add_dependencies( midend ROSETTA ) + +########### install files ############### + + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#SUBDIRS = \ +# abstractHandle \ +# astDiagnostics \ +# astInlining \ +# astOutlining \ +# astProcessing \ +# astQuery \ +# astRewriteMechanism \ +# astUtil \ +# binaryAnalyses \ +# loopProcessing \ +# ompLowering \ +# programAnalysis \ +# programTransformation +# +## DQ (7/25/2008): +## This file is deliberately excluded from a distribution so that the +## "make docs" rule (at the top level directory) can query the file to +## determin if this is a distribution. +## EXTRA_DIST = midend.docs diff --git a/src/midend/abstractHandle/CMakeLists.txt b/src/midend/abstractHandle/CMakeLists.txt new file mode 100644 index 0000000000..94fd874987 --- /dev/null +++ b/src/midend/abstractHandle/CMakeLists.txt @@ -0,0 +1,38 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + +set( libabstractHandle_SRC + abstract_handle.cpp roseAdapter.cpp + ) +#add_library(libabstractHandle ${libabstractHandle_SRC}) + +########### install files ############### + +install(FILES abstract_handle.h roseAdapter.h DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#INCLUDES = $(ROSE_INCLUDES) +# +#noinst_LTLIBRARIES=libabstractHandle.la +# +#libabstractHandle_la_SOURCES =\ +# abstract_handle.cpp roseAdapter.cpp +# +#include_HEADERS = \ +# abstract_handle.h roseAdapter.h +# +#clean-local: +# rm -rf Templates.DB ii_files ti_files core +## This directory also contains a self-contained example +## using a simple loop data structure to demonstrate the usage. +## It can be released separated from ROSE +#EXTRA_DIST = README testMyLoop.cpp myloop.h loopAdapter.h loopAdapter.cpp \ +# makefile-myloop diff --git a/src/midend/astDiagnostics/CMakeLists.txt b/src/midend/astDiagnostics/CMakeLists.txt new file mode 100644 index 0000000000..ae6c38e4bf --- /dev/null +++ b/src/midend/astDiagnostics/CMakeLists.txt @@ -0,0 +1,60 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + set(rose_diagnostics_src + ${CMAKE_SOURCE_DIR}/src/midend/astDiagnostics/AstConsistencyTests.C + ${CMAKE_SOURCE_DIR}/src/midend/astDiagnostics/AstWarnings.C + ${CMAKE_SOURCE_DIR}/src/midend/astDiagnostics/AstStatistics.C + ${CMAKE_SOURCE_DIR}/src/midend/astDiagnostics/AstPerformance.C + ) + +# add_library(rose_diagnostics ${rose_diagnostics_src} ) + + +########### install files ############### + +install(FILES AstDiagnostics.h AstConsistencyTests.h AstWarnings.h AstStatistics.h AstPerformance.h DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#INCLUDES = $(ROSE_INCLUDES) +# +#noinst_LTLIBRARIES = libastDiagnostics.la +# +#libastDiagnostics_la_SOURCES = AstConsistencyTests.C AstWarnings.C AstStatistics.C AstPerformance.C +# +## DQ (12/8/2006): Linux memory support used in ROSE +#ramustMemoryUsageObjs = \ +# $(top_builddir)/src/3rdPartyLibraries/ramust/memcheck.o \ +# $(top_builddir)/src/3rdPartyLibraries/ramust/filemap.o \ +# $(top_builddir)/src/3rdPartyLibraries/ramust/processes.o \ +# $(top_builddir)/src/3rdPartyLibraries/ramust/mem_totals.o \ +# $(top_builddir)/src/3rdPartyLibraries/ramust/cleanup_memory.o \ +# $(top_builddir)/src/3rdPartyLibraries/ramust/procps/alloc.o \ +# $(top_builddir)/src/3rdPartyLibraries/ramust/procps/devname.o \ +# $(top_builddir)/src/3rdPartyLibraries/ramust/procps/escape.o \ +# $(top_builddir)/src/3rdPartyLibraries/ramust/procps/ksym.o \ +# $(top_builddir)/src/3rdPartyLibraries/ramust/procps/pwcache.o \ +# $(top_builddir)/src/3rdPartyLibraries/ramust/procps/readproc.o \ +# $(top_builddir)/src/3rdPartyLibraries/ramust/procps/sig.o \ +# $(top_builddir)/src/3rdPartyLibraries/ramust/procps/slab.o \ +# $(top_builddir)/src/3rdPartyLibraries/ramust/procps/sysinfo.o \ +# $(top_builddir)/src/3rdPartyLibraries/ramust/procps/version.o \ +# $(top_builddir)/src/3rdPartyLibraries/ramust/procps/whattime.o +# +## DQ (12/8/2006): Added to support memory useage under Linux +## libastDiagnostics_la_OBJECTS = AstConsistencyTests.o AstWarnings.o AstStatistics.o AstPerformance.o $(ramustMemoryUsageObjs) +# +#include_HEADERS = AstDiagnostics.h AstConsistencyTests.h AstWarnings.h AstStatistics.h AstPerformance.h +# +#clean-local: +# rm -rf Templates.DB ii_files ti_files core +# +#EXTRA_DIST = AstDiagnostics.docs diff --git a/src/midend/astInlining/CMakeLists.txt b/src/midend/astInlining/CMakeLists.txt new file mode 100644 index 0000000000..ec58580394 --- /dev/null +++ b/src/midend/astInlining/CMakeLists.txt @@ -0,0 +1,33 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + +install(FILES replaceExpressionWithStatement.h inlinerSupport.h inliner.h DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#INCLUDES = $(ROSE_INCLUDES) +# +#libastinliningSources = \ +# inliner.C inlinerSupport.C isPotentiallyModified.C \ +# replaceExpressionWithStatement.C +# +## lib_LTLIBRARIES = libastinlining.a +## libastinlining_a_SOURCES = $(libastinliningSources) +# +#noinst_LTLIBRARIES = libastinlining.la +#libastinlining_la_SOURCES = $(libastinliningSources) +# +#include_HEADERS = replaceExpressionWithStatement.h inlinerSupport.h inliner.h +# +#clean-local: +# rm -rf Templates.DB ii_files ti_files core diff --git a/src/midend/astOutlining/CMakeLists.txt b/src/midend/astOutlining/CMakeLists.txt new file mode 100644 index 0000000000..17b83375bd --- /dev/null +++ b/src/midend/astOutlining/CMakeLists.txt @@ -0,0 +1,73 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + +install(FILES Outliner.hh NameGenerator.hh ASTtools.hh Copy.hh Jumps.hh PrePostTraversal.hh PreprocessingInfo.hh StmtRewrite.hh This.hh VarSym.hh IfDirectiveContextFinder.hh IfDirectiveExtractor.hh If.hh Preprocess.hh DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#INCLUDES = $(ROSE_INCLUDES) +# +#noinst_LTLIBRARIES = libastOutliner.la +# +#libastOutliner_la_SOURCES = \ +# Check.cc \ +# Outliner.cc \ +# NameGenerator.cc \ +# PragmaInterface.cc \ +# ASTtools.cc \ +# Copy.cc \ +# Jumps.cc \ +# PrePostTraversal.cc \ +# PreprocessingInfo.cc \ +# StmtRewrite.cc \ +# This.cc \ +# VarSym.cc \ +# Case.cc \ +# ExtractIfs.cc \ +# If.cc \ +# IfDirectiveContextFinder.cc \ +# IfDirectiveExtractor.cc \ +# Block.cc \ +# NonLocalDecls.cc \ +# PreprocIfs.cc \ +# NonLocalControlFlow.cc \ +# Preprocess.cc \ +# ThisExprs.cc \ +# CollectVars.cc \ +# GenerateCall.cc \ +# GenerateFunc.cc \ +# Insert.cc \ +# Transform.cc +# +#include_HEADERS = \ +# Outliner.hh \ +# NameGenerator.hh \ +# ASTtools.hh \ +# Copy.hh \ +# Jumps.hh \ +# PrePostTraversal.hh \ +# PreprocessingInfo.hh \ +# StmtRewrite.hh \ +# This.hh \ +# VarSym.hh \ +# IfDirectiveContextFinder.hh \ +# IfDirectiveExtractor.hh \ +# If.hh \ +# Preprocess.hh +## Transform.hh +# +#clean-local: +# rm -rf Templates.DB ii_files ti_files core +# +#EXTRA_DIST = README +# diff --git a/src/midend/astProcessing/CMakeLists.txt b/src/midend/astProcessing/CMakeLists.txt new file mode 100644 index 0000000000..2b506e844f --- /dev/null +++ b/src/midend/astProcessing/CMakeLists.txt @@ -0,0 +1,83 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### +set( libastprocessing_SRC + AstPDFGeneration.C AstNodeVisitMapping.C AstTextAttributesHandling.C + AstDOTGeneration.C AstProcessing.C AstSimpleProcessing.C Ast.C + AstNodePtrs.C AstSuccessorsSelectors.C AstAttributeMechanism.C + AstReverseSimpleProcessing.C AstRestructure.C AstClearVisitFlags.C + AstTraversal.C AstCombinedSimpleProcessing.C + AstSharedMemoryParallelSimpleProcessing.C + ) +#add_library( libastprocessingSources ${libastprocessing_SRC} ) +#add_dependencies( libastprocessingSources ROSETTA ) + + +########### install files ############### + +install(FILES AstPDFGeneration.h AstNodeVisitMapping.h AstAttributeMechanism.h AstTextAttributesHandling.h AstDOTGeneration.h AstProcessing.h AstSimpleProcessing.h AstTraverseToRoot.h AstNodePtrs.h AstSuccessorsSelectors.h AstReverseProcessing.h AstReverseSimpleProcessing.h Ast.h AstRestructure.h AstClearVisitFlags.h AstTraversal.h AstCombinedProcessing.h AstCombinedProcessingImpl.h AstCombinedSimpleProcessing.h StackFrameVector.h AstSharedMemoryParallelProcessing.h AstSharedMemoryParallelProcessingImpl.h AstSharedMemoryParallelSimpleProcessing.h DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#SUBDIRS = +# +#INCLUDES = $(ROSE_INCLUDES) +# +### The grammar generator (ROSETTA) should use its own template repository +#CXX_TEMPLATE_REPOSITORY_PATH = . +# +#libastprocessingSources = \ +# AstPDFGeneration.C AstNodeVisitMapping.C AstTextAttributesHandling.C \ +# AstDOTGeneration.C AstProcessing.C AstSimpleProcessing.C Ast.C \ +# AstNodePtrs.C AstSuccessorsSelectors.C AstAttributeMechanism.C \ +# AstReverseSimpleProcessing.C AstRestructure.C AstClearVisitFlags.C \ +# AstTraversal.C AstCombinedSimpleProcessing.C \ +# AstSharedMemoryParallelSimpleProcessing.C +# +## Removed AstTests.C AstStatistics.C +# +## lib_LTLIBRARIES = libastprocessing.a +## libastprocessing_a_SOURCES = $(libastprocessingSources) +## libastprocessing_a_LIBADD = $(CXX_TEMPLATE_OBJECTS) +## libastprocessing_a_DEPENDENCIES = $(libastprocessing_a_SOURCES) +# +#noinst_LTLIBRARIES = libastprocessing.la +#libastprocessing_la_SOURCES = $(libastprocessingSources) +#libastprocessing_la_LIBADD = $(CXX_TEMPLATE_OBJECTS) +#libastprocessing_la_DEPENDENCIES = $(libastprocessing_a_SOURCES) +# +## $(GENERATED_SOURCE): +## cd $(top_builddir)/src/ROSETTA/src; $(MAKE) +# +#clean-local: +# rm -rf Templates.DB ii_files ti_files cxx_templates +# +#distclean-local: +# rm -rf Templates.DB +# +#include_HEADERS = \ +# AstPDFGeneration.h AstNodeVisitMapping.h AstAttributeMechanism.h \ +# AstTextAttributesHandling.h AstDOTGeneration.h AstProcessing.h \ +# AstSimpleProcessing.h AstTraverseToRoot.h AstNodePtrs.h \ +# AstSuccessorsSelectors.h AstReverseProcessing.h \ +# AstReverseSimpleProcessing.h Ast.h AstRestructure.h AstClearVisitFlags.h \ +# AstTraversal.h AstCombinedProcessing.h AstCombinedProcessingImpl.h \ +# AstCombinedSimpleProcessing.h StackFrameVector.h AstSharedMemoryParallelProcessing.h \ +# AstSharedMemoryParallelProcessingImpl.h AstSharedMemoryParallelSimpleProcessing.h +# +## Removed AstTests.h AstStatistics.h +# +#EXTRA_DIST = AstProcessing.docs +# +# +# +# +# +# +# diff --git a/src/midend/astQuery/CMakeLists.txt b/src/midend/astQuery/CMakeLists.txt new file mode 100644 index 0000000000..5277100c6f --- /dev/null +++ b/src/midend/astQuery/CMakeLists.txt @@ -0,0 +1,71 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + +install(FILES nodeQuery.h nodeQueryInheritedAttribute.h booleanQuery.h booleanQueryInheritedAttribute.h nameQuery.h nameQueryInheritedAttribute.h numberQuery.h numberQueryInheritedAttribute.h astQuery.h astQueryInheritedAttribute.h roseQueryLib.h DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#INCLUDES = $(ROSE_INCLUDES) +# +### The grammar generator (ROSETTA) should use its own template repository +#CXX_TEMPLATE_REPOSITORY_PATH = . +# +#libquerySources = \ +# nodeQuery.C nodeQueryInheritedAttribute.C \ +# booleanQuery.C booleanQueryInheritedAttribute.C \ +# nameQuery.C nameQueryInheritedAttribute.C \ +# numberQuery.C numberQueryInheritedAttribute.C \ +# astQuery.C astQueryInheritedAttribute.C +# +## queryVariant.C +# +#nodeQuery.o : nodeQuery.C queryVariant.C +# +## lib_LTLIBRARIES = libquery.a +## libquery_a_SOURCES = $(libquerySources) +# +#noinst_LTLIBRARIES = libquery.la +#libquery_la_SOURCES = $(libquerySources) +# +#libquery_la_DEPENDENCIES = nodeQuery.o +# +#include_HEADERS = \ +# nodeQuery.h nodeQueryInheritedAttribute.h \ +# booleanQuery.h booleanQueryInheritedAttribute.h \ +# nameQuery.h nameQueryInheritedAttribute.h \ +# numberQuery.h numberQueryInheritedAttribute.h \ +# astQuery.h astQueryInheritedAttribute.h \ +# roseQueryLib.h +# +#clean-local: +# rm -rf Templates.DB ii_files ti_files cxx_templates +# +#distclean-local: +# rm -rf Templates.DB +# +## Note: queryVariant.C is included in nodeQuery.C +#EXTRA_DIST = queryVariant.C QueryLib.docs +# +## A way to add additional error checking at compile time +## ROSE_WARNINGS = -Wall -W -Wswitch-enum -Wswitch-default -Wswitch +## GXX_COMPILER_REPORT = -fmem-report -ftime-report +## GXX_COMPILER_REPORT = +## AM_CXXFLAGS = $(ROSE_WARNINGS) $(GXX_COMPILER_REPORT) +# +# +# +# +# +# +# +# diff --git a/src/midend/astRewriteMechanism/CMakeLists.txt b/src/midend/astRewriteMechanism/CMakeLists.txt new file mode 100644 index 0000000000..b4c4a6589d --- /dev/null +++ b/src/midend/astRewriteMechanism/CMakeLists.txt @@ -0,0 +1,98 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + +install(FILES rewrite.h lowLevelRewriteInterface.h midLevelRewriteInterface.h highLevelRewriteInterface.h $(TemplateFiles) DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +### The Rewrite Library should use its own template repository +## CXX_TEMPLATE_REPOSITORY_PATH = . +# +#INCLUDES = $(ROSE_INCLUDES) +# +## Separate out the template files to make clear which sources are templates +## the hope was that this would be useful to generate the TemplateSourceFiles +#TemplateFiles = \ +# rewriteMidLevelInterfaceTemplatesImpl.h \ +# prefixGenerationImpl.h \ +# ASTFragmentCollectorTraversalImpl.h \ +# rewriteSynthesizedAttributeTemplatesImpl.h \ +# rewriteTreeTraversalImpl.h \ +# rewriteASTFragementStringTemplatesImpl.h \ +# nodeCollectionTemplatesImpl.h \ +# rewriteDebuggingSupportTemplatesImpl.h \ +# rewriteTemplateImpl.h +# +#librewriteSources = \ +# nodeCollection.C \ +# rewriteMidLevelInterface.C \ +# rewriteHighLevelInterface.C \ +# rewriteSynthesizedAttribute.C \ +# rewriteASTFragementString.C \ +# rewriteAccumulatedAttribute.C \ +# rewriteTypeDeclaration.C \ +# rewriteDebuggingSupport.C \ +# rewriteLowLevelInterface.C \ +# $(TemplateFiles) +# +## lib_LTLIBRARIES = librewrite.a +## librewrite_a_SOURCES = $(librewriteSources) +## librewrite_a_DEPENDENCIES = $(librewrite_a_SOURCES) +# +#noinst_LTLIBRARIES = librewrite.la +#librewrite_la_SOURCES = $(librewriteSources) rewriteTemplateInstantiations.C $(TemplateFiles) +#librewrite_la_DEPENDENCIES = $(librewrite_la_SOURCES) +# +## Header files we want to have installed +## (note that rewrite.h includes the rewriteTreeTraversal.C +## and rewriteSynthesizedAttributeTemplates.C because of how +## templates are used). +#include_HEADERS = \ +# rewrite.h \ +# lowLevelRewriteInterface.h \ +# midLevelRewriteInterface.h \ +# highLevelRewriteInterface.h \ +# $(TemplateFiles) +# +#clean-local: +# rm -rf Templates.DB ii_files ti_files core *.dot *.pdf +# rm -rf rose_inputProgram*.C \ +# rose_transformation_*.C *.C.pdf +# +#EXTRA_DIST = ASTRewrite.docs +# +# +# +# +# +# +# +# +# +# +# +# +# +# +# +# +# +# +# +# +# +# +# +# +# +# diff --git a/src/midend/astUtil/CMakeLists.txt b/src/midend/astUtil/CMakeLists.txt new file mode 100644 index 0000000000..f88aa2ddd1 --- /dev/null +++ b/src/midend/astUtil/CMakeLists.txt @@ -0,0 +1,33 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + +add_subdirectory(astInterface) +add_subdirectory(astSupport) +add_subdirectory(symbolicVal) +add_subdirectory(annotation) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#SUBDIRS = astInterface astSupport symbolicVal annotation +# +### The grammar generator (ROSETTA) should use its own template repository +#CXX_TEMPLATE_REPOSITORY_PATH = . +# +#clean-local: +# +#distclean-local: +# +# +# +# +# +# +# diff --git a/src/midend/astUtil/annotation/CMakeLists.txt b/src/midend/astUtil/annotation/CMakeLists.txt new file mode 100644 index 0000000000..e04b7e0266 --- /dev/null +++ b/src/midend/astUtil/annotation/CMakeLists.txt @@ -0,0 +1,42 @@ + +include_directories(${CMAKE_SOURCE_DIR}/src/util ${CMAKE_SOURCE_DIR}/src/util/support ${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + +install(FILES AnnotCollect.h AnnotExpr.h AnnotStmt.h OperatorDescriptors.h AnnotDescriptors.h AnnotIO.h OperatorAnnotation.h TypeAnnotation.h CPPAnnotation.h DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#INCLUDES = $(ROSE_INCLUDES) -I$(srcdir)/../astInterface -I$(srcdir)/../symbolicVal -I$(srcdir)/../astSupport -I$(top_srcdir)/src/util -I$(top_srcdir)/src/util/support +# +### The grammar generator (ROSETTA) should use its own template repository +#CXX_TEMPLATE_REPOSITORY_PATH = . +# +#libannotationSources = \ +# AnnotCollect.C AnnotExpr.C OperatorAnnotation.C TypeAnnotation.C \ +# AnnotDescriptors.C AnnotIO.C OperatorDescriptors.C +# +## lib_LTLIBRARIES = libannotation.a +## libannotation_a_SOURCES = $(libannotationSources) +# +#noinst_LTLIBRARIES = libannotation.la +#libannotation_la_SOURCES = $(libannotationSources) +# +#clean-local: +# rm -rf Templates.DB ii_files ti_files cxx_templates +# +#distclean-local: +# rm -rf Templates.DB +# +#include_HEADERS = \ +# AnnotCollect.h AnnotExpr.h AnnotStmt.h OperatorDescriptors.h \ +# AnnotDescriptors.h AnnotIO.h OperatorAnnotation.h TypeAnnotation.h \ +# CPPAnnotation.h diff --git a/src/midend/astUtil/astInterface/CMakeLists.txt b/src/midend/astUtil/astInterface/CMakeLists.txt new file mode 100644 index 0000000000..9aa7b4b837 --- /dev/null +++ b/src/midend/astUtil/astInterface/CMakeLists.txt @@ -0,0 +1,45 @@ + +include_directories(${CMAKE_SOURCE_DIR}/src/util ${CMAKE_SOURCE_DIR}/src/util/support ${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + +install(FILES AstInterface.h CPPAstInterface.h AstInterface_ROSE.h DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#INCLUDES = $(ROSE_INCLUDES) -I$(srcdir)/.. -I$(top_srcdir)/src/util -I$(top_srcdir)/src/util/support +# +### The grammar generator (ROSETTA) should use its own template repository +#CXX_TEMPLATE_REPOSITORY_PATH = . +# +#libastInterfaceSources = AstInterface.C CPPAstInterface.C +# +## lib_LTLIBRARIES = libastInterface.a +## libastInterface_a_SOURCES = $(libastInterfaceSources) +# +#noinst_LTLIBRARIES = libastInterface.la +#libastInterface_la_SOURCES = $(libastInterfaceSources) +# +#clean-local: +# rm -rf Templates.DB ii_files ti_files cxx_templates +# +#distclean-local: +# rm -rf Templates.DB +# +#include_HEADERS = AstInterface.h CPPAstInterface.h AstInterface_ROSE.h +# +# +# +# +# +# +# +# diff --git a/src/midend/astUtil/astSupport/CMakeLists.txt b/src/midend/astUtil/astSupport/CMakeLists.txt new file mode 100644 index 0000000000..7f99f82902 --- /dev/null +++ b/src/midend/astUtil/astSupport/CMakeLists.txt @@ -0,0 +1,45 @@ + +include_directories(${CMAKE_SOURCE_DIR}/src/util ${CMAKE_SOURCE_DIR}/src/util/support ${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + +install(FILES AnalysisInterface.h ProcessAstTree.h StmtInfoCollect.h LoopInfoInterface.h DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#INCLUDES = $(ROSE_INCLUDES) -I$(srcdir)/../astInterface -I$(srcdir)/../symbolicVal -I$(top_srcdir)/src/util -I$(top_srcdir)/src/util/support +# +### The grammar generator (ROSETTA) should use its own template repository +#CXX_TEMPLATE_REPOSITORY_PATH = . +# +#libastSupportSources = ProcessAstTree.C StmtInfoCollect.C +# +## lib_LTLIBRARIES = libastSupport.a +## libastSupport_a_SOURCES = $(libastSupportSources) +# +#noinst_LTLIBRARIES = libastSupport.la +#libastSupport_la_SOURCES = $(libastSupportSources) +# +#clean-local: +# rm -rf Templates.DB ii_files ti_files cxx_templates +# +#distclean-local: +# rm -rf Templates.DB +# +#include_HEADERS = AnalysisInterface.h ProcessAstTree.h StmtInfoCollect.h LoopInfoInterface.h +# +# +# +# +# +# +# +# diff --git a/src/midend/astUtil/symbolicVal/CMakeLists.txt b/src/midend/astUtil/symbolicVal/CMakeLists.txt new file mode 100644 index 0000000000..a647492e7d --- /dev/null +++ b/src/midend/astUtil/symbolicVal/CMakeLists.txt @@ -0,0 +1,48 @@ + +include_directories(${CMAKE_SOURCE_DIR}/src/util ${CMAKE_SOURCE_DIR}/src/util/support ${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + +install(FILES SymbolicMultiply.h SymbolicPlus.h SymbolicVal.h SymbolicExpr.h SymbolicSelect.h SymbolicBound.h DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#INCLUDES = $(ROSE_INCLUDES) -I$(srcdir)/../astInterface -I$(top_srcdir)/src/util -I$(top_srcdir)/src/util/support +# +### The grammar generator (ROSETTA) should use its own template repository +#CXX_TEMPLATE_REPOSITORY_PATH = . +# +#libsymbolicValSources = \ +# SymbolicBound.C SymbolicExpr.C SymbolicFind.C SymbolicOperator.C \ +# SymbolicUnwrapCond.C SymbolicVal.C +# +## lib_LTLIBRARIES = libsymbolicVal.a +## libsymbolicVal_a_SOURCES = $(libsymbolicValSources) +# +#noinst_LTLIBRARIES = libsymbolicVal.la +#libsymbolicVal_la_SOURCES = $(libsymbolicValSources) +# +#clean-local: +# rm -rf Templates.DB ii_files ti_files cxx_templates +# +#distclean-local: +# rm -rf Templates.DB +# +#include_HEADERS = SymbolicMultiply.h SymbolicPlus.h SymbolicVal.h \ +# SymbolicExpr.h SymbolicSelect.h SymbolicBound.h +# +# +# +# +# +# +# +# diff --git a/src/midend/binaryAnalyses/CMakeLists.txt b/src/midend/binaryAnalyses/CMakeLists.txt new file mode 100644 index 0000000000..a491095b2d --- /dev/null +++ b/src/midend/binaryAnalyses/CMakeLists.txt @@ -0,0 +1,95 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + +install(FILES $(BINARY_DISASSEMBLY_HEADER_FILES) DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#INCLUDES = -Winvalid-pch $(ROSE_INCLUDES) -I$(srcdir)/graph -I$(srcdir)/libraryIdentification +# +#noinst_LTLIBRARIES = libbinaryMidend.la +# +## Isolated part of library that is independent of the mysql database +#libbinaryMidend_la_DEPENDENCIES = +# +#sourse_files = \ +# binary_analysis.C \ +# RoseBin_CompareAnalysis.cpp RoseBin_ControlFlowAnalysis.cpp \ +# RoseBin_printInstructions.cpp RoseBin_DataFlowAnalysis.cpp \ +# RoseBin_CallGraphAnalysis.cpp RoseBin_FlowAnalysis.cpp \ +# dataflowanalyses/RoseBin_DefUseAnalysis.cpp \ +# dataflowanalyses/RoseBin_VariableAnalysis.cpp \ +# dataflowanalyses/InterruptAnalysis.cpp \ +# dataflowanalyses/RoseBin_Emulate.cpp \ +# dataflowanalyses/RoseBin_DataFlowAbstract.cpp GraphAlgorithms.C +# +#if ROSE_USE_SQLITE_DATABASE +#database_sourse_files = \ +# libraryIdentification/libraryIdentification_reader.C \ +# libraryIdentification/libraryIdentification_writer.C \ +# libraryIdentification/functionIdentification.C +#else +#database_sourse_files = +#endif +# +## DQ (8/18/2009): Removed the support for this old configure option. +## DQ (5/2/2009): Added support for configure options +##if ROSE_USE_NEW_GRAPH_NODES +##if ROSE_USING_GRAPH_IR_NODES_FOR_BACKWARD_COMPATABILITY +## Using the new Graph IR nodes and the optional backward compatability API. +##libbinaryMidend_la_SOURCES = $(sourse_files) $(database_sourse_files) +##else +## The current code will not compile with the new Graph IR node interface. +##libbinaryMidend_la_SOURCES = +##endif +##else +## This is the original case (not using the new Graph IR nodes) +#libbinaryMidend_la_SOURCES = $(sourse_files) $(database_sourse_files) +##endif +# +#BUILT_SOURCES = +# +#CLEANFILES = $(BUILT_SOURCES) +# +#BINARY_DISASSEMBLY_HEADER_FILES = \ +# binary_analysis.h \ +# GraphAlgorithms.h \ +# RoseBin_CallGraphAnalysis.h \ +# RoseBin_CompareAnalysis.h \ +# RoseBin_ControlFlowAnalysis.h \ +# RoseBin_DataFlowAnalysis.h \ +# RoseBin_FlowAnalysis.h \ +# RoseBin_printInstructions.h \ +# dataflowanalyses/InterruptAnalysis.h \ +# dataflowanalyses/RoseBin_DataFlowAbstract.h \ +# dataflowanalyses/RoseBin_DefUseAnalysis.h \ +# dataflowanalyses/RoseBin_Emulate.h \ +# dataflowanalyses/RoseBin_VariableAnalysis.h \ +# instructionSemantics/findConstants.h \ +# instructionSemantics/flowEquations.h \ +# instructionSemantics/semanticsModule.h \ +# instructionSemantics/x86InstructionSemantics.h \ +# libraryIdentification/functionIdentification.h \ +# libraryIdentification/libraryIdentification.h +# +# +# +#include_HEADERS = $(BINARY_DISASSEMBLY_HEADER_FILES) +# +#EXTRA_DIST = +# +# +#clean-local: +# +#print: +# echo "libbinaryMidend_la_SOURCES = $(libbinaryMidend_la_SOURCES)" diff --git a/src/midend/loopProcessing/CMakeLists.txt b/src/midend/loopProcessing/CMakeLists.txt new file mode 100644 index 0000000000..42fab49461 --- /dev/null +++ b/src/midend/loopProcessing/CMakeLists.txt @@ -0,0 +1,36 @@ + +include_directories(${CMAKE_SOURCE_DIR}/src/util/support ${CMAKE_SOURCE_DIR}/src/util/graphs ${CMAKE_SOURCE_DIR}/src/midend/astUtil/astSupport ${CMAKE_SOURCE_DIR}/src/midend/astUtil/symbolicVal ${CMAKE_SOURCE_DIR}/src/midend/astUtil/astInterface ${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + +add_subdirectory(depInfo) +add_subdirectory(depGraph) +add_subdirectory(computation) +add_subdirectory(outsideInterface) +add_subdirectory(slicing) +add_subdirectory(driver) +add_subdirectory(prepostTransformation) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#SUBDIRS = depInfo depGraph computation outsideInterface slicing driver prepostTransformation +# +#INCLUDES = \ +# $(ROSE_INCLUDES) -I${srcdir}/driver -I${srcdir}/prepostTransformation -I$(top_srcdir)/src/util/support -I$(top_srcdir)/src/util/graphs -I$(top_srcdir)/src/midend/astUtil/astSupport -I$(top_srcdir)/src/midend/astUtil/symbolicVal -I$(top_srcdir)/src/midend/astUtil/astInterface +# +### The grammar generator (ROSETTA) should use its own template repository +#CXX_TEMPLATE_REPOSITORY_PATH = . +# +#clean-local: +# rm -rf Templates.DB ii_files ti_files cxx_templates +# rm -rf rose_mm.C +# +#distclean-local: +# rm -rf Templates.DB +# diff --git a/src/midend/loopProcessing/computation/CMakeLists.txt b/src/midend/loopProcessing/computation/CMakeLists.txt new file mode 100644 index 0000000000..84d89f8dda --- /dev/null +++ b/src/midend/loopProcessing/computation/CMakeLists.txt @@ -0,0 +1,51 @@ + +include_directories(${CMAKE_SOURCE_DIR}/src/util/support ${CMAKE_SOURCE_DIR}/src/util/graphs ${CMAKE_SOURCE_DIR}/src/midend/astUtil/astSupport ${CMAKE_SOURCE_DIR}/src/midend/astUtil/astInterface ${CMAKE_SOURCE_DIR}/src/midend/astUtil/symbolicVal ${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + +install(FILES LoopTreeDummyNode.h LoopTreeShadow.h LoopTreeLocality.h LoopTreeBuild.h LoopTree.h LoopTreeObserver.h LoopTreeTransform.h LoopTreeDepComp.h LoopTreeHoldNode.h DepCompTransform.h DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#INCLUDES = -I$(srcdir)/../driver -I$(srcdir)/../depGraph -I$(srcdir)/../depInfo -I$(top_srcdir)/src/util/support -I$(top_srcdir)/src/util/graphs -I$(top_srcdir)/src/midend/astUtil/astSupport -I$(top_srcdir)/src/midend/astUtil/astInterface -I$(top_srcdir)/src/midend/astUtil/symbolicVal +# +### The grammar generator (ROSETTA) should use its own template repository +#CXX_TEMPLATE_REPOSITORY_PATH = . +# +#libcomputationSources = \ +# LoopTree.C LoopTreeDummyNode.C LoopTreeShadow.C LoopTreeLocality.C\ +# LoopTreeDepComp.C DepCompTransform.C LoopTreeTransform.C +# +## lib_LTLIBRARIES = libcomputation.a +## libcomputation_a_SOURCES = $(libcomputationSources) +# +#noinst_LTLIBRARIES = libcomputation.la +#libcomputation_la_SOURCES = $(libcomputationSources) +# +#clean-local: +# rm -rf Templates.DB ii_files ti_files cxx_templates +# +#distclean-local: +# rm -rf Templates.DB +# +#include_HEADERS = \ +# LoopTreeDummyNode.h LoopTreeShadow.h LoopTreeLocality.h \ +# LoopTreeBuild.h LoopTree.h LoopTreeObserver.h LoopTreeTransform.h \ +# LoopTreeDepComp.h LoopTreeHoldNode.h DepCompTransform.h +# +# +# +# +# +# +# +# +# diff --git a/src/midend/loopProcessing/depGraph/CMakeLists.txt b/src/midend/loopProcessing/depGraph/CMakeLists.txt new file mode 100644 index 0000000000..ce7c31904e --- /dev/null +++ b/src/midend/loopProcessing/depGraph/CMakeLists.txt @@ -0,0 +1,38 @@ + +include_directories(${CMAKE_SOURCE_DIR}/src/util/support ${CMAKE_SOURCE_DIR}/src/util/graphs ${CMAKE_SOURCE_DIR}/src/midend/astUtil/astSupport ${CMAKE_SOURCE_DIR}/src/midend/astUtil/astInterface ${CMAKE_SOURCE_DIR}/src/midend/astUtil/symbolicVal ${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + +install(FILES DepGraphBuild.h DepGraph.h DepGraphTransform.h LoopAnalysis.h TransDepGraph.h TransDepGraphImpl.h DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#INCLUDES = -I$(srcdir)/../driver -I$(srcdir)/../depInfo -I$(top_srcdir)/src/util/support -I$(top_srcdir)/src/util/graphs -I$(top_srcdir)/src/midend/astUtil/astSupport -I$(top_srcdir)/src/midend/astUtil/astInterface -I$(top_srcdir)/src/midend/astUtil/symbolicVal +# +### The grammar generator (ROSETTA) should use its own template repository +#CXX_TEMPLATE_REPOSITORY_PATH = . +# +#libdepGraphSources = DepGraphBuild.C LoopAnalysis.C TransDepGraph.C +# +## lib_LTLIBRARIES = libdepGraph.a +## libdepGraph_a_SOURCES = $(libdepGraphSources) +# +#noinst_LTLIBRARIES = libdepGraph.la +#libdepGraph_la_SOURCES = $(libdepGraphSources) +# +#clean-local: +# rm -rf Templates.DB ii_files ti_files cxx_templates +# +#distclean-local: +# rm -rf Templates.DB +# +#include_HEADERS = DepGraphBuild.h DepGraph.h DepGraphTransform.h LoopAnalysis.h TransDepGraph.h TransDepGraphImpl.h +# diff --git a/src/midend/loopProcessing/depInfo/CMakeLists.txt b/src/midend/loopProcessing/depInfo/CMakeLists.txt new file mode 100644 index 0000000000..4a0157821f --- /dev/null +++ b/src/midend/loopProcessing/depInfo/CMakeLists.txt @@ -0,0 +1,43 @@ + +include_directories(${CMAKE_SOURCE_DIR}/src/util/support ${CMAKE_SOURCE_DIR}/src/midend/astUtil/astSupport ${CMAKE_SOURCE_DIR}/src/midend/astUtil/astInterface ${CMAKE_SOURCE_DIR}/src/midend/astUtil/symbolicVal ${CMAKE_SOURCE_DIR}/src/midend/loopProcessing/driver ${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + +install(FILES DepEDD.h DepInfo.h DepInfoUpdate.h DomainInfo.h DepInfoAnal.h DepInfoSet.h DepRel.h DomainInfoUpdate.h ReuseAnalysis.h StmtDepAnal.h DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#INCLUDES = -I$(top_srcdir)/src/util/support -I$(top_srcdir)/src/midend/astUtil/astSupport -I$(top_srcdir)/src/midend/astUtil/astInterface -I$(top_srcdir)/src/midend/astUtil/symbolicVal -I$(top_srcdir)/src/midend/loopProcessing/driver +# +### The grammar generator (ROSETTA) should use its own template repository +#CXX_TEMPLATE_REPOSITORY_PATH = . +# +#libdepInfoSources = \ +# DepEDD.C DepInfoAnal.C ReuseAnalysis.C DepInfo.C \ +# DepInfoSet.C DepRel.C DomainInfo.C StmtDepAnal.C +# +## lib_LTLIBRARIES = libdepInfo.a +## libdepInfo_a_SOURCES = $(libdepInfoSources) +# +#noinst_LTLIBRARIES = libdepInfo.la +#libdepInfo_la_SOURCES = $(libdepInfoSources) +# +# +#clean-local: +# rm -rf Templates.DB ii_files ti_files cxx_templates +# +#distclean-local: +# rm -rf Templates.DB +# +#include_HEADERS = DepEDD.h DepInfo.h DepInfoUpdate.h DomainInfo.h \ +# DepInfoAnal.h DepInfoSet.h DepRel.h DomainInfoUpdate.h \ +# ReuseAnalysis.h StmtDepAnal.h +# diff --git a/src/midend/loopProcessing/driver/CMakeLists.txt b/src/midend/loopProcessing/driver/CMakeLists.txt new file mode 100644 index 0000000000..b89b90db6b --- /dev/null +++ b/src/midend/loopProcessing/driver/CMakeLists.txt @@ -0,0 +1,43 @@ + +include_directories(${CMAKE_SOURCE_DIR}/src/util/support ${CMAKE_SOURCE_DIR}/src/util/graphs ${CMAKE_SOURCE_DIR}/src/midend/astUtil/astSupport ${CMAKE_SOURCE_DIR}/src/midend/astUtil/symbolicVal ${CMAKE_SOURCE_DIR}/src/midend/astUtil/astInterface ${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + +install(FILES BlockingAnal.h InterchangeAnal.h CopyArrayAnal.h LoopTransformOptions.h LoopTransformInterface.h FusionAnal.h DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#INCLUDES = $(ROSE_INCLUDES) -I$(srcdir)/../prepostTransformation -I$(srcdir)/../slicing -I$(srcdir)/../computation -I$(srcdir)/../depGraph -I$(srcdir)/../depInfo -I$(top_srcdir)/src/util/support -I$(top_srcdir)/src/util/graphs -I$(top_srcdir)/src/midend/astUtil/astSupport -I$(top_srcdir)/src/midend/astUtil/symbolicVal -I$(top_srcdir)/src/midend/astUtil/astInterface +# +### The grammar generator (ROSETTA) should use its own template repository +#CXX_TEMPLATE_REPOSITORY_PATH = . +# +#libdriverSources = \ +# BlockingAnal.C FusionAnal.C CopyArrayAnal.C LoopTransformOptions.C \ +# TransformComputation.C InterchangeAnal.C TypedFusionImpl.C LoopTransformInterface.C \ +# NormalizeCPP.C +# +## lib_LTLIBRARIES = libdriver.a +## libdriver_a_SOURCES = $(libdriverSources) +# +#noinst_LTLIBRARIES = libdriver.la +#libdriver_la_SOURCES = $(libdriverSources) +# +#clean-local: +# rm -rf Templates.DB ii_files ti_files cxx_templates +# +#distclean-local: +# rm -rf Templates.DB +# +#include_HEADERS = BlockingAnal.h InterchangeAnal.h CopyArrayAnal.h \ +# LoopTransformOptions.h LoopTransformInterface.h\ +# FusionAnal.h +# diff --git a/src/midend/loopProcessing/outsideInterface/CMakeLists.txt b/src/midend/loopProcessing/outsideInterface/CMakeLists.txt new file mode 100644 index 0000000000..5683735e04 --- /dev/null +++ b/src/midend/loopProcessing/outsideInterface/CMakeLists.txt @@ -0,0 +1,35 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + +install(FILES ArrayAnnot.h ArrayInterface.h ArrayRewrite.h DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +## Liao, 11/14/2008, Moved from project/arrayOptimization +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#INCLUDES = $(ROSE_INCLUDES) +# +#noinst_LTLIBRARIES=libarrayOptimization.la +# +#libarrayOptimization_la_SOURCES = \ +# ArrayAnnot.C ArrayInterface.C ArrayRewrite.C +# +#include_HEADERS = \ +# ArrayAnnot.h ArrayInterface.h ArrayRewrite.h +# +#clean-local: +# rm -rf Templates.DB ii_files ti_files core +# +#EXTRA_DIST = +# +# +# diff --git a/src/midend/loopProcessing/prepostTransformation/CMakeLists.txt b/src/midend/loopProcessing/prepostTransformation/CMakeLists.txt new file mode 100644 index 0000000000..5f01b8a686 --- /dev/null +++ b/src/midend/loopProcessing/prepostTransformation/CMakeLists.txt @@ -0,0 +1,45 @@ + +include_directories(${CMAKE_SOURCE_DIR}/src/util/support ${CMAKE_SOURCE_DIR}/src/midend/astUtil/astSupport ${CMAKE_SOURCE_DIR}/src/midend/astUtil/symbolicVal ${CMAKE_SOURCE_DIR}/src/midend/astUtil/astInterface ${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/dataflowAnalysis ${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/CFG ${CMAKE_SOURCE_DIR}/src/util/graphs ${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + +install(FILES BreakupStmt.h LoopUnroll.h PrePostTransformation.h PrivatizeScalar.h DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#INCLUDES = -I$(srcdir)/../driver -I$(srcdir)/../depInfo -I$(top_srcdir)/src/util/support -I$(top_srcdir)/src/midend/astUtil/astSupport -I$(top_srcdir)/src/midend/astUtil/symbolicVal -I$(top_srcdir)/src/midend/astUtil/astInterface -I$(top_srcdir)/src/midend/programAnalysis/dataflowAnalysis -I$(top_srcdir)/src/midend/programAnalysis/CFG -I$(top_srcdir)/src/util/graphs +# +### The grammar generator (ROSETTA) should use its own template repository +#CXX_TEMPLATE_REPOSITORY_PATH = . +# +#libprepostloopSources = BreakupStmt.C LoopUnroll.C PrivatizeScalar.C +# +## lib_LTLIBRARIES = libprepostloop.a +## libprepostloop_a_SOURCES = $(libprepostloopSources) +# +#noinst_LTLIBRARIES = libprepostloop.la +#libprepostloop_la_SOURCES = $(libprepostloopSources) +# +#clean-local: +# rm -rf Templates.DB ii_files ti_files cxx_templates +# +#distclean-local: +# rm -rf Templates.DB +# +#include_HEADERS = BreakupStmt.h LoopUnroll.h PrePostTransformation.h PrivatizeScalar.h +# +# +# +# +# +# +# +# diff --git a/src/midend/loopProcessing/slicing/CMakeLists.txt b/src/midend/loopProcessing/slicing/CMakeLists.txt new file mode 100644 index 0000000000..bfeec89044 --- /dev/null +++ b/src/midend/loopProcessing/slicing/CMakeLists.txt @@ -0,0 +1,47 @@ + +include_directories(${CMAKE_SOURCE_DIR}/src/util/support ${CMAKE_SOURCE_DIR}/src/util/graphs ${CMAKE_SOURCE_DIR}/src/midend/astUtil/astSupport ${CMAKE_SOURCE_DIR}/src/midend/astUtil/symbolicVal ${CMAKE_SOURCE_DIR}/src/midend/astUtil/astInterface ${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + +install(FILES CompSliceDepGraph.h CompSliceImpl.h DynamicCompSlice.h CompSliceObserver.h CompSlice.h CompSliceLocality.h CompSliceRegistry.h DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#INCLUDES = -I$(srcdir)/../driver -I$(srcdir)/../computation -I$(srcdir)/../depGraph -I$(srcdir)/../depInfo -I$(top_srcdir)/src/util/support -I$(top_srcdir)/src/util/graphs -I$(top_srcdir)/src/midend/astUtil/astSupport -I$(top_srcdir)/src/midend/astUtil/symbolicVal -I$(top_srcdir)/src/midend/astUtil/astInterface +# +### The grammar generator (ROSETTA) should use its own template repository +#CXX_TEMPLATE_REPOSITORY_PATH = . +# +#libslicingSources = \ +# CompSlice.C DynamicCompSlice.C CompSliceDepGraph.C CompSliceLocality.C DependenceHoisting.C +# +## lib_LTLIBRARIES = libslicing.a +## libslicing_a_SOURCES = $(libslicingSources) +# +#noinst_LTLIBRARIES = libslicing.la +#libslicing_la_SOURCES = $(libslicingSources) +# +#clean-local: +# rm -rf Templates.DB ii_files ti_files cxx_templates +# +#distclean-local: +# rm -rf Templates.DB +# +#include_HEADERS = CompSliceDepGraph.h CompSliceImpl.h DynamicCompSlice.h CompSliceObserver.h \ +# CompSlice.h CompSliceLocality.h CompSliceRegistry.h +# +# +# +# +# +# +# +# diff --git a/src/midend/ompLowering/CMakeLists.txt b/src/midend/ompLowering/CMakeLists.txt new file mode 100644 index 0000000000..076148d3be --- /dev/null +++ b/src/midend/ompLowering/CMakeLists.txt @@ -0,0 +1,28 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + +install(FILES omp_lowering.h libgomp_g.h DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#INCLUDES = $(ROSE_INCLUDES) +# +#noinst_LTLIBRARIES = libompLowering.la +#libompLowering_la_SOURCES = omp_lowering.cpp +# +#include_HEADERS = omp_lowering.h libgomp_g.h +# +#EXTRA_DIST = README +# +#clean-local: +# rm -rf Templates.DB ii_files ti_files core diff --git a/src/midend/programAnalysis/CFG/CMakeLists.txt b/src/midend/programAnalysis/CFG/CMakeLists.txt new file mode 100644 index 0000000000..c040065d82 --- /dev/null +++ b/src/midend/programAnalysis/CFG/CMakeLists.txt @@ -0,0 +1,45 @@ + +include_directories(${CMAKE_SOURCE_DIR}/src/util/support ${CMAKE_SOURCE_DIR}/src/util/graphs ${CMAKE_SOURCE_DIR}/src/midend/astUtil/astSupport ${CMAKE_SOURCE_DIR}/src/midend/astUtil/astInterface ${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + +install(FILES CFG.h CFGImpl.h DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#INCLUDES = $(ROSE_INCLUDES) -I$(srcdir)/.. -I$(srcdir)/../OAWrap -I$(top_srcdir)/src/util/support -I$(top_srcdir)/src/util/graphs -I$(top_srcdir)/src/midend/astUtil/astSupport -I$(top_srcdir)/src/midend/astUtil/astInterface +# +### The grammar generator (ROSETTA) should use its own template repository +#CXX_TEMPLATE_REPOSITORY_PATH = . +# +#libCFGSources = CFG_ROSE.C CFG_OA.C +# +## lib_LTLIBRARIES = libCFG.a +## libCFG_a_SOURCES = $(libCFGSources) +# +#noinst_LTLIBRARIES = libCFG.la +#libCFG_la_SOURCES = $(libCFGSources) +# +#clean-local: +# rm -rf Templates.DB ii_files ti_files cxx_templates +# +#distclean-local: +# rm -rf Templates.DB +# +#include_HEADERS = CFG.h CFGImpl.h +# +# +# +# +# +# +# +# diff --git a/src/midend/programAnalysis/CMakeLists.txt b/src/midend/programAnalysis/CMakeLists.txt new file mode 100644 index 0000000000..ee638bebbc --- /dev/null +++ b/src/midend/programAnalysis/CMakeLists.txt @@ -0,0 +1,63 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + +add_subdirectory(CallGraphAnalysis) +add_subdirectory(OAWrap) +add_subdirectory(CFG) +add_subdirectory(dataflowAnalysis) +add_subdirectory(valuePropagation) +add_subdirectory(defUseAnalysis) +add_subdirectory(dominanceAnalysis) +add_subdirectory(staticInterproceduralSlicing) +add_subdirectory(pointerAnal) +add_subdirectory(annotationLanguageParser) +add_subdirectory(sideEffectAnalysis) +add_subdirectory(distributedMemoryAnalysis) +add_subdirectory(graphAnalysis) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +## DQ (5/3/2007): Old version before Christian's work was added. +##SUBDIRS = CallGraphAnalysis OAWrap CFG dataflowAnalysis +## valuePropagation dominatorTreesAndDominanceFrontiers +## staticProgramSlicing proceduralSlicing +# +#SUBDIRS = CallGraphAnalysis OAWrap CFG dataflowAnalysis \ +# valuePropagation defUseAnalysis dominanceAnalysis \ +# staticInterproceduralSlicing pointerAnal \ +# annotationLanguageParser sideEffectAnalysis distributedMemoryAnalysis \ +# graphAnalysis +# +## DQ (9/6/2005): Commented out these directories since they +## represent code that used the older graph interface and they +## no longer compile! These will be updated later. +## staticProgramSlicing proceduralSlicing +# +### The grammar generator (ROSETTA) should use its own template repository +#CXX_TEMPLATE_REPOSITORY_PATH = . +# +#clean-local: +# rm -rf Templates.DB ii_files ti_files cxx_templates +# +#distclean-local: +# rm -rf Templates.DB +# +##dist-hook: +## ln -s ../STL-link ${distdir} +# +## AUTOMAKE_OPTIONS = foreign +# +#EXTRA_DIST = OpenAnalysis +# +# +# +# +# diff --git a/src/midend/programAnalysis/CallGraphAnalysis/CMakeLists.txt b/src/midend/programAnalysis/CallGraphAnalysis/CMakeLists.txt new file mode 100644 index 0000000000..f7a07f84c0 --- /dev/null +++ b/src/midend/programAnalysis/CallGraphAnalysis/CMakeLists.txt @@ -0,0 +1,34 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + +install(FILES CallGraph.h ClassHierarchyGraph.h DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +# +# +#INCLUDES = $(ROSE_INCLUDES) $(BOOST_CPPFLAGS) +#libCallGraphSources = CallGraph.C CallGraphDB.C ClassHierarchyGraph.C +# +#noinst_LTLIBRARIES = libCallGraph.la +#libCallGraph_la_SOURCES = $(libCallGraphSources) +# +#clean-local: +# rm -rf Templates.DB ii_files ti_files cxx_templates +# +#distclean-local: +# rm -rf Templates.DB +# +#include_HEADERS = CallGraph.h ClassHierarchyGraph.h +# +# diff --git a/src/midend/programAnalysis/OAWrap/CMakeLists.txt b/src/midend/programAnalysis/OAWrap/CMakeLists.txt new file mode 100644 index 0000000000..434ac185f7 --- /dev/null +++ b/src/midend/programAnalysis/OAWrap/CMakeLists.txt @@ -0,0 +1,44 @@ + +include_directories(${CMAKE_SOURCE_DIR}/src/midend/programAnalysis/OAWrap ${CMAKE_SOURCE_DIR}/src/midend/programAnalysis ${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + +install(FILES OAWrap.h SAGE2OA.h OAConfig.h DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#INCLUDES = $(ROSE_INCLUDES) -I$(top_srcdir)/src/midend/programAnalysis/OAWrap -I$(top_srcdir)/src/midend/programAnalysis +# +### The grammar generator (ROSETTA) should use its own template repository +#CXX_TEMPLATE_REPOSITORY_PATH = . +# +#libOAWrapSources = OAWrap.C SAGE2OA.C +# +## lib_LTLIBRARIES = libOAWrap.a +## libOAWrap_a_SOURCES = $(libOAWrapSources) +# +#noinst_LTLIBRARIES = libOAWrap.la +#libOAWrap_la_SOURCES = $(libOAWrapSources) +# +#clean-local: +# rm -rf Templates.DB ii_files ti_files cxx_templates +# +#distclean-local: +# rm -rf Templates.DB +# +#include_HEADERS = OAWrap.h SAGE2OA.h OAConfig.h +# +# +# +# +# +# +# diff --git a/src/midend/programAnalysis/annotationLanguageParser/CMakeLists.txt b/src/midend/programAnalysis/annotationLanguageParser/CMakeLists.txt new file mode 100644 index 0000000000..7b68ef65b4 --- /dev/null +++ b/src/midend/programAnalysis/annotationLanguageParser/CMakeLists.txt @@ -0,0 +1,66 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#noinst_HEADERS = \ +# actionchanger.h analyze.h annvariable.h callingcontext.h diagnostic.h \ +# localstl.h property.h set_property.h action.h ann.h bdwy_liveness.h \ +# constantprop.h enum_property.h pointerrule.h report.h structure.h \ +# adaptor_statistics.h annotations.h broadway.h cpattern.h broadway_expr.h \ +# procedure.h rule.h unification_ann.h +# +#include_HEADERS = +# +#noinst_LTLIBRARIES = libannotationLanguageParser.la +# +### Specifications for building the pdf library. +#libannotationLanguageParser_la_SOURCES = \ +# language-lexer.cc language-parser.cc \ +# annotations.cc \ +# annvariable.cc \ +# structure.cc \ +# enum_property.cc \ +# procedure.cc \ +# set_property.cc \ +# pointerrule.cc \ +# analyze.cc \ +# rule.cc \ +# broadway_expr.cc \ +# report.cc \ +# language.tab.h +# +#libannotationLanguageParser_la_DEPENDENCES = language-lexer.cc language-parser.cc language.tab.h +## libannotationLanguageParser_la_LIBADD = +# +#BUILT_SOURCES = language-lexer.cc language-parser.cc language.tab.h +# +#AM_CXXFLAGS = -D__LOCALSTL_H +# +#language-parser.cc: $(srcdir)/language.y +# bison -d -pann -o ./tempBisonOutput.c $(srcdir)/language.y +# mv tempBisonOutput.c language-parser.cc +# mv tempBisonOutput.h language.tab.h +# +#language-lexer.cc: $(srcdir)/language.l language-parser.cc +# flex $(srcdir)/language.l +# mv lex.ann.c language-lexer.cc +# +#language.tab.h: language-parser.cc +# +#clean: +# rm -f language-lexer.cc lex.ann.c language-parser.cc language.tab.h tempBisonOutput.* +# rm -f *.lo *.la +# +#EXTRA_DIST = language.l language.y diff --git a/src/midend/programAnalysis/dataflowAnalysis/CMakeLists.txt b/src/midend/programAnalysis/dataflowAnalysis/CMakeLists.txt new file mode 100644 index 0000000000..7a336656ae --- /dev/null +++ b/src/midend/programAnalysis/dataflowAnalysis/CMakeLists.txt @@ -0,0 +1,46 @@ + +include_directories(${CMAKE_SOURCE_DIR}/src/util ${CMAKE_SOURCE_DIR}/src/util/support ${CMAKE_SOURCE_DIR}/src/util/graphs ${CMAKE_SOURCE_DIR}/src/midend/astUtil ${CMAKE_SOURCE_DIR}/src/midend/astUtil/astSupport ${CMAKE_SOURCE_DIR}/src/midend/astUtil/astInterface ${CMAKE_SOURCE_DIR}/src/util/support ${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + +install(FILES DataFlowAnalysis.h DefUseChain.h ReachingDefinition.h DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#INCLUDES = $(ROSE_INCLUDES) -I$(srcdir)/.. -I$(srcdir)/../CFG -I$(top_srcdir)/src/util -I$(top_srcdir)/src/util/support -I$(top_srcdir)/src/util/graphs -I$(top_srcdir)/src/midend/astUtil -I$(top_srcdir)/src/midend/astUtil/astSupport -I$(top_srcdir)/src/midend/astUtil/astInterface -I$(top_srcdir)/src/util/support +# +### The grammar generator (ROSETTA) should use its own template repository +#CXX_TEMPLATE_REPOSITORY_PATH = . +# +#libdataflowAnalysisSources = DataFlowAnalysis.C DefUseChain.C ReachingDefinition.C +##libdataflowAnalysisSources = DataFlowAnalysis.C ReachingDefinition.C +# +## lib_LTLIBRARIES = libdataflowAnalysis.a +## libdataflowAnalysis_a_SOURCES = $(libdataflowAnalysisSources) +# +#noinst_LTLIBRARIES = libdataflowAnalysis.la +#libdataflowAnalysis_la_SOURCES = $(libdataflowAnalysisSources) +# +#clean-local: +# rm -rf Templates.DB ii_files ti_files cxx_templates +# +#distclean-local: +# rm -rf Templates.DB +# +#include_HEADERS = DataFlowAnalysis.h DefUseChain.h ReachingDefinition.h +# +# +# +# +# +# +# +# diff --git a/src/midend/programAnalysis/defUseAnalysis/CMakeLists.txt b/src/midend/programAnalysis/defUseAnalysis/CMakeLists.txt new file mode 100644 index 0000000000..c4fdc3410d --- /dev/null +++ b/src/midend/programAnalysis/defUseAnalysis/CMakeLists.txt @@ -0,0 +1,47 @@ + +include_directories(${CMAKE_SOURCE_DIR}/src/midend/loopProcessing ${CMAKE_SOURCE_DIR}/src/midend/astUtil ${CMAKE_SOURCE_DIR}/src/midend/astUtil/astInterface ${CMAKE_SOURCE_DIR}/src/midend/astUtil/annotation ${CMAKE_SOURCE_DIR}/src/midend/astUtil/symbolicVal ${CMAKE_SOURCE_DIR}/src/midend/astUtil/astSupport ${CMAKE_SOURCE_DIR}/src/util/support ${CMAKE_SOURCE_DIR}/src/util/graphs ${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + +install(FILES DefUseAnalysis.h BottomUpTraversalLiveness.h DefUseAnalysis_perFunction.h DFAFilter.h DFAnalysis.h dfaToDot.h GlobalVarAnalysis.h support.h LivenessAnalysis.h DefUseAnalysisAbstract.h DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#if ROSE_USE_GCC_OMP +#INCLUDES_OMP = -DROSE_GCC_OMP +#endif +# +#INCLUDES = $(ROSE_INCLUDES) \ +# -I$(srcdir)/.. -I$(srcdir)/../dataflowAnalysis -I$(srcdir)/../CFG -I$(top_srcdir)/src/midend/loopProcessing \ +# -I$(top_srcdir)/src/midend/astUtil -I$(top_srcdir)/src/midend/astUtil/astInterface \ +# -I$(top_srcdir)/src/midend/astUtil/annotation -I$(top_srcdir)/src/midend/astUtil/symbolicVal \ +# -I$(top_srcdir)/src/midend/astUtil/astSupport -I$(top_srcdir)/src/util/support -I$(top_srcdir)/src/util/graphs \ +# $(INCLUDES_OMP) +# +### The grammar generator (ROSETTA) should use its own template repository +#CXX_TEMPLATE_REPOSITORY_PATH = . +# +# +#noinst_LTLIBRARIES = libDefUseAnalysis.la +# +## DQ (11/8/2007): The runTest.cpp file was moved to tests/roseTests/programAnalysisTests/defUseAnalysisTests/runTest.C by Thomas. +## libDefUseAnalysis_la_SOURCES = $(srcdir)/GlobalVarAnalysis.cpp $(srcdir)/DefUseAnalysis.cpp $(srcdir)/DefUseAnalysis_perFunction.cpp $(srcdir)/dfaToDot.cpp $(srcdir)/runTest.cpp +#libDefUseAnalysis_la_SOURCES = $(srcdir)/GlobalVarAnalysis.cpp $(srcdir)/DefUseAnalysis.cpp $(srcdir)/DefUseAnalysis_perFunction.cpp $(srcdir)/dfaToDot.cpp $(srcdir)/LivenessAnalysis.cpp $(srcdir)/DefUseAnalysisAbstract.cpp +# +# +# +#clean-local: +# rm -rf Templates.DB ii_files ti_files cxx_templates +# +#distclean-local: +# rm -rf Templates.DB +# +#include_HEADERS = DefUseAnalysis.h BottomUpTraversalLiveness.h DefUseAnalysis_perFunction.h DFAFilter.h DFAnalysis.h dfaToDot.h GlobalVarAnalysis.h support.h LivenessAnalysis.h DefUseAnalysisAbstract.h diff --git a/src/midend/programAnalysis/distributedMemoryAnalysis/CMakeLists.txt b/src/midend/programAnalysis/distributedMemoryAnalysis/CMakeLists.txt new file mode 100644 index 0000000000..a83a09f5a4 --- /dev/null +++ b/src/midend/programAnalysis/distributedMemoryAnalysis/CMakeLists.txt @@ -0,0 +1,42 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + +install(FILES functionNames.h DistributedMemoryAnalysis.h DistributedMemoryAnalysisImplementation.h functionLevelTraversal.h DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#if ROSE_MPI +# +#INCLUDES = $(ROSE_INCLUDES) -DROSE_MPI +# +##LTCXXCOMPILE = \ +## $(LIBTOOL) --tag=CXX --mode=compile $(MPICXX) $(DEFS) \ +## $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ +## $(AM_CXXFLAGS) $(CXXFLAGS) +##CXXCOMPILE = \ +## $(MPICXX) $(DEFS) \ +## $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ +## $(AM_CXXFLAGS) $(CXXFLAGS) +##CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(MPICXX) $(AM_CXXFLAGS) \ +## $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +# +#noinst_LTLIBRARIES = libdistributedMemoryAnalysis.la +#libdistributedMemoryAnalysis_la_SOURCES = DistributedMemoryAnalysis.C functionNames.C +# +#include_HEADERS = functionNames.h DistributedMemoryAnalysis.h DistributedMemoryAnalysisImplementation.h functionLevelTraversal.h +# +#endif +# +#EXTRA_DIST = DistributedMemoryAnalysis.C functionNames.C functionNames.h \ +# DistributedMemoryAnalysis.h \ +# DistributedMemoryAnalysisImplementation.h functionLevelTraversal.h diff --git a/src/midend/programAnalysis/dominanceAnalysis/CMakeLists.txt b/src/midend/programAnalysis/dominanceAnalysis/CMakeLists.txt new file mode 100644 index 0000000000..ebdd825117 --- /dev/null +++ b/src/midend/programAnalysis/dominanceAnalysis/CMakeLists.txt @@ -0,0 +1,22 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### install files ############### + +install(FILES DominatorTree.h filteredCFG.h DominanceFrontier.h DominatorTreeImpl.h DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#clean-local: +# rm -rf Templates.DB ii_files ti_files cxx_templates +# +#distclean-local: +# rm -rf Templates.DB +# +#include_HEADERS = DominatorTree.h filteredCFG.h DominanceFrontier.h DominatorTreeImpl.h +# diff --git a/src/midend/programAnalysis/dominatorTreesAndDominanceFrontiers/CMakeLists.txt b/src/midend/programAnalysis/dominatorTreesAndDominanceFrontiers/CMakeLists.txt new file mode 100644 index 0000000000..e51154e454 --- /dev/null +++ b/src/midend/programAnalysis/dominatorTreesAndDominanceFrontiers/CMakeLists.txt @@ -0,0 +1,33 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + +install(FILES ControlFlowGraph.h SimpleDirectedGraph.h DominanceFrontier.h DominatorTree.h DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#INCLUDES = $(ROSE_INCLUDES) +# +### The grammar generator (ROSETTA) should use its own template repository +#CXX_TEMPLATE_REPOSITORY_PATH = . +# +#libdominance_la_SOURCES = ControlFlowGraph.C DominanceFrontier.C DominatorTree.C +# +#noinst_LTLIBRARIES = libdominance.la +# +#clean-local: +# rm -rf Templates.DB ii_files ti_files cxx_templates +# +#distclean-local: +# rm -rf Templates.DB +# +#include_HEADERS = ControlFlowGraph.h SimpleDirectedGraph.h DominanceFrontier.h DominatorTree.h diff --git a/src/midend/programAnalysis/graphAnalysis/CMakeLists.txt b/src/midend/programAnalysis/graphAnalysis/CMakeLists.txt new file mode 100644 index 0000000000..52282265b4 --- /dev/null +++ b/src/midend/programAnalysis/graphAnalysis/CMakeLists.txt @@ -0,0 +1,54 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + +install(FILES CallGraphAnalysis.h RoseBin_DotGraph.h RoseBin_Graph.h RoseBin_GmlGraph.h SB_Graph.h RoseSrc_CallGraphAnalysis.h DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +# +#INCLUDES = $(ROSE_INCLUDES) +# +### The grammar generator (ROSETTA) should use its own template repository +#CXX_TEMPLATE_REPOSITORY_PATH = . +# +#noinst_LTLIBRARIES = libSB_GraphAnalysis.la +# +#sourse_files = \ +# $(srcdir)/CallGraphAnalysis.C \ +# $(srcdir)/RoseBin_DotGraph.cpp \ +# $(srcdir)/RoseBin_Graph.cpp \ +# $(srcdir)/RoseBin_GmlGraph.cpp \ +# $(srcdir)/SB_Graph.C \ +# $(srcdir)/RoseSrc_CallGraphAnalysis.C +# +## DQ (5/2/2009): I wonder why we can't form predicates this way (does not work in Automake). +##if ROSE_USE_NEW_GRAPH_NODES && ROSE_USING_GRAPH_IR_NODES_FOR_BACKWARD_COMPATABILITY +## if ROSE_USE_NEW_GRAPH_NODES +##if ROSE_USING_GRAPH_IR_NODES_FOR_BACKWARD_COMPATABILITY +##libSB_GraphAnalysis_la_SOURCES = $(sourse_files) +##else +##libSB_GraphAnalysis_la_SOURCES = +##endif +##else +#libSB_GraphAnalysis_la_SOURCES = $(sourse_files) +##endif +# +# +#clean-local: +# rm -rf Templates.DB ii_files ti_files cxx_templates *.la *.lo +# +#distclean-local: +# rm -rf Templates.DB +# +#include_HEADERS = CallGraphAnalysis.h RoseBin_DotGraph.h RoseBin_Graph.h RoseBin_GmlGraph.h SB_Graph.h RoseSrc_CallGraphAnalysis.h +# diff --git a/src/midend/programAnalysis/pointerAnal/CMakeLists.txt b/src/midend/programAnalysis/pointerAnal/CMakeLists.txt new file mode 100644 index 0000000000..15e1a0c364 --- /dev/null +++ b/src/midend/programAnalysis/pointerAnal/CMakeLists.txt @@ -0,0 +1,42 @@ + +include_directories(${CMAKE_SOURCE_DIR}/src/util/support ${CMAKE_SOURCE_DIR}/src/util/graphs ${CMAKE_SOURCE_DIR}/src/midend/astUtil ${CMAKE_SOURCE_DIR}/src/midend/astUtil/astSupport ${CMAKE_SOURCE_DIR}/src/midend/astUtil/astInterface ${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + +install(FILES steensgaard.h PtrAnal.h DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#INCLUDES = $(ROSE_INCLUDES) -I../CFG -I$(top_srcdir)/src/util/support -I$(top_srcdir)/src/util/graphs -I$(top_srcdir)/src/midend/astUtil -I$(top_srcdir)/src/midend/astUtil/astSupport -I$(top_srcdir)/src/midend/astUtil/astInterface +# +### The grammar generator (ROSETTA) should use its own template repository +#CXX_TEMPLATE_REPOSITORY_PATH = . +# +#EXTRA_DIST = steensgaard.h PtrAnal.h SteensgaardPtrAnal.h +# +#noinst_LTLIBRARIES = libpointerAnal.la +#libpointerAnal_la_SOURCES = PtrAnal.C PtrAnalCFG.C +# +#clean-local: +# rm -rf Templates.DB ii_files ti_files cxx_templates +# +#distclean-local: +# rm -rf Templates.DB +# +#include_HEADERS = steensgaard.h PtrAnal.h +# +# +# +# +# +# +# +# diff --git a/src/midend/programAnalysis/proceduralSlicing/CMakeLists.txt b/src/midend/programAnalysis/proceduralSlicing/CMakeLists.txt new file mode 100644 index 0000000000..640291d065 --- /dev/null +++ b/src/midend/programAnalysis/proceduralSlicing/CMakeLists.txt @@ -0,0 +1,33 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + +install(FILES CheckWhichAreMarked.h FindStatements.h KeepAttribute.h MarkingNodes.h RemovalOfNodes.h SlicingCriterion.h Slicing.h DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#INCLUDES = $(ROSE_INCLUDES) +# +### The grammar generator (ROSETTA) should use its own template repository +#CXX_TEMPLATE_REPOSITORY_PATH = . +# +## DQ (9/10/2005): Commented out until Millind can get this code compiled (Qing changed the Graph interface) +# libalternativeProgramSlicing_la_SOURCES = FindStatements.cpp MarkingNodes.cpp RemovalOfNodes.cpp Slicing.cpp SlicingCriterion.cpp SlicingInfo.C +#noinst_LTLIBRARIES = libalternativeProgramSlicing.la +# +#clean-local: +# rm -rf Templates.DB ii_files ti_files cxx_templates +# +#distclean-local: +# rm -rf Templates.DB +# +#include_HEADERS = CheckWhichAreMarked.h FindStatements.h KeepAttribute.h MarkingNodes.h RemovalOfNodes.h SlicingCriterion.h Slicing.h diff --git a/src/midend/programAnalysis/sideEffectAnalysis/CMakeLists.txt b/src/midend/programAnalysis/sideEffectAnalysis/CMakeLists.txt new file mode 100644 index 0000000000..2f46b17771 --- /dev/null +++ b/src/midend/programAnalysis/sideEffectAnalysis/CMakeLists.txt @@ -0,0 +1,40 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + +install(FILES sideEffect.h DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +## tps (1Dec2008) : I enabled the mysql path detection and this code fails because no such include files can be found. +## so I disable this if --with-binarysql is used! +#if ROSE_USE_BINARY_SQL +#else +#if ROSE_USE_MYSQL_DATABASE +#INCLUDES = $(ROSE_INCLUDES) -idirafter @MySQL_path@/include -idirafter @MySQL_path@/include/mysql -idirafter /home/thuerey1/local/include +# +## noinst_HEADERS = sideEffect.h +#include_HEADERS = sideEffect.h +# +#noinst_LTLIBRARIES = libsideEffect.la +# +### Specifications for building the pdf library. +#libsideEffect_la_SOURCES = sideEffect.C +# +## libannotationLanguageParser_la_DEPENDENCES = language-lexer.cc language-parser.cc language.tab.h +## libannotationLanguageParser_la_LIBADD = +#endif +#endif +#clean: +# rm -f a.out +# +# diff --git a/src/midend/programAnalysis/staticInterproceduralSlicing/CMakeLists.txt b/src/midend/programAnalysis/staticInterproceduralSlicing/CMakeLists.txt new file mode 100644 index 0000000000..78cff93ce7 --- /dev/null +++ b/src/midend/programAnalysis/staticInterproceduralSlicing/CMakeLists.txt @@ -0,0 +1,39 @@ + +include_directories(${CMAKE_SOURCE_DIR}/src/midend/loopProcessing ${CMAKE_SOURCE_DIR}/src/midend/astUtil ${CMAKE_SOURCE_DIR}/src/midend/astUtil/astInterface ${CMAKE_SOURCE_DIR}/src/midend/astUtil/annotation ${CMAKE_SOURCE_DIR}/src/midend/astUtil/symbolicVal ${CMAKE_SOURCE_DIR}/src/midend/astUtil/astSupport ${CMAKE_SOURCE_DIR}/src/util/support ${CMAKE_SOURCE_DIR}/src/util/graphs ${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + +install(FILES DebugTool.h DefUseExtension.h DependenceGraph.h InterproceduralInfo.h SimpleDirectedGraph.h SlicingInfo.h EDefUse.h SDGLibraryExtender.h CreateSlice.h CreateSliceSet.h ControlFlowGraph.h DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +## INCLUDES = $(ROSE_INCLUDES) -I$(srcdir)/.. -I$(srcdir)/../dataflowAnalysis -I$(srcdir)/../CFG -I$(top_srcdir)/src/midend/loopProcessing -I$(top_srcdir)/src/midend/astUtil -I$(top_srcdir)/src/midend/astUtil/astInterface -I$(top_srcdir)/src/midend/astUtil/annotation -I$(top_srcdir)/src/midend/astUtil/symbolicVal -I$(top_srcdir)/src/midend/astUtil/astSupport -I$(top_srcdir)/src/util/support -I$(top_srcdir)/src/util/graphs -I$(srcdir)/../dominatorTreesAndDominanceFrontiers +#INCLUDES = $(ROSE_INCLUDES) -I$(srcdir)/.. -I$(srcdir)/../dataflowAnalysis -I$(srcdir)/../CFG -I$(top_srcdir)/src/midend/loopProcessing -I$(top_srcdir)/src/midend/astUtil -I$(top_srcdir)/src/midend/astUtil/astInterface -I$(top_srcdir)/src/midend/astUtil/annotation -I$(top_srcdir)/src/midend/astUtil/symbolicVal -I$(top_srcdir)/src/midend/astUtil/astSupport -I$(top_srcdir)/src/util/support -I$(top_srcdir)/src/util/graphs +# +#noinst_LTLIBRARIES = libStaticSlicing.la +# +## DQ (1/2/2007): Copied the ControlFlowGraph.C and ControlFlowGraph.h from ../dominatorTreesAndDominanceFrontiers +## since that directory has been deprecated. +# +#libStaticSlicing_la_SOURCES = \ +# $(srcdir)/ControlDependenceGraph.C $(srcdir)/DataDependenceGraph.C \ +# $(srcdir)/MergedDependenceGraph.C $(srcdir)/CreateSlice.C $(srcdir)/SlicingInfo.C $(srcdir)/CreateSliceSet.C \ +# $(srcdir)/DependenceGraph.C $(srcdir)/FunctionDependenceGraph.C \ +# $(srcdir)/SystemDependenceGraph.C $(srcdir)/DefUseExtension.C $(srcdir)/EDefUse.C \ +# ControlFlowGraph.C +# +#clean-local: +# rm -rf Templates.DB ii_files ti_files cxx_templates +# +#distclean-local: +# rm -rf Templates.DB +# +#include_HEADERS = DebugTool.h DefUseExtension.h DependenceGraph.h InterproceduralInfo.h SimpleDirectedGraph.h SlicingInfo.h EDefUse.h SDGLibraryExtender.h CreateSlice.h CreateSliceSet.h ControlFlowGraph.h diff --git a/src/midend/programAnalysis/valuePropagation/CMakeLists.txt b/src/midend/programAnalysis/valuePropagation/CMakeLists.txt new file mode 100644 index 0000000000..5baa624ce3 --- /dev/null +++ b/src/midend/programAnalysis/valuePropagation/CMakeLists.txt @@ -0,0 +1,46 @@ + +include_directories(${CMAKE_SOURCE_DIR}/src/midend/loopProcessing ${CMAKE_SOURCE_DIR}/src/midend/astUtil ${CMAKE_SOURCE_DIR}/src/midend/astUtil/astInterface ${CMAKE_SOURCE_DIR}/src/midend/astUtil/annotation ${CMAKE_SOURCE_DIR}/src/midend/astUtil/symbolicVal ${CMAKE_SOURCE_DIR}/src/midend/astUtil/astSupport ${CMAKE_SOURCE_DIR}/src/util/support ${CMAKE_SOURCE_DIR}/src/util/graphs ${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + +install(FILES ValueAnnot.h ValuePropagate.h DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +## INCLUDES = $(ROSE_INCLUDES) -I$(srcdir)/.. -I$(top_srcdir)/src/midend/loopProcessing -I$(top_srcdir)/src/midend/astUtil -I$(top_srcdir)/src/util/support -I$(top_srcdir)/src/util +# +#INCLUDES = $(ROSE_INCLUDES) -I$(srcdir)/.. -I$(srcdir)/../dataflowAnalysis -I$(srcdir)/../CFG -I$(top_srcdir)/src/midend/loopProcessing -I$(top_srcdir)/src/midend/astUtil -I$(top_srcdir)/src/midend/astUtil/astInterface -I$(top_srcdir)/src/midend/astUtil/annotation -I$(top_srcdir)/src/midend/astUtil/symbolicVal -I$(top_srcdir)/src/midend/astUtil/astSupport -I$(top_srcdir)/src/util/support -I$(top_srcdir)/src/util/graphs +# +### The grammar generator (ROSETTA) should use its own template repository +#CXX_TEMPLATE_REPOSITORY_PATH = . +# +#libvaluePropagationSources = ValueAnnot.C ValuePropagate.C +# +## lib_LTLIBRARIES = libvaluePropagation.a +## libvaluePropagation_a_SOURCES = $(libvaluePropagationSources) +# +#noinst_LTLIBRARIES = libvaluePropagation.la +#libvaluePropagation_la_SOURCES = $(libvaluePropagationSources) +# +#clean-local: +# rm -rf Templates.DB ii_files ti_files cxx_templates +# +#distclean-local: +# rm -rf Templates.DB +# +#include_HEADERS = ValueAnnot.h ValuePropagate.h +# +# +# +# +# +# +# diff --git a/src/midend/programTransformation/CMakeLists.txt b/src/midend/programTransformation/CMakeLists.txt new file mode 100644 index 0000000000..ad4952b1f1 --- /dev/null +++ b/src/midend/programTransformation/CMakeLists.txt @@ -0,0 +1,23 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + +add_subdirectory(partialRedundancyElimination) +add_subdirectory(finiteDifferencing) +add_subdirectory(functionCallNormalization) +add_subdirectory(constantFolding) +add_subdirectory(implicitCodeGeneration) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#SUBDIRS = partialRedundancyElimination finiteDifferencing functionCallNormalization constantFolding implicitCodeGeneration +# +# +# diff --git a/src/midend/programTransformation/constantFolding/CMakeLists.txt b/src/midend/programTransformation/constantFolding/CMakeLists.txt new file mode 100644 index 0000000000..6d7a42bb80 --- /dev/null +++ b/src/midend/programTransformation/constantFolding/CMakeLists.txt @@ -0,0 +1,29 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + +install(FILES constantFolding.h DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#INCLUDES = $(ROSE_INCLUDES) +# +#libconstantFoldingSources = \ +# constantFolding.C +# +#noinst_LTLIBRARIES = libconstantFolding.la +#libconstantFolding_la_SOURCES = $(libconstantFoldingSources) +# +#include_HEADERS = constantFolding.h +# +#clean-local: +# rm -rf Templates.DB ii_files ti_files core diff --git a/src/midend/programTransformation/finiteDifferencing/CMakeLists.txt b/src/midend/programTransformation/finiteDifferencing/CMakeLists.txt new file mode 100644 index 0000000000..b85e121a48 --- /dev/null +++ b/src/midend/programTransformation/finiteDifferencing/CMakeLists.txt @@ -0,0 +1,29 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + +install(FILES finiteDifferencing.h patternRewrite.h DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#INCLUDES = $(ROSE_INCLUDES) -I${top_srcdir}/src/midend/programAnalysis/CFG +# +#libfiniteDifferencingSources = \ +# finiteDifferencing.C patternRewrite.C +# +#noinst_LTLIBRARIES = libfiniteDifferencing.la +#libfiniteDifferencing_la_SOURCES = $(libfiniteDifferencingSources) +# +#include_HEADERS = finiteDifferencing.h patternRewrite.h +# +#clean-local: +# rm -rf Templates.DB ii_files ti_files core diff --git a/src/midend/programTransformation/functionCallNormalization/CMakeLists.txt b/src/midend/programTransformation/functionCallNormalization/CMakeLists.txt new file mode 100644 index 0000000000..e037b05d58 --- /dev/null +++ b/src/midend/programTransformation/functionCallNormalization/CMakeLists.txt @@ -0,0 +1,29 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + +install(FILES FunctionNormalization.h DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#INCLUDES = $(ROSE_INCLUDES) +# +#libfunctionCallNormalizationSources = \ +# FunctionNormalization.C +# +#noinst_LTLIBRARIES = libfunctionCallNormalization.la +#libfunctionCallNormalization_la_SOURCES = $(libfunctionCallNormalizationSources) +# +#include_HEADERS = FunctionNormalization.h +# +#clean-local: +# rm -rf Templates.DB ii_files ti_files core diff --git a/src/midend/programTransformation/implicitCodeGeneration/CMakeLists.txt b/src/midend/programTransformation/implicitCodeGeneration/CMakeLists.txt new file mode 100644 index 0000000000..cb46e4311f --- /dev/null +++ b/src/midend/programTransformation/implicitCodeGeneration/CMakeLists.txt @@ -0,0 +1,26 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + +install(FILES analysisUtils.h defaultFunctionGenerator.h destructorCallAnnotator.h shortCircuitingTransformation.h DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#INCLUDES = $(ROSE_INCLUDES) +# +#noinst_LTLIBRARIES = libimplicitCodeGeneration.la +# +#libimplicitCodeGeneration_la_SOURCES = analysisUtils.C defaultFunctionGenerator.C destructorCallAnnotator.C shortCircuitingTransformation.C +# +#include_HEADERS = analysisUtils.h defaultFunctionGenerator.h destructorCallAnnotator.h shortCircuitingTransformation.h +# +#EXTRA_DIST = README diff --git a/src/midend/programTransformation/partialRedundancyElimination/CMakeLists.txt b/src/midend/programTransformation/partialRedundancyElimination/CMakeLists.txt new file mode 100644 index 0000000000..bd30860500 --- /dev/null +++ b/src/midend/programTransformation/partialRedundancyElimination/CMakeLists.txt @@ -0,0 +1,29 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + +install(FILES expressionTreeEqual.h pre.h controlFlowGraph.h DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#INCLUDES = $(ROSE_INCLUDES) -I${top_srcdir}/src/midend/programAnalysis/CFG +# +#libpreSources = \ +# expressionTreeEqual.C pre.C controlFlowGraph.C +# +#noinst_LTLIBRARIES = libpre.la +#libpre_la_SOURCES = $(libpreSources) +# +#include_HEADERS = expressionTreeEqual.h pre.h controlFlowGraph.h +# +#clean-local: +# rm -rf Templates.DB ii_files ti_files core diff --git a/src/roseExtensions/CMakeLists.txt b/src/roseExtensions/CMakeLists.txt new file mode 100644 index 0000000000..efe26fb49d --- /dev/null +++ b/src/roseExtensions/CMakeLists.txt @@ -0,0 +1,29 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + +add_subdirectory(sqlite3x) +add_subdirectory(SQLiteConnection) +add_subdirectory(databaseConnection) +add_subdirectory(dataStructureTraversal) +add_subdirectory(highLevelGrammar) +add_subdirectory(roseHPCToolkit) +#add_subdirectory(qtWidgets) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#SUBDIRS = \ +# sqlite3x \ +# SQLiteConnection \ +# databaseConnection \ +# dataStructureTraversal \ +# highLevelGrammar \ +# roseHPCToolkit \ +# qtWidgets diff --git a/src/roseExtensions/SQLiteConnection/CMakeLists.txt b/src/roseExtensions/SQLiteConnection/CMakeLists.txt new file mode 100644 index 0000000000..7b85870e1c --- /dev/null +++ b/src/roseExtensions/SQLiteConnection/CMakeLists.txt @@ -0,0 +1,40 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + +install(FILES README DESTINATION ${INCLUDE_INSTALL_DIR} ) +install(FILES ColData.h Connection.h dbheaders.h GlobalDatabaseConnection.h Query.h Result.h Row.h DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#if ROSE_USE_SQLITE_DATABASE +#INCLUDES = $(ROSE_INCLUDES) +# +### The grammar generator (ROSETTA) should use its own template repository +## CXX_TEMPLATE_REPOSITORY_PATH = . +# +#libRoseSQLiteDatabaseSources = Result.C GlobalDatabaseConnection.C Query.C Connection.C +# +#noinst_LTLIBRARIES = libRoseSQLiteDatabase.la +#libRoseSQLiteDatabase_la_SOURCES = $(libRoseSQLiteDatabaseSources) +#endif +# +#clean-local: +# rm -rf Templates.DB ii_files ti_files cxx_templates libRoseSQLiteDatabase.so +# +#distclean-local: +# rm -rf Templates.DB +# +#include_HEADERS = \ +# ColData.h Connection.h dbheaders.h GlobalDatabaseConnection.h Query.h Result.h Row.h +# +#dist_noinst_DATA = README diff --git a/src/roseExtensions/dataStructureTraversal/CMakeLists.txt b/src/roseExtensions/dataStructureTraversal/CMakeLists.txt new file mode 100644 index 0000000000..2f04af83c5 --- /dev/null +++ b/src/roseExtensions/dataStructureTraversal/CMakeLists.txt @@ -0,0 +1,86 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### install files ############### + +install(FILES ControlStructure.h GenGeneration.h GenRepresentation.h helpFunctions.h DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include ../../../config/Makefile.for.ROSE.includes.and.libs +# +#INCLUDES = $(ROSE_INCLUDES) +# +## Define the template repository path used in the autoconf +## subsitution for various C++ template control variables. +#CXX_TEMPLATE_REPOSITORY_PATH = . +# +## DQ (2/8/2004): Disabled +## bin_PROGRAMS = cgraphpp +# +## list of dependencies for all example programs +#EXAMPLE_PROGRAMS_DEPENDENCY_LIST = $(ROSE_LIBS) +# +## DQ (2/8/2004): Disabled +## cgraphpp_SOURCES = ControlStructure.C GenGeneration.C GenRepresentation.C helpFunctions.C main.C +# +## DQ (2/8/2004): Disabled +## Can't use $(ROSE_LIBS) since it would make librewrite.a be compiled +## (and it appears after src in the SUBDIRS line). But then we can't +## compile the cgraphpp translator. Need tomove the AST_RewriteMechanism +## directory into ROSE/src so that the ordering can be handled in the +## ROSE/src/Makefile.am. This is too much to do right now. So it +## is reseverd for the next checkin. +## cgraphpp_DEPENDENCIES = $(EXAMPLE_PROGRAMS_DEPENDENCY_LIST) +## cgraphpp_DEPENDENCIES = +# +#LDADD = $(ROSE_LIBS) +# +### Code added to permit tests in this directory as part of development +# +### Add bugs to this line as they are fixed so that they can be used as test problems +### At least we should not reintroduce these fixed bugs again later. +#TESTCODES = +# +## DQ (2/8/2004): Disabled +## exampleTest.C +# +## Use of this test code requires specification of EDG include files +## dataStructureTest_1.C +# +## Build the list of object files +#TEST_Objects = ${TESTCODES:.C=.o} +# +## ROSE_FLAGS = -rose:dot -rose:test 6 -rose:outputGrammarTreeFiles -rose:outputGrammarTreeFilesForHeaderFiles +#ROSE_FLAGS = -rose:dot -rose:test 6 -rose:outputGrammarTreeFiles -rose:outputGrammarTreeFilesForHeaderFiles -rose:outputGrammarTreeFilesForEDG +# +## How to run Andreas' graphing preprocessor (note -gall option causes g++ warning -fgall ???) +## 1) cgraphpp --gall exampleTest.C +## 2) dotgl Static_exampleTest.C.dot & +# +#$(TEST_Objects): $(TESTCODES) +# : remove this so that we can force the examples to be run +# rm -f $(TEST_Objects) +# ./cgraphpp --gall exampleTest.C +# : remove this so that we can force the examples to be run +# rm -f $(TEST_Objects) +# +## helpFunctions.h need to be put into the util directory +#include_HEADERS = \ +# ControlStructure.h GenGeneration.h GenRepresentation.h helpFunctions.h +# +#EXTRA_DIST = $(TESTCODES) +# +#clean-local: +# rm -rf $(CXX_TEMPLATE_OBJECTS) Templates.DB ii_files ti_files +# rm -f *.o rose_*.C *.sage.C \ +# *.C.pdf *.C.edg.pdf *.pdf *.dot *.sidl *.int.C rose_directives_list.txt core +# rm -rf ti_files +# +## This rule is run after automake's internal check rule (which we don't want to use) +#check-local: +# @$(MAKE) $(TEST_Objects) +# diff --git a/src/roseExtensions/databaseConnection/CMakeLists.txt b/src/roseExtensions/databaseConnection/CMakeLists.txt new file mode 100644 index 0000000000..b8f569aa47 --- /dev/null +++ b/src/roseExtensions/databaseConnection/CMakeLists.txt @@ -0,0 +1,127 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + +install(FILES GlobalDatabaseConnection.h TableAccessMacros.h TableAccess.h DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +## tps (1Dec2008) : I enabled the mysql path detection and this code fails because no such include files can be found. +## so I disable this if --with-binarysql is used! +#if ROSE_USE_BINARY_SQL +#else +#if ROSE_USE_MYSQL_DATABASE +# +## DQ (11/13/2003): Modified to use GNU specific -idirafter option to +## correct set.h (the g++ set.h instead of the C++ mySQL set.h) +## INCLUDES = $(ROSE_INCLUDES) -I/usr/include/g++-3 -I@MySQL_path@/include -I@MySQL_path@/include/mysql +## INCLUDES = $(ROSE_INCLUDES) -idirafter @MySQL_path@/include -idirafter @MySQL_path@/include/mysql +#INCLUDES = $(ROSE_INCLUDES) -idirafter @MySQL_path@/include -idirafter @MySQL_path@/include/mysql -idirafter /home/thuerey1/local/include +# +#LDADD = $(LIBS_WITH_RPATH) $(ROSE_LIBS) $(top_builddir)/projects/dataBase/librosedatabase.a @MySQL_path@/lib/mysql/libmysqlclient.a @MySQL_path@/lib/libsqlplus.a -lz +# +#librosedatabaseSources = \ +# GlobalDatabaseConnection.C \ +# TableAccess.C +# +## lib_LIBRARIES = librosedatabase.a +## librosedatabase_a_SOURCES = $(librosedatabaseSources) +## librosedatabase_a_DEPENDENCIES = $(librosedatabase_a_SOURCES) +# +#noinst_LTLIBRARIES = librosedatabase.la +#librosedatabase_la_SOURCES = $(librosedatabaseSources) +# +#include_HEADERS = GlobalDatabaseConnection.h TableAccessMacros.h TableAccess.h +# +# +## Test codes must be placed outside of the source directory (ROSE/src) into the ROSE/tests directory +##bin_PROGRAMS = testDataBase testEdges +##testDataBase_SOURCES = testDataBase.C +##testDataBase_DEPENDENCIES = +##testEdges_SOURCES = testEdges.C +# +## define all test codes +## TESTCODES = testEdges.C +# +## Build the list of object files +## TEST_Objects = ${TESTCODES:.C=.o} +# +## EXTRA_DIST = $(TESTCODES) +# +#CLEANFILES = +# +#clean-local: +# rm -rf Templates.DB ii_files ti_files rose_*.C *.pdf +# +## /usr/casc/overture/MySQL/MySQL_Install/bin/mysql -u root -prose-dq mysql -e "DELETE FROM user WHERE user = ''; GRANT ALL ON db.* TO dquinlan@'%.llnl.gov' IDENTIFIED BY 'rosepwd'; FLUSH PRIVILEGES; SELECT * FROM user;" +## "@MySQL_username@" , "@MySQL_password@", "@MySQL_database_name@" +# +#check-db: +## initial zap to clean up from any errors in previous runs +# @echo "Cleanup any previously left state within MySQL (errors in previous runs)" +# @MySQL_path@/bin/mysql_zap -f mysqld +## Create a data directory +# -rm -rf /tmp/mysqld-datadir +## Remove database directory (used for makefile check rule only, should not be used by users!) +# mkdir /tmp/mysqld-datadir +## Instantiate administrative databases +# @MySQL_path@/bin/mysql_install_db --datadir=/tmp/mysqld-datadir/ +## start the daemon +# @MySQL_path@/bin/mysqld_safe --datadir=/tmp/mysqld-datadir/ & +# sleep 1 +## set the root password +# @MySQL_path@/bin/mysqladmin --user=root password rootpwd +## connect to the database as root to perform access control +# @MySQL_path@/bin/mysql --user=root --password=rootpwd mysql -e "DELETE FROM user WHERE user = ''; \ +# GRANT ALL ON *.* TO @MySQL_username@ IDENTIFIED BY '@MySQL_password@'; FLUSH PRIVILEGES;" +# @echo "Run test code ..." +# ./testEdges +## rm -f testCode.o +## ./testDataBase +## $(MAKE) $(TEST_Objects) +## pkill mysqld_safe +# @echo "Cleanup use of MySQL ..." +# @MySQL_path@/bin/mysql_zap -f mysqld +# +## This test must be done in the ROSE/tests directory tree (not in the ROSE/src directory tree) +## check-local: check-db +# +#old-check-local: +## Create a data directory +# mkdir /tmp/mysqld-datadir +## Instantiate administrative databases +# @MySQL_path@/bin/mysql_install_db --datadir=/tmp/mysqld-datadir/ +## start the daemon +# @MySQL_path@/bin/mysqld_safe --datadir=/tmp/mysqld-datadir/ & +## set the root password +# @MySQL_path@/bin/mysqladmin --user=root password rootpwd +## connect to the database as root to perform access control +# @MySQL_path@/bin/mysql --user=root --password=rootpwd mysql -e "DELETE FROM user WHERE user = ''; GRANT ALL ON *.* TO @MySQL_username@ IDENTIFIED BY @MySQL_password@; FLUSH PRIVILEGES;" +# ./testEdges +## rm -f testCode.o +## ./testDataBase +## $(MAKE) $(TEST_Objects) +# pkill mysqld_safe +#endif +#endif +# +# +# +# +# +# +# +# +# +# +# +# diff --git a/src/roseExtensions/highLevelGrammar/CMakeLists.txt b/src/roseExtensions/highLevelGrammar/CMakeLists.txt new file mode 100644 index 0000000000..90275a330d --- /dev/null +++ b/src/roseExtensions/highLevelGrammar/CMakeLists.txt @@ -0,0 +1,12 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs diff --git a/src/roseExtensions/qtWidgets/AsmInstructionBar/CMakeLists.txt b/src/roseExtensions/qtWidgets/AsmInstructionBar/CMakeLists.txt new file mode 100644 index 0000000000..7963f2e52c --- /dev/null +++ b/src/roseExtensions/qtWidgets/AsmInstructionBar/CMakeLists.txt @@ -0,0 +1,38 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +##------------ AsmInstructionBar Makefile.am ----------- +#include $(top_srcdir)/src/roseExtensions/qtWidgets/Make.inc +# +#if ROSE_WITH_ROSEQT +# +#noinst_LTLIBRARIES = libAsmInstructionBar.la +# +# +# +#libAsmInstructionBar_la_SOURCES = AsmInstructionsBar.cpp +# +#nodist_libAsmInstructionBar_la_SOURCES = moc_AsmInstructionsBar.cxx +# +# +# +## Target for installing header +#headerTargetdir = $(roseQtWidgetsHeaderInstallPath)/ +#headerTarget_HEADERS = AsmInstructionsBar.h +# +# +#endif +# +#EXTRA_DIST = +# diff --git a/src/roseExtensions/qtWidgets/AsmView/CMakeLists.txt b/src/roseExtensions/qtWidgets/AsmView/CMakeLists.txt new file mode 100644 index 0000000000..b1790e484f --- /dev/null +++ b/src/roseExtensions/qtWidgets/AsmView/CMakeLists.txt @@ -0,0 +1,41 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +##------------ AsmView Makefile.am ----------- +#include $(top_srcdir)/src/roseExtensions/qtWidgets/Make.inc +# +#if ROSE_WITH_ROSEQT +# +#noinst_LTLIBRARIES = libAsmView.la +# +# +# +#libAsmView_la_SOURCES = AsmTreeNode.cpp\ +# AsmView.cpp +# +#nodist_libAsmView_la_SOURCES = moc_AsmView.cxx\ +# ui_ConfigureAsmViewDelegate.h +# +#BUILT_SOURCES = ui_ConfigureAsmViewDelegate.h +# +## Target for installing header +#headerTargetdir = $(roseQtWidgetsHeaderInstallPath)/ +#headerTarget_HEADERS = AsmTreeNode.h\ +# AsmView.h +# +# +#endif +# +#EXTRA_DIST = ConfigureAsmViewDelegate.ui +# diff --git a/src/roseExtensions/qtWidgets/AstBrowserWidget/CMakeLists.txt b/src/roseExtensions/qtWidgets/AstBrowserWidget/CMakeLists.txt new file mode 100644 index 0000000000..2fac5335e4 --- /dev/null +++ b/src/roseExtensions/qtWidgets/AstBrowserWidget/CMakeLists.txt @@ -0,0 +1,41 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +##------------ AstBrowserWidget Makefile.am ----------- +#include $(top_srcdir)/src/roseExtensions/qtWidgets/Make.inc +# +#if ROSE_WITH_ROSEQT +# +#noinst_LTLIBRARIES = libAstBrowserWidget.la +# +# +# +#libAstBrowserWidget_la_SOURCES = AstBrowserWidget.cpp\ +# QtAstModel.cpp +# +#nodist_libAstBrowserWidget_la_SOURCES = moc_AstBrowserWidget.cxx\ +# moc_QtAstModel.cxx +# +# +# +## Target for installing header +#headerTargetdir = $(roseQtWidgetsHeaderInstallPath)/ +#headerTarget_HEADERS = AstBrowserWidget.h\ +# QtAstModel.h +# +# +#endif +# +#EXTRA_DIST = +# diff --git a/src/roseExtensions/qtWidgets/AstProcessing/CMakeLists.txt b/src/roseExtensions/qtWidgets/AstProcessing/CMakeLists.txt new file mode 100644 index 0000000000..fc930a1bf9 --- /dev/null +++ b/src/roseExtensions/qtWidgets/AstProcessing/CMakeLists.txt @@ -0,0 +1,41 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +##------------ AstProcessing Makefile.am ----------- +#include $(top_srcdir)/src/roseExtensions/qtWidgets/Make.inc +# +#if ROSE_WITH_ROSEQT +# +#noinst_LTLIBRARIES = libAstProcessing.la +# +# +# +#libAstProcessing_la_SOURCES = NewAstProcessing.cpp +# +# +# +# +# +## Target for installing header +#headerTargetdir = $(roseQtWidgetsHeaderInstallPath)/ +#headerTarget_HEADERS = AstProcessing_BottomUp_impl.h\ +# AstProcessing_TopDown_impl.h\ +# AstProcessing_TopDownBottomUp_impl.h\ +# NewAstProcessing.h +# +# +#endif +# +#EXTRA_DIST = +# diff --git a/src/roseExtensions/qtWidgets/BeautifiedAst/CMakeLists.txt b/src/roseExtensions/qtWidgets/BeautifiedAst/CMakeLists.txt new file mode 100644 index 0000000000..239f6be73f --- /dev/null +++ b/src/roseExtensions/qtWidgets/BeautifiedAst/CMakeLists.txt @@ -0,0 +1,52 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +##------------ BeautifiedAst Makefile.am ----------- +#include $(top_srcdir)/src/roseExtensions/qtWidgets/Make.inc +# +#if ROSE_WITH_ROSEQT +# +#noinst_LTLIBRARIES = libBeautifiedAst.la +# +# +# +#libBeautifiedAst_la_SOURCES = BAstModel.cpp\ +# BAstNode.cpp\ +# BAstView.cpp +# +#nodist_libBeautifiedAst_la_SOURCES = moc_BAstModel.cxx\ +# moc_BAstView.cxx\ +# qrc_BeautifiedAst.cpp +# +# +# +## Target for installing header +#headerTargetdir = $(roseQtWidgetsHeaderInstallPath)/ +#headerTarget_HEADERS = BAstModel.h\ +# BAstNode.h\ +# BAstView.h +# +# +#endif +# +#EXTRA_DIST = BeautifiedAst.qrc \ +# icons/loop.png \ +# icons/sourcefile.gif \ +# icons/class.gif \ +# icons/namespace.gif \ +# icons/project.gif \ +# icons/function.gif \ +# icons/includes.gif \ +# icons/include.gif +# diff --git a/src/roseExtensions/qtWidgets/FlopCounter/CMakeLists.txt b/src/roseExtensions/qtWidgets/FlopCounter/CMakeLists.txt new file mode 100644 index 0000000000..b4d69297ae --- /dev/null +++ b/src/roseExtensions/qtWidgets/FlopCounter/CMakeLists.txt @@ -0,0 +1,40 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +##------------ FlopCounter Makefile.am ----------- +#include $(top_srcdir)/src/roseExtensions/qtWidgets/Make.inc +# +#if ROSE_WITH_ROSEQT +# +#noinst_LTLIBRARIES = libFlopCounter.la +# +# +# +#libFlopCounter_la_SOURCES = FlopCounter.cpp\ +# Flops.cpp +# +# +# +# +# +## Target for installing header +#headerTargetdir = $(roseQtWidgetsHeaderInstallPath)/ +#headerTarget_HEADERS = FlopCounter.h\ +# Flops.h +# +# +#endif +# +#EXTRA_DIST = +# diff --git a/src/roseExtensions/qtWidgets/InstructionCountAnnotator/CMakeLists.txt b/src/roseExtensions/qtWidgets/InstructionCountAnnotator/CMakeLists.txt new file mode 100644 index 0000000000..d81efd08f8 --- /dev/null +++ b/src/roseExtensions/qtWidgets/InstructionCountAnnotator/CMakeLists.txt @@ -0,0 +1,40 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +##------------ InstructionCountAnnotator Makefile.am ----------- +#include $(top_srcdir)/src/roseExtensions/qtWidgets/Make.inc +# +#if ROSE_WITH_ROSEQT +# +#noinst_LTLIBRARIES = libInstructionCountAnnotator.la +# +# +# +#libInstructionCountAnnotator_la_SOURCES = InstructionCountAnnotator.cpp\ +# PTracer.cpp +# +# +# +# +# +## Target for installing header +#headerTargetdir = $(roseQtWidgetsHeaderInstallPath)/ +#headerTarget_HEADERS = InstructionCountAnnotator.h\ +# PTracer.h +# +# +#endif +# +#EXTRA_DIST = +# diff --git a/src/roseExtensions/qtWidgets/KiviatView/CMakeLists.txt b/src/roseExtensions/qtWidgets/KiviatView/CMakeLists.txt new file mode 100644 index 0000000000..516c5aa1f0 --- /dev/null +++ b/src/roseExtensions/qtWidgets/KiviatView/CMakeLists.txt @@ -0,0 +1,38 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +##------------ KiviatView Makefile.am ----------- +#include $(top_srcdir)/src/roseExtensions/qtWidgets/Make.inc +# +#if ROSE_WITH_ROSEQT +# +#noinst_LTLIBRARIES = libKiviatView.la +# +# +# +#libKiviatView_la_SOURCES = KiviatView.cpp +# +#nodist_libKiviatView_la_SOURCES = moc_KiviatView.cxx +# +# +# +## Target for installing header +#headerTargetdir = $(roseQtWidgetsHeaderInstallPath)/ +#headerTarget_HEADERS = KiviatView.h +# +# +#endif +# +#EXTRA_DIST = +# diff --git a/src/roseExtensions/qtWidgets/MetricFilter/CMakeLists.txt b/src/roseExtensions/qtWidgets/MetricFilter/CMakeLists.txt new file mode 100644 index 0000000000..591219dd9f --- /dev/null +++ b/src/roseExtensions/qtWidgets/MetricFilter/CMakeLists.txt @@ -0,0 +1,39 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +##------------ MetricFilter Makefile.am ----------- +#include $(top_srcdir)/src/roseExtensions/qtWidgets/Make.inc +# +#if ROSE_WITH_ROSEQT +# +#noinst_LTLIBRARIES = libMetricFilter.la +# +# +# +#libMetricFilter_la_SOURCES = MetricFilter.cpp +# +#nodist_libMetricFilter_la_SOURCES = moc_MetricFilter.cxx\ +# ui_MetricFilter.h +# +#BUILT_SOURCES = ui_MetricFilter.h +# +## Target for installing header +#headerTargetdir = $(roseQtWidgetsHeaderInstallPath)/ +#headerTarget_HEADERS = MetricFilter.h +# +# +#endif +# +#EXTRA_DIST = MetricFilter.ui +# diff --git a/src/roseExtensions/qtWidgets/MetricsConfig/CMakeLists.txt b/src/roseExtensions/qtWidgets/MetricsConfig/CMakeLists.txt new file mode 100644 index 0000000000..d917f0489f --- /dev/null +++ b/src/roseExtensions/qtWidgets/MetricsConfig/CMakeLists.txt @@ -0,0 +1,41 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +##------------ MetricsConfig Makefile.am ----------- +#include $(top_srcdir)/src/roseExtensions/qtWidgets/Make.inc +# +#if ROSE_WITH_ROSEQT +# +#noinst_LTLIBRARIES = libMetricsConfig.la +# +# +# +#libMetricsConfig_la_SOURCES = MetricsConfig.cpp\ +# MetricsInfo.cpp +# +#nodist_libMetricsConfig_la_SOURCES = moc_MetricsConfig.cxx\ +# ui_MetricsConfig.h +# +#BUILT_SOURCES = ui_MetricsConfig.h +# +## Target for installing header +#headerTargetdir = $(roseQtWidgetsHeaderInstallPath)/ +#headerTarget_HEADERS = MetricsConfig.h\ +# MetricsInfo.h +# +# +#endif +# +#EXTRA_DIST = MetricsConfig.ui +# diff --git a/src/roseExtensions/qtWidgets/MetricsKiviat/CMakeLists.txt b/src/roseExtensions/qtWidgets/MetricsKiviat/CMakeLists.txt new file mode 100644 index 0000000000..a7bb330d8e --- /dev/null +++ b/src/roseExtensions/qtWidgets/MetricsKiviat/CMakeLists.txt @@ -0,0 +1,45 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +##------------ MetricsKiviat Makefile.am ----------- +#include $(top_srcdir)/src/roseExtensions/qtWidgets/Make.inc +# +#if ROSE_WITH_ROSEQT +# +#noinst_LTLIBRARIES = libMetricsKiviat.la +# +# +# +#libMetricsKiviat_la_SOURCES = KiviatInfo.cpp\ +# MetricsKiviat.cpp +# +#nodist_libMetricsKiviat_la_SOURCES = moc_KiviatInfo.cxx\ +# moc_MetricsKiviat.cxx\ +# ui_KiviatInfo.h\ +# ui_MetricsWidget.h +# +#BUILT_SOURCES = ui_KiviatInfo.h\ +# ui_MetricsWidget.h +# +## Target for installing header +#headerTargetdir = $(roseQtWidgetsHeaderInstallPath)/ +#headerTarget_HEADERS = KiviatInfo.h\ +# MetricsKiviat.h +# +# +#endif +# +#EXTRA_DIST = KiviatInfo.ui \ +# MetricsWidget.ui +# diff --git a/src/roseExtensions/qtWidgets/NodeInfoWidget/CMakeLists.txt b/src/roseExtensions/qtWidgets/NodeInfoWidget/CMakeLists.txt new file mode 100644 index 0000000000..a4ad8e7d41 --- /dev/null +++ b/src/roseExtensions/qtWidgets/NodeInfoWidget/CMakeLists.txt @@ -0,0 +1,38 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +##------------ NodeInfoWidget Makefile.am ----------- +#include $(top_srcdir)/src/roseExtensions/qtWidgets/Make.inc +# +#if ROSE_WITH_ROSEQT +# +#noinst_LTLIBRARIES = libNodeInfoWidget.la +# +# +# +#libNodeInfoWidget_la_SOURCES = NodeInfoWidget.cpp +# +#nodist_libNodeInfoWidget_la_SOURCES = moc_NodeInfoWidget.cxx +# +# +# +## Target for installing header +#headerTargetdir = $(roseQtWidgetsHeaderInstallPath)/ +#headerTarget_HEADERS = NodeInfoWidget.h +# +# +#endif +# +#EXTRA_DIST = +# diff --git a/src/roseExtensions/qtWidgets/ProjectManager/CMakeLists.txt b/src/roseExtensions/qtWidgets/ProjectManager/CMakeLists.txt new file mode 100644 index 0000000000..be720bd3ef --- /dev/null +++ b/src/roseExtensions/qtWidgets/ProjectManager/CMakeLists.txt @@ -0,0 +1,50 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +##------------ ProjectManager Makefile.am ----------- +#include $(top_srcdir)/src/roseExtensions/qtWidgets/Make.inc +# +#if ROSE_WITH_ROSEQT +# +#noinst_LTLIBRARIES = libProjectManager.la +# +# +# +#libProjectManager_la_SOURCES = CmdLineEditDialog.cpp\ +# DependencyInfo.cpp\ +# Project.cpp\ +# ProjectManager.cpp\ +# ProjectView.cpp +# +#nodist_libProjectManager_la_SOURCES = moc_CmdLineEditDialog.cxx\ +# moc_DependencyInfo.cxx\ +# moc_Project.cxx\ +# moc_ProjectView.cxx\ +# ui_CmdLineEditDialog.h +# +#BUILT_SOURCES = ui_CmdLineEditDialog.h +# +## Target for installing header +#headerTargetdir = $(roseQtWidgetsHeaderInstallPath)/ +#headerTarget_HEADERS = CmdLineEditDialog.h\ +# DependencyInfo.h\ +# Project.h\ +# ProjectManager.h\ +# ProjectView.h +# +# +#endif +# +#EXTRA_DIST = CmdLineEditDialog.ui +# diff --git a/src/roseExtensions/qtWidgets/PropertyTreeWidget/CMakeLists.txt b/src/roseExtensions/qtWidgets/PropertyTreeWidget/CMakeLists.txt new file mode 100644 index 0000000000..f2bbd16bf5 --- /dev/null +++ b/src/roseExtensions/qtWidgets/PropertyTreeWidget/CMakeLists.txt @@ -0,0 +1,41 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +##------------ PropertyTreeWidget Makefile.am ----------- +#include $(top_srcdir)/src/roseExtensions/qtWidgets/Make.inc +# +#if ROSE_WITH_ROSEQT +# +#noinst_LTLIBRARIES = libPropertyTreeWidget.la +# +# +# +#libPropertyTreeWidget_la_SOURCES = PropertyTreeModel.cpp\ +# PropertyTreeWidget.cpp +# +#nodist_libPropertyTreeWidget_la_SOURCES = moc_PropertyTreeModel.cxx\ +# moc_PropertyTreeWidget.cxx +# +# +# +## Target for installing header +#headerTargetdir = $(roseQtWidgetsHeaderInstallPath)/ +#headerTarget_HEADERS = PropertyTreeModel.h\ +# PropertyTreeWidget.h +# +# +#endif +# +#EXTRA_DIST = +# diff --git a/src/roseExtensions/qtWidgets/QCodeEditWidget/CMakeLists.txt b/src/roseExtensions/qtWidgets/QCodeEditWidget/CMakeLists.txt new file mode 100644 index 0000000000..31726ee729 --- /dev/null +++ b/src/roseExtensions/qtWidgets/QCodeEditWidget/CMakeLists.txt @@ -0,0 +1,111 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + +add_subdirectory(QCodeEdit) + + +########### next target ############### + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +##------------ QCodeEditWidget Makefile.am ----------- +#include $(top_srcdir)/src/roseExtensions/qtWidgets/Make.inc +# +#if ROSE_WITH_ROSEQT +# +#noinst_LTLIBRARIES = libQCodeEditWidget.la +# +# +## Contents of Makefile.am.pre +#INCLUDES += -I$(srcdir)/QCodeEdit -I$(srcdir)/QCodeEdit/document +#SUBDIRS = QCodeEdit +#libQCodeEditWidget_la_LIBADD = QCodeEdit/libQCodeEdit.la +# +## End of Makefile.am.pre Content +# +#libQCodeEditWidget_la_SOURCES = QCodeEditWidget.cpp +# +#nodist_libQCodeEditWidget_la_SOURCES = moc_QCodeEditWidget.cxx\ +# qrc_example.cpp\ +# qrc_QCodeEdit.cpp +# +# +# +## Target for installing header +#headerTargetdir = $(roseQtWidgetsHeaderInstallPath)/ +#headerTarget_HEADERS = QCodeEditWidget.h +# +# +#endif +# +#EXTRA_DIST = example.qrc \ +# QCodeEdit.qrc \ +# goto.png \ +# copy.png \ +# open.png \ +# bold.png \ +# paste.png \ +# break.png \ +# new.png \ +# package_settings.png \ +# undo.png \ +# uncomment.png \ +# formats.png \ +# settings.png \ +# indent.png \ +# reload.png \ +# exit.png \ +# comment.png \ +# error.png \ +# strikeout.png \ +# fillcolor.png \ +# find.png \ +# replace.png \ +# unindent.png \ +# editor.png \ +# print.png \ +# closeall.png \ +# italic.png \ +# redo.png \ +# strokecolor.png \ +# cut.png \ +# warning.png \ +# up.png \ +# debug-resume.png \ +# textcolor.png \ +# saveas.png \ +# save.png \ +# down.png \ +# underline.png \ +# qxs/bibtex.qnfa \ +# qxs/cpp.qnfa \ +# qxs/csharp.qnfa \ +# qxs/css.qnfa \ +# qxs/dox.qnfa \ +# qxs/formats.qxf \ +# qxs/php.qnfa \ +# qxs/pro.qnfa \ +# qxs/python.qnfa \ +# qxs/qtscript.qnfa \ +# qxs/snippet.qnfa \ +# qxs/tex.qxf \ +# qxs/xml.qxf \ +# qxs/bibtex.qxf \ +# qxs/cpp.qxf \ +# qxs/csharp.qxf \ +# qxs/css.qxf \ +# qxs/dox.qxf \ +# qxs/marks.qxm \ +# qxs/php.qxf \ +# qxs/pro.qxf \ +# qxs/python.qxf \ +# qxs/qtscript.qxf \ +# qxs/tex.qnfa \ +# qxs/xml.qnfa +# diff --git a/src/roseExtensions/qtWidgets/QCodeEditWidget/QCodeEdit/document/CMakeLists.txt b/src/roseExtensions/qtWidgets/QCodeEditWidget/QCodeEdit/document/CMakeLists.txt new file mode 100644 index 0000000000..83c7f842fd --- /dev/null +++ b/src/roseExtensions/qtWidgets/QCodeEditWidget/QCodeEdit/document/CMakeLists.txt @@ -0,0 +1,55 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +##------------ document Makefile.am ----------- +#include $(top_srcdir)/src/roseExtensions/qtWidgets/Make.inc +# +#if ROSE_WITH_ROSEQT +# +#noinst_LTLIBRARIES = libdocument.la +# +# +## Contents of Makefile.am.pre +#INCLUDES += -I$(srcdir)/.. -I$(srcdir)/../qnfa -I$(srcdir)/../widgets +# +## End of Makefile.am.pre Content +# +#libdocument_la_SOURCES = qdocument.cpp\ +# qdocumentbuffer.cpp\ +# qdocumentcommand.cpp\ +# qdocumentcursor.cpp\ +# qdocumentline.cpp\ +# qdocumentsearch.cpp +# +#nodist_libdocument_la_SOURCES = moc_qdocument.cxx +# +# +# +## Target for installing header +#headerTargetdir = $(roseQtWidgetsHeaderInstallPath)/QCodeEdit +#headerTarget_HEADERS = qdocument.h\ +# qdocument_p.h\ +# qdocumentbuffer.h\ +# qdocumentcommand.h\ +# qdocumentcursor.h\ +# qdocumentcursor_p.h\ +# qdocumentline.h\ +# qdocumentline_p.h\ +# qdocumentsearch.h +# +# +#endif +# +#EXTRA_DIST = +# diff --git a/src/roseExtensions/qtWidgets/QCodeEditWidget/QCodeEdit/qnfa/CMakeLists.txt b/src/roseExtensions/qtWidgets/QCodeEditWidget/QCodeEdit/qnfa/CMakeLists.txt new file mode 100644 index 0000000000..1bf0d1a3cb --- /dev/null +++ b/src/roseExtensions/qtWidgets/QCodeEditWidget/QCodeEdit/qnfa/CMakeLists.txt @@ -0,0 +1,46 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +##------------ qnfa Makefile.am ----------- +#include $(top_srcdir)/src/roseExtensions/qtWidgets/Make.inc +# +#if ROSE_WITH_ROSEQT +# +#noinst_LTLIBRARIES = libqnfa.la +# +# +## Contents of Makefile.am.pre +#INCLUDES += -I$(srcdir)/.. -I$(srcdir)/../document -I$(srcdir)/../widgets +# +## End of Makefile.am.pre Content +# +#libqnfa_la_SOURCES = qnfa.cpp\ +# qnfadefinition.cpp\ +# xml2qnfa.cpp +# +# +# +# +# +## Target for installing header +#headerTargetdir = $(roseQtWidgetsHeaderInstallPath)/QCodeEdit +#headerTarget_HEADERS = light_vector.h\ +# qnfa.h\ +# qnfadefinition.h +# +# +#endif +# +#EXTRA_DIST = +# diff --git a/src/roseExtensions/qtWidgets/QCodeEditWidget/QCodeEdit/widgets/CMakeLists.txt b/src/roseExtensions/qtWidgets/QCodeEditWidget/QCodeEdit/widgets/CMakeLists.txt new file mode 100644 index 0000000000..a9d5c2c567 --- /dev/null +++ b/src/roseExtensions/qtWidgets/QCodeEditWidget/QCodeEdit/widgets/CMakeLists.txt @@ -0,0 +1,84 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +##------------ widgets Makefile.am ----------- +#include $(top_srcdir)/src/roseExtensions/qtWidgets/Make.inc +# +#if ROSE_WITH_ROSEQT +# +#noinst_LTLIBRARIES = libwidgets.la +# +# +## Contents of Makefile.am.pre +#INCLUDES += -I$(srcdir)/.. -I$(srcdir)/../document -I$(srcdir)/../qnfa +# +## End of Makefile.am.pre Content +# +#libwidgets_la_SOURCES = qcalltip.cpp\ +# qeditconfig.cpp\ +# qfoldpanel.cpp\ +# qformatconfig.cpp\ +# qgotolinedialog.cpp\ +# qlinechangepanel.cpp\ +# qlinemarkpanel.cpp\ +# qlinenumberpanel.cpp\ +# qpanel.cpp\ +# qsearchreplacepanel.cpp\ +# qsimplecolorpicker.cpp\ +# qstatuspanel.cpp +# +#nodist_libwidgets_la_SOURCES = moc_qeditconfig.cxx\ +# moc_qfoldpanel.cxx\ +# moc_qformatconfig.cxx\ +# moc_qgotolinedialog.cxx\ +# moc_qlinechangepanel.cxx\ +# moc_qlinemarkpanel.cxx\ +# moc_qlinenumberpanel.cxx\ +# moc_qpanel.cxx\ +# moc_qsearchreplacepanel.cxx\ +# moc_qsimplecolorpicker.cxx\ +# moc_qstatuspanel.cxx\ +# ui_editconfig.h\ +# ui_formatconfig.h\ +# ui_gotoline.h\ +# ui_searchreplace.h +# +#BUILT_SOURCES = ui_editconfig.h\ +# ui_formatconfig.h\ +# ui_gotoline.h\ +# ui_searchreplace.h +# +## Target for installing header +#headerTargetdir = $(roseQtWidgetsHeaderInstallPath)/QCodeEdit +#headerTarget_HEADERS = qcalltip.h\ +# qeditconfig.h\ +# qfoldpanel.h\ +# qformatconfig.h\ +# qgotolinedialog.h\ +# qlinechangepanel.h\ +# qlinemarkpanel.h\ +# qlinenumberpanel.h\ +# qpanel.h\ +# qsearchreplacepanel.h\ +# qsimplecolorpicker.h\ +# qstatuspanel.h +# +# +#endif +# +#EXTRA_DIST = editconfig.ui \ +# formatconfig.ui \ +# gotoline.ui \ +# searchreplace.ui +# diff --git a/src/roseExtensions/qtWidgets/RoseCodeEdit/CMakeLists.txt b/src/roseExtensions/qtWidgets/RoseCodeEdit/CMakeLists.txt new file mode 100644 index 0000000000..e6ffb06515 --- /dev/null +++ b/src/roseExtensions/qtWidgets/RoseCodeEdit/CMakeLists.txt @@ -0,0 +1,38 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +##------------ RoseCodeEdit Makefile.am ----------- +#include $(top_srcdir)/src/roseExtensions/qtWidgets/Make.inc +# +#if ROSE_WITH_ROSEQT +# +#noinst_LTLIBRARIES = libRoseCodeEdit.la +# +# +# +#libRoseCodeEdit_la_SOURCES = RoseCodeEdit.cpp +# +# +# +# +# +## Target for installing header +#headerTargetdir = $(roseQtWidgetsHeaderInstallPath)/ +#headerTarget_HEADERS = RoseCodeEdit.h +# +# +#endif +# +#EXTRA_DIST = +# diff --git a/src/roseExtensions/qtWidgets/RoseFileSelector/CMakeLists.txt b/src/roseExtensions/qtWidgets/RoseFileSelector/CMakeLists.txt new file mode 100644 index 0000000000..5e5e21b7d4 --- /dev/null +++ b/src/roseExtensions/qtWidgets/RoseFileSelector/CMakeLists.txt @@ -0,0 +1,38 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +##------------ RoseFileSelector Makefile.am ----------- +#include $(top_srcdir)/src/roseExtensions/qtWidgets/Make.inc +# +#if ROSE_WITH_ROSEQT +# +#noinst_LTLIBRARIES = libRoseFileSelector.la +# +# +# +#libRoseFileSelector_la_SOURCES = RoseFileComboBox.cpp +# +#nodist_libRoseFileSelector_la_SOURCES = moc_RoseFileComboBox.cxx +# +# +# +## Target for installing header +#headerTargetdir = $(roseQtWidgetsHeaderInstallPath)/ +#headerTarget_HEADERS = RoseFileComboBox.h +# +# +#endif +# +#EXTRA_DIST = +# diff --git a/src/roseExtensions/qtWidgets/SrcBinView/CMakeLists.txt b/src/roseExtensions/qtWidgets/SrcBinView/CMakeLists.txt new file mode 100644 index 0000000000..28a487b48f --- /dev/null +++ b/src/roseExtensions/qtWidgets/SrcBinView/CMakeLists.txt @@ -0,0 +1,35 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +##------------ AsmView Makefile.am ----------- +#include ../Make.inc +# +#if ROSE_WITH_ROSEQT +# +#noinst_LTLIBRARIES = libSrcBinView.la +# +#libSrcBinView_la_SOURCES = SrcBinView.cpp +# +#nodist_libSrcBinView_la_SOURCES = moc_SrcBinView.cxx \ +# ui_SrcBinView.h +# +#BUILT_SOURCES = ui_SrcBinView.h +# +#EXTRA_DIST = SrcBinView.ui +# +## Target for installing header +#headerTargetdir = $(roseQtWidgetsHeaderInstallPath)/ +#headerTarget_HEADERS = SrcBinView.h +# +#endif diff --git a/src/roseExtensions/qtWidgets/TaskSystem/CMakeLists.txt b/src/roseExtensions/qtWidgets/TaskSystem/CMakeLists.txt new file mode 100644 index 0000000000..285aa5d2a1 --- /dev/null +++ b/src/roseExtensions/qtWidgets/TaskSystem/CMakeLists.txt @@ -0,0 +1,54 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +##------------ TaskSystem Makefile.am ----------- +#include $(top_srcdir)/src/roseExtensions/qtWidgets/Make.inc +# +#if ROSE_WITH_ROSEQT +# +#noinst_LTLIBRARIES = libTaskSystem.la +# +# +# +#libTaskSystem_la_SOURCES = CompilerOutputWidget.cpp\ +# GccTask.cpp\ +# RoseFrontendTask.cpp\ +# TaskList.cpp +# +#nodist_libTaskSystem_la_SOURCES = moc_CompilerOutputWidget.cxx\ +# moc_GccTask.cxx\ +# moc_RoseFrontendTask.cxx\ +# moc_TaskInterface.cxx\ +# moc_TaskList.cxx\ +# qrc_res.cpp +# +# +# +## Target for installing header +#headerTargetdir = $(roseQtWidgetsHeaderInstallPath)/ +#headerTarget_HEADERS = CompilerOutputWidget.h\ +# GccTask.h\ +# RoseFrontendTask.h\ +# TaskInterface.h\ +# TaskList.h +# +# +#endif +# +#EXTRA_DIST = res.qrc \ +# images/gears.gif \ +# images/compile_warning.png \ +# images/compile_error.png \ +# images/compile_unspecified.png +# diff --git a/src/roseExtensions/qtWidgets/TreeModel/CMakeLists.txt b/src/roseExtensions/qtWidgets/TreeModel/CMakeLists.txt new file mode 100644 index 0000000000..c08271c4a1 --- /dev/null +++ b/src/roseExtensions/qtWidgets/TreeModel/CMakeLists.txt @@ -0,0 +1,40 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +##------------ TreeModel Makefile.am ----------- +#include $(top_srcdir)/src/roseExtensions/qtWidgets/Make.inc +# +#if ROSE_WITH_ROSEQT +# +#noinst_LTLIBRARIES = libTreeModel.la +# +# +# +#libTreeModel_la_SOURCES = ItemTreeModel.cpp\ +# ItemTreeNode.cpp +# +#nodist_libTreeModel_la_SOURCES = moc_ItemTreeModel.cxx +# +# +# +## Target for installing header +#headerTargetdir = $(roseQtWidgetsHeaderInstallPath)/ +#headerTarget_HEADERS = ItemTreeModel.h\ +# ItemTreeNode.h +# +# +#endif +# +#EXTRA_DIST = +# diff --git a/src/roseExtensions/qtWidgets/WidgetCreator/CMakeLists.txt b/src/roseExtensions/qtWidgets/WidgetCreator/CMakeLists.txt new file mode 100644 index 0000000000..49d2e0d2fa --- /dev/null +++ b/src/roseExtensions/qtWidgets/WidgetCreator/CMakeLists.txt @@ -0,0 +1,82 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +##------------ WidgetCreator Makefile.am ----------- +#include $(top_srcdir)/src/roseExtensions/qtWidgets/Make.inc +# +#if ROSE_WITH_ROSEQT +# +#noinst_LTLIBRARIES = libWidgetCreator.la +# +# +# +#libWidgetCreator_la_SOURCES = AsmInstructionBarCreator.cpp\ +# AsmViewCreator.cpp\ +# AstBrowserWidgetCreator.cpp\ +# AstGraphWidgetCreator.cpp\ +# BeautifiedAstCreator.cpp\ +# CallGraphWidgetCreator.cpp\ +# MetricsKiviatCreator.cpp\ +# NodeInfoWidgetCreator.cpp\ +# QRQueryBoxCreator.cpp\ +# QRSourceBoxCreator.cpp\ +# QRTreeBoxCreator.cpp\ +# RoseCodeEditCreator.cpp\ +# RoseFileSelectorCreator.cpp\ +# SrcBinViewCreator.cpp\ +# SubWindowFactory.cpp\ +# WidgetCreatorInterface.cpp +# +#nodist_libWidgetCreator_la_SOURCES = moc_AsmInstructionBarCreator.cxx\ +# moc_AsmViewCreator.cxx\ +# moc_AstBrowserWidgetCreator.cxx\ +# moc_AstGraphWidgetCreator.cxx\ +# moc_BeautifiedAstCreator.cxx\ +# moc_CallGraphWidgetCreator.cxx\ +# moc_MetricsKiviatCreator.cxx\ +# moc_NodeInfoWidgetCreator.cxx\ +# moc_QRQueryBoxCreator.cxx\ +# moc_QRSourceBoxCreator.cxx\ +# moc_QRTreeBoxCreator.cxx\ +# moc_RoseCodeEditCreator.cxx\ +# moc_RoseFileSelectorCreator.cxx\ +# moc_SrcBinViewCreator.cxx\ +# moc_SubWindowFactory.cxx +# +# +# +## Target for installing header +#headerTargetdir = $(roseQtWidgetsHeaderInstallPath)/ +#headerTarget_HEADERS = AsmInstructionBarCreator.h\ +# AsmViewCreator.h\ +# AstBrowserWidgetCreator.h\ +# AstGraphWidgetCreator.h\ +# BeautifiedAstCreator.h\ +# CallGraphWidgetCreator.h\ +# MetricsKiviatCreator.h\ +# NodeInfoWidgetCreator.h\ +# QRQueryBoxCreator.h\ +# QRSourceBoxCreator.h\ +# QRTreeBoxCreator.h\ +# RoseCodeEditCreator.h\ +# RoseFileSelectorCreator.h\ +# SrcBinViewCreator.h\ +# SubWindowFactory.h\ +# WidgetCreatorInterface.h +# +# +#endif +# +#EXTRA_DIST = +# diff --git a/src/roseExtensions/qtWidgets/util/CMakeLists.txt b/src/roseExtensions/qtWidgets/util/CMakeLists.txt new file mode 100644 index 0000000000..c05e9fb3a0 --- /dev/null +++ b/src/roseExtensions/qtWidgets/util/CMakeLists.txt @@ -0,0 +1,94 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +##------------ util Makefile.am ----------- +#include $(top_srcdir)/src/roseExtensions/qtWidgets/Make.inc +# +#if ROSE_WITH_ROSEQT +# +#noinst_LTLIBRARIES = libutil.la +# +# +# +#libutil_la_SOURCES = AsmToSourceMapper.cpp\ +# AstDisplayInfo.cpp\ +# AstFilters.cpp\ +# ItemModelHelper.cpp\ +# LCS.cpp\ +# MetricAttributeCollector.cpp\ +# MetricBgDelegate.cpp\ +# QRoseComponentProxy.cpp\ +# RoseGraphicsView.cpp\ +# RoseTreeView.cpp\ +# SageMimeData.cpp\ +# SgNodeUtil.cpp +# +#nodist_libutil_la_SOURCES = moc_MetricAttributeCollector.cxx\ +# moc_MetricBgDelegate.cxx\ +# moc_QRoseComponentProxy.cxx\ +# moc_RoseGraphicsView.cxx\ +# moc_RoseTreeView.cxx\ +# qrc_util.cpp\ +# ui_MetricBgDelegateConfig.h +# +#BUILT_SOURCES = ui_MetricBgDelegateConfig.h +# +## Target for installing header +#headerTargetdir = $(roseQtWidgetsHeaderInstallPath)/ +#headerTarget_HEADERS = AsmToSourceMapper.h\ +# AstDisplayInfo.h\ +# AstFilters.h\ +# ItemModelHelper.h\ +# LCS.h\ +# MetricAttributeCollector.h\ +# MetricBgDelegate.h\ +# QRoseComponentProxy.h\ +# RoseGraphicsView.h\ +# RoseTreeView.h\ +# SageMimeData.h\ +# SgNodeUtil.h\ +# StreamRedirector.h +# +# +#endif +# +#EXTRA_DIST = MetricBgDelegateConfig.ui \ +# util.qrc \ +# AppIcons/info.png \ +# AppIcons/document-properties.png \ +# AppIcons/document-save.png \ +# AppIcons/application-exit.png \ +# AppIcons/document-save-as.png \ +# AppIcons/document-open.png \ +# NodeIcons/loop.png \ +# NodeIcons/sourcefiles.gif \ +# NodeIcons/sourcefile.gif \ +# NodeIcons/class.gif \ +# NodeIcons/enum.gif \ +# NodeIcons/pragma.gif \ +# NodeIcons/variable.gif \ +# NodeIcons/typedef.gif \ +# NodeIcons/namespace.gif \ +# NodeIcons/project.gif \ +# NodeIcons/binaryfiles.gif \ +# NodeIcons/binaryfile.gif \ +# NodeIcons/function.gif \ +# NodeIcons/includes.gif \ +# NodeIcons/include.gif \ +# WidgetIcons/Kiviat.gif \ +# WidgetIcons/PropTreeWidget.gif \ +# WidgetIcons/Rose.gif \ +# WidgetIcons/CallGraph.gif \ +# WidgetIcons/Graph.gif +# diff --git a/src/roseExtensions/roseHPCToolkit/CMakeLists.txt b/src/roseExtensions/roseHPCToolkit/CMakeLists.txt new file mode 100644 index 0000000000..f1501a4694 --- /dev/null +++ b/src/roseExtensions/roseHPCToolkit/CMakeLists.txt @@ -0,0 +1,22 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + +add_subdirectory(include) +add_subdirectory(src) +add_subdirectory(docs) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +## ROSE-HPCT Module +##examples is moved to tests/roseTests/ +#SUBDIRS = include src docs +# +#EXTRA_DIST = Make.inc README +# +## eof diff --git a/src/roseExtensions/roseHPCToolkit/docs/CMakeLists.txt b/src/roseExtensions/roseHPCToolkit/docs/CMakeLists.txt new file mode 100644 index 0000000000..fd7b9c38cd --- /dev/null +++ b/src/roseExtensions/roseHPCToolkit/docs/CMakeLists.txt @@ -0,0 +1,16 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +## ROSE-HPCT module documentation +# +#EXTRA_DIST = roseHPCToolkit.docs +# +## eof diff --git a/src/roseExtensions/roseHPCToolkit/include/CMakeLists.txt b/src/roseExtensions/roseHPCToolkit/include/CMakeLists.txt new file mode 100644 index 0000000000..b57786a0f5 --- /dev/null +++ b/src/roseExtensions/roseHPCToolkit/include/CMakeLists.txt @@ -0,0 +1,18 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + +add_subdirectory(rosehpct) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +## ROSE-HPCT header files +# +#SUBDIRS = rosehpct +# +## eof diff --git a/src/roseExtensions/roseHPCToolkit/include/rosehpct/CMakeLists.txt b/src/roseExtensions/roseHPCToolkit/include/rosehpct/CMakeLists.txt new file mode 100644 index 0000000000..3113c703b7 --- /dev/null +++ b/src/roseExtensions/roseHPCToolkit/include/rosehpct/CMakeLists.txt @@ -0,0 +1,30 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + +add_subdirectory(util) +add_subdirectory(xml) +add_subdirectory(profir) +add_subdirectory(xml2profir) +add_subdirectory(sage) +add_subdirectory(profir2sage) +add_subdirectory(xml-xercesc) +add_subdirectory(gprof) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +## ROSE-HPCT header files +# +#SUBDIRS = util xml profir xml2profir sage profir2sage \ +# xml-xercesc gprof +# +#include ../../Make.inc +# +#rosehpctinc_HEADERS = rosehpct.hh +# +## eof diff --git a/src/roseExtensions/roseHPCToolkit/include/rosehpct/gprof/CMakeLists.txt b/src/roseExtensions/roseHPCToolkit/include/rosehpct/gprof/CMakeLists.txt new file mode 100644 index 0000000000..aff711a04d --- /dev/null +++ b/src/roseExtensions/roseHPCToolkit/include/rosehpct/gprof/CMakeLists.txt @@ -0,0 +1,18 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +## ROSE-HPCT Sage IR interface submodule -- header files +# +#include ../../../Make.inc +#sageincdir = $(rosehpctincdir)/gprof +#sageinc_HEADERS = gprof_info.hh +# +## eof diff --git a/src/roseExtensions/roseHPCToolkit/include/rosehpct/profir/CMakeLists.txt b/src/roseExtensions/roseHPCToolkit/include/rosehpct/profir/CMakeLists.txt new file mode 100644 index 0000000000..1ca5faedc1 --- /dev/null +++ b/src/roseExtensions/roseHPCToolkit/include/rosehpct/profir/CMakeLists.txt @@ -0,0 +1,18 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +## ROSE-HPCT Profile IR submodule -- header files +# +#include ../../../Make.inc +#profirincdir = $(rosehpctincdir)/profir +#profirinc_HEADERS = profir.hh +# +## eof diff --git a/src/roseExtensions/roseHPCToolkit/include/rosehpct/profir2sage/CMakeLists.txt b/src/roseExtensions/roseHPCToolkit/include/rosehpct/profir2sage/CMakeLists.txt new file mode 100644 index 0000000000..e2d086415e --- /dev/null +++ b/src/roseExtensions/roseHPCToolkit/include/rosehpct/profir2sage/CMakeLists.txt @@ -0,0 +1,18 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +## ROSE-HPCT Profile IR-to-Sage IR conversion -- header files +# +#include ../../../Make.inc +#profir2sageincdir = $(rosehpctincdir)/profir2sage +#profir2sageinc_HEADERS = profir2sage.hh +# +## eof diff --git a/src/roseExtensions/roseHPCToolkit/include/rosehpct/sage/CMakeLists.txt b/src/roseExtensions/roseHPCToolkit/include/rosehpct/sage/CMakeLists.txt new file mode 100644 index 0000000000..0720ce7e21 --- /dev/null +++ b/src/roseExtensions/roseHPCToolkit/include/rosehpct/sage/CMakeLists.txt @@ -0,0 +1,18 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +## ROSE-HPCT Sage IR interface submodule -- header files +# +#include ../../../Make.inc +#sageincdir = $(rosehpctincdir)/sage +#sageinc_HEADERS = sage.hh collectors.hh +# +## eof diff --git a/src/roseExtensions/roseHPCToolkit/include/rosehpct/util/CMakeLists.txt b/src/roseExtensions/roseHPCToolkit/include/rosehpct/util/CMakeLists.txt new file mode 100644 index 0000000000..80922a9225 --- /dev/null +++ b/src/roseExtensions/roseHPCToolkit/include/rosehpct/util/CMakeLists.txt @@ -0,0 +1,18 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +## ROSE-HPCT General Utilities -- header files +# +#include ../../../Make.inc +#utilincdir = $(rosehpctincdir)/util +#utilinc_HEADERS = general.hh tree2.hh types.hh +# +## eof diff --git a/src/roseExtensions/roseHPCToolkit/include/rosehpct/xml-xercesc/CMakeLists.txt b/src/roseExtensions/roseHPCToolkit/include/rosehpct/xml-xercesc/CMakeLists.txt new file mode 100644 index 0000000000..1ccfc47bf2 --- /dev/null +++ b/src/roseExtensions/roseHPCToolkit/include/rosehpct/xml-xercesc/CMakeLists.txt @@ -0,0 +1,18 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +## ROSE-HPCT XML wrapper around Xerces-C library -- header files +# +#include ../../../Make.inc +#xmlincdir = $(rosehpctincdir)/xml-xercesc +#xmlinc_HEADERS = xml.hh +# +## eof diff --git a/src/roseExtensions/roseHPCToolkit/include/rosehpct/xml/CMakeLists.txt b/src/roseExtensions/roseHPCToolkit/include/rosehpct/xml/CMakeLists.txt new file mode 100644 index 0000000000..6d34850f3c --- /dev/null +++ b/src/roseExtensions/roseHPCToolkit/include/rosehpct/xml/CMakeLists.txt @@ -0,0 +1,18 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +## ROSE-HPCT XML submodule -- header files +# +#include ../../../Make.inc +#xmlincdir = $(rosehpctincdir)/xml +#xmlinc_HEADERS = xml.hh +# +## eof diff --git a/src/roseExtensions/roseHPCToolkit/include/rosehpct/xml2profir/CMakeLists.txt b/src/roseExtensions/roseHPCToolkit/include/rosehpct/xml2profir/CMakeLists.txt new file mode 100644 index 0000000000..557f54eb01 --- /dev/null +++ b/src/roseExtensions/roseHPCToolkit/include/rosehpct/xml2profir/CMakeLists.txt @@ -0,0 +1,18 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +## ROSE-HPCT Profile IR submodule -- header files +# +#include ../../../Make.inc +#xml2profirincdir = $(rosehpctincdir)/xml2profir +#xml2profirinc_HEADERS = xml2profir.hh +# +## eof diff --git a/src/roseExtensions/roseHPCToolkit/src/CMakeLists.txt b/src/roseExtensions/roseHPCToolkit/src/CMakeLists.txt new file mode 100644 index 0000000000..31f601e61a --- /dev/null +++ b/src/roseExtensions/roseHPCToolkit/src/CMakeLists.txt @@ -0,0 +1,52 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + +add_subdirectory(util) +add_subdirectory(xml) +add_subdirectory(profir) +add_subdirectory(xml2profir) +add_subdirectory(sage) +add_subdirectory(profir2sage) +add_subdirectory(xml-xercesc) +add_subdirectory(gprof) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +## ROSE-HPCT sources +# +#SUBDIRS = util xml profir xml2profir sage profir2sage \ +# xml-xercesc gprof +# +#include ../Make.inc +# +#EXTRA_DIST = rosehpct.cc +# +#if ROSE_BUILD_ROSEHPCT +# +#rosehpctlibdir = $(libdir) +#rosehpctlib_LTLIBRARIES = librosehpct.la +#librosehpct_la_SOURCES = rosehpct.cc +#librosehpct_la_LIBADD = \ +# util/libutil.la \ +# xml/libxml.la \ +# profir/libprofir.la \ +# xml2profir/libxml2profir.la \ +# sage/libsage.la \ +# gprof/libgprof.la \ +# profir2sage/libprofir2sage.la +# +#clean-local: +# rm -rf $(CXX_TEMPLATE_OBJECTS) Templates.DB ii_files ti_files +# +#distclean-local: +# rm -rf Templates.DB +# +#endif # ROSE_BUILD_ROSEHPCT +# +## eof diff --git a/src/roseExtensions/roseHPCToolkit/src/gprof/CMakeLists.txt b/src/roseExtensions/roseHPCToolkit/src/gprof/CMakeLists.txt new file mode 100644 index 0000000000..49a1dc1dcf --- /dev/null +++ b/src/roseExtensions/roseHPCToolkit/src/gprof/CMakeLists.txt @@ -0,0 +1,30 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +## ROSE-HPCT Sage IR interface -- source files +# +#include ../../Make.inc +# +#if ROSE_BUILD_ROSEHPCT +# +#noinst_LTLIBRARIES = libgprof.la +#libgprof_la_SOURCES = gprof_info.cc +# +#else # !ROSE_BUILD_ROSEHPCT +# +#EXTRA_DIST = gprof_info.cc +# +#endif +# +## eof diff --git a/src/roseExtensions/roseHPCToolkit/src/profir/CMakeLists.txt b/src/roseExtensions/roseHPCToolkit/src/profir/CMakeLists.txt new file mode 100644 index 0000000000..675642a8d3 --- /dev/null +++ b/src/roseExtensions/roseHPCToolkit/src/profir/CMakeLists.txt @@ -0,0 +1,30 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +## ROSE-HPCT Profile IR -- source files +# +#include ../../Make.inc +# +#if ROSE_BUILD_ROSEHPCT +# +#noinst_LTLIBRARIES = libprofir.la +#libprofir_la_SOURCES = profir.cc +# +#else # !ROSE_BUILD_ROSEHPCT +# +#EXTRA_DIST = profir.cc +# +#endif +# +## eof diff --git a/src/roseExtensions/roseHPCToolkit/src/profir2sage/CMakeLists.txt b/src/roseExtensions/roseHPCToolkit/src/profir2sage/CMakeLists.txt new file mode 100644 index 0000000000..7f7210cbd5 --- /dev/null +++ b/src/roseExtensions/roseHPCToolkit/src/profir2sage/CMakeLists.txt @@ -0,0 +1,30 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +## ROSE-HPCT Profile IR--to-Sage IR conversion -- source files +# +#include ../../Make.inc +# +#if ROSE_BUILD_ROSEHPCT +# +#noinst_LTLIBRARIES = libprofir2sage.la +#libprofir2sage_la_SOURCES = attach.cc +# +#else # !ROSE_BUILD_ROSEHPCT +# +#EXTRA_DIST = attach.cc +# +#endif +# +## eof diff --git a/src/roseExtensions/roseHPCToolkit/src/sage/CMakeLists.txt b/src/roseExtensions/roseHPCToolkit/src/sage/CMakeLists.txt new file mode 100644 index 0000000000..d741ab909f --- /dev/null +++ b/src/roseExtensions/roseHPCToolkit/src/sage/CMakeLists.txt @@ -0,0 +1,30 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +## ROSE-HPCT Sage IR interface -- source files +# +#include ../../Make.inc +# +#if ROSE_BUILD_ROSEHPCT +# +#noinst_LTLIBRARIES = libsage.la +#libsage_la_SOURCES = collect.cc depth.cc metric.cc propagate.cc +# +#else # !ROSE_BUILD_ROSEHPCT +# +#EXTRA_DIST = collect.cc depth.cc metric.cc propagate.cc +# +#endif +# +## eof diff --git a/src/roseExtensions/roseHPCToolkit/src/util/CMakeLists.txt b/src/roseExtensions/roseHPCToolkit/src/util/CMakeLists.txt new file mode 100644 index 0000000000..d89e94363f --- /dev/null +++ b/src/roseExtensions/roseHPCToolkit/src/util/CMakeLists.txt @@ -0,0 +1,31 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +## ROSE-HPCT General Utilities -- source +# +#include ../../Make.inc +# +#if ROSE_BUILD_ROSEHPCT +# +#noinst_LTLIBRARIES = libutil.la +#libutil_la_SOURCES = general.cc +#EXTRA_DIST = tree_demo.cc +# +#else # !ROSE_BUILD_ROSEHPCT -------------------- +# +#EXTRA_DIST = general.cc tree_demo.cc +# +#endif +# +## eof diff --git a/src/roseExtensions/roseHPCToolkit/src/xml-xercesc/CMakeLists.txt b/src/roseExtensions/roseHPCToolkit/src/xml-xercesc/CMakeLists.txt new file mode 100644 index 0000000000..38f58f2d19 --- /dev/null +++ b/src/roseExtensions/roseHPCToolkit/src/xml-xercesc/CMakeLists.txt @@ -0,0 +1,27 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +## ROSE-HPCT XML wrappers around Xerces-C library -- sources +# +#include ../../Make.inc +# +##if ROSE_BUILD_ROSEHPCT +## +##noinst_LTLIBRARIES = libxml.la +##libxml_la_SOURCES = elem.cc handler.cc parser.cc util.cc +## +##else # !ROSE_BUILD_ROSEHPCT +# +#EXTRA_DIST = elem.cc handler.cc parser.cc util.cc +# +##endif +# +## eof diff --git a/src/roseExtensions/roseHPCToolkit/src/xml/CMakeLists.txt b/src/roseExtensions/roseHPCToolkit/src/xml/CMakeLists.txt new file mode 100644 index 0000000000..92dc792753 --- /dev/null +++ b/src/roseExtensions/roseHPCToolkit/src/xml/CMakeLists.txt @@ -0,0 +1,30 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +## ROSE-HPCT XML -- sources +# +#include ../../Make.inc +# +#if ROSE_BUILD_ROSEHPCT +# +#noinst_LTLIBRARIES = libxml.la +#libxml_la_SOURCES = elem.cc handler.cc parser.cc util.cc +# +#else # !ROSE_BUILD_ROSEHPCT +# +#EXTRA_DIST = elem.cc handler.cc parser.cc util.cc +# +#endif +# +## eof diff --git a/src/roseExtensions/roseHPCToolkit/src/xml2profir/CMakeLists.txt b/src/roseExtensions/roseHPCToolkit/src/xml2profir/CMakeLists.txt new file mode 100644 index 0000000000..e2d197e7af --- /dev/null +++ b/src/roseExtensions/roseHPCToolkit/src/xml2profir/CMakeLists.txt @@ -0,0 +1,30 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +## ROSE-HPCT XML-to-Profile IR conversion -- source files +# +#include ../../Make.inc +# +#if ROSE_BUILD_ROSEHPCT +# +#noinst_LTLIBRARIES = libxml2profir.la +#libxml2profir_la_SOURCES = convert.cc factory.cc process.cc query.cc +# +#else # !ROSE_BUILD_ROSEHPCT +# +#EXTRA_DIST = convert.cc factory.cc process.cc query.cc +# +#endif +# +## eof diff --git a/src/roseExtensions/sqlite3x/CMakeLists.txt b/src/roseExtensions/sqlite3x/CMakeLists.txt new file mode 100644 index 0000000000..e443a21a18 --- /dev/null +++ b/src/roseExtensions/sqlite3x/CMakeLists.txt @@ -0,0 +1,41 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + +install(FILES sqlite3x.h DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#if ROSE_USE_SQLITE_DATABASE +#INCLUDES = $(ROSE_INCLUDES) +##ACLOCAL_AMFLAGS = -I m4 +# +##AM_CXXFLAGS = $(BOOST_CPPFLAGS) ${SQLITE3_CFLAGS} +##AM_LDFLAGS = $(BOOST_LDFLAGS) $(BOOST_PROGRAM_OPTIONS_LIB) $(SQLITE3_LDFLAGS) +# +# +# +#libRoseSQLite3xDatabaseSources = sqlite3x_command.C sqlite3x_exception.C sqlite3x_transaction.C \ +#sqlite3x_connection.C sqlite3x_reader.C +#noinst_LTLIBRARIES = libRoseSQLite3xDatabase.la +#libRoseSQLite3xDatabase_la_SOURCES = $(libRoseSQLite3xDatabaseSources) +#endif +# +#clean-local: +# rm -rf Templates.DB ii_files ti_files cxx_templates libRoseSQLite3xDatabase.so +# +#distclean-local: +# rm -rf Templates.DB +# +#include_HEADERS = \ +# sqlite3x.h +# diff --git a/src/roseIndependentSupport/CMakeLists.txt b/src/roseIndependentSupport/CMakeLists.txt new file mode 100644 index 0000000000..53c9b66681 --- /dev/null +++ b/src/roseIndependentSupport/CMakeLists.txt @@ -0,0 +1,23 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + +add_subdirectory(dot2gml) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +## DQ (1/18/2008): The visualization work is not superseded by zgrviewer which is availalble on the web. +## The graphics directory contains an old STL based graphics interface that is no longer +## used. A newer design is being implemented to support graphs in ROSE. +## The dot2gml is only compiled if the DOT_TO_GML_TRANSLATOR configure option is used +## The graphicalUserInterface is compiled only if the ROSE_USE_QROSE configure option is used +## SUBDIRS = graphicalUserInterface graphics visualization dot2gml +## SUBDIRS = graphicalUserInterface dot2gml +#SUBDIRS = dot2gml diff --git a/src/roseIndependentSupport/dot2gml/CMakeLists.txt b/src/roseIndependentSupport/dot2gml/CMakeLists.txt new file mode 100644 index 0000000000..09b62056c1 --- /dev/null +++ b/src/roseIndependentSupport/dot2gml/CMakeLists.txt @@ -0,0 +1,51 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + +########### next target ############### +if( DOT_TO_GML_TRANSLATOR ) + +set(dot2gml_SRCS main.C parseDot.ll parseDotGrammar.yy) + +add_executable(dot2gml ${dot2gml_SRCS}) + +target_link_libraries(dot2gml ${KDE4_KDECORE_LIBS}) + +install(TARGETS dot2gml ${INSTALL_TARGETS_DEFAULT_ARGS}) +endif() + + +########### install files ############### +install(FILES parse_header.h DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#AM_YFLAGS = -d +# +## "if" for DOT_TO_GML_TRANSLATOR (AutoMake conditional block) +#if DOT_TO_GML_TRANSLATOR +# +#bin_PROGRAMS = dot2gml +# +#dot2gml_SOURCES = \ +# main.C parseDot.ll parseDotGrammar.yy +# +#BUILT_SOURCES = parseDotGrammar.h +#DISTCLEANFILES = parseDotGrammar.h parseDotGrammar.cc parseDot.cc +# +## Header files that need to be included in the distribution +#include_HEADERS = parse_header.h +# +#clean-local: +# rm -f *.o *~ *.gml +# +## DQ (9/10/2005): This should be moved to the tests directory +##check: +## ./dot2gml $(srcdir)/onefileonly.C.dot +# +#endif +# +#EXTRA_DIST = parse_header.h parseDot.ll parseDotGrammar.yy README main.C diff --git a/src/roseIndependentSupport/graphics/CMakeLists.txt b/src/roseIndependentSupport/graphics/CMakeLists.txt new file mode 100644 index 0000000000..b6e6f2939e --- /dev/null +++ b/src/roseIndependentSupport/graphics/CMakeLists.txt @@ -0,0 +1,26 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### install files ############### + +install(FILES stlDOTgraph.h stlgraph.h DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +## Header files that need to be included in the distribution +## include_HEADERS = \ +## DOTGraphInterface.h \ +## DOTSubgraphRepresentation.h \ +## DOTSubgraphRepresentation.C \ +## stlDOTgraph.h \ +## stlgraph.h +# +#include_HEADERS = \ +# stlDOTgraph.h \ +# stlgraph.h +# diff --git a/src/roseIndependentSupport/visualization/CMakeLists.txt b/src/roseIndependentSupport/visualization/CMakeLists.txt new file mode 100644 index 0000000000..e88de4b1f2 --- /dev/null +++ b/src/roseIndependentSupport/visualization/CMakeLists.txt @@ -0,0 +1,99 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + +set(dotgl_SRCS + dotvisualizer.cpp + glcodegen.cpp + glf.c + graphinfo.cpp + mapcodegen.cpp + vizgroup.cpp + main.cpp) + +add_executable(dotgl ${dotgl_SRCS}) + +target_link_libraries(dotgl ${KDE4_KDECORE_LIBS}) + +install(TARGETS dotgl ${INSTALL_TARGETS_DEFAULT_ARGS}) + + +########### install files ############### + +install(FILES dotvisualizer.h glcodegen.h glf.h graphinfo.h mapcodegen.h style.h vizgroup.h ntl_vector3dim.h DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +## ROSE_USE_VISUALIZATION +#if ROSE_USE_VISUALIZATION +# +## FLTK_INCLUDE = -I/home/thuerey1/local/include/ +## GRAPHVIZ_INCLUDE = -I/home/thuerey1/local/include/graphviz +## OPENGL_INCLUDE = +## FLTK_LIBS = -L/home/thuerey1/local/lib/ -L/usr/X11R6/lib -lfltk -lfltk_gl -lX11 +## GRAPHVIZ_LIBS = -L/home/thuerey1/local/lib/graphviz -ldotneato -lfreetype -lpng -ljpeg -lz +## OPENGL_LIBS = -lGL -lGLU -lglut +# +#FLTK_INCLUDE = -I@FLTK_include_path@ +#GRAPHVIZ_INCLUDE = -I@GraphViz_include_path@ +#GLUT_INCLUDE = -I@GLUT_include_path@ +# +#FLTK_LIBS = -L@FLTK_libs_path@ -L/usr/X11R6/lib -lfltk -lfltk_gl -lX11 +#GRAPHVIZ_LIBS = -L@GraphViz_libs_path@ -ldotneato -lfreetype -lpng -ljpeg -lz +#GLUT_LIBS = -L@GLUT_libs_path@ +#OPENGL_LIBS = -lGL -lGLU -lglut +# +##FLTK_LIBS = -lfltk -lfltk_gl -lX11 +##GRAPHVIZ_LIBS = -ldotneato -lfreetype -lpng -ljpeg -lz +##OPENGL_LIBS = -lGL -lGLU -lglut +# +## DQ (4/20/2005): New variables that are required (from Andreas) +## LDFLAGS = -L/usr/local/lib/graphviz/ -L/usr/lib/ -L/usr/X11/lib/ -L/usr/local/lib/ +## LD_INCLUDE_PATH = /usr/lib/:/usr/include/:/usr/local/include/graphviz:/usr/X11/include/:$LD_INCLUDE_PATH +## CPPFLAGS = -I/usr/local/include/graphviz/ -I/usr/include/ -I/usr/X11/include/ +## CFLAGS = -I/usr/local/include/graphviz/ -I/usr/include/ -I/usr/X11/include/ +# +## LDFLAGS = -L/usr/local/lib/graphviz/ -L/usr/lib/ -L/usr/X11R6/lib/ -L/usr/local/lib/ +## CPPFLAGS = -I/usr/local/include/graphviz/ -I/usr/X11R6/include/ +## CFLAGS = -I/usr/local/include/graphviz/ -I/usr/X11R6/include/ +# +#INCLUDES = $(FLTK_INCLUDE) $(GRAPHVIZ_INCLUDE) $(GLUT_INCLUDE) $(OPENGL_INCLUDE) +# +#bin_PROGRAMS = dotgl +# +#dotgl_SOURCES = \ +# dotvisualizer.cpp \ +# glcodegen.cpp \ +# glf.c \ +# graphinfo.cpp \ +# mapcodegen.cpp \ +# vizgroup.cpp \ +# main.cpp +# +#DEPENDENCIES = +# +## Header files that need to be included in the distribution +#include_HEADERS = \ +# dotvisualizer.h \ +# glcodegen.h \ +# glf.h \ +# graphinfo.h \ +# mapcodegen.h \ +# style.h \ +# vizgroup.h \ +# ntl_vector3dim.h +# +## LDFLAGS = -Xlinker -rpath/home/thuerey1/local/lib/ -Xlinker -rpath/usr/X11R6/lib -Xlinker -rpath/home/thuerey1/local/lib/graphviz +#LDADD = $(FLTK_LIBS) $(GRAPHVIZ_LIBS) $(GLUT_LIBS) $(OPENGL_LIBS) -lm +# +## Extra flags specified exlicitly +#AM_CXXFLAGS = -Wno-unknown-pragmas +## CXXFLAGS = -g -Wall -Wno-unknown-pragmas +# +#endif diff --git a/src/roseSupport/CMakeLists.txt b/src/roseSupport/CMakeLists.txt new file mode 100644 index 0000000000..1198c20ff5 --- /dev/null +++ b/src/roseSupport/CMakeLists.txt @@ -0,0 +1,70 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +#add_library( rose_support ${rose_support_src} ) +#add_dependencies( rose_support ROSETTA ) +########### install files ############### + +install(FILES transformationSupport.h optionDeclaration.h sourceLocationInheritedAttribute.h roseTranslators.h utility_functions.h DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +## To keep compile commands tidy, please ONLY put required include flags here. +#INCLUDES = $(ROSE_INCLUDES) +# +### Don't use the repository in ../src +#CXX_TEMPLATE_REPOSITORY_PATH = . +# +#libroseSupportSources = \ +# transformationSupport.C \ +# optionDeclaration.C \ +# sourceLocationInheritedAttribute.C \ +# roseTranslators.C \ +# utility_functions.C \ +# memoryUsage.C +# +## DQ (10/11/2007): This used to be part of the template instationation mechanism, but it was +## based on nm and was not robust. Instead we instantiate all templates and figure out which +## are truely required. +## templateSupport.C +# +## lib_LIBRARIES = libroseSupport.a +## libroseSupport_a_SOURCES = $(libroseSupportSources) +# +#noinst_LTLIBRARIES = libroseSupport.la +# +#libroseSupport_la_SOURCES = $(libroseSupportSources) +# +#include_HEADERS = \ +# transformationSupport.h \ +# optionDeclaration.h \ +# sourceLocationInheritedAttribute.h \ +# roseTranslators.h \ +# utility_functions.h +# +## DQ (10/11/2007): This used to be part of the template instationation mechanism, but it was +## based on nm and was not robust. Instead we instantiate all templates and figure out which +## are truely required. +## templateSupport.h +# +#clean-local: +# rm -rf Templates.DB ii_files ti_files +# +#distclean-local: +# rm -rf Templates.DB +# +# +# +# +# +# +# +# diff --git a/src/util/CMakeLists.txt b/src/util/CMakeLists.txt new file mode 100644 index 0000000000..034a3f984a --- /dev/null +++ b/src/util/CMakeLists.txt @@ -0,0 +1,113 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + +add_subdirectory(stringSupport) +add_subdirectory(commandlineProcessing) +add_subdirectory(support) +add_subdirectory(graphs) + + + +#Generating "rose_paths.C" +#We may want to generate it in a different way in the future +file( REMOVE ${ROSE_TOP_BINARY_DIR}/src/util/rose_paths.C ) +file( WRITE ${ROSE_TOP_BINARY_DIR}/src/util/rose_paths.C "\#include \n\n" ) +#file( APPEND ${ROSE_TOP_BINARY_DIR}/test.txt we have ${CMAKE_Fortran_COMPILER} ) +file( APPEND ${ROSE_TOP_BINARY_DIR}/src/util/rose_paths.C "/* Use the same header file to declare these variables as is used to reference them so that they will be globally available (and not local). */\n" ) +file( APPEND ${ROSE_TOP_BINARY_DIR}/src/util/rose_paths.C "\#include \"rose_paths.h\" \n\n" ) + +file( APPEND ${ROSE_TOP_BINARY_DIR}/src/util/rose_paths.C "/* These paths will be absolute or relative depending on how the configure script is called (called with an absolute or relative path). */\n" ) +file( APPEND ${ROSE_TOP_BINARY_DIR}/src/util/rose_paths.C "const std::string ROSE_GFORTRAN_PATH = \"${CMAKE_Fortran_COMPILER}\";\n" ) +file( APPEND ${ROSE_TOP_BINARY_DIR}/src/util/rose_paths.C "const std::string ROSE_AUTOMAKE_TOP_SRCDIR = \"${ROSE_TOP_SRC_DIR}\";\n" ) +file( APPEND ${ROSE_TOP_BINARY_DIR}/src/util/rose_paths.C "const std::string ROSE_AUTOMAKE_TOP_BUILDDIR = \"${ROSE_TOP_BINARY_DIR}\";\n" ) +#FIXME: may be a different directory at times. Not sure what the semantics are. +file( APPEND ${ROSE_TOP_BINARY_DIR}/src/util/rose_paths.C "const std::string ROSE_AUTOMAKE_PREFIX = \"${ROSE_TOP_BINARY_DIR}\";\n" ) +file( APPEND ${ROSE_TOP_BINARY_DIR}/src/util/rose_paths.C "const std::string ROSE_AUTOMAKE_DATADIR = \"/*deprecated*/\";\n" ) +file( APPEND ${ROSE_TOP_BINARY_DIR}/src/util/rose_paths.C "const std::string ROSE_AUTOMAKE_BINDIR = \"/*deprecated*/\";\n" ) +file( APPEND ${ROSE_TOP_BINARY_DIR}/src/util/rose_paths.C "const std::string ROSE_AUTOMAKE_INCLUDEDIR = \"/*deprecated*/\";\n" ) +file( APPEND ${ROSE_TOP_BINARY_DIR}/src/util/rose_paths.C "const std::string ROSE_AUTOMAKE_INFODIR = \"/*deprecated*/\";\n" ) +file( APPEND ${ROSE_TOP_BINARY_DIR}/src/util/rose_paths.C "const std::string ROSE_AUTOMAKE_LIBDIR = \"/*deprecated*/\";" ) +file( APPEND ${ROSE_TOP_BINARY_DIR}/src/util/rose_paths.C "const std::string ROSE_AUTOMAKE_LIBEXECDIR = \"/*deprecated*/\";\n" ) +file( APPEND ${ROSE_TOP_BINARY_DIR}/src/util/rose_paths.C "const std::string ROSE_AUTOMAKE_LOCALSTATEDIR = \"/*deprecated*/\";\n" ) +file( APPEND ${ROSE_TOP_BINARY_DIR}/src/util/rose_paths.C "const std::string ROSE_AUTOMAKE_MANDIR = \"/*deprecated*/\";\n\n" ) +file( APPEND ${ROSE_TOP_BINARY_DIR}/src/util/rose_paths.C "/* This will always be an absolute path, while paths above are dependent on how the configure script is called \(called with an absolute or relative path\). */\n" ) +file( APPEND ${ROSE_TOP_BINARY_DIR}/src/util/rose_paths.C "const std::string ROSE_AUTOMAKE_ABSOLUTE_PATH_TOP_SRCDIR = \"${ROSE_TOP_SRC_DIR}\";\n\n" ) +file( APPEND ${ROSE_TOP_BINARY_DIR}/src/util/rose_paths.C "/* Additional interesting data to provide. */\n" ) +file( APPEND ${ROSE_TOP_BINARY_DIR}/src/util/rose_paths.C "const std::string ROSE_CONFIGURE_DATE = \"@configure_date@\";\n" ) +file( APPEND ${ROSE_TOP_BINARY_DIR}/src/util/rose_paths.C "const std::string ROSE_AUTOMAKE_BUILD_OS = \"${CMAKE_HOST_SYSTEM_VERSION}\";\n" ) +file( APPEND ${ROSE_TOP_BINARY_DIR}/src/util/rose_paths.C "const std::string ROSE_AUTOMAKE_BUILD_CPU = \"${CMAKE_HOST_SYSTEM_PROCESSOR}\";\n" ) +file( APPEND ${ROSE_TOP_BINARY_DIR}/src/util/rose_paths.C "/* Numeric form of ROSE version -- assuming ROSE version x.y.zL \(where */\n" ) +file( APPEND ${ROSE_TOP_BINARY_DIR}/src/util/rose_paths.C "/* x, y, and z are numbers, and L is a single lowercase letter from a to j\), */\n" ) +file( APPEND ${ROSE_TOP_BINARY_DIR}/src/util/rose_paths.C "/* the numeric value is x * 1000000 + y * 10000 + z * 100 + \(L - 'a'\). */\n" ) +# @@echo "@PACKAGE_VERSION@" | sed 's/\([0-9]\)\([a-z]\)/\1_\2/g' | tr .a-j _0-9 | awk -F_ '{printf "%02d%02d%02d%02d\n", $$1, $$2, $$3, $$4}' | sed 's/^0*//' | sed 's/.*/const int ROSE_NUMERIC_VERSION = \0;/' >> src/util/rose_paths.C +########### next target ############### + + +########### install files ############### + +install(FILES setup.h processSupport.h rose_paths.h DESTINATION ${INCLUDE_INSTALL_DIR}) +#set( graphs DGBaseGraphImpl.C SCCAnalysis.C TransAnalysis.C TypedFusion.C ) + +#add_library( roseutil SHARED ${graphs} ) +add_library(rose_util_lib ${rose_util_src} ) + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#SUBDIRS = stringSupport commandlineProcessing support graphs +# +## To keep compile commands tidy, please ONLY put required include flags here. +#INCLUDES = $(ROSE_INCLUDES) +# +### Don't use the repository in ../src +#CXX_TEMPLATE_REPOSITORY_PATH = . +# +## DQ (7/4/2004): Need this to be explicit so that it will not be set to "libroseutil.a.c" +## DIST_SOURCES = +# +## lib_LIBRARIES = libroseutil.a +## libroseutil_a_DEPENDENCIES = $(libroseutilDependencies) +# +## DQ (4/5/2009): I have moved rose_paths.h file from src/frontend/SageIII to src/util +## so that it is better matched with where the source file is build (even though the +## source file is generated in the associated compile tree instead of the source tree). +## The rose_paths.[hC] data is referenced by both ROSETTA and ROSE (so it is located in src/util). +#rose_paths.C: +# cd $(top_builddir); $(MAKE) src/util/rose_paths.C +# +#noinst_LTLIBRARIES = libroseutil.la +# +## libroseutil_la_SOURCES = processSupport.C processSupport.h +#libroseutil_la_SOURCES = processSupport.C +#nodist_libroseutil_la_SOURCES = rose_paths.C +#libroseutil_la_LIBADD = \ +# stringSupport/libRoseStringSupport.la \ +# commandlineProcessing/libRoseCommandlineUtil.la +# +## DQ (4/5/2009): I don't think this needs to be specified using this Automake technique. +## The use of this technique for force rose_paths.C to be built was also what was causing +## large parts of ROSE to be rebuilt when configure was return (this appears to be fixed now). +## BUILT_SOURCES = rose_paths.C +# +## DQ (4/5/2009): Added rose_paths.C to clean rule, instead of to the DISTCLEANFILES +## DISTCLEANFILES = rose_paths.C +# +#include_HEADERS = setup.h processSupport.h rose_paths.h +# +#EXTRA_DIST = setup.h utilDocumentation.docs +# +## DQ (4/5/2009): Added rose_paths.C to clean rule, instead of to the DISTCLEANFILES +#clean-local: +# rm -rf $(CXX_TEMPLATE_OBJECTS) Templates.DB ii_files ti_files rose_paths.C +# +#distclean-local: +# rm -rf Templates.DB +# +# +# +# +# +# +# +# diff --git a/src/util/commandlineProcessing/CMakeLists.txt b/src/util/commandlineProcessing/CMakeLists.txt new file mode 100644 index 0000000000..d7df12d238 --- /dev/null +++ b/src/util/commandlineProcessing/CMakeLists.txt @@ -0,0 +1,60 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + +install(FILES sla.h commandline_processing.h DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +## To keep compile commands tidy, please ONLY put required include flags here. +#INCLUDES = $(ROSE_INCLUDES) +# +### Don't use the repository in ../src +#CXX_TEMPLATE_REPOSITORY_PATH = . +# +## libRoseCommandlineUtilSources = commandline_processing.C sla.c sla++.C +#libRoseCommandlineUtilSources = commandline_processing.C sla++.C +# +## lib_LIBRARIES = libRoseCommandlineUtil.a +## libRoseCommandlineUtil_a_SOURCES = $(libRoseCommandlineUtilSources) +# +#noinst_LTLIBRARIES = libRoseCommandlineUtil.la +#libRoseCommandlineUtil_la_SOURCES = $(libRoseCommandlineUtilSources) +# +## We have to explicily build this rule since we want to avoid the use of "ar cru" +## (need to use the C++ compiler so that templates will be built) +## libRoseCommandlineUtil.a: $(libRoseCommandlineUtil_a_OBJECTS) +## -rm -f $@ +## $(CXX_STATIC_LIB_UPDATE) $@ $(libRoseCommandlineUtil_a_OBJECTS) +## $(RANLIB) $@ +## test -f $@ || exit 1 +# +##libRoseCommandlineUtil.so: $(libRoseCommandlineUtil_so_OBJECTS) +## -rm -f $@ +## $(CXX_SHARED_LIB_UPDATE) $@ $(libRoseCommandlineUtil_so_OBJECTS) +## test -f $@ || exit 1 +# +#include_HEADERS = sla.h commandline_processing.h +# +#clean-local: +# rm -rf $(CXX_TEMPLATE_OBJECTS) Templates.DB ii_files ti_files +# +#distclean-local: +# rm -rf Templates.DB +# +#EXTRA_DIST = commandlineProcessingDocumentation.docs +# +# +# +# +# +# diff --git a/src/util/graphs/CMakeLists.txt b/src/util/graphs/CMakeLists.txt new file mode 100644 index 0000000000..bf91fa975d --- /dev/null +++ b/src/util/graphs/CMakeLists.txt @@ -0,0 +1,42 @@ + +include_directories(${CMAKE_SOURCE_DIR}/src/util/support ${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + +install(FILES BaseGraphCreate.h GraphScope.h VirtualGraphCreate.h TransAnalysis.h GraphGroup.h MultiGraphCreate.h TypedFusion.h DGBaseGraphImpl.h GraphAccess.h GraphUtils.h GraphUpdate.h SCCAnalysis.h GraphDotOutput.h GraphIO.h MultiGraphObserve.h DESTINATION ${INCLUDE_INSTALL_DIR}) + +set( graphs DGBaseGraphImpl.C SCCAnalysis.C TransAnalysis.C TypedFusion.C GLOBAL ) + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#INCLUDES = -I$(top_srcdir)/src/util/support -I$(srcdir)/.. +# +#CXX_TEMPLATE_REPOSITORY_PATH = . +# +#libgraphsSources = \ +# DGBaseGraphImpl.C SCCAnalysis.C TransAnalysis.C TypedFusion.C +# +## lib_LIBRARIES = libgraphs.a +## libgraphs_a_SOURCES = $(libgraphsSources) +# +#noinst_LTLIBRARIES = libgraphs.la +#libgraphs_la_SOURCES = $(libgraphsSources) +# +#clean-local: +# rm -rf Templates.DB ii_files ti_files cxx_templates +# +#distclean-local: +# rm -rf Templates.DB +# +#include_HEADERS = \ +# BaseGraphCreate.h GraphScope.h VirtualGraphCreate.h \ +# TransAnalysis.h GraphGroup.h MultiGraphCreate.h \ +# TypedFusion.h DGBaseGraphImpl.h GraphAccess.h GraphUtils.h\ +# GraphUpdate.h SCCAnalysis.h GraphDotOutput.h GraphIO.h \ +# MultiGraphObserve.h diff --git a/src/util/stringSupport/CMakeLists.txt b/src/util/stringSupport/CMakeLists.txt new file mode 100644 index 0000000000..7cf9954ae7 --- /dev/null +++ b/src/util/stringSupport/CMakeLists.txt @@ -0,0 +1,63 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + +install(FILES string_functions.h escape.h DESTINATION ${INCLUDE_INSTALL_DIR}) + +set( RoseStringSupport string_functions.cpp FileNameClassifier.C escape.C ) + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +## To keep compile commands tidy, please ONLY put required include flags here. +#INCLUDES = $(ROSE_INCLUDES) +# +### Don't use the repository in ../src +#CXX_TEMPLATE_REPOSITORY_PATH = . +# +#libRoseStringSupportSources = string_functions.cpp FileNameClassifier.C escape.C +# +## lib_LIBRARIES = libRoseStringSupport.a +## libRoseStringSupport_a_SOURCES = $(libRoseStringSupportSources) +# +## Tell automake install to copy this library +#noinst_LTLIBRARIES = libRoseStringSupport.la +## noinst_LIBRARIES = libRoseStringSupport.so +#libRoseStringSupport_la_SOURCES = $(libRoseStringSupportSources) +# +## Tell automake install to copy this library +## EXTRA_LIBRARIES = libRoseStringSupport.so +# +## We have to explicily build this rule since we want to avoid the use of "ar cru" +## (need to use the C++ compiler so that templates will be built) +##libRoseStringSupport.a: $(libRoseStringSupport_a_OBJECTS) +## -rm -f $@ +## $(CXX_STATIC_LIB_UPDATE) $@ $(libRoseStringSupport_a_OBJECTS) +## $(RANLIB) $@ +## test -f $@ || exit 1 +# +##libRoseStringSupport.so: $(libRoseStringSupport_so_OBJECTS) +## -rm -f $@ +## $(CXX_SHARED_LIB_UPDATE) $@ $(libRoseStringSupport_so_OBJECTS) +## test -f $@ || exit 1 +# +#include_HEADERS = string_functions.h escape.h +# +#clean-local: +# rm -rf $(CXX_TEMPLATE_OBJECTS) Templates.DB ii_files ti_files +# +#distclean-local: +# rm -rf Templates.DB +# +#EXTRA_DIST = stringSupportDocumentation.docs +# +# +# +# +# diff --git a/src/util/support/CMakeLists.txt b/src/util/support/CMakeLists.txt new file mode 100644 index 0000000000..16cf2a9ccb --- /dev/null +++ b/src/util/support/CMakeLists.txt @@ -0,0 +1,45 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + + +########### install files ############### + +install(FILES DAG.h IteratorCompound.h TreeImpl.h BitVectorRepr.h DirectedGraph.h IteratorTmpl.h PtrMap.h union_find.h VectorCommandOptions.h CommandOptions.h DoublyLinkedList.h LatticeElemList.h PtrSet.h const.h FunctionObject.h Matrix.h SinglyLinkedList.h CountRefHandle.h general.h ObserveObject.h StreamIO.h DESTINATION ${INCLUDE_INSTALL_DIR}) + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +### The grammar generator (ROSETTA) should use its own template repository +#CXX_TEMPLATE_REPOSITORY_PATH = . +# +#libsupportSources = VectorCommandOptions.C CommandOptions.C DAG.C DirectedGraph.C +# +#noinst_LTLIBRARIES = libsupport.la +#libsupport_la_SOURCES = $(libsupportSources) +# +#clean-local: +# rm -rf Templates.DB ii_files ti_files cxx_templates +# +#distclean-local: +# rm -rf Templates.DB +# +#include_HEADERS = \ +# DAG.h IteratorCompound.h TreeImpl.h \ +# BitVectorRepr.h DirectedGraph.h IteratorTmpl.h PtrMap.h union_find.h \ +# VectorCommandOptions.h CommandOptions.h DoublyLinkedList.h LatticeElemList.h PtrSet.h \ +# const.h FunctionObject.h Matrix.h SinglyLinkedList.h \ +# CountRefHandle.h general.h ObserveObject.h StreamIO.h +# +# +# +# +# +# +# +# diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt new file mode 100644 index 0000000000..7ac269d99b --- /dev/null +++ b/tests/CMakeLists.txt @@ -0,0 +1,92 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ${Boost_INCLUDE_DIRS} ) + +add_executable( testTranslator testTranslator.C ) +target_link_libraries(testTranslator rose edg33 ${link_with_libraries} ${Boost_LIBRARIES} + libastMerge libsageInterface libastTokenStream + libastHiddenTypeAndDeclarationLists libastVisualization + roseDisassemblers + libsageInterface roseExecFormats midend unparser + libastHiddenTypeAndDeclarationLists roseAsmUnparser libastPostProcessing + libhpdf + ) + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +## Temporarily remove the performance tests since they don't yet compile properly +## SUBDIRS = CompileTests RunTests PerformanceTests +## SUBDIRS = CompileTests RunTests @optional_PERFORMANCE_subdirs@ +## if ROSE_PERFORMANCE_TESTS +## SUBDIRS = CompileTests RunTests PerformanceTests +## else +## SUBDIRS = CompileTests RunTests +## endif +# +#SUBDIRS = CompileTests roseTests RunTests PerformanceTests CompilerOptionsTests \ +# translatorTests +# +## CompileTests +# +## This allows us to make distributions that could exclude the PerformanceTests directory +## I don't know if this is a good idea but it also allows us to test ROSE without the +## PerformanceTests directory as well. +## DIST_SUBDIRS = $(SUBDIRS) +# +## DQ (1/7/2004): Relocation of ROSE/src/rose.C to ROSE/tests/testTranslator.C +## Build rose.C test translator in this directory since it is only used for tests +## of the included test codes. This code has been moved from the ROSE/src/rose.C +## to ROSE/tests/testTranslator.C as part of the directory reorganization. +## The change was required because of the dependences of ROSE/src/rose.C upon +## libraries that had not yet been built. There was no order in which the +## parent directories could be visited to build all the libraries require before +## the ROSE/src directory was processed. +#bin_PROGRAMS = testTranslator testAnalysis +# +## This tests the ability to read and regnerate the input application and compile it using the backend compiler. +#testTranslator_SOURCES = testTranslator.C +# +## This tests only the ability to read application, not regenerate the source code and compile it using the backend compiler. +## This test code is used for the testing of ROSE compiling ROSE to support analysis using Compass. +#testAnalysis_SOURCES = testAnalysis.C +# +## Use the names of the libraries as the list of dependences +##testTranslator_DEPENDENCIES = $(ROSE_LIBS_WITH_PATH) +# +## Use names set in ROSE/config/Makefile.for.ROSE.includes.and.libs +#INCLUDES = $(ROSE_INCLUDES) +#LDADD = $(LIBS_WITH_RPATH) $(ROSE_LIBS) +# +#EXTRA_DIST = tests.tex +# +#testObjectFile: testAnalysis +# ./testAnalysis $(INCLUDES) -c $(srcdir)/inputFile.C -o alt_inputFile.o +# +#testLinkFile: testObjectFile +## ./testAnalysis $(INCLUDES) alt_inputFile.o -o alt_inputFile +# ./testAnalysis $(INCLUDES) alt_inputFile.o +# +#testCppFile: testAnalysis +# ./testAnalysis -E $(INCLUDES) $(srcdir)/inputFile.C +# +#testExecutableFile: testAnalysis +# ./testAnalysis $(INCLUDES) $(srcdir)/inputFile.C +# +#check-local: +# @echo "************************************************************************" +# @echo "****** ROSE/tests: make check rule complete (terminated normally) ******" +# @echo "************************************************************************" +# +# +# +# +# +# +# +# +# +# +# +# +# +# +# diff --git a/tests/RunTests/AstDeleteTests/CMakeLists.txt b/tests/RunTests/AstDeleteTests/CMakeLists.txt new file mode 100644 index 0000000000..841fd4374d --- /dev/null +++ b/tests/RunTests/AstDeleteTests/CMakeLists.txt @@ -0,0 +1,61 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + +set(memoryTranslator_SRCS test.C) + +kde4_add_executable(memoryTranslator ${memoryTranslator_SRCS}) + +target_link_libraries(memoryTranslator ${KDE4_KDECORE_LIBS}) + +install(TARGETS memoryTranslator ${INSTALL_TARGETS_DEFAULT_ARGS}) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#TEST_TRANSLATOR = $(top_builddir)/tests/testTranslator $(ROSE_FLAGS) +# +#bin_PROGRAMS = memoryTranslator +#memoryTranslator_SOURCES = test.C +# +#INCLUDES = $(ROSE_INCLUDES) +#LDADD = $(LIBS_WITH_RPATH) $(ROSE_LIBS) +# +#TESTCODES_REQUIRED_TO_PASS = \ +# test1.C +# +#TESTCODES = \ +#$(TESTCODES_REQUIRED_TO_PASS) +# +#TEST_Objects = ${TESTCODES:.c=.o} +# +# +#$(TEST_Objects): memoryTranslator +# ./memoryTranslator $(ROSE_FLAGS) -c $(srcdir)/$(@:.o=.c) +# +# +## This rule is run after automake's internal check rule (which we don't want to use) +#check-local: +# @echo "#################################################" +# @echo " Test ROSEs Deleting of nodes " +# @echo "#################################################" +# @$(MAKE) $(TEST_Objects) +# @echo "*****************************************************************************************************************" +# @echo "* ROSE/tests/RunTests/AstDeleteTests: make check rule complete (terminated normally) *" +# @echo "*****************************************************************************************************************" +# +# +#EXTRA_DIST = $(TESTCODES_REQUIRED_TO_PASS) +# +#clean-local: +# rm -f *.o test1 *.s rm *.out rose_*.C *.C.pdf *.dot core local_test-isystemOption.C *.dump *.new +# diff --git a/tests/RunTests/CMakeLists.txt b/tests/RunTests/CMakeLists.txt new file mode 100644 index 0000000000..e05a79c95f --- /dev/null +++ b/tests/RunTests/CMakeLists.txt @@ -0,0 +1,25 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + +add_subdirectory(A++Tests) +add_subdirectory(AstDeleteTests) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +## SUBDIRS = @optional_AxxPxxSpecificTest_subdirs@ +## we can't make this @optional_AxxPxxSpecificTest_subdirs@ +## since the substitution could be NULL which causes a problem +## for automake generated shell code placed in Makefile. +# +## Comment out P++ tests until they compile properly +## SUBDIRS = A++Tests P++Tests +#SUBDIRS = A++Tests AstDeleteTests +# diff --git a/tests/translatorTests/CMakeLists.txt b/tests/translatorTests/CMakeLists.txt new file mode 100644 index 0000000000..a791e23d96 --- /dev/null +++ b/tests/translatorTests/CMakeLists.txt @@ -0,0 +1,68 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + +set(bug125_SRCS bug125.C) + +kde4_add_executable(bug125 ${bug125_SRCS}) + +target_link_libraries(bug125 ${KDE4_KDECORE_LIBS}) + + +########### next target ############### + +set(qualifiedName_SRCS qualifiedName.C) + +kde4_add_executable(qualifiedName ${qualifiedName_SRCS}) + +target_link_libraries(qualifiedName ${KDE4_KDECORE_LIBS}) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +## To keep compile commands tidy, please ONLY put required include flags here. +#INCLUDES = $(ROSE_INCLUDES) +# +## The bug numbers come from ROSE's SciDAC bug trackers +#noinst_PROGRAMS = \ +# bug125 \ +# qualifiedName +# +#bug125_SOURCES = bug125.C +#qualifiedName_SOURCES = qualifiedName.C +# +#LDADD = $(LIBS_WITH_RPATH) $(ROSE_SEPARATE_LIBS) +# +#VALGRIND_OPTIONS = --tool=memcheck -v --num-callers=30 --leak-check=no --error-limit=no --show-reachable=yes +# +#VALGRIND = +# +#testbug125:bug125 +# ./bug125 -c $(srcdir)/inputbug125.C +# +#testqualifiedName: qualifiedName +# ./qualifiedName -c $(top_srcdir)/projects/autoTuning/tests/jacobi.c +# +#EXTRA_DIST = inputbug125.C +# +#check-local: +# @$(MAKE) testbug125 testqualifiedName +# +#distclean-local: +# rm -rf Makefile +# +#clean-local: +# rm -rf *.o *.ps *.pdf *.dot rose_*.C rose_*.c core *.int.c *.ti a.out roseTestProgram.C +# +#cleandata: +# rm -f *.ti *.ii rose_*.C rose_*.c *.dot test*.o rose_*.o +# diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt new file mode 100644 index 0000000000..82807d1f85 --- /dev/null +++ b/tools/CMakeLists.txt @@ -0,0 +1,18 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### install files ############### + +install(FILES cpp2cpp cpp2pdf cpp2ps dot2ps lsviz cpp2beauty indent.cfg pragmarize DESTINATION ) + + + +#original Makefile.am contents follow: + +## copy the tools (scripts only) from the source tree to the source destination in the distribution +#EXTRA_DIST = cpp2cpp cpp2pdf cpp2ps dot2ps lsviz cpp2beauty indent.cfg pragmarize +# +## install the tools in 'bin' +#bin_SCRIPTS = cpp2cpp cpp2pdf cpp2ps dot2ps lsviz cpp2beauty indent.cfg pragmarize +# diff --git a/tutorial/CMakeLists.txt b/tutorial/CMakeLists.txt new file mode 100644 index 0000000000..8569846d70 --- /dev/null +++ b/tutorial/CMakeLists.txt @@ -0,0 +1,1397 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + +add_subdirectory(database) +add_subdirectory(roseHPCT) +add_subdirectory(outliner) +add_subdirectory(intelPin) + + +########### next target ############### + +set($(TUTORIAL_EXAMPLES)_SRCS ${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp) + +kde4_add_executable($(TUTORIAL_EXAMPLES) ${$(TUTORIAL_EXAMPLES)_SRCS}) + +target_link_libraries($(TUTORIAL_EXAMPLES) ${KDE4_KDECORE_LIBS}) + + +########### next target ############### + +set($(TUTORIAL_EXAMPLES)_SRCS ${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp) + +kde4_add_executable($(TUTORIAL_EXAMPLES) ${$(TUTORIAL_EXAMPLES)_SRCS}) + +target_link_libraries($(TUTORIAL_EXAMPLES) ${KDE4_KDECORE_LIBS}) + + +########### next target ############### + +set(sharedMemoryTraversals_SRCS sharedMemoryTraversals.C) + +kde4_add_executable(sharedMemoryTraversals ${sharedMemoryTraversals_SRCS}) + +target_link_libraries(sharedMemoryTraversals ${KDE4_KDECORE_LIBS}) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +## Add Projects that are associated with capabilities that belong to ROSE here +#SUBDIRS = database roseHPCT outliner intelPin +# +#INCLUDES = $(ROSE_INCLUDES) +# +## all: exampleMakefile +# +#ROSE_FLAGS = --edg:no_warnings -w +# +#noinst_HEADERS = \ +# coverage_funcsC.h \ +# inputCode_collectComments.h +# +##varSubstCopy , disabled this one Liao, and sorted the list +#TUTORIAL_EXAMPLES = \ +# abstractHandle1 \ +# abstractHandle2 \ +# accumulatorAttributeTraversal \ +# addAssignmentStmt \ +# addComments \ +# addArbitraryTextForUnparser \ +# addExpression \ +# addFunctionCalls \ +# addFunctionDeclaration \ +# addFunctionDeclaration2 \ +# addFunctionDeclaration3 \ +# addStruct \ +# addVariableDeclaration \ +# addVariableDeclaration2 \ +# AST_PDF_Generator \ +# astFileIO_GenerateBinaryFile \ +# astFileIO_ReadMultipleASTs \ +# ASTGraphGenerator \ +# bin_example \ +# binaryAnalysis \ +# binaryAnalysis_symbolTable \ +# binaryFileRead \ +# sb_callgraphAnalysis \ +# buildCFG \ +# buildCG \ +# callGraphAnalysis \ +# changeFunction \ +# charmSupport \ +# classHierarchyGraph \ +# classicObjectOrientedVisitorPatternMemoryPoolTraversal \ +# classicObjectOrientedVisitorPatternTraversal \ +# codeCoverage \ +# codeGenerationFormatControl \ +# collectComments \ +# collectDefineDirectives \ +# combinedTraversals \ +# commandlineProcessing \ +# constantFoldingTransformation \ +# constantUnFoldingTransformation \ +# customGraphGeneration \ +# customGraphGenerationWithColors \ +# customGraphGenerationWithFiltering \ +# dataBaseUsage \ +# dataFlowGraph \ +# debuggingIRnodeToString \ +# debuggingSourceCodePositionInformation \ +# defuseAnalysis \ +# dwarfAnalysis \ +# dwarfInstructionAddressToSourceLineAnalysis \ +# generatingUniqueNamesFromDeclaration \ +# graphGenerationOfSubtree \ +# graphTraversal \ +# identityTranslator \ +# inheritedAndSynthesizedAttributeTraversal \ +# inheritedAttributeTraversal \ +# inlineTransformations \ +# instrumentationExample \ +# instrumentEndOfFunction \ +# interveneAtVariables \ +# lineReplacement \ +# loopNestingInfoProcessing \ +# loopOptimization \ +# loopProcessor \ +# loopRecognition \ +# nestedQueryExample \ +# nestedTraversal \ +# partialRedundancyElimination \ +# persistantAttributes \ +# prePostTraversal \ +# queryLibraryExample \ +# reductionRecognition \ +# resolveOverloadedFunction \ +# seedBugsExample_arrayIndexing \ +# scopeInformation \ +# selectedFileTranslation \ +# sprintf_to_snprintf \ +# switchWithoutDefault \ +# symbolTableHandling \ +# synthesizedAttributeTraversal \ +# tauInstrumenter \ +# templateParameter \ +# traversalShortCircuit \ +# traverseIRnodeTypes \ +# typeInfoFromFunctionParameters \ +# typeTransformation \ +# virtualCFG \ +# virtualFunctionIdentification \ +# visitorMemoryPoolTraversal \ +# visitorTraversal \ +# volatileTypeModifier \ +# wholeASTGraphGenerator \ +# wholeGraphAST \ +# wholeGraphFilterOnPersistantAttributes +# +## DQ (3/21/2009): Separate those that compile under Cygwin from those that don't. +#if ROSE_BUILD_OS_IS_CYGWIN +# noinst_PROGRAMS = $(TUTORIAL_EXAMPLES) +#else +# noinst_PROGRAMS = $(TUTORIAL_EXAMPLES) sharedMemoryTraversals +# sharedMemoryTraversals_SOURCES = sharedMemoryTraversals.C +#endif +# +#binaryFileRead_SOURCES = binaryFileRead.C +# +#ASTGraphGenerator_SOURCES = ASTGraphGenerator.C +# +#AST_PDF_Generator_SOURCES = AST_PDF_Generator.C +# +#wholeASTGraphGenerator_SOURCES = wholeASTGraphGenerator.C +# +#identityTranslator_SOURCES = identityTranslator.C +# +#lineReplacement_SOURCES = lineReplacement.C +# +#queryLibraryExample_SOURCES = queryLibraryExample.C +# +#nestedQueryExample_SOURCES = nestedQueryExample.C +# +## need to call this something different since it is likely +## to be easily confused with the visitorPatternTraversal.C +#visitorTraversal_SOURCES = visitorTraversal.C +# +#prePostTraversal_SOURCES = prePostTraversal.C +# +#combinedTraversals_SOURCES = combinedTraversals.C +# +#traverseIRnodeTypes_SOURCES = traverseIRnodeTypes.C +# +#classicObjectOrientedVisitorPatternTraversal_SOURCES = classicObjectOrientedVisitorPatternTraversal.C +# +#inheritedAttributeTraversal_SOURCES = inheritedAttributeTraversal.C +# +#synthesizedAttributeTraversal_SOURCES = synthesizedAttributeTraversal.C +# +#inheritedAndSynthesizedAttributeTraversal_SOURCES = inheritedAndSynthesizedAttributeTraversal.C +# +#accumulatorAttributeTraversal_SOURCES = accumulatorAttributeTraversal.C +# +#persistantAttributes_SOURCES = persistantAttributes.C +# +#nestedTraversal_SOURCES = nestedTraversal.C +# +#visitorMemoryPoolTraversal_SOURCES = visitorMemoryPoolTraversal.C +# +#classicObjectOrientedVisitorPatternMemoryPoolTraversal_SOURCES = classicObjectOrientedVisitorPatternMemoryPoolTraversal.C +# +#loopRecognition_SOURCES = loopRecognition.C +# +#typeInfoFromFunctionParameters_SOURCES = typeInfoFromFunctionParameters.C +# +#resolveOverloadedFunction_SOURCES = resolveOverloadedFunction.C +# +#templateParameter_SOURCES = templateParameter.C +# +#instrumentEndOfFunction_SOURCES = instrumentEndOfFunction.C +# +#reductionRecognition_SOURCES= reductionRecognition.C +# +#instrumentationExample_SOURCES = instrumentationExample.C +# +#abstractHandle1_SOURCES = abstractHandle1.cpp +# +#abstractHandle2_SOURCES = abstractHandle2.cpp +# +#addVariableDeclaration_SOURCES = addVariableDeclaration.C +# +#addVariableDeclaration2_SOURCES = addVariableDeclaration2.C +# +#addAssignmentStmt_SOURCES = addAssignmentStmt.C +# +#addExpression_SOURCES = addExpression.C +# +#addFunctionCalls_SOURCES = addFunctionCalls.C +# +#addFunctionDeclaration_SOURCES = addFunctionDeclaration.C +# +#addFunctionDeclaration2_SOURCES = addFunctionDeclaration2.C +# +#addFunctionDeclaration3_SOURCES = addFunctionDeclaration3.C +# +# +#loopOptimization_SOURCES = loopOptimization.C +# +#loopProcessor_SOURCES = LoopProcessor.C +# +#buildCFG_SOURCES = buildCFG.C +# +#defuseAnalysis_SOURCES = defuseAnalysis.C +# +#binaryAnalysis_SOURCES = binaryAnalysis.C +# +#sb_callgraphAnalysis_SOURCES = callGraphSourceBinaryExample.C +# +#binaryAnalysis_symbolTable_SOURCES = binaryAnalysis_symbolTable.C +# +#bin_example_SOURCES = bin_example.C +# +#buildCG_SOURCES = buildCG.C +# +#charmSupport_SOURCES = CharmSupport.C +# +#debuggingIRnodeToString_SOURCES = debuggingIRnodeToString.C +# +#debuggingSourceCodePositionInformation_SOURCES = debuggingSourceCodePositionInformation.C +# +#commandlineProcessing_SOURCES = commandlineProcessing.C +# +#codeCoverage_SOURCES = codeCoverage.C coverageCodeFromShmuel.c +# +#interveneAtVariables_SOURCES = interveneAtVariables.C +# +#changeFunction_SOURCES = changeFunction.C +# +#callGraphAnalysis_SOURCES = callGraphAnalysis.C +# +#classHierarchyGraph_SOURCES = classHierarchyGraph.C +# +#dataBaseUsage_SOURCES = dataBaseUsage.C +# +#dwarfAnalysis_SOURCES = dwarfAnalysis.C +# +#dwarfInstructionAddressToSourceLineAnalysis_SOURCES = dwarfInstructionAddressToSourceLineAnalysis.C +# +#loopNestingInfoProcessing_SOURCES = loopNestingInfoProcessing.C +# +#tauInstrumenter_SOURCES = tauInstrumenter.C +# +#typeTransformation_SOURCES = typeTransformation.C +# +#astFileIO_GenerateBinaryFile_SOURCES = astFileIO_GenerateBinaryFile.C +# +#generatingUniqueNamesFromDeclaration_SOURCES = generatingUniqueNamesFromDeclaration.C +# +#symbolTableHandling_SOURCES = symbolTableHandling.C +# +#scopeInformation_SOURCES = scopeInformation.C +# +#customGraphGeneration_SOURCES = customGraphGeneration.C +# +#inlineTransformations_SOURCES = inlineTransformations.C +# +#addComments_SOURCES = addComments.C +# +#addArbitraryTextForUnparser_SOURCES = addArbitraryTextForUnparser.C +# +#collectComments_SOURCES = collectComments.C +# +#collectDefineDirectives_SOURCES = collectDefineDirectives.C +# +#partialRedundancyElimination_SOURCES = partialRedundancyElimination.C +# +#codeGenerationFormatControl_SOURCES = codeGenerationFormatControl.C +# +#dataFlowGraph_SOURCES = dataFlowGraph.C +# +#customGraphGenerationWithFiltering_SOURCES = customGraphGenerationWithFiltering.C +# +#graphTraversal_SOURCES = graphTraversal.C +# +#wholeGraphAST_SOURCES = wholeGraphAST.C +# +#traversalShortCircuit_SOURCES = traversalShortCircuit.C +# +#customGraphGenerationWithColors_SOURCES = customGraphGenerationWithColors.C +# +#astFileIO_ReadMultipleASTs_SOURCES = astFileIO_ReadMultipleASTs.C +# +#constantFoldingTransformation_SOURCES = constantFoldingTransformation.C +# +#constantUnFoldingTransformation_SOURCES = constantUnFoldingTransformation.C +# +#selectedFileTranslation_SOURCES = selectedFileTranslation.C +# +#wholeGraphFilterOnPersistantAttributes_SOURCES = wholeGraphFilterOnPersistantAttributes.C +# +#graphGenerationOfSubtree_SOURCES = graphGenerationOfSubtree.C +# +#virtualCFG_SOURCES = virtualCFG.C +# +#virtualFunctionIdentification_SOURCES = virtualFunctionIdentification.C +# +##varSubstCopy_SOURCES = varSubstCopy.C +# +#switchWithoutDefault_SOURCES = switchWithoutDefault.C +# +#addStruct_SOURCES = addStruct.C +# +#sprintf_to_snprintf_SOURCES = sprintf_to_snprintf.C +# +#seedBugsExample_arrayIndexing_SOURCES = seedBugsExample_arrayIndexing.C +# +#volatileTypeModifier_SOURCES = volatileTypeModifier.C +# +## Use this to control use of -lrose -ledg vs. the very long list +## of separate libraries which is faster to use in development. +## LDADD = $(LIBS_WITH_RPATH) $(ROSE_LIBS) +#LDADD = $(LIBS_WITH_RPATH) $(WAVE_LDFLAGS) $(ROSE_SEPARATE_LIBS) +# +## ##################################### +## Tests for debugging tutorial examples +## ##################################### +# +#VALGRIND_OPTIONS = --tool=memcheck -v --num-callers=80 --leak-check=no --error-limit=no --show-reachable=yes +## VALGRIND = /usr/apps/valgrind/new/bin/valgrind $(VALGRIND_OPTIONS) +#VALGRIND = +# +#testASTGraphGenerator: ASTGraphGenerator +# @echo "Generating dot file ..." +# ./ASTGraphGenerator $(srcdir)/inputCode_2.C +# @echo "Generate pdf file (default name: test.pdf) from dot file ..." +# $(top_srcdir)/scripts/dotgenLetterPDF inputCode_2.C.dot inputCode_2.pdf +# +#testAST_PDF_Generator: AST_PDF_Generator +# @echo "Generating PDF file ..." +# ./AST_PDF_Generator $(srcdir)/inputCode_2.C +# +#testWholeASTGraphGenerator_small: wholeASTGraphGenerator +# @echo "Generating dot file of whole AST ..." +# ./wholeASTGraphGenerator $(srcdir)/inputCode_wholeAST_1.C +# @echo "Generate pdf file (default name: test.pdf) from dot file ..." +# $(top_srcdir)/scripts/dotgenLetterPDF inputCode_wholeAST_1_WholeAST.dot inputCode_WholeAST_small.pdf +# +#testWholeASTGraphGenerator_large: wholeASTGraphGenerator +# @echo "Generating dot file of whole AST ..." +# ./wholeASTGraphGenerator $(srcdir)/inputCode_wholeAST_2.C +# @echo "Generate pdf file (default name: test.pdf) from dot file ..." +# $(top_srcdir)/scripts/dotgenLetterPDF inputCode_wholeAST_2_WholeAST.dot inputCode_WholeAST_large.pdf +# +## DQ (9/6/2008): Added test to generate a graph of the binary for the tiny program example (with debugging data). +#testBinaryASTGraphGenerator: wholeASTGraphGenerator +# gcc -g $(srcdir)/inputCode_binaryAST_1.c -o inputCode_binaryAST_1 +# ./wholeASTGraphGenerator inputCode_binaryAST_1 +# $(top_srcdir)/scripts/dotgenLetterPDF inputCode_binaryAST_1_WholeAST.dot inputCode_binaryAST_1_WholeAST.pdf +# +#testLoopRecognition: loopRecognition +# ./loopRecognition $(srcdir)/inputCode_1.C +# +#testResolveOverloadedFunction: resolveOverloadedFunction +# ./resolveOverloadedFunction $(srcdir)/inputCode_1.C +# +#testInstantiatedTemplate: templateParameter +# ./templateParameter $(srcdir)/inputCode_1.C +# +#testInstrumentationExample: instrumentationExample +# ./instrumentationExample -rose:verbose 0 -c $(srcdir)/inputCode_InstrumentationTranslator.C +# +#testInstrumentEndOfFunction: instrumentEndOfFunction +# ./instrumentEndOfFunction -rose:verbose 0 -c $(srcdir)/inputCode_instrumentEndOfFunction.C +# +#testReductionRecognition: reductionRecognition +# ./reductionRecognition -rose:verbose 0 -c $(srcdir)/inputCode_reductionRecognition.C +# +## turn off the warning for input code with unused variable declarations +#testAddVariableDeclaration: addVariableDeclaration +# ./addVariableDeclaration --edg:no_warnings -c $(srcdir)/inputCode_AddVariableDeclaration.C +# +#testAddVariableDeclaration2: addVariableDeclaration2 +# ./addVariableDeclaration2 --edg:no_warnings -c $(srcdir)/inputCode_AddVariableDeclaration2.C +# +#testAddFunctionDeclaration: addFunctionDeclaration +# ./addFunctionDeclaration --edg:no_warnings -c $(srcdir)/inputCode_AddFunctionDeclaration.C +# +#testAddFunctionDeclaration2: addFunctionDeclaration2 +# ./addFunctionDeclaration2 --edg:no_warnings -c $(srcdir)/inputCode_AddFunctionDeclaration2.C +#testAddFunctionDeclaration3: addFunctionDeclaration3 +# ./addFunctionDeclaration3 --edg:no_warnings -c $(srcdir)/inputCode_AddFunctionDeclaration3.C +# +#testAddAssignmentStmt: addAssignmentStmt +# ./addAssignmentStmt --edg:no_warnings -c $(srcdir)/inputCode_AddAssignmentStmt.C +# +#testAbstractHandle1:abstractHandle1 +# ./abstractHandle1 --edg:no_warnings -c $(srcdir)/inputCode_AbstractHandle1.cpp +# +#testAbstractHandle2:abstractHandle2 +# ./abstractHandle2 --edg:no_warnings -c $(srcdir)/inputCode_AbstractHandle2.cpp +# +#testAddExpression: addExpression +# ./addExpression --edg:no_warnings -c $(srcdir)/inputCode_AddExpression.C +# +#testAddFunctionCalls: addFunctionCalls +# ./addFunctionCalls --edg:no_warnings -c $(srcdir)/inputCode_AddFunctionCalls.C +# +#testLoopOptimization: loopOptimization +# $(VALGRIND) ./loopOptimization -c $(srcdir)/inputCode_LoopOptimization.C +# +#testIdentityTranslator: identityTranslator +# ./identityTranslator -c $(srcdir)/inputCode_IdentityTranslator.C +# +#testCharmSupport: charmSupport +# ./charmSupport -c $(srcdir)/inputCode_ExampleCharmSupport.C +# +#testBuildCFG: buildCFG +## ./buildCFG $(srcdir)/inputCode_1.C +## ./buildCFG $(srcdir)/inputCode_CallGraphAnalysis.C +# ./buildCFG $(srcdir)/inputCode_ControlFlowGraphAnalysis.C +# @echo "Building postscript file from foo.dot ..." +## $(top_srcdir)/scripts/dotgenLetterPDF controlFlowGraph.dot controlFlowGraph.ps +## $(top_srcdir)/scripts/dotgenLetterPDF foo.dot controlFlowGraph.ps +# $(top_srcdir)/scripts/dotgenLetterPDF main.dot controlFlowGraph.pdf +# +#testBuildCFG_testfile1: buildCFG +# ./buildCFG $(srcdir)/inputCode_ControlFlowGraphAnalysis_testfile1.c +# @echo "Building postscript file from foo.dot ..." +# $(top_srcdir)/scripts/dotgenLetterPDF testCFG.dot controlFlowGraph_testfile1.pdf +# +#testVirtualCFG: virtualCFG +# ./virtualCFG $(srcdir)/inputCode_ControlFlowGraphAnalysis.C > vcfg.dot || (rm -f vcfg.dot; exit 1) +# $(top_srcdir)/scripts/dotgenLetterPDF vcfg.dot vcfg.pdf +# +## Both this and the testCallGraphAnalysis rule generate a file called callGraph.ps +#testBuildCG: buildCG +# ./buildCG $(srcdir)/inputCode_BuildCG.C +# @echo "Building postscript file from DATABASE.dot ..." +## $(top_srcdir)/scripts/dotgenLetterPDF controlFlowGraph.dot controlFlowGraph.ps +# $(top_srcdir)/scripts/dotgenLetterPDF callGraph.dot callGraph.pdf +# +#testClassHierarchyGraph: classHierarchyGraph +# ./classHierarchyGraph $(srcdir)/inputCode_ClassHierarchyGraph.C +# @echo "Building postscript file from DATABASE.dot ..." +## $(top_srcdir)/scripts/dotgenLetterPDF controlFlowGraph.dot controlFlowGraph.ps +# $(top_srcdir)/scripts/dotgenLetterPDF classHier.dot classHierarchyGraph.pdf +# +#testCodeCoverage: codeCoverage +# ./codeCoverage -c $(srcdir)/inputCode_ExampleCodeCoverage.C +# +#testCodeCoverageIBMExample: codeCoverage +# ./codeCoverage -c $(srcdir)/inputCode_ExampleCodeCoverageIBMExample.C +# +#testChangeFunction: changeFunction +# ./changeFunction -rose:verbose 0 -c $(srcdir)/inputCode_ChangeFunctionExample.C +# +#testInterveneAtVariables: interveneAtVariables +# ./interveneAtVariables -rose:verbose 0 -c $(srcdir)/inputCode_interveneAtVariables.C +# +#testCallGraphAnalysis: callGraphAnalysis +# ./callGraphAnalysis -c $(srcdir)/inputCode_CallGraphAnalysis.C +# @echo "Building postscript file from inputCode_CallGraphAnalysis.C.callgraph.dot ..." +## $(top_srcdir)/scripts/dotgenLetterPDF callgraph.dot callGraph.ps +## $(top_srcdir)/scripts/dotgen callgraph.dot callGraph.ps +# $(top_srcdir)/scripts/dotgenLetterPDF callGraph.dot callGraph.pdf +# +#testTemplateExample1: identityTranslator +# ./identityTranslator -c $(srcdir)/inputCode_templateExample1.C +# +#testTemplateExample2: identityTranslator +# ./identityTranslator -c $(srcdir)/inputCode_templateExample2.C +# +#testDataBaseExample1: dataBaseUsage +# ./dataBaseUsage -c $(srcdir)/inputCode_dataBaseExample1.C +# +#testLoopNestingInfoProcessing: loopNestingInfoProcessing +# ./loopInfoProcessing -c $(srcdir)/inputCode_loopNestingInfoProcessing.C +# +#loopOptimizationOutputFiles = \ +# rose_inputCode_LoopOptimization_blocking.C \ +# rose_inputCode_LoopOptimization_fusion.C \ +# rose_inputCode_LoopOptimization_mm.C \ +# rose_inputCode_LoopOptimization_dgemm.C \ +# rose_inputCode_LoopOptimization_lufac.C \ +# rose_inputCode_LoopOptimization_tridvpk.C +# +#testLoopOptimization: loopProcessor $(loopOptimizationOutputFiles) +# +#testInheritedAttributeTraversal: inheritedAttributeTraversal +# $(VALGRIND) ./inheritedAttributeTraversal -c $(srcdir)/inputCode_ExampleTraversals_1.C +# +#testPersistantAttributes: persistantAttributes +# ./persistantAttributes -c $(srcdir)/inputCode_ExampleTraversals_2.C +# +## TAU_INCLUDES = -I/home/dquinlan/TAU/tau-2.14.8/include +#TAU_INCLUDES = -I$(srcdir)/TAU_INCLUDE_DIR +#testTauInstrumenter: tauInstrumenter +# ./tauInstrumenter $(TAU_INCLUDES) -c $(srcdir)/inputCode_tauInstrumenter.C +# +#testTypeTransformation: typeTransformation +# ./typeTransformation -c $(srcdir)/inputCode_typeTransformation.C +# +#testAstFileIO_GenerateBinaryFile: astFileIO_GenerateBinaryFile +# ./astFileIO_GenerateBinaryFile -c $(srcdir)/inputCode_astFileIO_GenerateBinaryFile.C +# +#testAstFileIO_ReadMultipleASTs: astFileIO_ReadMultipleASTs +# ./astFileIO_GenerateBinaryFile -c $(srcdir)/inputCode_astFileIO_GenerateBinaryFile_1.C +# ./astFileIO_GenerateBinaryFile -c $(srcdir)/inputCode_astFileIO_GenerateBinaryFile_2.C +# ./astFileIO_GenerateBinaryFile -c $(srcdir)/inputCode_astFileIO_GenerateBinaryFile_3.C +# ./astFileIO_ReadMultipleASTs inputCode_astFileIO_GenerateBinaryFile_1 inputCode_astFileIO_GenerateBinaryFile_2 inputCode_astFileIO_GenerateBinaryFile_3 +# +#testTraverseIRnodeTypes: traverseIRnodeTypes +# $(VALGRIND) ./traverseIRnodeTypes -c $(srcdir)/inputCode_ExampleTraversals_3.C +# +#testGeneratingUniqueNamesFromDeclaration: generatingUniqueNamesFromDeclaration +# ./generatingUniqueNamesFromDeclaration -c $(srcdir)/inputCode_generatingUniqueNamesFromDeclaration.C +# +#testGeneratingUniqueNamesFromDeclaration2: generatingUniqueNamesFromDeclaration +# ./generatingUniqueNamesFromDeclaration -c $(srcdir)/inputCode_generatingUniqueNamesFromDeclaration2.C +# +#testSymbolTableHandling: symbolTableHandling +# ./symbolTableHandling -c $(srcdir)/inputCode_testsymbolTableHandling.C +# +#testScopeInformation: scopeInformation +# ./scopeInformation -c $(srcdir)/inputCode_scopeInformation.C +# +#testCustomGraphGeneration: customGraphGeneration customGraphGenerationWithFiltering +# ./customGraphGeneration +# @echo "Building postscript file from foo.dot ..." +# $(top_srcdir)/scripts/dotgenLetterPDF customGraph.dot customGraph.pdf +# ./customGraphGenerationWithFiltering +# $(top_srcdir)/scripts/dotgenLetterPDF customGraphWithFiltering.dot customGraphWithFiltering_test.pdf +# +#testInlineTransformations: inlineTransformations +# ./inlineTransformations -c $(srcdir)/inputCode_inlineTransformations.C +# +#testAddComments: addComments +# ./addComments -c $(srcdir)/inputCode_addComments.C +# +#testAddArbitraryTextForUnparser: +# ./addArbitraryTextForUnparser -c $(srcdir)/inputCode_addArbitraryTextForUnparser.C +# +#testCollectComments: collectComments +# ./collectComments -rose:collectAllCommentsAndDirectives -I$(srcdir) -c $(srcdir)/inputCode_collectComments.C +# +#testCollectCommentsSkipHeaders: collectComments +# ./collectComments -I$(srcdir) -c $(srcdir)/inputCode_collectComments.C +# +#testCollectDefineDirectives: collectDefineDirectives +# ./collectDefineDirectives -rose:collectAllCommentsAndDirectives -I$(srcdir) -c $(srcdir)/inputCode_collectComments.C +# +#testPartialRedundancyElimination: partialRedundancyElimination +# ./partialRedundancyElimination -c $(srcdir)/inputCode_partialRedundancyElimination.C +# +#testCodeGenerationFormatControl: codeGenerationFormatControl +# ./codeGenerationFormatControl -c $(srcdir)/inputCode_codeGenerationFormatControl.C +# +#testDataFlowGraph: dataFlowGraph +# ./dataFlowGraph -c $(srcdir)/inputCode_dataFlowGraphAnalysis.C +# @echo "Building postscript file from inputCode_dataFlowGraphAnalysis.C.dot ..." +# $(top_srcdir)/scripts/dotgenLetterPDF inputCode_dataFlowGraphAnalysis.C.dot inputCode_dataFlowGraphAnalysis.pdf +# +#testDataFlowGraph_testfile1: dataFlowGraph +# ./dataFlowGraph -c $(srcdir)/inputCode_dataFlowGraphAnalysis_testfile1.C +# @echo "Building postscript file from inputCode_dataFlowGraphAnalysis.C.dot ..." +# $(top_srcdir)/scripts/dotgenLetterPDF inputCode_dataFlowGraphAnalysis_testfile1.C.dot inputCode_dataFlowGraphAnalysis_testfile1.pdf +# +#testGraphTraversal: graphTraversal +# ./graphTraversal +# +#testWholeGraphAST: wholeGraphAST +# ./wholeGraphAST $(srcdir)/inputCode_wholeGraphAST.C +# @echo "Building postscript file from wholeGraphAST.dot and wholeGraphASTPool.dot ..." +## $(top_srcdir)/scripts/dotgenLetterPDF wholeGraphAST.dot wholeGraphAST.ps +# $(top_srcdir)/scripts/dotgenLetterPDF wholeGraphAST1.dot wholeGraphAST.pdf +## $(top_srcdir)/scripts/dotgenLetterPDF wholeGraphASTPool.dot wholeGraphASTPool.ps +# $(top_srcdir)/scripts/dotgenLetterPDF wholeGraphASTPool1.dot wholeGraphASTPool.pdf +# +#testCustomGraphGenerationWithColors: customGraphGenerationWithColors +# ./customGraphGenerationWithColors $(srcdir)/inputCode_customGraphGenerationWithColors.C +# @echo "Building postscript file from customGraphGenerationWithColors.dot and customGraphGenerationWithColors.dot ..." +# $(top_srcdir)/scripts/dotgenLetterPDF customGraphGenerationWithColors.dot customGraphGenerationWithColors.pdf +# +#testConstantFoldingTransformation: constantFoldingTransformation +## ./customGraphGenerationWithColors $(srcdir)/inputCode_constantFoldingTransformation.C +## $(top_srcdir)/scripts/dotgenLetterPDF inputCode_constantFoldingTransformation.C.dot constantFoldingTransformation.ps +# ./constantFoldingTransformation -c $(srcdir)/inputCode_constantFoldingTransformation.C +# +## This tests the generation f an intrmediate example in the tutorial +#testConstantUnFoldingTransformation: constantUnFoldingTransformation +# ./constantUnFoldingTransformation -c $(srcdir)/inputCode_constantUnFoldingTransformation.C +# +#testSelectedFileTranslationFilterPath: selectedFileTranslation +# ./selectedFileTranslation -rose:verbose 0 -skipFile:path /home/dquinlan/ROSE -c $(srcdir)/inputCode_addComments.C +# +#testSelectedFileTranslation: selectedFileTranslation +# ./selectedFileTranslation -rose:verbose 0 -skipFile:path /nonDirectory -c $(srcdir)/inputCode_addComments.C +# +#testMultipleFiles: selectedFileTranslation +# $(VALGRIND) ./selectedFileTranslation -rose:verbose 0 -c $(srcdir)/inputCode_addComments.C $(srcdir)/inputCode_wholeGraphAST.C $(srcdir)/inputCode_constantFoldingTransformation.C $(srcdir)/inputCode_dataFlowGraphAnalysis.C $(srcdir)/inputCode_partialRedundancyElimination.C $(srcdir)/inputCode_scopeInformation.C $(srcdir)/inputCode_ExampleTraversals_4.C +# +#testVirtualFunctionIdentification: virtualFunctionIdentification +# ./virtualFunctionIdentification -c $(srcdir)/inputCode_virtualFunctionIdentification.C +# +# +#testGraphGenerationOfSubtree: graphGenerationOfSubtree +# @echo "Generating dot file ..." +# ./graphGenerationOfSubtree $(srcdir)/inputCode_graphGenerationOfSubtree.C +# @echo "Generate postscript file (default name: test.pdf) from dot file ..." +# $(top_srcdir)/scripts/dotgenLetterPDF inputCode_graphGenerationOfSubtree.subtree.dot inputCode_2.pdf +# +#testSwitchWithoutDefault: switchWithoutDefault +# ./switchWithoutDefault -rose:verbose 0 -I$(srcdir) -c $(srcdir)/inputCode_switchWithoutDefault.C +# +#testRoseSwitchWithoutDefault: switchWithoutDefault +# ./switchWithoutDefault -rose:verbose 0 -I.. $(INCLUDES) -c ../src/frontend/SageIII/Cxx_Grammar.C +# +#testAddStruct: addStruct +# ./addStruct -rose:verbose 0 -I.. $(INCLUDES) -c $(srcdir)/inputCode_addStruct.C +# +#testsnprintf: sprintf_to_snprintf +## ./sprintf_to_snprintf -rose:verbose 0 -I.. $(INCLUDES) -c $(srcdir)/inputCode_sprintf_to_snprintf.C +# ./sprintf_to_snprintf -rose:verbose 0 -c $(srcdir)/inputCode_sprintf_to_snprintf.C +# +#testSeedBugsExample_arrayIndexing: seedBugsExample_arrayIndexing +# ./seedBugsExample_arrayIndexing -rose:verbose 0 -c $(srcdir)/inputCode_seedBugsExample_arrayIndexing.C +# +#testVolatileTypeModifier: volatileTypeModifier +# ./volatileTypeModifier -rose:verbose 0 -c $(srcdir)/inputCode_volatileTypeModifier.C +# +#if ROSE_USE_DWARF +## This should only be tested if Dwarf is in use, and it should not +## be used on the Mac OSX system because we build the executable and +## ROSE does not yet handle the Mach-O executable i386 binary file format. +#inputCode_dwarfAnalysis: +# g++ -g3 -o inputCode_dwarfAnalysis $(srcdir)/inputCode_dwarfAnalysis.C +#else +#inputCode_dwarfAnalysis: +## DQ (2/12/2009): This fails when make check is run and the file ($(top_srcdir)/developersScratchSpace/Dan/Disassembler_tests/i386-nologin) +## is not available (e.g. external distributions). +## cp $(top_srcdir)/developersScratchSpace/Dan/Disassembler_tests/i386-nologin inputCode_dwarfAnalysis +# cp $(srcdir)/buffer2.bin inputCode_dwarfAnalysis +#endif +# +# +#testDwarfAnalysis: dwarfAnalysis inputCode_dwarfAnalysis +## Note: different stages of AST representation and visualization. +## ./dwarfAnalysis -c $(srcdir)/inputCode_dwarfAnalysis.C +## ./dwarfAnalysis -rose:visualize_dwarf_only inputCode_dwarfAnalysis +## ./dwarfAnalysis -rose:visualize_executable_file_format_skip_symbols inputCode_dwarfAnalysis +## ./dwarfAnalysis -rose:read_executable_file_format_only inputCode_dwarfAnalysis +## ./dwarfAnalysis -rose:read_executable_file_format_only -rose:visualize_executable_file_format_skip_symbols inputCode_dwarfAnalysis +# ./dwarfAnalysis -rose:visualize_dwarf_only -rose:read_executable_file_format_only inputCode_dwarfAnalysis +# +#testDwarfInstructionAddressToSourceLineAnalysis: dwarfInstructionAddressToSourceLineAnalysis inputCode_dwarfAnalysis +## ./dwarfAnalysis -rose:verbose 0 -c $(srcdir)/inputCode_dwarfAnalysis.C +## ./dwarfInstructionAddressToSourceLineAnalysis -rose:visualize_dwarf_only inputCode_dwarfAnalysis +# ./dwarfInstructionAddressToSourceLineAnalysis inputCode_dwarfAnalysis +# +# +## ##################################### +## Output files use in tutorial +## ##################################### +# +#traversalOutput = \ +# visitorTraversal.out \ +# prePostTraversal.out \ +# combinedTraversals.out \ +# sharedMemoryTraversals.out \ +# classicObjectOrientedVisitorPatternTraversal.out \ +# inheritedAttributeTraversal.out \ +# synthesizedAttributeTraversal.out \ +# inheritedAndSynthesizedAttributeTraversal.out \ +# accumulatorAttributeTraversal.out \ +# persistantAttributes.out \ +# visitorMemoryPoolTraversal.out \ +# classicObjectOrientedVisitorPatternMemoryPoolTraversal.out \ +# traverseIRnodeTypes.out \ +# nestedTraversal.out +# +# +# #rose_inputCode_varSubstCopy.C , temporary disabled this test, don't go into patch!,Liao +## .out suffix may cause conflicts with a temporary file used by makefile/libtool +## using a different name is highly recommended!! Liao, 10/15/2008 +#generatedCodeExamples = \ +# rose_inputCode_inlineTransformations.C \ +# rose_inputCode_partialRedundancyElimination.C \ +# rose_inputCode_tauInstrumenter.C \ +# inputCode_ASTGraphGenerator.pdf \ +# inputCode_AST_PDF_Generator.pdf \ +# inputCode_ASTWholeGraphGenerator_small.pdf \ +# inputCode_ASTWholeGraphGenerator_large.pdf \ +# rose_inputCode_IdentityTranslator.C \ +# queryLibrary.out \ +# nestedQuery.out \ +# $(traversalOutput) \ +# rose_inputCode_AddFunctionDeclaration.C \ +# rose_inputCode_AddFunctionDeclaration2.C \ +# rose_inputCode_AddFunctionDeclaration3.C \ +# rose_inputCode_AddVariableDeclaration.C \ +# rose_inputCode_AddAssignmentStmt.C \ +# abstractHandle1.outx \ +# abstractHandle2.outx \ +# rose_inputCode_AddExpression.C \ +# rose_inputCode_AddFunctionCalls.C \ +# rose_inputCode_InstrumentationTranslator.C \ +# rose_inputCode_instrumentEndOfFunction.C \ +# loopRecognition.out \ +# reductionRecognition.out \ +# typeInfoFromFunctionParameters.out \ +# resolveOverloadedFunction.out \ +# templateParameter.out \ +# rose_inputCode_LoopOptimization_blocking.C \ +# rose_inputCode_LoopOptimization_fusion.C \ +# rose_inputCode_LoopOptimization_mm.C \ +# rose_inputCode_LoopOptimization_dgemm.C \ +# rose_inputCode_LoopOptimization_lufac.C \ +# rose_inputCode_LoopOptimization_tridvpk.C \ +# controlFlowGraph.pdf \ +# vcfg.pdf \ +# debuggingIRnodeToString.out \ +# debuggingSourceCodePositionInformation.out \ +# commandlineProcessing.out \ +# charmSupport.out \ +# codeCoverage.out \ +# callGraph.pdf \ +# classHierarchyGraph.pdf \ +# rose_inputCode_templateExample1.C \ +# rose_inputCode_templateExample2.C \ +# dataBaseExample1.out \ +# loopNestingInfoProcessing.out \ +# loopProcessor.C.aa loopProcessor.C.ab \ +# generatingUniqueNamesFromDeclaration.out \ +# generatingUniqueNamesFromDeclaration2.out \ +# symbolTableHandling.out \ +# scopeInformation.out \ +# rose_inputCode_typeTransformation.C \ +# astFileIO_GenerateBinaryFile.out \ +# customGraph.pdf \ +# customGraphWithFiltering.pdf \ +# graphTraversal.pdf \ +# rose_inputCode_addComments.C \ +# rose_inputCode_addArbitraryTextForUnparser.C \ +# rose_inputCode_codeGenerationFormatControl.C \ +# rose_inputCode_addStruct.C \ +# traversalShortCircuit.out \ +# wholeGraphAST.pdf \ +# collectCommentsSkipHeaderFiles.out \ +# collectCommentsAcrossHeaderFiles.out \ +# collectDefineDirectives.out \ +# defuseAnalysis_pic1.pdf \ +# binaryAnalysis_pic1.pdf \ +# binaryAnalysis_pic3.pdf \ +# rose_inputCode_seedBugsExample_arrayIndexing.C \ +# rose_inputCode_VolatileTypeModifier.C \ +# inputCode_dwarfAnalysis.pdf \ +# inputCode_dwarfAnalysis.out +# +## ##################################### +## Output file generation rules +## ##################################### +# +#inputCode_ASTGraphGenerator.pdf: ASTGraphGenerator +# @echo "Generating required documentation for tutorial (inputCode_ASTGraphGenerator.pdf) ..." +## Build smaller versions of these files (so that they fit onto two separate pages (within the tutorial)) +# split -80 $(srcdir)/addFunctionDeclaration.C addFunctionDeclaration. +# split -80 $(srcdir)/inheritedAndSynthesizedAttributeTraversal.C inheritedAndSynthesizedAttributeTraversal. +# split -64 $(srcdir)/loopRecognition.C loopRecognition. +# ./ASTGraphGenerator $(ROSE_FLAGS) $(srcdir)/inputCode_ASTGraphGenerator.C +# @echo "Generate postscript file (default name: test.pdf) from dot file ..." +# $(top_srcdir)/scripts/dotgenLetterPDF inputCode_ASTGraphGenerator.C.dot inputCode_ASTGraphGenerator.pdf +# +#inputCode_AST_PDF_Generator.pdf: AST_PDF_Generator +# @echo "Generating required documentation for tutorial (inputCode_AST_PDF_Generator.pdf) ..." +# @echo "Reusing the same inputCode_ASTGraphGenerator.C as for the DOT graph (but copy to new name) ..." +# cp $(srcdir)/inputCode_ASTGraphGenerator.C inputCode_AST_PDF_Generator.C +# ./AST_PDF_Generator $(ROSE_FLAGS) inputCode_AST_PDF_Generator.C +# cp -f inputCode_AST_PDF_Generator.C.pdf inputCode_AST_PDF_Generator.pdf +# +#inputCode_ASTWholeGraphGenerator_small.pdf: wholeASTGraphGenerator +# @echo "Generating dot file of whole AST ..." +# ./wholeASTGraphGenerator $(srcdir)/inputCode_wholeAST_1.C +# @echo "Generate pdf file (default name: test.pdf) from dot file ..." +# $(top_srcdir)/scripts/dotgenLetterPDF inputCode_wholeAST_1_WholeAST.dot inputCode_ASTWholeGraphGenerator_small.pdf +# +#inputCode_ASTWholeGraphGenerator_large.pdf: wholeASTGraphGenerator +# @echo "Generating dot file of whole AST ..." +# ./wholeASTGraphGenerator $(srcdir)/inputCode_wholeAST_2.C +# @echo "Generate pdf file (default name: test.pdf) from dot file ..." +# $(top_srcdir)/scripts/dotgenLetterPDF inputCode_wholeAST_2_WholeAST.dot inputCode_ASTWholeGraphGenerator_large.pdf +# +#rose_inputCode_IdentityTranslator.C: identityTranslator +# @echo "Generate executable from compilation of input code (identityTranslator) ..." +# ./identityTranslator $(ROSE_FLAGS) -c $(srcdir)/inputCode_IdentityTranslator.C +# +#queryLibrary.out: queryLibraryExample +# @echo "Generate executable from compilation of input code (queryLibraryExample) ..." +# ./queryLibraryExample $(ROSE_FLAGS) -c $(srcdir)/inputCode_QueryLibrary.C > queryLibrary.out +# +#nestedQuery.out: nestedQueryExample +# @echo "Generate executable from compilation of input code (nestedQueryExample) ..." +# ./nestedQueryExample $(ROSE_FLAGS) -c $(srcdir)/inputCode_NestedQuery.C > nestedQuery.out +# +## DQ (9/7/2006): These need separate rules so that when using "make -j" each is run by at most only one process. +## traversalExecutables = \ +## visitorTraversal \ +## classicObjectOrientedVisitorPatternTraversal \ +## inheritedAttributeTraversal \ +## synthesizedAttributeTraversal \ +## inheritedAndSynthesizedAttributeTraversal \ +## accumulatorAttributeTraversal \ +## persistantAttributes \ +## visitorMemoryPoolTraversal \ +## classicObjectOrientedVisitorPatternMemoryPoolTraversal \ +## nestedTraversal +## $(traversalOutput): $(traversalExecutables) +## @echo "Generate executable from compilation of input code (visitorTraversal) ..." +## ./visitorTraversal $(ROSE_FLAGS) -c $(srcdir)/inputCode_ExampleTraversals_5.C > visitorTraversal.out +## @echo "Generate executable from compilation of input code (classicObjectOrientedVisitorPatternTraversal) ..." +## ./classicObjectOrientedVisitorPatternTraversal $(ROSE_FLAGS) -c $(srcdir)/inputCode_ExampleTraversals_6.C > classicObjectOrientedVisitorPatternTraversal.out +## @echo "Generate executable from compilation of input code (inheritedAttributeTraversal) ..." +## ./inheritedAttributeTraversal $(ROSE_FLAGS) -c $(srcdir)/inputCode_ExampleTraversals_7.C > inheritedAttributeTraversal.out +## @echo "Generate executable from compilation of input code (synthesizedAttributeTraversal) ..." +## ./synthesizedAttributeTraversal $(ROSE_FLAGS) -c $(srcdir)/inputCode_ExampleTraversals_8.C > synthesizedAttributeTraversal.out +## @echo "Generate executable from compilation of input code (inheritedAndSynthesizedAttributeTraversal) ..." +## ./inheritedAndSynthesizedAttributeTraversal $(ROSE_FLAGS) -c $(srcdir)/inputCode_ExampleTraversals_9.C > inheritedAndSynthesizedAttributeTraversal.out +## @echo "Generate executable from compilation of input code (accumulatorAttributeTraversal) ..." +## ./accumulatorAttributeTraversal $(ROSE_FLAGS) -c $(srcdir)/inputCode_ExampleTraversals_10.C > accumulatorAttributeTraversal.out +## @echo "Generate executable from compilation of input code (nestedTraversal) ..." +## ./nestedTraversal $(ROSE_FLAGS) -c $(srcdir)/inputCode_ExampleTraversals_11.C > nestedTraversal.out +## @echo "Generate executable from compilation of input code (persistantAttributes) ..." +## ./persistantAttributes $(ROSE_FLAGS) -c $(srcdir)/inputCode_ExampleTraversals_12.C > persistantAttributes.out +## @echo "Generate executable from compilation of input code (visitorMemoryPoolTraversal) ..." +## ./visitorMemoryPoolTraversal $(ROSE_FLAGS) -c $(srcdir)/inputCode_ExampleTraversals_13.C > visitorMemoryPoolTraversal.out +## @echo "Generate executable from compilation of input code (classicObjectOrientedVisitorPatternMemoryPoolTraversal) ..." +## ./classicObjectOrientedVisitorPatternMemoryPoolTraversal $(ROSE_FLAGS) -c $(srcdir)/inputCode_ExampleTraversals_14.C > classicObjectOrientedVisitorPatternMemoryPoolTraversal.out +## @echo "Generate executable from compilation of input code (traverseIRnodeTypes) ..." +## ./traverseIRnodeTypes $(ROSE_FLAGS) -c $(srcdir)/inputCode_ExampleTraversals_15.C > traverseIRnodeTypes.out +# +## DQ (9/7/2006): These need separate rules so that when using "make -j" each is run by at most only one process. +#visitorTraversal.out: visitorTraversal +# @echo "Generate executable from compilation of input code (visitorTraversal) ..." +# ./visitorTraversal $(ROSE_FLAGS) -c $(srcdir)/inputCode_ExampleTraversals_5.C > visitorTraversal.out +# +#prePostTraversal.out: prePostTraversal +# @echo "Generate executable from compilation of input code (prePostTraversal) ..." +# ./prePostTraversal $(ROSE_FLAGS) -c $(srcdir)/inputCode_ExampleTraversals_16.C > prePostTraversal.out +# +#combinedTraversals.out: combinedTraversals +# @echo "Generate executable from compilation of input code (combinedTraversals) ..." +# ./combinedTraversals $(ROSE_FLAGS) -c $(srcdir)/inputCode_ExampleTraversals_17.C > combinedTraversals.out +# +## DQ (3/21/2009): sharedMemoryTraversals fails to compile under Cygwin. +#if ROSE_BUILD_OS_IS_CYGWIN +#sharedMemoryTraversals.out: +# @echo "Commented out shared memory tests for Cygwin (sharedMemoryTraversals fails to compile) ..." +# touch sharedMemoryTraversals.out +#else +#sharedMemoryTraversals.out: sharedMemoryTraversals +# @echo "Generate executable from compilation of input code (sharedMemoryTraversals) ..." +# ./sharedMemoryTraversals $(ROSE_FLAGS) -c $(srcdir)/inputCode_ExampleTraversals_18.C > sharedMemoryTraversals.out +#endif +# +#classicObjectOrientedVisitorPatternTraversal.out: classicObjectOrientedVisitorPatternTraversal +# @echo "Generate executable from compilation of input code (classicObjectOrientedVisitorPatternTraversal) ..." +# ./classicObjectOrientedVisitorPatternTraversal $(ROSE_FLAGS) -c $(srcdir)/inputCode_ExampleTraversals_6.C > classicObjectOrientedVisitorPatternTraversal.out +# +#inheritedAttributeTraversal.out: inheritedAttributeTraversal +# @echo "Generate executable from compilation of input code (inheritedAttributeTraversal) ..." +# ./inheritedAttributeTraversal $(ROSE_FLAGS) -c $(srcdir)/inputCode_ExampleTraversals_7.C > inheritedAttributeTraversal.out +# +#synthesizedAttributeTraversal.out: synthesizedAttributeTraversal +# @echo "Generate executable from compilation of input code (synthesizedAttributeTraversal) ..." +# ./synthesizedAttributeTraversal $(ROSE_FLAGS) -c $(srcdir)/inputCode_ExampleTraversals_8.C > synthesizedAttributeTraversal.out +# +#inheritedAndSynthesizedAttributeTraversal.out: inheritedAndSynthesizedAttributeTraversal +# @echo "Generate executable from compilation of input code (inheritedAndSynthesizedAttributeTraversal) ..." +# ./inheritedAndSynthesizedAttributeTraversal $(ROSE_FLAGS) -c $(srcdir)/inputCode_ExampleTraversals_9.C > inheritedAndSynthesizedAttributeTraversal.out +# +#accumulatorAttributeTraversal.out: accumulatorAttributeTraversal +# @echo "Generate executable from compilation of input code (accumulatorAttributeTraversal) ..." +# ./accumulatorAttributeTraversal $(ROSE_FLAGS) -c $(srcdir)/inputCode_ExampleTraversals_10.C > accumulatorAttributeTraversal.out +# +#nestedTraversal.out: nestedTraversal +# @echo "Generate executable from compilation of input code (nestedTraversal) ..." +# ./nestedTraversal $(ROSE_FLAGS) -c $(srcdir)/inputCode_ExampleTraversals_11.C > nestedTraversal.out +# +#persistantAttributes.out: persistantAttributes +# @echo "Generate executable from compilation of input code (persistantAttributes) ..." +# ./persistantAttributes $(ROSE_FLAGS) -c $(srcdir)/inputCode_ExampleTraversals_12.C > persistantAttributes.out +# +#visitorMemoryPoolTraversal.out: visitorMemoryPoolTraversal +# @echo "Generate executable from compilation of input code (visitorMemoryPoolTraversal) ..." +# ./visitorMemoryPoolTraversal $(ROSE_FLAGS) -c $(srcdir)/inputCode_ExampleTraversals_13.C > visitorMemoryPoolTraversal.out +# +#classicObjectOrientedVisitorPatternMemoryPoolTraversal.out: classicObjectOrientedVisitorPatternMemoryPoolTraversal +# @echo "Generate executable from compilation of input code (classicObjectOrientedVisitorPatternMemoryPoolTraversal) ..." +# ./classicObjectOrientedVisitorPatternMemoryPoolTraversal $(ROSE_FLAGS) -c $(srcdir)/inputCode_ExampleTraversals_14.C > classicObjectOrientedVisitorPatternMemoryPoolTraversal.out +# +#traverseIRnodeTypes.out: traverseIRnodeTypes +# @echo "Generate executable from compilation of input code (traverseIRnodeTypes) ..." +# ./traverseIRnodeTypes $(ROSE_FLAGS) -c $(srcdir)/inputCode_ExampleTraversals_15.C > traverseIRnodeTypes.out +# +# +#rose_inputCode_AddFunctionDeclaration.C: addFunctionDeclaration +# @echo "Generate executable from compilation of input code (addFunctionDeclaration) ..." +# ./addFunctionDeclaration $(ROSE_FLAGS) -c $(srcdir)/inputCode_AddFunctionDeclaration.C +# +#rose_inputCode_AddFunctionDeclaration2.C: addFunctionDeclaration2 +# @echo "Generate executable from compilation of input code (addFunctionDeclaration2) ..." +# ./addFunctionDeclaration2 $(ROSE_FLAGS) -c $(srcdir)/inputCode_AddFunctionDeclaration2.C +# +#rose_inputCode_AddFunctionDeclaration3.C: addFunctionDeclaration3 +# @echo "Generate executable from compilation of input code (addFunctionDeclaration3) ..." +# ./addFunctionDeclaration3 $(ROSE_FLAGS) -c $(srcdir)/inputCode_AddFunctionDeclaration3.C +# +#rose_inputCode_AddVariableDeclaration.C: addVariableDeclaration +# @echo "Generate executable from compilation of input code (addVariableDeclaration) ..." +# ./addVariableDeclaration $(ROSE_FLAGS) -c $(srcdir)/inputCode_AddVariableDeclaration.C +# +#rose_inputCode_AddVariableDeclaration2.C: addVariableDeclaration2 +# @echo "Generate executable from compilation of input code (addVariableDeclaration2) ..." +# ./addVariableDeclaration2 $(ROSE_FLAGS) -c $(srcdir)/inputCode_AddVariableDeclaration2.C +# +#abstractHandle1.outx: abstractHandle1 +# @echo "Generate executable from compilation of input code (abstractHandle1) ..." +# ./abstractHandle1 $(ROSE_FLAGS) -c $(srcdir)/inputCode_AbstractHandle1.cpp | fold > abstractHandle1.outx +# +#abstractHandle2.outx: abstractHandle2 +# @echo "Generate executable from compilation of input code (abstractHandle2) ..." +# ./abstractHandle2 $(ROSE_FLAGS) -c $(srcdir)/inputCode_AbstractHandle2.cpp | fold > abstractHandle2.outx +# +#rose_inputCode_AddAssignmentStmt.C: addAssignmentStmt +# @echo "Generate executable from compilation of input code (addAssignmentStmt) ..." +# ./addAssignmentStmt $(ROSE_FLAGS) -c $(srcdir)/inputCode_AddAssignmentStmt.C +# +#rose_inputCode_AddExpression.C: addExpression +# @echo "Generate executable from compilation of input code (addExpression) ..." +# ./addExpression $(ROSE_FLAGS) -c $(srcdir)/inputCode_AddExpression.C +# +#rose_inputCode_AddFunctionCalls.C: addFunctionCalls +# @echo "Generate executable from compilation of input code (addFunctionCalls) ..." +# ./addFunctionCalls $(ROSE_FLAGS) -c $(srcdir)/inputCode_AddFunctionCalls.C +# +#rose_inputCode_InstrumentationTranslator.C: instrumentationExample +# @echo "Generate executable from compilation of input code ..." +# ./instrumentationExample $(ROSE_FLAGS) -c $(srcdir)/inputCode_InstrumentationTranslator.C +# +#rose_inputCode_instrumentEndOfFunction.C: instrumentEndOfFunction +# @echo "Generate executable from compilation of input code ..." +# ./instrumentEndOfFunction $(ROSE_FLAGS) -c $(srcdir)/inputCode_instrumentEndOfFunction.C +#reductionRecognition.out: reductionRecognition +# @echo "Generate executable from compilation of input code ..." +# ./reductionRecognition $(ROSE_FLAGS) -c $(srcdir)/inputCode_reductionRecognition.C >reductionRecognition.out +# +#loopRecognition.out: loopRecognition +# @echo "Generate executable from compilation of input code (loopRecognition) ..." +# ./loopRecognition $(ROSE_FLAGS) -c $(srcdir)/inputCode_LoopRecognition.C > loopRecognition.out +# +#typeInfoFromFunctionParameters.out: typeInfoFromFunctionParameters +# @echo "Generate executable from compilation of input code (typeInfoFromFunctionParameters) ..." +# ./typeInfoFromFunctionParameters $(ROSE_FLAGS) -c $(srcdir)/inputCode_TypeInfoFromFunctionParameters.C > typeInfoFromFunctionParameters.out +# +#resolveOverloadedFunction.out: resolveOverloadedFunction +# @echo "Generate executable from compilation of input code (resolveOverloadedFunction) ..." +# ./resolveOverloadedFunction $(ROSE_FLAGS) -c $(srcdir)/inputCode_ResolvingOverloadedFunctions.C > resolveOverloadedFunction.out +# +#templateParameter.out: templateParameter $(srcdir)/inputCode_TemplateParameterExtration.C +# @echo "Generate executable from compilation of input code (templateParameter) ..." +# ./templateParameter $(ROSE_FLAGS) -c $(srcdir)/inputCode_TemplateParameterExtration.C > templateParameter.out +# +#rose_inputCode_LoopOptimization_blocking.C: loopOptimization +# @echo "Generate executable from compilation of input code (loopOptimization) ..." +# $(VALGRIND) ./loopOptimization $(ROSE_FLAGS) -bk1 -fs0 -c $(srcdir)/inputCode_LoopOptimization_blocking.C +# +#loopProcessor.C.aa loopProcessor.C.ab: $(srcdir)/LoopProcessor.C +# split -42 $(srcdir)/LoopProcessor.C loopProcessor.C. +# +#rose_inputCode_LoopOptimization_fusion.C: loopOptimization +# @echo "Generate executable from compilation of input code (loopOptimization) ..." +# ./loopOptimization $(ROSE_FLAGS) -fs2 -c $(srcdir)/inputCode_LoopOptimization_fusion.C +# +#rose_inputCode_LoopOptimization_mm.C: loopProcessor +# @echo "Generate executable from compilation of input code (loopOptimization) ..." +## ./loopOptimization -bk1 -fs0 -c $(srcdir)/inputCode_LoopOptimization_mm.C +## DQ (1/2/2008): This used to work, but it is part of what Qing is fixing. +# $(VALGRIND) ./loopProcessor $(ROSE_FLAGS) -bk1 -fs0 -c $(srcdir)/inputCode_LoopOptimization_mm.C +# +#rose_inputCode_LoopOptimization_dgemm.C: loopProcessor +# @echo "Generate executable from compilation of input code (loopOptimization) ..." +# ./loopProcessor $(ROSE_FLAGS) -bk1 -unroll nvar 16 -c $(srcdir)/inputCode_LoopOptimization_dgemm.C +# +#rose_inputCode_LoopOptimization_lufac.C: loopProcessor +# @echo "Generate executable from compilation of input code (loopOptimization) ..." +# ./loopProcessor $(ROSE_FLAGS) -bk1 -fs0 -splitloop -annotation -c $(srcdir)/inputCode_LoopOptimization_lufac.C +# +#rose_inputCode_LoopOptimization_tridvpk.C: loopProcessor +# @echo "Generate executable from compilation of input code (loopOptimization) ..." +# ./loopProcessor $(ROSE_FLAGS) -fs2 -ic1 -opt 1 -c $(srcdir)/inputCode_LoopOptimization_tridvpk.C +# +#controlFlowGraph.pdf: buildCFG +# @echo "Building an example Control Flow Graph (buildCFG) ..." +# ./buildCFG $(ROSE_FLAGS) $(srcdir)/inputCode_ControlFlowGraphAnalysis.C +# @echo "Building postscript file from main.dot ..." +# $(top_srcdir)/scripts/dotgenLetterPDF main.dot controlFlowGraph.pdf +# +#vcfg.pdf: virtualCFG +# @echo "Building an example virtual Control Flow Graph (virtualCFG) ..." +# ./virtualCFG $(ROSE_FLAGS) $(srcdir)/inputCode_ControlFlowGraphAnalysis.C > vcfg.dot || (rm -f vcfg.dot; exit 1) +# $(top_srcdir)/scripts/dotgenLetterPDF vcfg.dot vcfg.pdf +# +#defuseAnalysis_pic1.pdf: defuseAnalysis +# @echo "Building an example DefUse ..." +# ./defuseAnalysis $(ROSE_FLAGS) $(srcdir)/input_defuseAnalysis.C +# @echo "DefUseAnalysis: Building postscript file from foo.dot ..." +# $(top_srcdir)/scripts/dotgenLetterPDF dfa.dot defuseAnalysis_pic1.pdf +# +# +# +#binaryAnalysis_pic1.pdf: binaryAnalysis +# @echo "Building an example BinaryAnalysis ..." +## This does currently not work because we don't support 64bit binaries +## ./binaryAnalysis bin_example +## trick is to load a 32bit binary +# cp $(srcdir)/buffer2.bin ./bin_example +# ./binaryAnalysis bin_example +# @echo "BinaryAnalysis: Building assembly listing for binary (rose_bin_example.s.a) ..." +# split -42 rose_bin_example.s rose_bin_example.s. +# @echo "BinaryAnalysis: Building postscript file from cfg.dot & dfg.dot ..." +# $(top_srcdir)/scripts/dotgenLetterPDF cfg.dot binaryAnalysis_pic1.pdf +# $(top_srcdir)/scripts/dotgenLetterPDF dfg.dot binaryAnalysis_pic2.pdf +# +## DQ (8/17/2008): Added example to show how to use traversal on AST for binary executable format. +#binaryAnalysis_pic3.pdf: binaryAnalysis_symbolTable +# @echo "Building an example BinaryAnalysis ..." +# cp -f $(srcdir)/buffer2.bin ./bin_example_2 +# ./binaryAnalysis_symbolTable -rose:read_executable_file_format_only bin_example_2 +## DQ (9/6/2008): We are not ready for these yet, so don't generate them. +## @echo "BinaryAnalysis: Building postscript file from AST and whole graph dot files..." +# $(top_srcdir)/scripts/dotgenLetterPDF bin_example_2_WholeAST.dot binaryAnalysis_pic3.pdf +# $(top_srcdir)/scripts/dotgenLetterPDF bin_example_2.dot binaryAnalysis_pic4.pdf +# +## rose_bin_example.s.aa: binaryAnalysis_pic1.pdf +# +#debuggingIRnodeToString.out: debuggingIRnodeToString +# @echo "Generate executable from compilation of input code (debuggingIRnodeToString) ..." +# ./debuggingIRnodeToString $(ROSE_FLAGS) -c $(srcdir)/inputCode_ExampleDebugging.C > debuggingIRnodeToString.out +# +#debuggingSourceCodePositionInformation.out: debuggingSourceCodePositionInformation +# @echo "Generate executable from compilation of input code (debuggingSourceCodePositionInformation) ..." +# ./debuggingSourceCodePositionInformation $(ROSE_FLAGS) -c $(srcdir)/inputCode_ExampleDebugging.C > debuggingSourceCodePositionInformation.out +# +#commandlineProcessing.out: commandlineProcessing +# @echo "Generate executable from compilation of input code (commandlineProcessing) ..." +# ./commandlineProcessing $(ROSE_FLAGS) -c $(srcdir)/inputCode_ExampleDebugging.C -edg:restrict -myTranslator:verbose 42 > commandlineProcessing.out +# +#charmSupport.out: charmSupport +# @echo "Generate executable from compilation of input code (charmSupport) ..." +# ./charmSupport $(ROSE_FLAGS) -c $(srcdir)/inputCode_ExampleCharmSupport.C > charmSupport.out +# split -80 $(srcdir)/CharmSupport.C CharmSupport. +# +#codeCoverage.out: codeCoverage $(srcdir)/inputCode_ExampleCodeCoverage.C +# @echo "Generate executable from compilation of input code (codeCoverage) ..." +## While in development just run without building codeCoverage.out (and touch codeCoverage.out to allow makefile to work) +# ./codeCoverage $(ROSE_FLAGS) -c $(srcdir)/inputCode_ExampleCodeCoverage.C +## link the input file with the coverageCodeFromShmuel.o file (written by Shmuel, tool specific) +# $(CXX) -o ExampleCodeCoverage_GeneratedBinary inputCode_ExampleCodeCoverage.o coverageCodeFromShmuel.o +## Run the input code (collect any output in codeCoverage.out) +# ./ExampleCodeCoverage_GeneratedBinary > codeCoverage.out +# split -80 $(srcdir)/codeCoverage.C codeCoverage. +# +## DQ (4/10/2006): Not clear on which CG program we want! +#callGraph.pdf: callGraphAnalysis buildCG +# @echo "Generate call graph from processing of input code (callGraph) ..." +## ./callGraphAnalysis -c $(srcdir)/inputCode_CallGraphAnalysis.C +# ./buildCG $(ROSE_FLAGS) -c $(srcdir)/inputCode_CallGraphAnalysis.C +## $(top_srcdir)/scripts/dotgenLetterPDF callgraph.dot callGraph.ps +## $(top_srcdir)/scripts/dotgen callgraph.dot callGraph.ps +## $(top_srcdir)/scripts/dotgen DATABASE.dot callGraph.ps +# $(top_srcdir)/scripts/dotgenLetterPDF callGraph.dot callGraph.pdf +# +#classHierarchyGraph.pdf: classHierarchyGraph +# ./classHierarchyGraph $(srcdir)/inputCode_ClassHierarchyGraph.C +# @echo "Building postscript file from classHier.dot ..." +# $(top_srcdir)/scripts/dotgenLetterPDF classHier.dot classHierarchyGraph.pdf +# +#rose_inputCode_templateExample1.C: identityTranslator $(srcdir)/inputCode_templateExample1.C +# @echo "Generate executable from compilation of input code (template example #1) ..." +# ./identityTranslator $(ROSE_FLAGS) -c $(srcdir)/inputCode_templateExample1.C +# +#rose_inputCode_templateExample2.C: identityTranslator $(srcdir)/inputCode_templateExample2.C +# @echo "Generate executable from compilation of input code (template example #2) ..." +# ./identityTranslator $(ROSE_FLAGS) -c $(srcdir)/inputCode_templateExample2.C +# +#dataBaseExample1.out: dataBaseUsage +# @echo "Generate data base from compilation of input code (data base example #1) ..." +## Build smaller versions of these files (so that they fit onto two separate pages (within the tutorial)) +# split -64 $(srcdir)/dataBaseUsage.C dataBaseUsage. +# ./dataBaseUsage $(ROSE_FLAGS) -c $(srcdir)/inputCode_dataBaseExample1.C > dataBaseExample1.out +# +#loopNestingInfoProcessing.out: loopNestingInfoProcessing $(srcdir)/inputCode_loopNestingInfoProcessing.C +# @echo "Generate executable from compilation of input code (loopNestingInfoProcessing) ..." +# split -l80 $(srcdir)/loopNestingInfoProcessing.C loopNestingInfoProcessing. +# ./loopNestingInfoProcessing $(ROSE_FLAGS) -c $(srcdir)/inputCode_loopNestingInfoProcessing.C > loopNestingInfoProcessing.out +# +#rose_inputCode_typeTransformation.C: typeTransformation +# ./typeTransformation $(ROSE_FLAGS) -c $(srcdir)/inputCode_typeTransformation.C +# +#astFileIO_GenerateBinaryFile.out: astFileIO_GenerateBinaryFile +# ./astFileIO_GenerateBinaryFile $(ROSE_FLAGS) -c $(srcdir)/inputCode_astFileIO_GenerateBinaryFile.C > astFileIO_temp.out +# head -n 20 astFileIO_temp.out > astFileIO_GenerateBinaryFile.out +## echo "File I/O temporarily disabled!" > astFileIO_GenerateBinaryFile.out +# +#generatingUniqueNamesFromDeclaration.out: generatingUniqueNamesFromDeclaration +# ./generatingUniqueNamesFromDeclaration $(ROSE_FLAGS) -c $(srcdir)/inputCode_generatingUniqueNamesFromDeclaration.C | grep -v rose_edg_macros_and_functions_required_for_gnu > generatingUniqueNamesFromDeclaration.out +# +#generatingUniqueNamesFromDeclaration2.out: generatingUniqueNamesFromDeclaration +# ./generatingUniqueNamesFromDeclaration $(ROSE_FLAGS) -c $(srcdir)/inputCode_generatingUniqueNamesFromDeclaration2.C | grep -v rose_edg_macros_and_functions_required_for_gnu > generatingUniqueNamesFromDeclaration2.out +## echo "Test Failed!" > generatingUniqueNamesFromDeclaration2.out +# +#symbolTableHandling.out: symbolTableHandling +# ./symbolTableHandling $(ROSE_FLAGS) -c $(srcdir)/inputCode_testsymbolTableHandling.C > symbolTableHandling.out +# +#scopeInformation.out: scopeInformation +# ./scopeInformation $(ROSE_FLAGS) -c $(srcdir)/inputCode_scopeInformation.C > scopeInformation.out +# +#rose_inputCode_tauInstrumenter.C: tauInstrumenter +## ./tauInstrumenter $(ROSE_FLAGS) $(TAU_INCLUDES) -c $(srcdir)/inputCode_tauInstrumenter.C +# echo "Test Failed!" > rose_inputCode_tauInstrumenter.C +# +#rose_inputCode_inlineTransformations.C: inlineTransformations +# ./inlineTransformations $(ROSE_FLAGS) -c $(srcdir)/inputCode_inlineTransformations.C +# +#customGraph.pdf: customGraphGeneration +# ./customGraphGeneration +# @echo "Building postscript file from foo.dot ..." +# $(top_srcdir)/scripts/dotgenLetterPDF customGraph.dot customGraph.pdf +# +#customGraphWithFiltering.pdf: customGraphGenerationWithFiltering +# ./customGraphGenerationWithFiltering +# $(top_srcdir)/scripts/dotgenLetterPDF customGraphWithFiltering.dot customGraphWithFiltering.pdf +# +#graphTraversal.pdf: graphTraversal +# ./graphTraversal +# $(top_srcdir)/scripts/dotgenLetterPDF graphTraversal.dot graphTraversal.pdf +# +## Liao, 2/13/2008 , added this +#rose_inputCode_addStruct.C:addStruct +# ./addStruct $(ROSE_FLAGS) -c $(srcdir)/inputCode_addStruct.C +# +#rose_inputCode_addComments.C: addComments +# ./addComments $(ROSE_FLAGS) -c $(srcdir)/inputCode_addComments.C +# +#rose_inputCode_addArbitraryTextForUnparser.C: addArbitraryTextForUnparser +#if ROSE_BUILD_OS_IS_CYGWIN +## DQ (3/21/2009): These tests don't appear to run under Cygwin. +# @echo "Cygwin test of addArbitraryTextForUnparser fails ..." +# touch rose_inputCode_addArbitraryTextForUnparser.C +#else +# ./addArbitraryTextForUnparser $(ROSE_FLAGS) -c $(srcdir)/inputCode_addArbitraryTextForUnparser.C +#endif +# +#collectCommentsSkipHeaderFiles.out: collectComments +# ./collectComments $(ROSE_FLAGS) -I$(srcdir) -c $(srcdir)/inputCode_collectComments.C > collectCommentsSkipHeaderFiles.out +# +#collectCommentsAcrossHeaderFiles.out: collectComments +# ./collectComments $(ROSE_FLAGS) -rose:collectAllCommentsAndDirectives -I$(srcdir) -c $(srcdir)/inputCode_collectComments.C > collectCommentsAcrossHeaderFiles.out +# +#collectDefineDirectives.out: collectDefineDirectives +# ./collectDefineDirectives $(ROSE_FLAGS) -rose:collectAllCommentsAndDirectives -I$(srcdir) -c $(srcdir)/inputCode_collectComments.C > collectDefineDirectives.out +# +#rose_inputCode_partialRedundancyElimination.C: partialRedundancyElimination +# ./partialRedundancyElimination $(ROSE_FLAGS) -c $(srcdir)/inputCode_partialRedundancyElimination.C +# +#rose_inputCode_codeGenerationFormatControl.C: codeGenerationFormatControl +# ./codeGenerationFormatControl $(ROSE_FLAGS) -c $(srcdir)/inputCode_codeGenerationFormatControl.C +# +##rose_inputCode_varSubstCopy.C: varSubstCopy +## ./varSubstCopy $(ROSE_FLAGS) -c $(srcdir)/inputCode_varSubstCopy.C +# +#dataFlowGraph.pdf: dataFlowGraph +# @echo "Generate the data flow graph from processing of input code (dataFlowGraph) ..." +# ./callGraphAnalysis $(ROSE_FLAGS) -c $(srcdir)/inputCode_dataFlowGraphAnalysis.C +## $(top_srcdir)/scripts/dotgenLetterPDF callgraph.dot dataFlowGraph.ps +## $(top_srcdir)/scripts/dotgen inputCode_dataFlowGraphAnalysis.C.dot dataFlowGraph.ps +# $(top_srcdir)/scripts/dotgenLetterPDF inputCode_dataFlowGraphAnalysis.C.dot dataFlowGraph.pdf +# +#traversalShortCircuit.out: traversalShortCircuit +# ./traversalShortCircuit $(ROSE_FLAGS) -c $(srcdir)/inputCode_traversalShortCircuit.C > traversalShortCircuit.out +# +#wholeGraphAST.pdf: wholeGraphAST +# ./wholeGraphAST $(ROSE_FLAGS) $(srcdir)/inputCode_wholeGraphAST.C +# @echo "Building postscript file from wholeGraphAST.dot and wholeGraphASTPool.dot ..." +# $(top_srcdir)/scripts/dotgenLetterPDF wholeGraphAST1.dot wholeGraphAST.pdf +# $(top_srcdir)/scripts/dotgenLetterPDF wholeGraphASTPool1.dot wholeGraphASTPool.pdf +# +#rose_inputCode_seedBugsExample_arrayIndexing.C: seedBugsExample_arrayIndexing +# ./seedBugsExample_arrayIndexing $(ROSE_FLAGS) -c $(srcdir)/inputCode_seedBugsExample_arrayIndexing.C +# +#rose_inputCode_VolatileTypeModifier.C: volatileTypeModifier +# ./volatileTypeModifier $(ROSE_FLAGS) -c $(srcdir)/inputCode_VolatileTypeModifier.C +# +#inputCode_dwarfAnalysis.pdf: dwarfAnalysis inputCode_dwarfAnalysis +# ./dwarfAnalysis -rose:visualize_dwarf_only -rose:read_executable_file_format_only inputCode_dwarfAnalysis +# $(top_srcdir)/scripts/dotgenLetterPDF inputCode_dwarfAnalysis.dot inputCode_dwarfAnalysis.pdf +# +#inputCode_dwarfAnalysis.out: dwarfInstructionAddressToSourceLineAnalysis inputCode_dwarfAnalysis +# ./dwarfInstructionAddressToSourceLineAnalysis inputCode_dwarfAnalysis > inputCode_dwarfAnalysis.out +# +# +# +## Note that we have made multiple copies of "inputCode_ExampleTraversals.C" +## so that the processing could be done in parallel with out collisions. +#EXTRA_DIST = \ +# inputCode_1.C \ +# inputCode_BuildCFG.C \ +# inputCode_InstrumentationTranslator.C \ +# inputCode_instrumentEndOfFunction.C \ +# inputCode_wholeAST_1.C \ +# inputCode_wholeAST_2.C \ +# inputCode_QueryLibrary.C \ +# inputCode_AddFunctionDeclaration.C \ +# inputCode_AddFunctionDeclaration2.C \ +# inputCode_AddFunctionDeclaration3.C \ +# inputCode_AddExpression.C \ +# inputCode_AddAssignmentStmt.C \ +# inputCode_AbstractHandle1.cpp \ +# inputCode_AbstractHandle2.cpp \ +# inputCode_AddFunctionCalls.C \ +# inputCode_ExampleDebugging.C \ +# inputCode_LoopOptimization.C \ +# inputCode_ResolvingOverloadedFunctions.C \ +# inputCode_AddVariableDeclaration.C \ +# inputCode_ExampleTraversals.C \ +# inputCode_ExampleTraversals_1.C \ +# inputCode_ExampleTraversals_2.C \ +# inputCode_ExampleTraversals_3.C \ +# inputCode_ExampleTraversals_4.C \ +# inputCode_ExampleTraversals_5.C \ +# inputCode_ExampleTraversals_6.C \ +# inputCode_ExampleTraversals_7.C \ +# inputCode_ExampleTraversals_8.C \ +# inputCode_ExampleTraversals_9.C \ +# inputCode_ExampleTraversals_10.C \ +# inputCode_ExampleTraversals_11.C \ +# inputCode_ExampleTraversals_12.C \ +# inputCode_ExampleTraversals_13.C \ +# inputCode_ExampleTraversals_14.C \ +# inputCode_ExampleTraversals_15.C \ +# inputCode_ExampleTraversals_16.C \ +# inputCode_ExampleTraversals_17.C \ +# inputCode_ExampleTraversals_18.C \ +# inputCode_LoopOptimization_blocking.C \ +# inputCode_LoopOptimization_fusion.C \ +# inputCode_LoopOptimization_mm.C \ +# inputCode_LoopOptimization_dgemm.C \ +# inputCode_LoopOptimization_lufac.C \ +# inputCode_LoopOptimization_tridvpk.C \ +# inputCode_TemplateParameterExtration.C \ +# inputCode_ASTGraphGenerator.C \ +# inputCode_IdentityTranslator.C \ +# inputCode_LoopRecognition.C \ +# inputCode_TypeInfoFromFunctionParameters.C \ +# inputCode_ExampleCodeCoverage.C \ +# exampleMakefile.in \ +# slicingExample.C \ +# inputCode_ExampleCharmSupport.C \ +# inputCode_CallGraphAnalysis.C \ +# inputCode_templateExample1.C \ +# inputCode_templateExample2.C \ +# inputCode_dataBaseExample1.C \ +# inputCode_loopNestingInfoProcessing.C \ +# inputCode_ChangeFunctionExample.C \ +# inputCode_interveneAtVariables.C \ +# inputCode_tauInstrumenter.C \ +# inputCode_typeTransformation.C \ +# inputCode_astFileIO_GenerateBinaryFile.C \ +# inputCode_generatingUniqueNamesFromDeclaration.C \ +# inputCode_generatingUniqueNamesFromDeclaration2.C \ +# inputCode_scopeInformation.C \ +# inputCode_BuildCG.C \ +# inputCode_inlineTransformations.C \ +# inputCode_NestedQuery.C \ +# inputCode_ControlFlowGraphAnalysis.C \ +# inputCode_addComments.C \ +# inputCode_addArbitraryTextForUnparser.C \ +# inputCode_partialRedundancyElimination.C \ +# inputCode_codeGenerationFormatControl.C \ +# inputCode_dataFlowGraphAnalysis.C \ +# inputCode_wholeGraphAST.C \ +# inputCode_testsymbolTableHandling.C \ +# inputCode_traversalShortCircuit.C \ +# inputCode_collectComments.C \ +# inputCode_ClassHierarchyGraph.C \ +# inputCode_VolatileTypeModifier.C \ +# input_defuseAnalysis.C \ +# input_runtimeErrorCheck.C \ +# input_runtimeErrorCheck2.C \ +# attributeCopyExamples.C \ +# TAU_INCLUDE_DIR \ +# inputCode_addStruct.C \ +# rose_bin_example_backup.s \ +# buffer2.bin \ +# inputCode_seedBugsExample_arrayIndexing.C \ +# inputCode_dwarfAnalysis.C \ +# inputCode_reductionRecognition.C +# +## disabled this one due to problem with copy mechanism, Liao +## inputCode_varSubstCopy.C +# +#CLEANFILES = rose_bin_example.s callgraph.gml +# +#docs: $(noinst_PROGRAMS) $(generatedCodeExamples) +# @echo "" +## DQ (5/20/2007): Added to support Rich's work with outlining and the HPC Toolkit +# cd outliner; $(MAKE) docs +# cd roseHPCT; $(MAKE) docs +# cd intelPin; $(MAKE) docs +# @echo "******************************************************************" +# @echo "Generated required documentation for tutorial (make docs rule) ..." +# @echo "******************************************************************" +# +## Note that the *.trace files come from the execution of the codeCoverage.C test, +## and the *.binary files are generated from the astFileIO_GenerateBinaryFile.C test. +## The *.binary are the binary form of the ASTs. +#cleanDocs: +## This can not be called after make distclean (by make distcheck) +## cd outliner; $(MAKE) cleanDocs +# rm -f rose_*.C rose_*.cpp *.out *.a[a-l] *.dot *.ps *.pdf *.trace *.binaryAST +# rm -f ExampleCodeCoverage_GeneratedBinary +# rm -f inputCode_AST_PDF_Generator.C +# rm -f rose_inputCode_dwarfAnalysis.s inputCode_dwarfAnalysis rose_inputCode_dwarfAnalysis +# +#clean-local: cleanDocs +# rm -rf Templates.DB ii_files ti_files *.ti *.svg *.new rose_bin_example.s rose_bin_example_2.s bin_example_2 *.dump +# find . -depth -name \*.dSYM -exec rm -rf {} \; # OS X object file debug info +# rm -rf $(generatedCodeExamples) +## rm -f exampleTranslator exampleTranslatorMultiLib +## rm -f inputCode_ExampleCodeCoverage +# +## Compile everything with -g (compiler's debug flag) +## AM_CPPFLAGS = -g +# +## DQ (1/4/2006): Added check rule (remove all generated code and rerun "make docs"). +#check-local: +## DQ (3/27/2006): Note that these should not have to already exist, so use "rm -rf" +## rm -rf $(generatedCodeExamples) +# $(MAKE) docs +# @echo "***************************************************************************" +# @echo "****** ROSE/tutorial: make check rule complete (terminated normally) ******" +# @echo "***************************************************************************" +# +#installcheck: exampleMakefile +# @echo "Remove existing binaries so that they can be rebuilt using the installed libraries." +# rm -f $(noinst_PROGRAMS) *.o +# @echo "Call exampleMakefile to show how to build ROSE tutorial examples using installed libraries." +#if USE_ROSE_IN_BUILD_TREE_VAR +# unset ROSE_IN_BUILD_TREE; $(MAKE) -f exampleMakefile +#else +# $(MAKE) -f exampleMakefile +#endif +# diff --git a/tutorial/database/CMakeLists.txt b/tutorial/database/CMakeLists.txt new file mode 100644 index 0000000000..3e5faa8d01 --- /dev/null +++ b/tutorial/database/CMakeLists.txt @@ -0,0 +1,163 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + +set(customtable_example_SRCS customtable_example.C) + +kde4_add_executable(customtable_example ${customtable_example_SRCS}) + +target_link_libraries(customtable_example ${KDE4_KDECORE_LIBS}) + +install(TARGETS customtable_example ${INSTALL_TARGETS_DEFAULT_ARGS}) + + +########### next target ############### + +set(databasegraph_example_SRCS databasegraph_example.C) + +kde4_add_executable(databasegraph_example ${databasegraph_example_SRCS}) + +target_link_libraries(databasegraph_example ${KDE4_KDECORE_LIBS}) + +install(TARGETS databasegraph_example ${INSTALL_TARGETS_DEFAULT_ARGS}) + + +########### next target ############### + +set(rosedb_example_SRCS rosedb_example.C) + +kde4_add_executable(rosedb_example ${rosedb_example_SRCS}) + +target_link_libraries(rosedb_example ${KDE4_KDECORE_LIBS}) + +install(TARGETS rosedb_example ${INSTALL_TARGETS_DEFAULT_ARGS}) + + +########### next target ############### + +set(simplecallgraph_example_SRCS simplecallgraph_example.C) + +kde4_add_executable(simplecallgraph_example ${simplecallgraph_example_SRCS}) + +target_link_libraries(simplecallgraph_example ${KDE4_KDECORE_LIBS}) + +install(TARGETS simplecallgraph_example ${INSTALL_TARGETS_DEFAULT_ARGS}) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +## tps (1Dec2008) : I enabled the mysql path detection and this code fails because no such include files can be found. +## so I disable this if --with-binarysql is used! +#if ROSE_USE_BINARY_SQL +#else +#if ROSE_USE_MYSQL_DATABASE +## DQ (11/13/2003): Modified to use GNU specific -idirafter option to +## correct set.h (the g++ set.h instead of the C++ mySQL set.h) +## INCLUDES = $(ROSE_INCLUDES) -I/usr/include/g++-3 -I@MySQL_path@/include -I@MySQL_path@/include/mysql +## INCLUDES = $(ROSE_INCLUDES) -idirafter @MySQL_path@/include -idirafter @MySQL_path@/include/mysql +#INCLUDES = $(ROSE_INCLUDES) -idirafter @MySQL_path@/include -idirafter @MySQL_path@/include/mysql -idirafter /home/thuerey1/local/include +# +## LDADD = $(ROSE_LIBS) $(top_builddir)/projects/dataBase/librosedatabase.a @MySQL_path@/lib/mysql/libmysqlclient.a @MySQL_path@/lib/libsqlplus.a -lm -lfl -lz +# +## Note: stlgraph.h stlDOTgraph.h are include temporarily here so that the +## tutorial codes will compile. Later they will be removed. +## include_HEADERS = stlgraph.h stlDOTgraph.h DOTGraphInterface.h DOTSubgraphRepresentation.h DOTSubgraphRepresentation.C +# +#bin_PROGRAMS = \ +# customtable_example \ +# databasegraph_example \ +# rosedb_example \ +# simplecallgraph_example +# +#customtable_example_SOURCES = customtable_example.C +#databasegraph_example_SOURCES = databasegraph_example.C +#rosedb_example_SOURCES = rosedb_example.C +#simplecallgraph_example_SOURCES = simplecallgraph_example.C +# +#DEPENDENCIES = $(ROSE_LIBS_WITH_PATH) +# +#LDADD = $(LIBS_WITH_RPATH) $(ROSE_LIBS) $(top_builddir)/projects/dataBase/librosedatabase.a @MySQL_path@/lib/mysql/libmysqlclient.a @MySQL_path@/lib/libsqlplus.a -lz +# +## DEPENDENCIES = \ +## $(top_builddir)/QueryLibs/NameQuery/libnamequery.a \ +## $(top_builddir)/QueryLibs/NumberQuery/libnumberquery.a \ +## $(top_builddir)/src/librose.a \ +## $(top_builddir)/EDG/src/libedg.a \ +## $(top_builddir)/util/libroseutil.a \ +## $(top_builddir)/SAGE/libsage3.a \ +## $(top_builddir)/PDF/libpdf.a \ +## $(top_builddir)/AST_RewriteMechanism/librewrite.a \ +## $(top_builddir)/projects/dataBase/librosedatabase.a +# +## Add extra option to compile boost with g++ +#AM_CXXFLAGS = -ftemplate-depth-30 +# +#check-local: +# rm -f testCode.o +## Could not initialize the data base and need to work with Nils to check this out +# customtable_example +# rosedb_example +# databasegraph_example +# @echo "Test not run due to database connection problem being worked on presently!" +# $(MAKE) $(TEST_Objects) +# +## define all test codes +#TESTCODES = simplecallgraphTestProgram.c +# +#else +# +## define all test codes +#TESTCODES = +# +#endif +#endif +## Could not initialize the data base and need to work with Nils to check this out +## simplecallgraph_testprogram.C +# +## Build the list of object files +#TEST_Objects = ${TESTCODES:.C=.o} +# +#EXTRA_DIST = $(TESTCODES) +# +#CLEANFILES = +# +#clean-local: +# rm -rf Templates.DB ii_files ti_files rose_*.C *.pdf +# +#ROSE_FLAGS = +# +## This rule generates a dependency that forces the "make check" +## test to always compile the test code +#FORCE_TEST_CODES_TO_RUN: +# +## $(TEST_Objects): $(TESTCODES) FORCE_TEST_CODES_TO_RUN simplecallgraph_example +#$(TEST_Objects): FORCE_TEST_CODES_TO_RUN simplecallgraph_example +# : remove this so that we can force the examples to be run +# rm -f $(TEST_Objects) +# ./simplecallgraph_example -I$(srcdir) $(ROSE_FLAGS) $(INCLUDES) -c $(srcdir)/simplecallgraphTestProgram.C +# : remove this so that we can force the examples to be run +# rm -f $(TEST_Objects) +# +# +# +# +# +# +# +# +# +# +# +# +# +# +# diff --git a/tutorial/intelPin/CMakeLists.txt b/tutorial/intelPin/CMakeLists.txt new file mode 100644 index 0000000000..b17543a367 --- /dev/null +++ b/tutorial/intelPin/CMakeLists.txt @@ -0,0 +1,241 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + +set(dynamicStaticBinaryAnalysis_SRCS dynamicStaticBinaryAnalysis.C) + +kde4_add_executable(dynamicStaticBinaryAnalysis ${dynamicStaticBinaryAnalysis_SRCS}) + +target_link_libraries(dynamicStaticBinaryAnalysis ${KDE4_KDECORE_LIBS}) + + +########### next target ############### + +set(staticDynamicBinaryAnalysis_SRCS staticDynamicBinaryAnalysis.C) + +kde4_add_executable(staticDynamicBinaryAnalysis ${staticDynamicBinaryAnalysis_SRCS}) + +target_link_libraries(staticDynamicBinaryAnalysis ${KDE4_KDECORE_LIBS}) + + +########### next target ############### + +set(commandlineHandling_SRCS commandlineHandling.C) + +kde4_add_executable(commandlineHandling ${commandlineHandling_SRCS}) + +target_link_libraries(commandlineHandling ${KDE4_KDECORE_LIBS}) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +## if configured to use Intel Pin +#if ROSE_USE_INTEL_PIN +# +## Refernece location to where some of the example pin tools are located in the Intel Pin distribution. +#INTEL_PIN_TOOLS_PATH = $(INTEL_PIN_PATH)/source/tools/SimpleExamples +# +## INTEL PIN paths are now included in ROSE_INCLUDES with --with-Intel_Pin. +#INCLUDES = $(ROSE_INCLUDES) +# +## These are ROSE analysis applications that mix static and dynamic analysis. +#noinst_PROGRAMS = dynamicStaticBinaryAnalysis staticDynamicBinaryAnalysis commandlineHandling +# +## These are example Pin tools (some ruse ROSE and demonstrat how to link pin tools with ROSE for mixed analysis). +#noinst_OBJECTS = graphTrace.o imageload.o dynamicBinaryInfo.o +# +## LIBTOOL_RPATH_LDADD = $(ROSE_LIBS_WITH_PATH) $(RT_LIBS) $(INTEL_PIN_LIB_PATHS) -lpin -lxed -ldwarf -lelf -ldl +## LIBTOOL_RPATH_LDADD = $(ROSE_LIBS_WITH_PATH) $(RT_LIBS) $(INTEL_PIN_LIB_PATHS) -lpin -lxed -ldl $(ROSE_DWARF_LIBS_WITH_PATH) +#LIBTOOL_RPATH_LDADD = $(ROSE_LIBS_WITH_PATH) $(RT_LIBS) $(INTEL_PIN_LIB_PATHS) -lpin -lxed -ldl +# +## This ROSE application mixes dynamic analysis with static analysis (dynamic analysis first and then static analysis) +## as a result is must link to both ROSE and Pin. +#dynamicStaticBinaryAnalysis_SOURCES = dynamicStaticBinaryAnalysis.C +#dynamicStaticBinaryAnalysis_LDADD = $(LIBTOOL_RPATH_LDADD) +# +## dynamicStaticBinaryAnalysis_LDFLAGS = $(ROSE_DWARF_LIBS_WITH_PATH) +#AM_LDFLAGS = $(ROSE_DWARF_LIBS_WITH_PATH) +# +## This ROSE application mixes dynamic analysis with static analysis (dynamic analysis first and then static analysis) +## as a result is must link to both ROSE and Pin. +#staticDynamicBinaryAnalysis_SOURCES = staticDynamicBinaryAnalysis.C +#staticDynamicBinaryAnalysis_LDADD = $(LIBTOOL_RPATH_LDADD) +# +## This code demonstrates the commandline handling required to mix Pin with ROSE. +#commandlineHandling_SOURCES = commandlineHandling.C +#commandlineHandling_LDADD = $(LIBTOOL_RPATH_LDADD) +# +## This is a general variable to link against (uses -lrose and works with static or dynamic linking): +## NON_LIBTOOL_RPATH = -Wl,-rpath $(top_builddir)/src/.libs -L$(top_builddir)/src/.libs -lrose $(INTEL_PIN_LIB_PATHS) -lpin -lxed -ldwarf -lelf -ldl +## NON_LIBTOOL_RPATH = -Wl,-rpath $(top_builddir)/src/.libs -L$(top_builddir)/src/.libs -lrose $(INTEL_PIN_LIB_PATHS) -lpin -lxed -ldl $(ROSE_DWARF_LIBS_WITH_PATH) +#NON_LIBTOOL_RPATH = -Wl,-rpath $(top_builddir)/src/.libs -L$(top_builddir)/src/.libs -lrose $(INTEL_PIN_WITH_DWARF_LIBS_PATH) +# +# +## ************************************************************************** +## This we were we will put test codes (not there yet): +#TESTCODES_REQUIRED_TO_PASS = +## pintest2008_01.C +# +#TESTCODE_CURRENTLY_FAILING = +## pintest2008_02.C +# +## "make check" tests to be run: +#ROSE_PIN_TESTS = testGraphTrace testImageload testDynamicBinaryInfo +# +# +## This is a test code (executable) to be used with the Intel Pin dynamic instrumentation +## (it can be linked staticly or dynamically). +#input_testcode: $(srcdir)/input_testcode.C +## g++ -static $(srcdir)/input_testcode.C -o input_testcode +# g++ $(srcdir)/input_testcode.C -o input_testcode +# +# +## ************************************************************************** +## This tests the Intel Pin tool using one of its internal tools (should have been built if Intel Pin was built) +## This tests the installation of Pin and nothing about the use of Pin with ROSE. +#testPinInstallation: input_testcode $(INTEL_PIN_TOOLS_PATH)/obj-intel64/icount.so +# $(INTEL_PIN_PATH)/pin -slow_asserts -t $(INTEL_PIN_TOOLS_PATH)/obj-intel64/icount.so -- ./input_testcode +# +# +## ************************************************************************** +## This Pin tool generates a dot graph of the trace of execution of a binary (and uses support functions in ROSE). +## So it must be linked explicitly (not using libtool) and reference either the shared library or the static library. +## When the shared library (librose.so) is used, $(top_builddir)/src/.libs must be in the LD_LIBRARY_PATH. +#graphTrace.so: graphTrace.o +# g++ -g -shared -Wl,-Bsymbolic -Wl,--version-script=$(INTEL_PIN_PATH)/source/include/pintool.ver -o graphTrace.so graphTrace.o $(NON_LIBTOOL_RPATH) +# +## Test example program generate a graph of the execution trace of a binary +#testGraphTrace: graphTrace.so input_testcode +# $(INTEL_PIN_PATH)/pin -slow_asserts -t graphTrace.so -- ./input_testcode +# +# +## ************************************************************************** +## This Pin tool generates log of the image loading and unloading (of shared libraries) of a binary +#imageload.so: imageload.o +## g++ -g -shared -Wl,-Bsymbolic -Wl,--version-script=$(INTEL_PIN_PATH)/source/include/pintool.ver -o imageload.so imageload.o $(INTEL_PIN_LIB_PATHS) -lpin -lxed -ldwarf -lelf -ldl +## g++ -g -shared -Wl,-Bsymbolic -Wl,--version-script=$(INTEL_PIN_PATH)/source/include/pintool.ver -o imageload.so imageload.o $(INTEL_PIN_LIB_PATHS) -lpin -lxed -ldl $(ROSE_DWARF_LIBS_WITH_PATH) +# g++ -g -shared -Wl,-Bsymbolic -Wl,--version-script=$(INTEL_PIN_PATH)/source/include/pintool.ver -o imageload.so imageload.o $(INTEL_PIN_WITH_DWARF_LIBS_PATH) +# +## Test example program generate a graph of the execution trace of a binary +#testImageload: imageload.so input_testcode +# $(INTEL_PIN_PATH)/pin -slow_asserts -t imageload.so -- ./input_testcode +# +# +## ************************************************************************** +## This Pin tool generates log of the information take from each image (main program and each loaded shared library) of the binary +#dynamicBinaryInfo.so: dynamicBinaryInfo.o +## g++ -g -shared -Wl,-Bsymbolic -Wl,--version-script=$(INTEL_PIN_PATH)/source/include/pintool.ver -o dynamicBinaryInfo.so dynamicBinaryInfo.o $(INTEL_PIN_LIB_PATHS) -lpin -lxed -ldwarf -lelf -ldl +## g++ -g -shared -Wl,-Bsymbolic -Wl,--version-script=$(INTEL_PIN_PATH)/source/include/pintool.ver -o dynamicBinaryInfo.so dynamicBinaryInfo.o $(INTEL_PIN_LIB_PATHS) -lpin -lxed -ldl $(ROSE_DWARF_LIBS_WITH_PATH) +# g++ -g -shared -Wl,-Bsymbolic -Wl,--version-script=$(INTEL_PIN_PATH)/source/include/pintool.ver -o dynamicBinaryInfo.so dynamicBinaryInfo.o $(INTEL_PIN_WITH_DWARF_LIBS_PATH) +# +## Test example program generates information about the binary (from section data for main program and each shared library). +#testDynamicBinaryInfo: dynamicBinaryInfo.so input_testcode +# $(INTEL_PIN_PATH)/pin -slow_asserts -t dynamicBinaryInfo.so -- ./input_testcode +# +## ************************************************************************** +## This builds an Intel Pin tool (for testing the command line handling with ROSE) +#commandlineHandling.so: commandlineHandling.o +# g++ -g -shared -Wl,-Bsymbolic -Wl,--version-script=$(INTEL_PIN_PATH)/source/include/pintool.ver -o commandlineHandling.so commandlineHandling.o $(NON_LIBTOOL_RPATH) +# +#testCommandlineHandling: input_testcode commandlineHandling.so +# $(INTEL_PIN_PATH)/pin -slow_asserts -t commandlineHandling.so -- ./input_testcode +# +# +## ************************************************************************** +## This builds an Intel Pin tool (for use with Intel Pin dynamic instrumentation) from a ROSE translator. +## This allows for mixed static and dynamic analysis. +#dynamicStaticBinaryAnalysis.so: dynamicStaticBinaryAnalysis.o +# g++ -g -shared -Wl,-Bsymbolic -Wl,--version-script=$(INTEL_PIN_PATH)/source/include/pintool.ver -o dynamicStaticBinaryAnalysis.so dynamicStaticBinaryAnalysis.o $(NON_LIBTOOL_RPATH) +# +## DQ (3/9/2009): This test fails after the Pin Tool is called due to a linking problem with the -lrose shared library. +## This runs the Intel Pin dynamic instumentation on "input_testcode" using the ROSE static analysis tool +## In this case the dynamic instrumentation can call static analysis. +#testDynamicStaticBinaryAnalysis: input_testcode dynamicStaticBinaryAnalysis.so +# $(INTEL_PIN_PATH)/pin -slow_asserts -t dynamicStaticBinaryAnalysis.so -- ./input_testcode +# +# +## ************************************************************************** +## This builds an Intel Pin tool (for use with Intel Pin dynamic instrumentation) from a ROSE translator. +## This allows for mixed static and dynamic analysis (first static analysis then dynamic analysis). +#staticDynamicBinaryAnalysis.so: staticDynamicBinaryAnalysis.o +# g++ -g -shared -Wl,-Bsymbolic -Wl,--version-script=$(INTEL_PIN_PATH)/source/include/pintool.ver -o staticDynamicBinaryAnalysis.so staticDynamicBinaryAnalysis.o $(NON_LIBTOOL_RPATH) +# +## DQ (3/9/2009): This test fails after the Pin Tool is called due to a linking problem with the -lrose shared library. +## This runs the Intel Pin dynamic instumentation on "input_testcode" using the ROSE static analysis tool +## In this case the dynamic instrumentation can call static analysis. +#testStaticDynamicBinaryAnalysis: input_testcode staticDynamicBinaryAnalysis.so +# $(INTEL_PIN_PATH)/pin -slow_asserts -t staticDynamicBinaryAnalysis.so -- ./input_testcode +# +# +## ************************************************************************** +## Automake's testing mechanism (which defines the "make check" rule) requires passing tests. +#TESTCODES = $(TESTCODES_REQUIRED_TO_PASS) +# +## QMTest allows both passing and failing tests. +#ALL_TESTCODES = $(TESTCODES_REQUIRED_TO_PASS) $(TESTCODE_CURRENTLY_FAILING) +# +## File option to accumulate performance information about the compilation +#PERFORMANCE_REPORT_OPTION = -rose:compilationPerformanceFile $(top_builddir)/PIN_ROSE_PERFORMANCE_DATA.csv +# +#ROSE_FLAGS = -rose:verbose 0 $(PERFORMANCE_REPORT_OPTION) +# +#VALGRIND_OPTIONS = --tool=memcheck -v --num-callers=30 --leak-check=no --error-limit=no --show-reachable=yes +## VALGRIND = /usr/apps/valgrind/new/bin/valgrind $(VALGRIND_OPTIONS) +#VALGRIND = +# +#PASSING_TEST_Objects = ${TESTCODES:.C=.o} +#TEST_Objects = ${ALL_TESTCODES:.C=.o} +# +## $(TEST_Objects): preprocessor $(srcdir)/$(@:.o=.C) +##$(TEST_Objects): +## echo "Calling ..." +## $(VALGRIND) ./staticBinaryAnalysis $(ROSE_FLAGS) -c $(srcdir)/$(@:.o=.C) +# +#docs: +# @$(MAKE) $(ROSE_PIN_TESTS) +# @$(MAKE) testStaticDynamicBinaryAnalysis +# @$(MAKE) testDynamicStaticBinaryAnalysis +# @echo "" +# @echo "***************************************************************************" +# @echo "Generated required documentation for tutorial/intelPin (make docs rule) ..." +# @echo "***************************************************************************" +# +#check-local: +# $(MAKE) docs +# @echo "************************************************************************************" +# @echo "****** ROSE/tutorial/intelPin: make check rule complete (terminated normally) ******" +# @echo "************************************************************************************" +# +## else of configuration for ROSE_USE_INTEL_PIN +#else +# +#docs: +# @echo "Tutorial Intel Pin development tests NOT run. To run these reconfigure with:" +# @echo "*******************************************************************************************************" +# @echo "*************** make check not run here: configure --with-IntelPin= ****************" +# @echo "*******************************************************************************************************" +# +#check-local: +# $(MAKE) docs +# +## endif of configuration for ROSE_USE_INTEL_PIN +#endif +# +#EXTRA_DIST = \ +# README dynamicStaticBinaryAnalysis.C staticDynamicBinaryAnalysis.C dynamicBinaryInfo.C \ +# graphTrace.C imageload.C input_testcode.C commandlineHandling.C +# +#clean-local: +# rm -f *.o rose_*.[s] *.dot *.pdf *~ *.ps *.out *.new *.dump rose_performance_report_lockfile.lock *.so +# rm -f pinRoseTranslator.so input_testcode pin.log +# rm -rf QMTest +# diff --git a/tutorial/outliner/CMakeLists.txt b/tutorial/outliner/CMakeLists.txt new file mode 100644 index 0000000000..4b193769f7 --- /dev/null +++ b/tutorial/outliner/CMakeLists.txt @@ -0,0 +1,254 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + +set(outline_SRCS outline.cc) + +kde4_add_executable(outline ${outline_SRCS}) + +target_link_libraries(outline ${KDE4_KDECORE_LIBS}) + +install(TARGETS outline ${INSTALL_TARGETS_DEFAULT_ARGS}) + + +########### next target ############### + +set(outlineIfs_SRCS outlineIfs.cc) + +kde4_add_executable(outlineIfs ${outlineIfs_SRCS}) + +target_link_libraries(outlineIfs ${KDE4_KDECORE_LIBS}) + + +########### next target ############### + +set(outlinePreproc_SRCS outlinePreproc.cc) + +kde4_add_executable(outlinePreproc ${outlinePreproc_SRCS}) + +target_link_libraries(outlinePreproc ${KDE4_KDECORE_LIBS}) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +##========================================================================== +## Outliner tutorial examples. +# +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#OUTLINER_INCS = -I$(top_srcdir)/src/midend/astOutlining +#OUTLINER_LIBS = $(ROSE_LIBS) +# +## Data files generated by running the demo. +## noinst_DATA = inputCode_OutlineLoop$(EXEEXT) +#generatedFiles = inputCode_OutlineLoop$(EXEEXT) \ +# rose_inputCode_OutlineLoop.cc \ +# inputCode_OutlineLoop.out \ +# \ +# outlined-inputCode_OutlineLoop.cc \ +# rose_outlined-inputCode_OutlineLoop.cc \ +# outlined_pp-inputCode_OutlineLoop.cc \ +# rose_outlined_pp-inputCode_OutlineLoop.cc \ +# \ +# inputCode_OutlineNonLocalJumps$(EXEEXT) \ +# rose_inputCode_OutlineNonLocalJumps.cc \ +# inputCode_OutlineNonLocalJumps.out \ +# \ +# rose_outlined-inputCode_OutlineNonLocalJumps.cc \ +# outlined-inputCode_OutlineNonLocalJumps.cc \ +# outlined_pp-inputCode_OutlineNonLocalJumps.cc \ +# rose_outlined_pp-inputCode_OutlineNonLocalJumps.cc \ +# \ +# inputCode_Ifs$(EXEEXT) \ +# inputCode_Ifs.out \ +# rose_inputCode_Ifs.cc \ +# rose_inputCode_OutlineLoop2.c \ +# rose_inputCode_OutlineLoop2b.c \ +# rose_declarations.c \ +# rose_thisExpression.cpp +# +##docs: $(generatedFiles) +## declarations.c is used to test "outline -rose:outline:preproc-only" +#EXTRA_DIST = \ +# inputCode_OutlineLoop.cc \ +# inputCode_OutlineLoop2.c \ +# inputCode_OutlineNonLocalJumps.cc \ +# inputCode_Ifs.cc \ +# declarations.c \ +# thisExpression.cpp +# +#INDENT_BIN = indent +#INDENT_ARGS = -npsl +# +##========================================================================== +## Build demo translators +# +#INCLUDES = $(ROSE_INCLUDES) $(OUTLINER_INCS) +## We install a copy +#bin_PROGRAMS = outline +#noinst_PROGRAMS = outlineIfs outlinePreproc +# +#outline_SOURCES = outline.cc +#outline_LDFLAGS = $(OUTLINER_LIBS) +# +#outlineIfs_SOURCES = outlineIfs.cc +#outlineIfs_LDFLAGS = $(OUTLINER_LIBS) +# +#outlinePreproc_SOURCES = outlinePreproc.cc +#outlinePreproc_LDFLAGS = $(OUTLINER_LIBS) +# +##========================================================================== +## Example 1: Basic outlining of a nested loop +# +#inputCode_OutlineLoop$(EXEEXT): rose_inputCode_OutlineLoop.cc +# $(CXX) -o $@ $< +# +#rose_inputCode_OutlineLoop.cc: outline$(EXEEXT) \ +# $(srcdir)/inputCode_OutlineLoop.cc +# ./outline$(EXEEXT) -c $(srcdir)/inputCode_OutlineLoop.cc +# +#inputCode_OutlineLoop.out: inputCode_OutlineLoop$(EXEEXT) +# ./$< > $@ +# +## Copies the input file so unparsed output has the desired filename. +#outlined-inputCode_OutlineLoop.cc: \ +# $(srcdir)/inputCode_OutlineLoop.cc +# cp $< $@ +# +#rose_outlined-inputCode_OutlineLoop.cc: outline$(EXEEXT) \ +# outlined-inputCode_OutlineLoop.cc +# ./outline$(EXEEXT) -c outlined-inputCode_OutlineLoop.cc +# test -f $@ +# if which $(INDENT_BIN); then \ +# $(INDENT_BIN) $(INDENT_ARGS) $@; \ +# fi +# +##========================================================================== +## Example 2: Non-local jumps demo +# +#inputCode_OutlineNonLocalJumps$(EXEEXT): rose_inputCode_OutlineNonLocalJumps.cc +# $(CXX) -o $@ $< +# +#rose_inputCode_OutlineNonLocalJumps.cc : outline$(EXEEXT) $(srcdir)/inputCode_OutlineNonLocalJumps.cc +# ./outline$(EXEEXT) -o inputCode_OutlineNonLocalJumps$(EXEEXT) $(srcdir)/inputCode_OutlineNonLocalJumps.cc +# +#inputCode_OutlineNonLocalJumps.out: inputCode_OutlineNonLocalJumps$(EXEEXT) +# ./$< > $@ +# +## Copies the input file so unparsed output has the desired filename. +#outlined-inputCode_OutlineNonLocalJumps.cc: $(srcdir)/inputCode_OutlineNonLocalJumps.cc +# cp $< $@ +# +#rose_outlined-inputCode_OutlineNonLocalJumps.cc: outline$(EXEEXT) \ +# outlined-inputCode_OutlineNonLocalJumps.cc +# ./outline$(EXEEXT) -c outlined-inputCode_OutlineNonLocalJumps.cc +# test -f $@ +# if which $(INDENT_BIN); then \ +# $(INDENT_BIN) $(INDENT_ARGS) $@ ; \ +# fi +# +##========================================================================== +## Example 3: Direct-call demo (outline all if statements) +# +## inputCode_Ifs$(EXEEXT) rose_inputCode_Ifs.cc: outlineIfs$(EXEEXT) +#inputCode_Ifs$(EXEEXT): rose_inputCode_Ifs.cc +# $(CXX) -o $@ $< +# +#rose_inputCode_Ifs.cc: outlineIfs$(EXEEXT) \ +# $(srcdir)/inputCode_Ifs.cc +# ./outlineIfs$(EXEEXT) -c $(srcdir)/inputCode_Ifs.cc +# +#inputCode_Ifs.out: inputCode_Ifs$(EXEEXT) +# ./$< January February March April May June July \ +# August September October November December \ +# > $@ +# +##========================================================================== +## Example 4: Running the outliner's preprocessing-only phase. +# +## Copies the input file so unparsed output has the desired filename. +#outlined_pp-inputCode_OutlineLoop.cc: $(srcdir)/inputCode_OutlineLoop.cc +# cp $< $@ +# +#rose_outlined_pp-inputCode_OutlineLoop.cc : outlinePreproc$(EXEEXT) outlined_pp-inputCode_OutlineLoop.cc +# ./outlinePreproc$(EXEEXT) -c outlined_pp-inputCode_OutlineLoop.cc +# test -f $@ +## if test -x `which $(INDENT_BIN)` ; then +# if which $(INDENT_BIN) ; then \ +# $(INDENT_BIN) $(INDENT_ARGS) $@ ; \ +# fi +# +## Copies the input file so unparsed output has the desired filename. +#outlined_pp-inputCode_OutlineNonLocalJumps.cc: $(srcdir)/inputCode_OutlineNonLocalJumps.cc +# cp $< $@ +# +#rose_outlined_pp-inputCode_OutlineNonLocalJumps.cc: outlinePreproc$(EXEEXT) \ +# outlined_pp-inputCode_OutlineNonLocalJumps.cc +# ./outlinePreproc$(EXEEXT) -c \ +# outlined_pp-inputCode_OutlineNonLocalJumps.cc +# test -f $@ +# if which $(INDENT_BIN) ; then \ +# $(INDENT_BIN) $(INDENT_ARGS) $@ ; \ +# fi +##======================================================================== +## example 5: abstract handle demo +## using source file location : a for loop at line 12, +#rose_inputCode_OutlineLoop2.c: outline$(EXEEXT) \ +# $(srcdir)/inputCode_OutlineLoop.cc +# ./outline$(EXEEXT) -rose:outline:enable_debug -rose:outline:enable_classic -rose:outline:abstract_handle "ForStatement" -c $(srcdir)/inputCode_OutlineLoop2.c +## using name and relative numbering: the second loop within a function named initialize() +#rose_inputCode_OutlineLoop2b.c: outline$(EXEEXT) \ +# $(srcdir)/inputCode_OutlineLoop.cc +# ./outline$(EXEEXT) -rose:outline:enable_classic -rose:outline:enable_debug -rose:outline:abstract_handle "FunctionDeclaration::ForStatement" -c $(srcdir)/inputCode_OutlineLoop2.c -rose:output rose_inputCode_OutlineLoop2b.c +# +#rose_declarations.c:outline$(EXEEXT) +# ./outline$(EXEEXT) -rose:outline:preproc-only -rose:outline:abstract_handle "Statement" -c $(srcdir)/declarations.c +# +#rose_thisExpression.cpp:outline$(EXEEXT) +# ./outline$(EXEEXT) -c $(srcdir)/thisExpression.cpp +# +# +##========================================================================== +## Miscellaneous +# +#cleanDocs: +# rm -f *.C *.cc *.ti *.out +# +#clean-local: +# rm -rf rose_*.c rose_*.C OUT__* $(CXX_TEMPLATE_OBJECTS) Templates.DB ii_files ti_files *.ti $(generatedFiles) +# rm -f $(generatedFiles) *.o *~ core *.BAK +# +#distclean-local: +# rm -rf Templates.DB +# rm -f $(generatedFiles) +# +## DQ (5/27/2007): Added "docs" rule +## docs: $(noinst_PROGRAMS) $(generatedFiles) +#docs: $(generatedFiles) +# @echo "" +# @echo "******************************************************************************" +# @echo "Generated required documentation for tutorial/outliner (make docs rule) ..." +# @echo "******************************************************************************" +# +## DQ (9/8/2007): Added "check" rule +#check-local: +## For make check to be rerun if we want to rerun make clean +## rm -rf $(generatedFiles) +## DQ (9/10/2009): Skip tests on Debian system to test ROSE (and focus first on where it works!) +#if !OS_VENDOR_DEBIAN +# $(MAKE) docs +# @echo "***************************************************************************************" +# @echo "****** ROSE/tutorial/outliner: make check rule complete (terminated normally) ******" +# @echo "***************************************************************************************" +#else +# @echo "***** SKIPPING TESTS IN ROSE/tutorial/outliner *****" +#endif +# +## eof diff --git a/tutorial/roseHPCT/CMakeLists.txt b/tutorial/roseHPCT/CMakeLists.txt new file mode 100644 index 0000000000..c4da08dd45 --- /dev/null +++ b/tutorial/roseHPCT/CMakeLists.txt @@ -0,0 +1,174 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### next target ############### + +set(attachMetrics_SRCS attachMetrics.cc) + +kde4_add_executable(attachMetrics ${attachMetrics_SRCS}) + +target_link_libraries(attachMetrics ${KDE4_KDECORE_LIBS}) + + +########### install files ############### + +install(FILES profiled.out is-static.tex command-line.tex profiled-p93.pdf DESTINATION ) + + + +#original Makefile.am contents follow: + +##========================================================================== +## ROSE-HPCT tutorial example. +# +#include $(top_srcdir)/config/Makefile.for.ROSE.includes.and.libs +# +#LDADD = $(LIBS_WITH_RPATH) $(WAVE_LDFLAGS) $(ROSE_SEPARATE_LIBS) +# +## HPCToolkit-generated files. +#HPCT_FILES = PAPI_FP_OPS.xml \ +# PAPI_TOT_CYC.xml \ +# PAPI_L1_DCA.xml \ +# PAPI_L1_DCM.xml \ +# PAPI_L2_TCM.xml +# +## Extra files that need to be included in a distribution tarball. +#EXTRA_DIST = $(HPCT_FILES) \ +# profiled.c profiled-save.out profiled-p93-save.pdf \ +# command-line-static.tex static.tex +# +## Data files generated by running the demo. +#noinst_DATA = profiled.out \ +# is-static.tex command-line.tex \ +# profiled-p93.pdf +# +## Split source listings for inclusion in the chapter. +#noinst_DATA += profiled.c.aa profiled.c.ab \ +# PAPI_TOT_CYC.xml.aa PAPI_TOT_CYC.xml.ab PAPI_FP_OPS.xml.aa \ +# PAPI_FP_OPS.xml.ab +# +#profiled.c.ab : profiled.c.aa +# +## This needs to be fixed to have a single lhs entry so that parallel make will work. +## profiled.c.aa profiled.c.ab: $(srcdir)/profiled.c +#profiled.c.aa : $(srcdir)/profiled.c +# split -65 $(srcdir)/profiled.c profiled.c. +# test -f profiled.c.aa +# test -f profiled.c.ab +# +#PAPI_TOT_CYC.xml.ab: PAPI_TOT_CYC.xml.aa +# +## This needs to be fixed to have a single lhs entry so that parallel make will work. +## PAPI_TOT_CYC.xml.aa PAPI_TOT_CYC.xml.ab: $(srcdir)/PAPI_TOT_CYC.xml +#PAPI_TOT_CYC.xml.aa : $(srcdir)/PAPI_TOT_CYC.xml +# split -61 $(srcdir)/PAPI_TOT_CYC.xml PAPI_TOT_CYC.xml. +# +#PAPI_FP_OPS.xml.ab: PAPI_FP_OPS.xml.aa +# +## This needs to be fixed to have a single lhs entry so that parallel make will work. +## PAPI_FP_OPS.xml.aa PAPI_FP_OPS.xml.ab: $(srcdir)/PAPI_FP_OPS.xml +#PAPI_FP_OPS.xml.aa : $(srcdir)/PAPI_FP_OPS.xml +# split -61 $(srcdir)/PAPI_FP_OPS.xml PAPI_FP_OPS.xml. +# +##========================================================================== +#if ROSE_BUILD_ROSEHPCT # (--enable-rosehpct) +##========================================================================== +# +## DQ (3/21/2009): These fail to compile under Cygwin. +#if !ROSE_BUILD_OS_IS_CYGWIN +# +## Build demo program +#noinst_PROGRAMS = attachMetrics +#attachMetrics_SOURCES = attachMetrics.cc +#attachMetrics_LDFLAGS = \ +# $(ROSE_ROSEHPCT_LIBS_WITH_PATH) \ +# $(ROSE_LIBS_WITH_PATH) \ +# $(ROSEHPCT_DEP_LIBS) \ +# $(RT_LIBS) +#INCLUDES = $(ROSE_INCLUDES) $(ROSE_ROSEHPCT_INCLUDES) $(ROSEHPCT_DEP_INCLUDES) +# +## Extra data generated that needs to be cleaned up +#noinst_DATA += profiled.c.pdf +# +#profiled.c.pdf command-line.tex: profiled.out +# +## Run demo program +## This needs to be fixed to have a single lhs entry so that parallel make will work. +## profiled.out profiled.c.pdf command-line.tex: attachMetrics $(HPCT_FILES) $(srcdir)/profiled.c +#profiled.out: attachMetrics $(HPCT_FILES) $(srcdir)/profiled.c +# cmdline="./attachMetrics -rose:hpct:prof $(srcdir)/PAPI_TOT_CYC.xml -rose:hpct:prof $(srcdir)/PAPI_FP_OPS.xml -rose:hpct:eqpath .=`cd $(srcdir) && pwd` -c $(srcdir)/profiled.c" ; \ +# echo $$cmdline \ +# | sed 's,-rose:hpct:,\\\n -rose:hpct,g' \ +# | sed 's, -c ,\\\n -c ,g' \ +# > command-line.tex ; \ +# $$cmdline > profiled.out +# +## Liao, 5/9/2008. the page number has been changed to 67 in recent snapshot, pdf dump is much more thorough than before for unknown reasons to me. +#profiled-p93.pdf: profiled.c.pdf +# if ! gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=$@ \ +# -dFirstPage=67 -dLastPage=67 profiled.c.pdf ; then \ +# cp $(srcdir)/profiled-p93-save.pdf $@ ; \ +# fi +# +## Generate additional file for tutorial chapter. +#is-static.tex: +# rm -f $@ +# touch $@ +# +#else +# +## DQ (3/21/2009): Copy the required files (just as for the case of --disable-rosehpct) +#profiled.out: $(srcdir)/profiled-save.out +# cp $(srcdir)/profiled-save.out $@ +# +#profiled-p93.pdf: $(srcdir)/profiled-p93-save.pdf +# cp $(srcdir)/profiled-p93-save.pdf $@ +# +#is-static.tex: $(srcdir)/static.tex +# cp $(srcdir)/static.tex $@ +# +#command-line.tex: $(srcdir)/command-line-static.tex +# cp $(srcdir)/command-line-static.tex $@ +# +#endif +# +##========================================================================== +#else # !ROSE_BUILD_ROSEHPCT (--disable-rosehpct) +##========================================================================== +# +## ROSE-HPCT not enabled, so just use pre-generated data. +# +#profiled.out: $(srcdir)/profiled-save.out +# cp $(srcdir)/profiled-save.out $@ +# +#profiled-p93.pdf: $(srcdir)/profiled-p93-save.pdf +# cp $(srcdir)/profiled-p93-save.pdf $@ +# +#is-static.tex: $(srcdir)/static.tex +# cp $(srcdir)/static.tex $@ +# +#command-line.tex: $(srcdir)/command-line-static.tex +# cp $(srcdir)/command-line-static.tex $@ +# +#endif # ROSE_BUILD_ROSEHPCT +# +##========================================================================== +## Miscellaneous +# +#clean-local: +# rm -rf $(CXX_TEMPLATE_OBJECTS) Templates.DB ii_files ti_files +# rm -f $(noinst_DATA) rose_profiled.c +# +#distclean-local: +# rm -rf Templates.DB +# rm -f $(noinst_DATA) +# +## DQ (5/27/2007): Added docs rule +#docs: $(noinst_PROGRAMS) $(noinst_DATA) +# @echo "" +# @echo "***************************************************************************" +# @echo "Generated required documentation for tutorial/roseHPCT (make docs rule) ..." +# @echo "***************************************************************************" +# +## eof