-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split cmake files between core and gui
- Loading branch information
MickaelG
committed
Mar 30, 2018
1 parent
6682ff0
commit a1b94ed
Showing
8 changed files
with
97 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
add_library(pugixml ./pugixml.cpp) | ||
target_include_directories(pugixml PUBLIC ./) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
|
||
find_package(Boost 1.53 COMPONENTS date_time filesystem system unit_test_framework REQUIRED) | ||
|
||
file(GLOB CORE_SRC *.cpp) | ||
set (CORE_TEST_SRC ./test/test.cpp ./test/testgeometry.cpp) | ||
|
||
add_library(tomate_core ${CORE_SRC}) | ||
target_link_libraries(tomate_core pugixml) | ||
target_include_directories(tomate_core PUBLIC ./) | ||
QT5_USE_MODULES(tomate_core Core) | ||
|
||
add_executable(tomate_test ${CORE_TEST_SRC}) | ||
|
||
target_link_libraries(tomate_test tomate_core) | ||
target_link_libraries(tomate_test boost_unit_test_framework) | ||
target_link_libraries(tomate_test boost_date_time) | ||
|
||
add_test(NAME core | ||
COMMAND tomate_test | ||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) | ||
|
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
|
||
|
||
# Instruct CMake to run moc automatically when needed. | ||
set(CMAKE_AUTOMOC ON) | ||
|
||
file(GLOB WIDGETS_SRC ./gui_widgets/*.cpp) | ||
|
||
set(GUI_SRC | ||
croptimerepresentation.cpp | ||
DateRuler.cpp | ||
gui_calendar.cpp | ||
gui_controller.cpp | ||
gui_plants.cpp | ||
gui_plots.cpp | ||
gui_utils.cpp | ||
mainwindow.cpp | ||
spacescene.cpp | ||
spaceview.cpp | ||
timescene.cpp | ||
timeview.cpp | ||
) | ||
|
||
file(GLOB ui_FORMS gui_widgets/*.ui mainwindow.ui) | ||
QT5_WRAP_UI(ui_FORMS_HEADERS ${ui_FORMS}) | ||
|
||
add_executable(tomate_gui ${GUI_SRC} ${WIDGETS_SRC} main.cpp ${qrc_outfile} ${ui_FORMS_HEADERS}) | ||
target_include_directories(tomate_gui PUBLIC ./ ./gui_widgets) | ||
target_link_libraries(tomate_gui tomate_core) | ||
target_include_directories(tomate_gui PUBLIC ${CMAKE_CURRENT_BINARY_DIR}) | ||
target_link_libraries(tomate_gui boost_date_time boost_filesystem boost_system) | ||
QT5_USE_MODULES(tomate_gui Widgets) | ||
install(TARGETS tomate_gui RUNTIME DESTINATION bin) | ||
|
||
add_executable(tomate_test_gui ./test/test_gui.cpp ${GUI_SRC} ${WIDGETS_SRC} ${ui_FORMS_HEADERS}) | ||
target_include_directories(tomate_test_gui PUBLIC ./ ./gui_widgets) | ||
target_include_directories(tomate_test_gui PUBLIC ${CMAKE_CURRENT_BINARY_DIR}) | ||
target_link_libraries(tomate_test_gui tomate_core) | ||
target_link_libraries(tomate_test_gui boost_date_time boost_filesystem boost_system) | ||
QT5_USE_MODULES(tomate_test_gui Widgets Test) | ||
add_test(gui tomate_test_gui) | ||
|
||
#Translation files | ||
add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/tomate_fr.qm | ||
COMMAND lrelease ${CMAKE_SOURCE_DIR}/tomate_fr.ts -qm ${CMAKE_BINARY_DIR}/tomate_fr.qm | ||
MAIN_DEPENDENCY ${CMAKE_SOURCE_DIR}/tomate_fr.ts) | ||
|
||
set( qrc_outfile ${CMAKE_CURRENT_BINARY_DIR}/qrc_tomate.cxx) | ||
set(qm_files ${CMAKE_BINARY_DIR}/tomate_fr.qm) | ||
set(qrc_srcfile ${CMAKE_CURRENT_SOURCE_DIR}/tomate.qrc) | ||
set(qrc_infile ${CMAKE_CURRENT_BINARY_DIR}/tomate_copied.qrc) | ||
# Copy the QRC file to the output directory, because the files listed in the | ||
# qrc file are relative to that directory. | ||
add_custom_command( | ||
OUTPUT ${qrc_infile} | ||
COMMAND ${CMAKE_COMMAND} -E copy ${qrc_srcfile} ${qrc_infile} | ||
MAIN_DEPENDENCY ${qrc_srcfile} | ||
) | ||
# Run the resource compiler (rcc_options should already be set). We can't | ||
# use QT4_ADD_RESOURCES because the qrc file may not exist yet. | ||
add_custom_command( | ||
OUTPUT ${qrc_outfile} | ||
COMMAND ${QT_RCC_EXECUTABLE} | ||
ARGS ${rcc_options} -name tomate -o ${qrc_outfile} ${qrc_infile} | ||
MAIN_DEPENDENCY ${qrc_infile} | ||
DEPENDS ${qm_files} | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
|
||
#include "gui/mainwindow.h" | ||
#include "mainwindow.h" | ||
|
||
#include <QApplication> | ||
#include <QTranslator> | ||
|
File renamed without changes.