diff options
| author | Eduard Braun <eduard.braun2@gmx.de> | 2017-05-08 22:59:44 +0000 |
|---|---|---|
| committer | Eduard Braun <eduard.braun2@gmx.de> | 2017-05-08 22:59:44 +0000 |
| commit | 576e8b76d437b1f3b3583e9a8f5d55f133c11dda (patch) | |
| tree | cbd54238bb8424341d8d51b245fa86872dd97dae | |
| parent | Build an inkview.com as consoler wrapper around inkview.exe to allow for prin... (diff) | |
| download | inkscape-576e8b76d437b1f3b3583e9a8f5d55f133c11dda.tar.gz inkscape-576e8b76d437b1f3b3583e9a8f5d55f133c11dda.zip | |
cmake: Correctly use 'install(TARGETS ...)' instead of 'install(FILES ...)' for inkscape executables.
It's not only more elegant, but it also makes the "install/strip" target work!
Also convert DESTINATION to a relative path. As relative paths are relative to ${CMAKE_INSTALL_PREFIX}, it's effectively the same as before, but cmake does not properly handle absolute paths on Windows, see [1].
[1] https://gitlab.kitware.com/cmake/cmake/issues/16859
(bzr r15678)
| -rw-r--r-- | CMakeScripts/Install.cmake | 17 | ||||
| -rw-r--r-- | CMakeScripts/InstallMSYS2.cmake | 22 | ||||
| -rw-r--r-- | src/CMakeLists.txt | 26 |
3 files changed, 21 insertions, 44 deletions
diff --git a/CMakeScripts/Install.cmake b/CMakeScripts/Install.cmake index f1fda7bcc..aab92067a 100644 --- a/CMakeScripts/Install.cmake +++ b/CMakeScripts/Install.cmake @@ -6,23 +6,6 @@ if(UNIX) endif()
if(WIN32)
- install(PROGRAMS
- ${EXECUTABLE_OUTPUT_PATH}/inkscape.exe
- ${EXECUTABLE_OUTPUT_PATH}/inkview.exe
- DESTINATION ${CMAKE_INSTALL_PREFIX}
- )
-
- install(PROGRAMS
- ${EXECUTABLE_OUTPUT_PATH}/inkscape_com.exe
- DESTINATION ${CMAKE_INSTALL_PREFIX}
- RENAME inkscape.com
- )
-
- install(FILES
- ${LIBRARY_OUTPUT_PATH}/libinkscape_base.dll
- DESTINATION ${CMAKE_INSTALL_PREFIX}
- )
-
install(FILES
AUTHORS
COPYING
diff --git a/CMakeScripts/InstallMSYS2.cmake b/CMakeScripts/InstallMSYS2.cmake index a96df045b..982237538 100644 --- a/CMakeScripts/InstallMSYS2.cmake +++ b/CMakeScripts/InstallMSYS2.cmake @@ -1,26 +1,4 @@ if(WIN32)
- install(PROGRAMS
- ${EXECUTABLE_OUTPUT_PATH}/inkscape.exe
- ${EXECUTABLE_OUTPUT_PATH}/inkview.exe
- DESTINATION ${CMAKE_INSTALL_PREFIX}
- )
-
- install(PROGRAMS
- ${EXECUTABLE_OUTPUT_PATH}/inkscape_com.exe
- DESTINATION ${CMAKE_INSTALL_PREFIX}
- RENAME inkscape.com
- )
- install(PROGRAMS
- ${EXECUTABLE_OUTPUT_PATH}/inkview_com.exe
- DESTINATION ${CMAKE_INSTALL_PREFIX}
- RENAME inkview.com
- )
-
- install(FILES
- ${LIBRARY_OUTPUT_PATH}/libinkscape_base.dll
- DESTINATION ${CMAKE_INSTALL_PREFIX}
- )
-
install(FILES
AUTHORS
COPYING
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index fe224b9fe..a189b96ca 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -485,19 +485,25 @@ if(WIN32) # Add the platform specific resource files (enabling the app icon). if(${HAVE_MINGW64}) list(APPEND main_SRC inkscape-x64.rc) - list(APPEND view_SRC inkscape-x64.rc) + list(APPEND view_SRC inkscape-x64.rc) else() list(APPEND main_SRC inkscape.rc) - list(APPEND view_SRC inkscape.rc) + list(APPEND view_SRC inkscape.rc) endif() # Build console applications as wrappers around inkscape/inkview.exe as GUI applications can't print to the console. add_executable(inkscape_com winconsole.cpp) set_target_properties(inkscape_com - PROPERTIES LINK_FLAGS "-mconsole") + PROPERTIES + LINK_FLAGS "-mconsole" + OUTPUT_NAME "inkscape" + SUFFIX ".com") add_executable(inkview_com winconsole.cpp) set_target_properties(inkview_com - PROPERTIES LINK_FLAGS "-mconsole") + PROPERTIES + LINK_FLAGS "-mconsole" + OUTPUT_NAME "inkview" + SUFFIX ".com") endif() # make executables for inkscape and inkview @@ -541,8 +547,10 @@ target_link_libraries(inkscape_base PRIVATE ${INKSCAPE_TARGET_LIBS} PUBLIC ${INK target_link_libraries(inkscape inkscape_base) target_link_libraries(inkview inkscape_base) + + +#Define the installation if(NOT WIN32) - #Define the installation install(TARGETS inkscape_base inkscape @@ -550,4 +558,12 @@ if(NOT WIN32) RUNTIME DESTINATION bin LIBRARY DESTINATION lib/inkscape ARCHIVE DESTINATION lib/inkscape) +else() + install(TARGETS + inkscape_base + inkscape + inkscape_com + inkview + inkview_com + DESTINATION .) endif() |
