diff options
author | gregory guy <g-gregory@gmx.fr> | 2019-06-27 16:35:25 +0200 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2019-06-27 16:35:25 +0200 |
commit | d4a1613e9f119ae68c695ab60f8d9856d1a54a52 (patch) | |
tree | 6de888ef76667e28c81832dc104c19b158859b9b /kalzium/src | |
parent | 9fb4e1ccde0b89b413bfdc8ae62f8178ecad5483 (diff) | |
download | tdeedu-d4a1613e9f119ae68c695ab60f8d9856d1a54a52.tar.gz tdeedu-d4a1613e9f119ae68c695ab60f8d9856d1a54a52.zip |
Conversion to the cmake building system.
Add includes to UI files to resolve FTBFS.
Signed-off-by: gregory guy <g-gregory@gmx.fr>
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
Diffstat (limited to 'kalzium/src')
-rw-r--r-- | kalzium/src/CMakeLists.txt | 109 | ||||
-rw-r--r-- | kalzium/src/data/CMakeLists.txt | 9 | ||||
-rw-r--r-- | kalzium/src/data/toolpics/CMakeLists.txt | 6 | ||||
-rw-r--r-- | kalzium/src/elementpics/CMakeLists.txt | 6 | ||||
-rw-r--r-- | kalzium/src/icons/CMakeLists.txt | 6 | ||||
-rw-r--r-- | kalzium/src/icons/htmlview/CMakeLists.txt | 6 | ||||
-rw-r--r-- | kalzium/src/molcalcwidgetbase.ui | 8 | ||||
-rw-r--r-- | kalzium/src/plotsetupwidget.ui | 8 | ||||
-rw-r--r-- | kalzium/src/settings_colors.ui | 34 | ||||
-rw-r--r-- | kalzium/src/solver/CMakeLists.txt | 118 | ||||
-rw-r--r-- | kalzium/src/somwidget.ui | 6 | ||||
-rw-r--r-- | kalzium/src/spectrumview.ui | 8 | ||||
-rw-r--r-- | kalzium/src/timewidget.ui | 6 |
13 files changed, 281 insertions, 49 deletions
diff --git a/kalzium/src/CMakeLists.txt b/kalzium/src/CMakeLists.txt new file mode 100644 index 00000000..b0b0cac2 --- /dev/null +++ b/kalzium/src/CMakeLists.txt @@ -0,0 +1,109 @@ +add_subdirectory( icons ) +add_subdirectory( elementpics ) +add_subdirectory( data ) +tde_conditional_add_subdirectory( WITH_OCAML_SOLVER solver ) + +include_directories( + ${CMAKE_BINARY_DIR} + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR} + ${TDE_INCLUDE_DIR} + ${TQT_INCLUDE_DIRS} + ${CMAKE_SOURCE_DIR}/libtdeedu/tdeeduplot + ${CMAKE_SOURCE_DIR}/libtdeedu/tdeeduui +) + +link_directories( + ${TQT_LIBRARY_DIRS} + ${TDE_LIB_DIR} + ${OCAML_LIBRARY_DIR} +) + +if( WITH_OCAML_SOLVER ) + set( OCAML_LIBRARIES asmrun nums m ${CMAKE_DL_LIBS} ) + set( OCAML_SOLVER + ${CMAKE_CURRENT_BINARY_DIR}/solver/modwrap.o + ${CMAKE_CURRENT_BINARY_DIR}/solver/solver.o + ) +else( ) + add_custom_target( kalzium_solver COMMENT "Empty kalzium solver" ) +endif( ) + + +##### kalzium (executable) + +tde_add_executable( kalzium AUTOMOC + + SOURCES + prefs.kcfgc + settings_colors.ui + settings_misc.ui + settings_units.ui + plotsetupwidget.ui + molcalcwidgetbase.ui + timewidget.ui + somwidget.ui + spectrumview.ui + eqresult.cpp + eqchemview.cpp + kalzium.cpp + main.cpp + periodictableview.cpp + element.cpp + detailinfodlg.cpp + orbitswidget.cpp + plotwidget.cpp + elementdataviewer.cpp + detailedgraphicaloverview.cpp + molcalcwidget.cpp + timewidget_impl.cpp + somwidget_impl.cpp + kalziumtip.cpp + spectrum.cpp + isotope.cpp + kalziumdataobject.cpp + spectrumwidget.cpp + exporter.cpp + spectrumviewimpl.cpp + kalziumutils.cpp + parser.cpp + moleculeparser.cpp + tempunit.cpp + LINK + tdecore-shared + tdeui-shared + tdeio-shared + tdehtml-shared + tdeeduplot-shared + tdeeduui-shared + ${OCAML_SOLVER} + ${OCAML_LIBRARIES} + + DEPENDENCIES + kalzium_solver + + DESTINATION ${BIN_INSTALL_DIR} +) + + +##### icons + +tde_install_icons( ) + + +##### other data + +install( + FILES kalziumui.rc + DESTINATION ${DATA_INSTALL_DIR}/kalzium +) + +install( + FILES kalzium.desktop + DESTINATION ${XDG_APPS_INSTALL_DIR} +) + +install( + FILES kalzium.kcfg + DESTINATION ${KCFG_INSTALL_DIR} +) diff --git a/kalzium/src/data/CMakeLists.txt b/kalzium/src/data/CMakeLists.txt new file mode 100644 index 00000000..a2229e0f --- /dev/null +++ b/kalzium/src/data/CMakeLists.txt @@ -0,0 +1,9 @@ +add_subdirectory( toolpics ) + + +##### other data + +install( + FILES bg.jpg data.xml knowledge.xml tools.xml + DESTINATION ${DATA_INSTALL_DIR}/kalzium/data +) diff --git a/kalzium/src/data/toolpics/CMakeLists.txt b/kalzium/src/data/toolpics/CMakeLists.txt new file mode 100644 index 00000000..f1189d0d --- /dev/null +++ b/kalzium/src/data/toolpics/CMakeLists.txt @@ -0,0 +1,6 @@ +file( GLOB _pics RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.jpg *.png ) + +install( + FILES ${_pics} + DESTINATION ${DATA_INSTALL_DIR}/kalzium/data/toolpics +) diff --git a/kalzium/src/elementpics/CMakeLists.txt b/kalzium/src/elementpics/CMakeLists.txt new file mode 100644 index 00000000..924eed7b --- /dev/null +++ b/kalzium/src/elementpics/CMakeLists.txt @@ -0,0 +1,6 @@ +file( GLOB _jpgs RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.jpg ) + +install( + FILES ${_jpgs} + DESTINATION ${DATA_INSTALL_DIR}/kalzium/elempics +) diff --git a/kalzium/src/icons/CMakeLists.txt b/kalzium/src/icons/CMakeLists.txt new file mode 100644 index 00000000..8fcaaaaa --- /dev/null +++ b/kalzium/src/icons/CMakeLists.txt @@ -0,0 +1,6 @@ +tde_auto_add_subdirectories( htmlview ) + + +##### icons + +tde_install_icons( DESTINATION ${DATA_INSTALL_DIR}/kalzium/icons ) diff --git a/kalzium/src/icons/htmlview/CMakeLists.txt b/kalzium/src/icons/htmlview/CMakeLists.txt new file mode 100644 index 00000000..0bbc208e --- /dev/null +++ b/kalzium/src/icons/htmlview/CMakeLists.txt @@ -0,0 +1,6 @@ +file( GLOB _pngs RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.png ) + +install( + FILES ${_pngs} icons.svg style.css + DESTINATION ${DATA_INSTALL_DIR}/kalzium/data/htmlview +) diff --git a/kalzium/src/molcalcwidgetbase.ui b/kalzium/src/molcalcwidgetbase.ui index d643dfe7..79a6074e 100644 --- a/kalzium/src/molcalcwidgetbase.ui +++ b/kalzium/src/molcalcwidgetbase.ui @@ -128,8 +128,8 @@ <slot access="protected">slotCalcButtonClicked()</slot> </Q_SLOTS> <layoutdefaults spacing="6" margin="11"/> -<includehints> - <includehint>klineedit.h</includehint> - <includehint>kpushbutton.h</includehint> -</includehints> +<includes> + <include location="global" impldecl="in implementation">klineedit.h</include> + <include location="global" impldecl="in implementation">kpushbutton.h</include> +</includes> </UI> diff --git a/kalzium/src/plotsetupwidget.ui b/kalzium/src/plotsetupwidget.ui index b777713c..b8972882 100644 --- a/kalzium/src/plotsetupwidget.ui +++ b/kalzium/src/plotsetupwidget.ui @@ -249,8 +249,8 @@ <customwidgets> </customwidgets> <layoutdefaults spacing="6" margin="11"/> -<includehints> - <includehint>knuminput.h</includehint> - <includehint>kcombobox.h</includehint> -</includehints> +<includes> + <include location="global" impldecl="in implementation">knuminput.h</include> + <include location="global" impldecl="in implementation">kcombobox.h</include> +</includes> </UI> diff --git a/kalzium/src/settings_colors.ui b/kalzium/src/settings_colors.ui index cd9316cb..46168417 100644 --- a/kalzium/src/settings_colors.ui +++ b/kalzium/src/settings_colors.ui @@ -902,35 +902,7 @@ <customwidgets> </customwidgets> <layoutdefaults spacing="6" margin="11"/> -<includehints> - <includehint>kcolorbutton.h</includehint> - <includehint>kcolorbutton.h</includehint> - <includehint>kcolorbutton.h</includehint> - <includehint>kcolorbutton.h</includehint> - <includehint>kcolorbutton.h</includehint> - <includehint>kcolorbutton.h</includehint> - <includehint>kcolorbutton.h</includehint> - <includehint>kcolorbutton.h</includehint> - <includehint>kcolorbutton.h</includehint> - <includehint>kcolorbutton.h</includehint> - <includehint>kcolorbutton.h</includehint> - <includehint>kcolorbutton.h</includehint> - <includehint>kcolorbutton.h</includehint> - <includehint>kcolorbutton.h</includehint> - <includehint>kcolorbutton.h</includehint> - <includehint>kcolorbutton.h</includehint> - <includehint>kcolorbutton.h</includehint> - <includehint>kcolorbutton.h</includehint> - <includehint>kcolorbutton.h</includehint> - <includehint>kcolorbutton.h</includehint> - <includehint>kcolorbutton.h</includehint> - <includehint>kcolorbutton.h</includehint> - <includehint>kcolorbutton.h</includehint> - <includehint>kcolorbutton.h</includehint> - <includehint>kcolorbutton.h</includehint> - <includehint>kcolorbutton.h</includehint> - <includehint>kcolorbutton.h</includehint> - <includehint>kcolorbutton.h</includehint> - <includehint>kcolorbutton.h</includehint> -</includehints> +<includes> + <include location="global" impldecl="in implementation">kcolorbutton.h</include> +</includes> </UI> diff --git a/kalzium/src/solver/CMakeLists.txt b/kalzium/src/solver/CMakeLists.txt new file mode 100644 index 00000000..aef745d4 --- /dev/null +++ b/kalzium/src/solver/CMakeLists.txt @@ -0,0 +1,118 @@ +##### macro to build ocaml sources + +macro( tde_add_ocaml_source _target _ml ) + + get_filename_component( basename "${_ml}" NAME_WE ) + + if( EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${basename}.mli ) + add_custom_command( + OUTPUT + ${CMAKE_CURRENT_BINARY_DIR}/${basename}.cmi + + COMMENT "Compile ${basename}.mli" + + COMMAND ${OCAMLC_EXECUTABLE} + -o ${CMAKE_CURRENT_BINARY_DIR}/${basename}.cmi + -I ${FACILE_INCLUDE_DIR} + -c ${CMAKE_CURRENT_SOURCE_DIR}/${basename}.mli + + DEPENDS + ${CMAKE_CURRENT_SOURCE_DIR}/${basename}.ml + ${ARGN} + + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + ) + + set( _build_cmi ${CMAKE_CURRENT_BINARY_DIR}/${basename}.cmi ) + else( ) + set( _build_cmi "" ) + endif( ) + + add_custom_command( + OUTPUT + ${CMAKE_CURRENT_BINARY_DIR}/${basename}.cmx + + COMMENT "Compile ${basename}.ml" + + COMMAND ${OCAMLOPT_EXECUTABLE} + -o ${CMAKE_CURRENT_BINARY_DIR}/${basename}.cmx + -I ${FACILE_INCLUDE_DIR} + -c ${CMAKE_CURRENT_SOURCE_DIR}/${basename}.ml + + DEPENDS + ${CMAKE_CURRENT_SOURCE_DIR}/${basename}.ml + ${_build_cmi} + ${ARGN} + + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + ) + + list( APPEND ${_target}-ocaml + ${CMAKE_CURRENT_BINARY_DIR}/${basename}.cmx + ) +endmacro( ) + + +# build kalzium ocaml solver + +tde_add_ocaml_source( kalzium_solver chemset.ml ) + +tde_add_ocaml_source( kalzium_solver datastruct.ml + ${CMAKE_CURRENT_BINARY_DIR}/chemset.cmi +) + +tde_add_ocaml_source( kalzium_solver chem.ml + ${CMAKE_CURRENT_BINARY_DIR}/chemset.cmi + ${CMAKE_CURRENT_BINARY_DIR}/datastruct.cmi +) + +tde_add_ocaml_source( kalzium_solver parser.ml + ${CMAKE_CURRENT_BINARY_DIR}/chemset.cmi +) + +tde_add_ocaml_source( kalzium_solver lexer.ml + ${CMAKE_CURRENT_BINARY_DIR}/chemset.cmi + ${CMAKE_CURRENT_BINARY_DIR}/parser.cmi +) + +tde_add_ocaml_source( kalzium_solver calc.ml + ${CMAKE_CURRENT_BINARY_DIR}/chem.cmi + ${CMAKE_CURRENT_BINARY_DIR}/chemset.cmi + ${CMAKE_CURRENT_BINARY_DIR}/datastruct.cmi + ${CMAKE_CURRENT_BINARY_DIR}/parser.cmi + ${CMAKE_CURRENT_BINARY_DIR}/lexer.cmx +) + +add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/modwrap.o + + COMMAND ${OCAMLOPT_EXECUTABLE} + -I ${FACILE_INCLUDE_DIR} + -c ${CMAKE_CURRENT_SOURCE_DIR}/modwrap.c + + DEPENDS + ${CMAKE_CURRENT_SOURCE_DIR}/modwrap.c + ${CMAKE_CURRENT_BINARY_DIR}/solver.o + + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} +) + +add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/solver.o + + COMMAND ${OCAMLOPT_EXECUTABLE} -output-obj + -o ${CMAKE_CURRENT_BINARY_DIR}/solver.o + ${FACILE_INCLUDE_DIR}/facile.cmxa + ${kalzium_solver-ocaml} + + DEPENDS + ${kalzium_solver-ocaml} + + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} +) + +add_custom_target( kalzium_solver + DEPENDS + ${CMAKE_CURRENT_BINARY_DIR}/modwrap.o + ${CMAKE_CURRENT_BINARY_DIR}/solver.o +) diff --git a/kalzium/src/somwidget.ui b/kalzium/src/somwidget.ui index 1494a1fe..d52a7abf 100644 --- a/kalzium/src/somwidget.ui +++ b/kalzium/src/somwidget.ui @@ -179,7 +179,7 @@ the state of matter</string> <connections> </connections> <layoutdefaults spacing="6" margin="11"/> -<includehints> - <includehint>knuminput.h</includehint> -</includehints> +<includes> + <include location="global" impldecl="in implementation">knuminput.h</include> +</includes> </UI> diff --git a/kalzium/src/spectrumview.ui b/kalzium/src/spectrumview.ui index 785d21af..25071379 100644 --- a/kalzium/src/spectrumview.ui +++ b/kalzium/src/spectrumview.ui @@ -217,8 +217,8 @@ <slot access="protected">slotExportAsImage()</slot> </Q_SLOTS> <layoutdefaults spacing="6" margin="11"/> -<includehints> - <includehint>spectrumwidget.h</includehint> - <includehint>kpushbutton.h</includehint> -</includehints> +<includes> + <include location="global" impldecl="in implementation">spectrumwidget.h</include> + <include location="global" impldecl="in implementation">kpushbutton.h</include> +</includes> </UI> diff --git a/kalzium/src/timewidget.ui b/kalzium/src/timewidget.ui index a684726f..b4c3b3ca 100644 --- a/kalzium/src/timewidget.ui +++ b/kalzium/src/timewidget.ui @@ -195,7 +195,7 @@ of the elements</string> </connection> </connections> <layoutdefaults spacing="6" margin="11"/> -<includehints> - <includehint>knuminput.h</includehint> -</includehints> +<includes> + <include location="global" impldecl="in implementation">knuminput.h</include> +</includes> </UI> |