diff options
author | Alexander Neundorf <neundorf@kde.org> | 2006-02-12 14:38:04 +0000 |
---|---|---|
committer | Alexander Neundorf <neundorf@kde.org> | 2006-02-12 14:38:04 +0000 |
commit | 75a07dd38b4a491a9d16d24492bea5c6ba90a8ff (patch) | |
tree | 0a65094e22bba335545b8ffe4a33fe7790edb21c /generate_findpackage_file | |
parent | bce40e0de3b22a291ecaa2b75358e6a998e1579b (diff) | |
download | extra-cmake-modules-75a07dd38b4a491a9d16d24492bea5c6ba90a8ff.tar.gz extra-cmake-modules-75a07dd38b4a491a9d16d24492bea5c6ba90a8ff.tar.bz2 |
-moved the cmake code to find kdewin32 out of FindKDE4.cmake and into its own FindKDEWIN32.cmake file
-added a new FindGNUWIN32.cmake file, which tries to find the gnuwin32 base directory
-changed all "FOO_LIBRARY" variable names to "FOO_LIBRARIES" to be more consistent with the other cmake modules
-added a macro_getenv_win_path() which replaces all backslahes with slashes from environment variables
-modified the kde4_add_kcfg_files() command, so that the generated header is also processed by moc
-all tests compile and link
Alex
CCMAIL:kde-buildsystem@kde.org
The changes to the windows stuff are untested, since I don't have a windows box.
Please check that everything still works. Please have a look at FindGNUWIN32.cmake,
there are probably ways to improve this. The resulting GNUWIN32_DIR variable is used in other
cmake modules as default path to search for headers and libraries.
svn path=/trunk/KDE/kdelibs/; revision=508648
Diffstat (limited to 'generate_findpackage_file')
-rwxr-xr-x | generate_findpackage_file | 38 |
1 files changed, 15 insertions, 23 deletions
diff --git a/generate_findpackage_file b/generate_findpackage_file index db3da7d9..69ee36ac 100755 --- a/generate_findpackage_file +++ b/generate_findpackage_file @@ -16,12 +16,15 @@ header=gets.chomp print("Include subdir (e.g. \"libxml2\", empty to skip ): ") incSubDir=gets.chomp +if not incSubDir.empty? + incSubDir="/"+incSubDir +end print("Look for library (e.g. \"jpeg\" or \"xml2\"): ") lib=gets.chomp cmakeIncDirName=package.upcase+"_INCLUDE_DIR" -cmakeLibName=package.upcase+"_LIBRARY" +cmakeLibName=package.upcase+"_LIBRARIES" cmakeDefsName=package.upcase+"_DEFINITIONS" cmakeFoundName=package.upcase+"_FOUND" cmakeQuietName=package+"_FIND_QUIETLY" @@ -48,29 +51,13 @@ if not pkgconfig.empty? file.printf("SET(#{cmakeDefsName} ${_#{package}Cflags})\n\n") end -if not incSubDir.empty? - cmakeRootIncDirName=package.upcase+"_ROOT_INCLUDE_DIR" - - file.printf("FIND_PATH(#{cmakeRootIncDirName} #{incSubDir}/#{header}\n") - if not pkgconfig.empty? - file.printf(" ${_#{package}IncDir}\n") - end - file.printf(" /usr/include\n") - file.printf(" /usr/local/include\n") - file.printf(")\n\n") - - file.printf("SET(#{cmakeIncDirName} ${#{cmakeRootIncDirName}}/#{incSubDir} CACHE PATH \"The #{package} include directory\" )\n") - file.printf("MARK_AS_ADVANCED(#{cmakeRootIncDirName})\n\n") -else - file.printf("FIND_PATH(#{cmakeIncDirName} #{header}\n") - if not pkgconfig.empty? - file.printf(" ${_#{package}IncDir}\n") - end - file.printf(" /usr/include\n") - file.printf(" /usr/local/include\n") - file.printf(")\n\n") +file.printf("FIND_PATH(#{cmakeIncDirName} #{header}\n") +if not pkgconfig.empty? + file.printf(" ${_#{package}IncDir}#{incSubDir}\n") end - +file.printf(" /usr/include#{incSubDir}\n") +file.printf(" /usr/local/include#{incSubDir}\n") +file.printf(")\n\n") file.printf("FIND_LIBRARY(#{cmakeLibName} NAMES #{lib}\n") file.printf(" PATHS\n") @@ -95,4 +82,9 @@ file.printf(" MESSAGE(FATAL_ERROR \"Could not find #{package}\")\n") file.printf(" ENDIF(#{cmakeRequiredName})\n") file.printf("ENDIF(#{cmakeFoundName})\n\n") + +file.printf("# show the #{cmakeIncDirName} and #{cmakeLibName} variables only in the advanced view\n") +file.printf("MARK_AS_ADVANCED(#{cmakeIncDirName} #{cmakeLibName} )\n\n") + + printf("Done, generated Find#{package}.cmake\n")
\ No newline at end of file |