summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Schmelzer2011-12-05 14:38:48 +0100
committerSebastian Schmelzer2011-12-05 14:38:48 +0100
commita0f2ef9ccaaba13198f680c438f7d4feb68da45d (patch)
tree930ad84710b9d4ddaf3eb6ec322699b1317a6dc9
parentcleanup (diff)
downloadfbgui-a0f2ef9ccaaba13198f680c438f7d4feb68da45d.tar.gz
fbgui-a0f2ef9ccaaba13198f680c438f7d4feb68da45d.tar.xz
fbgui-a0f2ef9ccaaba13198f680c438f7d4feb68da45d.zip
finaly clean cmake files
-rw-r--r--CMakeLists.txt65
-rw-r--r--cmake/FindQxt.cmake111
-rw-r--r--cmake/QxtConfig.cmake121
-rw-r--r--src/customdhcpcd/CMakeLists.txt15
-rw-r--r--src/customdhcpcd/logwriter.c2
-rw-r--r--src/fbgui/CMakeLists.txt64
6 files changed, 71 insertions, 307 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 31b8efe..6b20383 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,68 +2,7 @@ cmake_minimum_required(VERSION 2.8)
project(fbgui)
-set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
-
find_package(PkgConfig)
-pkg_check_modules(LOG4CXX REQUIRED liblog4cxx)
-pkg_check_modules(LIBSYSFS REQUIRED libsysfs)
-pkg_check_modules(LIBNL REQUIRED libnl-1)
-pkg_check_modules(LIBUSB REQUIRED libusb-1.0)
-
-set(QT_MIN_VERSION "4.7.0")
-find_package(Qt4 REQUIRED)
-if (QT4_FOUND)
- message(STATUS "QT4 found.")
-else(QT4_FOUND)
- message(FATAL_ERROR "QT4 not found!")
-endif(QT4_FOUND)
-
-set(QT_USE_QTNETWORK TRUE)
-set(QT_USE_QTWEBKIT TRUE)
-
-file(GLOB FBGUI_SOURCES src/fbgui/*.cpp)
-file(GLOB FBGUI_MOC_HEADERS src/fbgui/*.h src/common/*.h)
-file(GLOB FBGUI_UIS src/fbgui/*.ui)
-file(GLOB FBGUI_RCS src/fbgui/*.qrc)
-
-include_directories(${CMAKE_CURRENT_BINARY_DIR}
- ./src/customdhcpcd/
- ./src/common
- ./build
- /usr/include/
- ${QT_INCLUDES}
- ${LOG4CXX_INCLUDES}
- ${LIBSYSFS_INCLUDES}
- ${LIBNL_INCLUDES}
- ${LIBUSB_INCLUDES}
-)
-
-include(${QT_USE_FILE})
-add_definitions(${QT_DEFINITIONS})
-
-link_directories(
- /usr/lib
- /usr/local/lib
-)
-
-QT4_ADD_RESOURCES(FBGUI_RC_SOURCES ${FBGUI_RCS})
-QT4_WRAP_UI(FBGUI_UI_HEADERS ${FBGUI_UIS})
-QT4_WRAP_CPP(FBGUI_MOC_SOURCES ${FBGUI_MOC_HEADERS})
-
-add_executable(fbgui
- ${QT_INCLUDES}
- ${LIBSYSFS_INCLUDES}
- ${LIBNL_INCLUDES}
- ${LIBUSB_INCLUDES}
- ${FBGUI_SOURCES}
- ${FBGUI_MOC_SOURCES}
- ${FBGUI_UI_HEADERS}
- ${FBGUI_RC_SOURCES})
-target_link_libraries(fbgui
- ${QT_LIBRARIES}
- ${LOG4CXX_LIBRARIES}
- ${LIBSYSFS_LIBRARIES}
- ${LIBNL_LIBRARIES}
- ${LIBUSB_LIBRARIES}
- )
+add_subdirectory(src/customdhcpcd)
+add_subdirectory(src/fbgui)
diff --git a/cmake/FindQxt.cmake b/cmake/FindQxt.cmake
deleted file mode 100644
index 402fb51..0000000
--- a/cmake/FindQxt.cmake
+++ /dev/null
@@ -1,111 +0,0 @@
-#############
-## 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)
diff --git a/cmake/QxtConfig.cmake b/cmake/QxtConfig.cmake
deleted file mode 100644
index c3afe14..0000000
--- a/cmake/QxtConfig.cmake
+++ /dev/null
@@ -1,121 +0,0 @@
-##
-## 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 .... if everything depends on core... right?
-SET(QXT_MODULES QxtGui QxtNetwork QxtWork QxtSql QxtCore)
-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_QXTNETWORK_DEPENDSON QxtCore)
-SET(QXT_QXTWEB_DEPENDSON QxtCore)
-SET(QXT_QXTQSQL_DEPENDSON QxtCore)
-
-FOREACH(mod ${QXT_MODULES})
- STRING(TOUPPER ${mod} U_MOD)
- FIND_PATH(QXT_${U_MOD}_INCLUDE_DIR ${mod}
- /usr/Qxt/include/${mod}
- /usr/local/Qxt/include/${mod}
- C:\\libQxt\\include\\${mod}
- NO_DEFAULT_PATH
- )
- FIND_LIBRARY(QXT_${U_MOD}_LIB_RELEASE NAME ${mod}
- PATHS
- /usr/Qxt/lib
- /usr/lib
- /lib
- /usr/local/Qxt/lib
- C:\\libQxt\\lib
- NO_DEFAULT_PATH
- )
- FIND_LIBRARY(QXT_${U_MOD}_LIB_DEBUG NAME ${mod}d
- PATHS
- /usr/Qxt/lib
- /usr/lib
- /lib
- /usr/local/Qxt/lib
- C:\\libQxt\\lib
- NO_DEFAULT_PATH
- )
- MESSAGE( "Found lib..." ${QXT_${U_MOD}_LIB_RELEASE} )
-ENDFOREACH(mod)
-
-FOREACH(mod ${QXT_MODULES})
- STRING(TOUPPER ${mod} U_MOD)
- IF(QXT_${U_MOD}_INCLUDE_DIR AND QXT_${U_MOD}_LIB_RELEASE)
- SET(QXT_FOUND_${U_MOD} TRUE)
- ENDIF(QXT_${U_MOD}_INCLUDE_DIR AND QXT_${U_MOD}_LIB_RELEASE)
-ENDFOREACH(mod)
-
-
-##### find and include
-# To use a Qxt Library....
-# SET(QXT_FIND_COMPONENTS QxtCore, QxtGui)
-# ...and this will do the rest
-IF( QXT_FIND_COMPONENTS )
- FOREACH( component ${QXT_FIND_COMPONENTS} )
- STRING( TOUPPER ${component} _COMPONENT )
- SET(QXT_USE_${_COMPONENT}_COMPONENT TRUE)
- ENDFOREACH( component )
-ENDIF( QXT_FIND_COMPONENTS )
-
-SET(QXT_LIBRARIES "")
-SET(QXT_INCLUDE_DIRS "")
-
-# like FindQt4.cmake, in order of dependence
-FOREACH( module ${QXT_MODULES} )
- STRING(TOUPPER ${module} U_MOD)
- IF(QXT_USE_${U_MOD} OR QXT_DEPENDS_${U_MOD})
- MESSAGE("Searching for ${module}")
- IF(QXT_FOUND_${U_MOD})
- STRING(REPLACE "QXT" "" qxt_module_def "${U_MOD}")
- ADD_DEFINITIONS(-DQXT_${qxt_module_def}_LIB)
- SET(QXT_INCLUDE_DIRS ${QXT_INCLUDE_DIRS} ${QXT_${U_MOD}_INCLUDE_DIR})
- INCLUDE_DIRECTORIES(${QXT_${U_MOD}_INCLUDE_DIR})
- SET(QXT_LIBRARIES ${QXT_LIBRARIES} ${QXT_${U_MOD}_LIB_RELEASE})
- ELSE(QXT_FOUND_${U_MOD})
- MESSAGE("Could not find Qxt Module ${module}")
- RETURN()
- ENDIF(QXT_FOUND_${U_MOD})
- FOREACH(dep QXT_${U_MOD}_DEPENDSON)
- SET(QXT_DEPENDS_${dep} TRUE)
- ENDFOREACH(dep)
- ENDIF(QXT_USE_${U_MOD} OR QXT_DEPENDS_${U_MOD})
-ENDFOREACH(module)
-MESSAGE( "Including QxtLibraries..." ${QXT_LIBRARIES} )
diff --git a/src/customdhcpcd/CMakeLists.txt b/src/customdhcpcd/CMakeLists.txt
index a716a5a..f257ab2 100644
--- a/src/customdhcpcd/CMakeLists.txt
+++ b/src/customdhcpcd/CMakeLists.txt
@@ -1,17 +1,10 @@
-cmake_minimum_required(VERSION 2.8)
-
-project(customdhcpdcd)
-
-set(CMAKE_C_FLAGS "-lrt")
-
-set(CUSTOMDHCPCD_SOURCES arp.c configure.c info.c logger.c socket.c client.c discover.c interface.c logwriter.c
-common.c dhcp.c duid.c ipv4ll.c signal.c)
-
-#file(GLOB_RECURSE CUSTOMDHCPCD_SOURCES *.c)
+file(GLOB_RECURSE CUSTOMDHCPCD_SOURCES *.c)
file(GLOB_RECURSE CUSTOMDHCPCD_HEADERS *.h)
add_library(customdhcpcd SHARED ${CUSTOMDHCPCD_SOURCES} ${CUSTOMDHCPCD_HEADERS})
+target_link_libraries(customdhcpcd rt)
#add_executable(customdhcpcd ${CUSTOMDHCPCD_SOURCES})
add_executable(cdhcpcd dhcpcd.c)
-target_link_libraries(cdhcpcd customdhcpcd )
+set_target_properties(cdhcpcd PROPERTIES LINKER_LANGUAGE C)
+target_link_libraries(cdhcpcd customdhcpcd)
diff --git a/src/customdhcpcd/logwriter.c b/src/customdhcpcd/logwriter.c
index e3316cb..5437438 100644
--- a/src/customdhcpcd/logwriter.c
+++ b/src/customdhcpcd/logwriter.c
@@ -89,7 +89,7 @@ void sendToQt(log_msg * msg)
msg->substatus, msg->msg);
if (ret < 1)
{
- log ger(LOG_INFO, "[fbgui] ERROR filling message buffer");
+ logger(LOG_INFO, "[fbgui] ERROR filling message buffer");
//syslog(LOG_INFO, "[fbgui] ERROR filling message buffer");
return;
}
diff --git a/src/fbgui/CMakeLists.txt b/src/fbgui/CMakeLists.txt
new file mode 100644
index 0000000..434428f
--- /dev/null
+++ b/src/fbgui/CMakeLists.txt
@@ -0,0 +1,64 @@
+pkg_check_modules(LOG4CXX REQUIRED liblog4cxx)
+pkg_check_modules(LIBSYSFS REQUIRED libsysfs)
+pkg_check_modules(LIBNL REQUIRED libnl-1)
+pkg_check_modules(LIBUSB REQUIRED libusb-1.0)
+
+set(QT_MIN_VERSION "4.7.0")
+find_package(Qt4 REQUIRED)
+if (QT4_FOUND)
+ message(STATUS "QT4 found.")
+else(QT4_FOUND)
+ message(FATAL_ERROR "QT4 not found!")
+endif(QT4_FOUND)
+
+set(QT_USE_QTNETWORK TRUE)
+set(QT_USE_QTWEBKIT TRUE)
+
+file(GLOB FBGUI_SOURCES src/fbgui/*.cpp)
+file(GLOB FBGUI_HEADERS src/fbgui/*.h src/common/*.h)
+file(GLOB FBGUI_MOC_HEADERS
+src/fbgui/downloadmanager.h
+src/fbgui/interfaceconfiguration.h
+src/fbgui/javascriptinterface.h
+src/fbgui/ndgui.h
+src/fbgui/networkdiscovery.h
+src/fbgui/networkmanager.h
+src/fbgui/fbgui.h)
+file(GLOB FBGUI_UIS src/fbgui/*.ui)
+file(GLOB FBGUI_RCS src/fbgui/*.qrc)
+
+include_directories(${CMAKE_CURRENT_BINARY_DIR}
+ /usr/include/
+ ${QT_INCLUDES}
+ ${LOG4CXX_INCLUDES}
+ ${LIBSYSFS_INCLUDES}
+ ${LIBNL_INCLUDES}
+ ${LIBUSB_INCLUDES}
+)
+
+include(${QT_USE_FILE})
+add_definitions(${QT_DEFINITIONS})
+
+QT4_ADD_RESOURCES(FBGUI_RC_SOURCES ${FBGUI_RCS})
+QT4_WRAP_UI(FBGUI_UI_HEADERS ${FBGUI_UIS})
+QT4_WRAP_CPP(FBGUI_MOC_SOURCES ${FBGUI_MOC_HEADERS})
+
+add_executable(fbgui
+ ${QT_INCLUDES}
+ ${LIBSYSFS_INCLUDES}
+ ${LIBNL_INCLUDES}
+ ${LIBUSB_INCLUDES}
+ ${FBGUI_SOURCES}
+ ${FBGUI_MOC_SOURCES}
+ ${FBGUI_UI_HEADERS}
+ ${FBGUI_RC_SOURCES})
+
+set_target_properties(fbgui PROPERTIES LINKER_LANGUAGE C)
+target_link_libraries(fbgui
+ ${QT_LIBRARIES}
+ ${LOG4CXX_LIBRARIES}
+ ${LIBSYSFS_LIBRARIES}
+ ${LIBNL_LIBRARIES}
+ ${LIBUSB_LIBRARIES}
+ customdhcpcd
+)