Permalink
Browse files

Replace QMake with CMake

This replaces the QMake build system with CMake.
  • Loading branch information...
kylelutz committed Apr 4, 2011
1 parent 34f31f2 commit 329fc46c7aacc3309304213c5c4270327cef72f8
Showing 517 changed files with 4,750 additions and 2,849 deletions.
View
@@ -1,30 +1,8 @@
-
-# object files
-*~
-*.o
-*.obj
-*.a
-*.so
-*.exe
+# directories
+build/
# vim temp files
.*.sw*
# qt generated files
-*.moc
-moc_*.cpp
-ui_*.h
-qrc_*.cpp
-*.pro.user*
-Makefile*
-*.Debug
-*.Release
-
-# directories
-bin/
-lib/
-share/
-
-# misc
-gdb.txt
-callgrind.out.*
+CMakeLists.txt.user
View
@@ -0,0 +1,14 @@
+cmake_minimum_required(VERSION 2.8)
+
+project(chemkit)
+
+set(chemkit_VERSION_MAJOR 0)
+set(chemkit_VERSION_MINOR 0)
+
+set(CMAKE_BUILD_TYPE Release)
+
+add_subdirectory(src)
+add_subdirectory(examples)
+
+enable_testing()
+add_subdirectory(tests)
View
@@ -1,5 +1,6 @@
=== Dependencies ==============================================================
+ - CMake - http://www.cmake.org
- Boost - http://www.boost.org
- Qt Framework (version 4.7 or later) - http://qt.nokia.com
- BLAS & LAPACK libraries
@@ -9,7 +10,9 @@
From the chemkit directory (the same directory this file is in) run the
following commands:
- qmake
+ mkdir build
+ cd build
+ cmake ..
make
=== Installation ==============================================================
View
@@ -1,10 +0,0 @@
-TEMPLATE = subdirs
-CONFIG += ordered
-SUBDIRS = src examples tests
-
-OTHER_FILES += AUTHORS \
- BIBLIOGRAPHY \
- COPYING \
- COPYING.LESSER \
- INSTALL \
- README
View
@@ -0,0 +1,3 @@
+add_subdirectory(cube-viewer)
+add_subdirectory(pdb-viewer)
+add_subdirectory(uff-energy)
@@ -1,4 +0,0 @@
-cube-viewer
-
-debug/
-release/
@@ -0,0 +1,16 @@
+find_package(Qt4 4.6 COMPONENTS QtCore QtGui QtOpenGL REQUIRED)
+set(QT_USE_QTOPENGL TRUE)
+include(${QT_USE_FILE})
+
+include_directories(${CMAKE_CURRENT_BINARY_DIR})
+include_directories(../../include)
+
+set(SOURCES cubeviewerexample.cpp)
+set(MOC_HEADERS cubeviewerexample.h)
+set(UI_FORMS cubeviewerexample.ui)
+
+qt4_wrap_ui(UI_SOURCES ${UI_FORMS})
+qt4_wrap_cpp(MOC_SOURCES ${MOC_HEADERS})
+
+add_executable(cube-viewer ${SOURCES} ${MOC_SOURCES} ${UI_SOURCES})
+target_link_libraries(cube-viewer chemkit chemkit-graphics ${QT_LIBRARIES})
@@ -1,9 +0,0 @@
-TEMPLATE = app
-QT += opengl
-
-INCLUDEPATH += ../../include
-LIBS = -L../../lib -lchemkit -lchemkit-graphics
-
-HEADERS += cubeviewerexample.h
-SOURCES += cubeviewerexample.cpp
-FORMS += cubeviewerexample.ui
View
@@ -1,4 +0,0 @@
-TEMPLATE = subdirs
-SUBDIRS = cube-viewer \
- pdb-viewer \
- uff-energy
@@ -1,4 +0,0 @@
-pdb-viewer
-
-debug/
-release/
@@ -0,0 +1,16 @@
+find_package(Qt4 4.6 COMPONENTS QtCore QtGui QtOpenGL REQUIRED)
+set(QT_USE_QTOPENGL TRUE)
+include(${QT_USE_FILE})
+
+include_directories(${CMAKE_CURRENT_BINARY_DIR})
+include_directories(../../include)
+
+set(SOURCES pdbviewerexample.cpp)
+set(MOC_HEADERS pdbviewerexample.h)
+set(UI_FORMS pdbviewerexample.ui)
+
+qt4_wrap_ui(UI_SOURCES ${UI_FORMS})
+qt4_wrap_cpp(MOC_SOURCES ${MOC_HEADERS})
+
+add_executable(pdb-viewer ${SOURCES} ${MOC_SOURCES} ${UI_SOURCES})
+target_link_libraries(pdb-viewer chemkit chemkit-graphics ${QT_LIBRARIES})
@@ -1,9 +0,0 @@
-TEMPLATE = app
-QT += opengl
-
-INCLUDEPATH += ../../include
-LIBS = -L../../lib -lchemkit -lchemkit-graphics
-
-SOURCES += pdbviewerexample.cpp
-HEADERS += pdbviewerexample.h
-FORMS += pdbviewerexample.ui
@@ -1,4 +0,0 @@
-uff-energy
-
-debug/
-release/
@@ -0,0 +1,11 @@
+find_package(Qt4 4.6 COMPONENTS QtCore REQUIRED)
+set(QT_DONT_USE_QTGUI TRUE)
+include(${QT_USE_FILE})
+
+include_directories(${CMAKE_CURRENT_BINARY_DIR})
+include_directories(../../include)
+
+set(SOURCES uffenergyexample.cpp)
+
+add_executable(uff-energy ${SOURCES})
+target_link_libraries(uff-energy chemkit ${QT_LIBRARIES})
@@ -1,7 +0,0 @@
-TEMPLATE = app
-QT -= gui
-
-INCLUDEPATH += ../../include
-LIBS = -L../../lib -lchemkit
-
-SOURCES += uffenergyexample.cpp
View
@@ -1,67 +0,0 @@
-#!/usr/bin/python
-
-# this script runs all the chemkit auto tests
-
-import os
-import sys
-import subprocess
-
-TESTS_PASSED = 0
-TESTS_RUN = 0
-
-def runtest(file):
- filePath = os.path.join(os.getcwd(), file)
- os.putenv("LD_LIBRARY_PATH", os.path.join(os.getcwd(), "../lib/"))
- os.putenv("CHEMKIT_PLUGIN_PATH", os.path.join(os.getcwd(), "../share/chemkit/plugins/"))
-
- print " %-32s" % (os.path.sep.join(file.split("/")[-3:-1])),
-
- sys.stdout.flush()
-
- test = subprocess.Popen([filePath, "-silent"], stdout=subprocess.PIPE, cwd=os.path.dirname(filePath))
-
- ret = test.wait()
-
- # e.g. "Totals: 12 passed, 0 failed, 0 skipped"
- output = test.stdout.read()
- lastline = output.split("\n")[-2];
-
- passed = int(lastline.split(' ')[1])
- failed = int(lastline.split(' ')[3])
- skipped = int(lastline.split(' ')[5])
-
- global TESTS_PASSED
- global TESTS_RUN
- if not failed:
- TESTS_PASSED += 1
- TESTS_RUN += 1
-
- print " -- %s" % (("pass","FAIL")[failed>0])
-
-def runtests(directory):
- directory = os.path.join("../tests/auto/", directory)
-
- for dir in os.listdir(directory):
- dirpath = os.path.join(directory, dir)
-
- if not os.path.isdir(dirpath):
- continue
-
- testfile = os.path.join(dirpath, dir)
-
- if not os.path.exists(testfile):
- continue
-
- runtest(testfile)
-
-if __name__ == '__main__':
- print "Running Tests:"
- runtests("chemkit")
- runtests("graphics")
- runtests("widgets")
- runtests("plugins")
- runtests("apps")
- #runtests("../benchmarks")
-
- print "Results:"
- print " %i passed, %i failed, %i total" % (TESTS_PASSED, (TESTS_RUN-TESTS_PASSED), TESTS_RUN)
@@ -1,2 +0,0 @@
-TEMPLATE = subdirs
-SUBDIRS = inchi
@@ -1,12 +0,0 @@
-TARGET = inchi
-TEMPLATE = lib
-DESTDIR = ../../../lib
-CONFIG += staticlib
-QT -= core gui
-
-# The inchi sources are filled with warnings. Turn
-# them off get rid of the noise.
-CONFIG += warn_off
-
-SOURCES = *.c
-HEADERS = *.h
View
@@ -0,0 +1,7 @@
+add_subdirectory(chemkit)
+add_subdirectory(graphics)
+add_subdirectory(web)
+add_subdirectory(widgets)
+add_subdirectory(plugins)
+add_subdirectory(qt-designer-plugins)
+add_subdirectory(apps)
View
@@ -0,0 +1,14 @@
+macro(add_chemkit_executable name)
+ add_executable(${name} ${ARGN})
+ set_target_properties(${name} PROPERTIES OUTPUT_NAME chemkit-${name})
+ install(TARGETS ${name} DESTINATION bin)
+
+ # copy binary
+ get_target_property(location ${name} LOCATION)
+ get_filename_component(filename ${location} NAME)
+ add_custom_command(TARGET ${name} POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy ${location} ${CMAKE_BINARY_DIR}/bin/chemkit-${name})
+endmacro(add_chemkit_executable)
+
+add_subdirectory(builder)
+add_subdirectory(convert)
+add_subdirectory(grep)
View
@@ -1,10 +0,0 @@
-TEMPLATE = subdirs
-SUBDIRS = builder \
- convert \
- grep
-
-# windows with msvc does not have getopt which
-# chemkit-convert and chemkit-grep need
-win32-msvc* {
- SUBDIRS -= convert grep
-}
@@ -1,4 +0,0 @@
-chemkit-builder
-
-debug/
-release/
@@ -0,0 +1,47 @@
+find_package(Qt4 4.6 COMPONENTS QtCore QtGui QtOpenGL REQUIRED)
+set(QT_USE_QTGUI TRUE)
+include(${QT_USE_FILE})
+
+include_directories(${CMAKE_CURRENT_BINARY_DIR})
+include_directories(../../../include)
+
+set(SOURCES
+ builder.cpp
+ buildertool.cpp
+ builderwindow.cpp
+ buildtool.cpp
+ displaysettingsdock.cpp
+ energyminimizationdock.cpp
+ energyminimizer.cpp
+ manipulatetool.cpp
+ moleculelistdock.cpp
+ moleculepropertiesdialog.cpp
+ navigatetool.cpp
+ toolsettingsdock.cpp
+)
+
+set(MOC_HEADERS
+ builderwindow.h
+ buildtool.h
+ displaysettingsdock.h
+ energyminimizationdock.h
+ energyminimizer.h
+ moleculelistdock.h
+ moleculepropertiesdialog.h
+ toolsettingsdock.h
+)
+
+set(UI_FORMS
+ builderwindow.ui
+ displaysettingsdock.ui
+ energyminimizationdock.ui
+ moleculelistdock.ui
+ moleculepropertiesdialog.ui
+ toolsettingsdock.ui
+)
+
+qt4_wrap_ui(UI_SOURCES ${UI_FORMS})
+qt4_wrap_cpp(MOC_SOURCES ${MOC_HEADERS})
+
+add_chemkit_executable(builder ${SOURCES} ${MOC_SOURCES} ${UI_SOURCES})
+target_link_libraries(builder chemkit chemkit-graphics chemkit-widgets ${QT_LIBRARIES})
@@ -1,37 +0,0 @@
-TARGET = chemkit-builder
-DESTDIR = ../../../bin
-TEMPLATE = app
-INCLUDEPATH += ../../../include
-LIBS = -L../../../lib -lchemkit -lchemkit-graphics -lchemkit-widgets
-QT += opengl
-SOURCES += builder.cpp \
- buildertool.cpp \
- builderwindow.cpp \
- buildtool.cpp \
- displaysettingsdock.cpp \
- energyminimizationdock.cpp \
- energyminimizer.cpp \
- manipulatetool.cpp \
- moleculelistdock.cpp \
- moleculepropertiesdialog.cpp \
- navigatetool.cpp \
- toolsettingsdock.cpp
-HEADERS += buildertool.h \
- builderwindow.h \
- buildtool.h \
- displaysettingsdock.h \
- energyminimizationdock.h \
- energyminimizer.h \
- manipulatetool.h \
- moleculelistdock.h \
- moleculepropertiesdialog.h \
- navigatetool.h \
- toolsettingsdock.h
-FORMS += builderwindow.ui \
- displaysettingsdock.ui \
- energyminimizationdock.ui \
- moleculelistdock.ui \
- moleculepropertiesdialog.ui \
- toolsettingsdock.ui
-target.path = /usr/bin
-INSTALLS += target
@@ -1,4 +0,0 @@
-chemkit-convert
-
-debug/
-release/
@@ -0,0 +1,8 @@
+find_package(Qt4 4.6 COMPONENTS QtCore REQUIRED)
+set(QT_DONT_USE_QTGUI TRUE)
+include(${QT_USE_FILE})
+
+include_directories(../../../include)
+
+add_chemkit_executable(convert convert.cpp)
+target_link_libraries(convert chemkit ${QT_LIBRARIES})
Oops, something went wrong.

0 comments on commit 329fc46

Please sign in to comment.