Skip to content

Commit

Permalink
Update cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
WillNilges committed Jan 1, 2025
1 parent c7396a9 commit e2b7a77
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 18 deletions.
19 changes: 7 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/ImageTranscription)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/ImageTranscription)

# Things work a little differently on Windows vs Linux.
if (WIN32)
message("Building for Windows")
IF(WIN32)
message("Building for Windows")
set(INSTALL_DESTINATION "C:/Program Files/Xournal++/share/xournalpp/plugins")
ELSE()
# Need position-independent code flag enabled to make Lua work
Expand Down Expand Up @@ -56,18 +56,11 @@ target_link_libraries(inkpath ${OpenCV_LIBRARIES})

# Copy the script and manifest into the build artifact
file(GLOB PLUGIN_FILES "${CMAKE_CURRENT_SOURCE_DIR}/plugin/*")
foreach(FILE ${PLUGIN_FILES})
file(COPY ${FILE} DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
endforeach()
FOREACH(FILE ${PLUGIN_FILES})
file(COPY ${FILE} DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
ENDFOREACH()

IF(WIN32)
#add_custom_command(
# OUTPUT ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/lib
# COMMAND bash -c "echo chom && ldd ${LIBRARY_OUTPUT_NAME} | grep mingw64 | awk '{ print $3 }' | xargs -I {} cp {} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}"
#)

#install(CODE "execute_process(COMMAND ../scripts/copy_dlls.sh)")

install(CODE "execute_process(COMMAND bash \"${CMAKE_SOURCE_DIR}/scripts/copy_dlls.sh\")")
ENDIF()

Expand All @@ -76,6 +69,8 @@ install(DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} DESTINATION ${INSTALL_DESTIN

# Also set up debugging target
add_executable(inkpath-debug EXCLUDE_FROM_ALL ${CV_SOURCES} ${DEBUG_SOURCES})
target_compile_definitions(inkpath-debug PRIVATE INKPATH_DEBUG)

target_link_libraries(inkpath-debug ${OpenCV_LIBRARIES})
set_target_properties(inkpath-debug PROPERTIES OUTPUT_NAME "inkpath-debug")
set_target_properties(inkpath-debug PROPERTIES RUNTIME_OUTPUT_DIRECTORY "debug")
8 changes: 2 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# DEPRECATED DO NOT USE

CC=gcc
CXX=g++

Expand Down Expand Up @@ -41,12 +43,6 @@ dev-uninstall:
rm -rf $(XOPP_DEV_INSTALL_PATH)/plugins/$(PLUGIN_NAME)
rm -rf HACKING/StrokeTest $(XOPP_DEV_INSTALL_PATH)/plugins

# For generating a CV debugging binary
# TODO: Port to CMake
#debug: $(cv_source)
# mkdir -p build
# $(CXX) src/cv/debug/debug.cpp -DINKPATH_DEBUG $(cv_source) $(cv_deps) -static -o build/inkpath-debug

help:
@echo uninstall dev-uninstall

Expand Down

0 comments on commit e2b7a77

Please sign in to comment.