Debian Codegraph @

src/tools/CMakeLists.txt

raw
1 add_executable(nuspell-exe nuspell.cxx)
2 set_target_properties(nuspell-exe PROPERTIES RUNTIME_OUTPUT_NAME nuspell)
3 target_compile_definitions(nuspell-exe PRIVATE
4 PROJECT_VERSION=\"${PROJECT_VERSION}\")
5 target_link_libraries(nuspell-exe PRIVATE Nuspell::nuspell)
6 if (MSVC)
7 target_include_directories(nuspell-exe PRIVATE ${GETOPT_INCLUDE_DIR})
8 target_link_libraries(nuspell-exe PRIVATE ${GETOPT_LIBRARY})
9 endif()
10 if (BUILD_SHARED_LIBS AND WIN32)
11 # This should be PRE_LINK (or PRE_BUILD), so Vcpkg's POST_BUILD
12 # step (see VCPKG_APPLOCAL_DEPS) that copies dll can pick up nuspell.dll
13 # inside the folder ../tools and copy its transitive dependencies.
14 add_custom_command(TARGET nuspell-exe PRE_LINK
15 COMMAND ${CMAKE_COMMAND} -E copy_if_different
16 $<TARGET_FILE:nuspell> $<TARGET_FILE_DIR:nuspell-exe>)
17 endif()
18 if (NOT subproject)
19 install(TARGETS nuspell-exe DESTINATION ${CMAKE_INSTALL_BINDIR})
20 endif()