Skip to content

Commit 1a644c3

Browse files
committed
Added resource file for Windows build to add icon to the exe; and fixed a bug where CMake might fail to add tests due to /bin/echo command which isn't recognised on windows
1 parent 5399cba commit 1a644c3

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

frontend/gtkmm/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ set(cadabra_gtk_src
4949
)
5050
if (MSVC)
5151
list(APPEND cadabra_gtk_src ${CADABRA_LIBS_DIR}/tiny-process-library/process_win.cpp)
52+
# Configure and add resource file to list of sources
53+
configure_file(win_res.rc.in ${CMAKE_CURRENT_BINARY_DIR}/win_res.rc)
54+
list(APPEND cadabra_gtk_src ${CMAKE_CURRENT_BINARY_DIR}/win_res.rc)
5255
else()
5356
list(APPEND cadabra_gtk_src ${CADABRA_LIBS_DIR}/tiny-process-library/process_unix.cpp)
5457
endif()

frontend/gtkmm/win_res.rc.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
102 ICON "@CADABRA_ROOT_DIR@/config/cadabra2.ico"

tests/CMakeLists.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ project(Cadabra)
88

99
print_header("Configuring tests")
1010

11-
11+
if (WIN32)
12+
set(ECHO_N "")
13+
else()
14+
set(ECHO_N "/bin/echo -n")
15+
endif()
1216
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure)
1317

1418
if(WIN32)
@@ -49,7 +53,7 @@ foreach(NBTEST ${NBTESTS})
4953
COMMAND cadabra2cadabra
5054
ARGS ${CNBIN}/${NBTEST}.cnb ${CDBOUT}/${NBTEST}.cdb
5155
COMMENT "Creating ${NBTEST} notebook...")
52-
add_custom_target("${NBTEST}_test" ALL /bin/echo -n DEPENDS ${CDBOUT}/${NBTEST}.cdb)
56+
add_custom_target("${NBTEST}_test" ALL ${ECHO_N} DEPENDS ${CDBOUT}/${NBTEST}.cdb)
5357
add_test(${NBTEST} ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/core/cadabra2 ${CDBOUT}/${NBTEST}.cdb)
5458
set_tests_properties(${NBTEST} PROPERTIES ENVIRONMENT "PYTHONPATH=${PYTHONPATH};LANG=en_US.UTF-8;LC_ALL=en_US.UTF-8;PYTHONIOENCODING=utf-8")
5559
endforeach()

0 commit comments

Comments
 (0)