summaryrefslogtreecommitdiffstats
path: root/cmake/FindQxt.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/FindQxt.cmake')
-rw-r--r--cmake/FindQxt.cmake111
1 files changed, 111 insertions, 0 deletions
diff --git a/cmake/FindQxt.cmake b/cmake/FindQxt.cmake
new file mode 100644
index 0000000..402fb51
--- /dev/null
+++ b/cmake/FindQxt.cmake
@@ -0,0 +1,111 @@
+#############
+## basic FindQxt.cmake
+## This is an *EXTREMELY BASIC* cmake find/config file for
+## those times you have a cmake project and wish to use
+## libQxt.
+##
+## It should be noted that at the time of writing, that
+## I (mschnee) have an extremely limited understanding of the
+## way Find*.cmake files work, but I have attempted to
+## emulate what FindQt4.cmake and a few others do.
+##
+## To enable a specific component, set your QXT_USE_${modname}:
+## SET(QXT_USE_QXTCORE TRUE)
+## SET(QXT_USE_QXTGUI FALSE)
+## Currently available components:
+## QxtCore, QxtGui, QxtNetwork, QxtWeb, QxtSql
+## Auto-including directories are enabled with INCLUDE_DIRECTORIES(), but
+## can be accessed if necessary via ${QXT_INCLUDE_DIRS}
+##
+## To add the libraries to your build, TARGET_LINK_LIBRARIES(), such as...
+## TARGET_LINK_LIBRARIES(YourTargetNameHere ${QXT_LIBRARIES})
+## ...or..
+## TARGET_LINK_LIBRARIES(YourTargetNameHere ${QT_LIBRARIES} ${QXT_LIBRARIES})
+################### TODO:
+## The purpose of this cmake file is to find what components
+## exist, regardless of how libQxt was build or configured, thus
+## it should search/find all possible options. As I am not aware
+## that any module requires anything special to be used, adding all
+## modules to ${QXT_MODULES} below should be sufficient.
+## Eventually, there should be version numbers, but
+## I am still too unfamiliar with cmake to determine how to do
+## version checks and comparisons.
+## At the moment, this cmake returns a failure if you
+## try to use a component that doesn't exist. I don't know how to
+## set up warnings.
+## It would be nice having a FindQxt.cmake and a UseQxt.cmake
+## file like done for Qt - one to check for everything in advance
+
+##############
+
+###### setup
+SET(QXT_MODULES QxtGui QxtWeb QxtZeroConf QxtNetwork QxtSql QxtBerkeley QxtCore)
+SET(QXT_FOUND_MODULES)
+FOREACH(mod ${QXT_MODULES})
+ STRING(TOUPPER ${mod} U_MOD)
+ SET(QXT_${U_MOD}_INCLUDE_DIR NOTFOUND)
+ SET(QXT_${U_MOD}_LIB_DEBUG NOTFOUND)
+ SET(QXT_${U_MOD}_LIB_RELEASE NOTFOUND)
+ SET(QXT_FOUND_${U_MOD} FALSE)
+ENDFOREACH(mod)
+SET(QXT_QXTGUI_DEPENDSON QxtCore)
+SET(QXT_QXTWEB_DEPENDSON QxtCore QxtNetwork)
+SET(QXT_QXTZEROCONF_DEPENDSON QxtCore QxtNetwork)
+SET(QXT_QXTNETWORK_DEPENDSON QxtCore)
+SET(QXT_QXTQSQL_DEPENDSON QxtCore)
+SET(QXT_QXTBERKELEY_DEPENDSON QxtCore)
+
+FOREACH(mod ${QXT_MODULES})
+ STRING(TOUPPER ${mod} U_MOD)
+ FIND_PATH(QXT_${U_MOD}_INCLUDE_DIR ${mod}
+ PATH_SUFFIXES ${mod} include/${mod} Qxt/include/${mod} include/Qxt/${mod} include/qxt/${mod}
+ PATHS
+ ~/Library/Frameworks/
+ /Library/Frameworks/
+ /sw/
+ /usr/local/
+ /usr
+ /opt/local/
+ /opt/csw
+ /opt
+ "C:\\"
+ "C:\\Program Files\\"
+ "C:\\Program Files(x86)\\"
+ NO_DEFAULT_PATH
+ )
+ FIND_LIBRARY(QXT_${U_MOD}_LIB_RELEASE NAME ${mod}
+ PATH_SUFFIXES Qxt/lib64 Qxt/lib lib64 lib qxt/lib64 qxt/lib
+ PATHS
+ /sw
+ /usr/local
+ /usr
+ /opt/local
+ /opt/csw
+ /opt
+ "C:\\"
+ "C:\\Program Files"
+ "C:\\Program Files(x86)"
+ NO_DEFAULT_PATH
+ )
+ FIND_LIBRARY(QXT_${U_MOD}_LIB_DEBUG NAME ${mod}d
+ PATH_SUFFIXES Qxt/lib64 Qxt/lib lib64 lib qxt/lib64 qxt/lib
+ PATHS
+ /sw
+ /usr/local
+ /usr
+ /opt/local
+ /opt/csw
+ /opt
+ "C:\\"
+ "C:\\Program Files"
+ "C:\\Program Files(x86)"
+ NO_DEFAULT_PATH
+ )
+ IF (QXT_${U_MOD}_LIB_RELEASE)
+ SET(QXT_FOUND_MODULES "${QXT_FOUND_MODULES} ${mod}")
+ ENDIF (QXT_${U_MOD}_LIB_RELEASE)
+
+ IF (QXT_${U_MOD}_LIB_DEBUG)
+ SET(QXT_FOUND_MODULES "${QXT_FOUND_MODULES} ${mod}")
+ ENDIF (QXT_${U_MOD}_LIB_DEBUG)
+ENDFOREACH(mod)