diff options
author | Chris Robinson <[email protected]> | 2013-06-24 04:27:35 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2013-06-24 04:27:35 -0700 |
commit | eebc6c0419c30917f71b7ae741638bdb20c32f58 (patch) | |
tree | 1f492f24f0297fbac1cf96cdd607f021422aa10f | |
parent | 144059b062bd357cdec27416010872f37ef69cba (diff) |
Move alsoft-config to a separate project file
This to help avoid FindQt4.cmake from polluting the current project with
defines and include directories, applying them to targets that don't use Qt.
-rw-r--r-- | CMakeLists.txt | 27 | ||||
-rw-r--r-- | utils/alsoft-config/CMakeLists.txt | 30 |
2 files changed, 31 insertions, 26 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 19d1dece..87734373 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -866,32 +866,7 @@ IF(ALSOFT_UTILS) ) MESSAGE(STATUS "Building utility programs") - find_package(Qt4) - if(QT_FOUND) - include(${QT_USE_FILE}) - include_directories(${QT_QTCORE_INCLUDE_DIR} ${QT_QTGUI_INCLUDE_DIR} - ${QT_QTCORE_INCLUDE_DIR} ${QT_QTGUI_INCLUDE_DIR}) - - set(alsoft-config_SRCS utils/alsoft-config/main.cpp - utils/alsoft-config/mainwindow.cpp - ) - - set(alsoft-config_UIS utils/alsoft-config/mainwindow.ui) - QT4_WRAP_UI(UIS ${alsoft-config_UIS}) - - set(alsoft-config_MOCS utils/alsoft-config/mainwindow.h) - QT4_WRAP_CPP(MOCS ${alsoft-config_MOCS}) - - add_executable(alsoft-config ${alsoft-config_SRCS} ${UIS} ${RSCS} ${TRS} ${MOCS}) - target_link_libraries(alsoft-config ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY}) - - INSTALL(TARGETS alsoft-config - RUNTIME DESTINATION bin - LIBRARY DESTINATION "lib${LIB_SUFFIX}" - ARCHIVE DESTINATION "lib${LIB_SUFFIX}" - ) - message(STATUS "Building configuration program") - endif() + add_subdirectory(utils/alsoft-config) MESSAGE(STATUS "") ENDIF() diff --git a/utils/alsoft-config/CMakeLists.txt b/utils/alsoft-config/CMakeLists.txt new file mode 100644 index 00000000..143834c1 --- /dev/null +++ b/utils/alsoft-config/CMakeLists.txt @@ -0,0 +1,30 @@ +project(alsoft-config) + +include_directories("${alsoft-config_BINARY_DIR}") + +find_package(Qt4 COMPONENTS QtCore QtGui) +if(QT_QTGUI_LIBRARY AND QT_QTCORE_LIBRARY) + include(${QT_USE_FILE}) + + include_directories(${QT_QTCORE_INCLUDE_DIR} ${QT_QTGUI_INCLUDE_DIR}) + + set(alsoft-config_SRCS main.cpp + mainwindow.cpp + ) + + set(alsoft-config_UIS mainwindow.ui) + QT4_WRAP_UI(UIS ${alsoft-config_UIS}) + + set(alsoft-config_MOCS mainwindow.h) + QT4_WRAP_CPP(MOCS ${alsoft-config_MOCS}) + + add_executable(../../alsoft-config ${alsoft-config_SRCS} ${UIS} ${RSCS} ${TRS} ${MOCS}) + target_link_libraries(../../alsoft-config ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY}) + + INSTALL(TARGETS ../../alsoft-config + RUNTIME DESTINATION bin + LIBRARY DESTINATION "lib${LIB_SUFFIX}" + ARCHIVE DESTINATION "lib${LIB_SUFFIX}" + ) + message(STATUS "Building configuration program") +endif() |