Permalink
Browse files

Moved platform.hints outside of rc

  • Loading branch information...
1 parent 1d01fbc commit b9eab3aa372b921bc490ab0c829a03627938c405 @bmcdorman bmcdorman committed Oct 17, 2012
Showing with 11 additions and 13 deletions.
  1. +9 −6 CMakeLists.txt
  2. +0 −5 rc/platform.qrc
  3. +2 −2 src/MainWindow.cpp
View
@@ -24,7 +24,7 @@ SET(computer_SRCS_CXX ${SOURCES})
SET(computer_UI ${UIS})
SET(computer_MOC_SRCS ${INCLUDES})
-SET(computer_QRC_FILES ${RC}/icons.qrc ${RC}/platform.qrc)
+SET(computer_QRC_FILES ${RC}/icons.qrc)
QT4_WRAP_CPP(computer_SRCS_CXX ${computer_MOC_SRCS})
QT4_WRAP_UI(computer_SRCS_CXX ${computer_UI})
@@ -49,27 +49,30 @@ SET(EXECUTABLE_OUTPUT_PATH ${computer_SOURCE_DIR}/deploy)
SET(LIBRARY_OUTPUT_PATH ${computer_SOURCE_DIR}/lib)
TARGET_LINK_LIBRARIES(computer ${QT_LIBRARIES} qscintilla2 pcompiler easydevice kar)
-macro(copy_files FILES DESTINATION)
- add_custom_target(copy ALL
+macro(copy_files NAME FILES DESTINATION)
+ add_custom_target(copy_${NAME} ALL
COMMENT "Copying files: ${FILES}")
foreach(FILENAME ${FILES})
get_filename_component(REAL_FILENAME ${FILENAME} NAME)
set(DST "${DESTINATION}/${REAL_FILENAME}")
add_custom_command(
- TARGET copy
+ TARGET copy_${NAME}
COMMAND ${CMAKE_COMMAND} -E copy "${FILENAME}" "${DST}"
)
endforeach(FILENAME)
endmacro(copy_files)
IF(APPLE)
-copy_files(${RC}/target.h ${computer_SOURCE_DIR}/deploy/computer.app/Contents/prefix/usr/include)
+copy_files(target ${RC}/target.h ${computer_SOURCE_DIR}/deploy/computer.app/Contents/prefix/usr/include)
+copy_files(platform.hints ${RC}/platform.hints ${computer_SOURCE_DIR}/deploy/computer.app/Contents)
ELSE(APPLE)
-copy_files(${RC}/target.h ${computer_SOURCE_DIR}/deploy/prefix/usr/include)
+copy_files(target ${RC}/target.h ${computer_SOURCE_DIR}/deploy/prefix/usr/include)
+copy_files(platform.hints ${RC}/platform.hints ${computer_SOURCE_DIR}/deploy)
ENDIF(APPLE)
+
IF(APPLE)
ADD_CUSTOM_TARGET(computer_MacDeployQt ALL
COMMAND ${QT_BINARY_DIR}/macdeployqt ${computer_SOURCE_DIR}/deploy/computer.app -verbose=0
View
@@ -1,5 +0,0 @@
-<RCC>
- <qresource prefix="/platform/">
- <file>platform.hints</file>
- </qresource>
-</RCC>
View
@@ -172,7 +172,7 @@ Compiler::OutputList MainWindow::compile(const QString& name)
}
Input input = Input::fromList(extractedFiles);
Engine engine(Compilers::instance()->compilers());
- Options opts = Options::load(QDir::current().filePath(":/platform/platform.hints"));
+ Options opts = Options::load(QDir::current().filePath("platform.hints"));
opts.replace("${PREFIX}", QDir::currentPath() + "/prefix");
qDebug() << "Building with" << opts;
OutputList ret = engine.compile(input, opts);
@@ -206,7 +206,7 @@ Compiler::OutputList MainWindow::compile(const QString& name)
}
QString cachedResult = cachePath(name) + "/" + QFileInfo(firstTerminalFile).fileName();
-
+ QFile::remove(cachedResult);
if(!QFile::copy(firstTerminalFile, cachedResult)) {
ret << OutputList() << Output(programSavePath(name), 1,
QByteArray(), ("error: Failed to copy \"" + firstTerminalFile

0 comments on commit b9eab3a

Please sign in to comment.