From d877a378a6d1b11417c73862ddb82be680f66378 Mon Sep 17 00:00:00 2001 From: Moritz Eberl Date: Sat, 16 Apr 2016 12:54:58 +0200 Subject: CMake build creates a shared libinkscape_base library and links inkscape and inkview against it. (bzr r14761.1.6) --- src/CMakeLists.txt | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5c436cefb..93eea1e2a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -506,14 +506,14 @@ set(inkscape_SRC #add_inkscape_lib(sp_LIB "${sp_SRC}") #add_inkscape_lib(inkscape_LIB "${inkscape_SRC}") -# Build everything except main and inkview.c in a CMake "object" library. -# An object library is just a bunch of .o files. Linking them with main.c or inkview.c -# we get the inkscape and inkview executables respectively. -add_library(inkscape_base OBJECT ${inkscape_SRC} ${sp_SRC}) +# Build everything except main and inkview.c in a shared library. +add_library(inkscape_base SHARED ${inkscape_SRC} ${sp_SRC}) # make executables for inkscape and inkview -add_executable(inkscape ${main_SRC} $) -add_executable(inkview inkview.cpp $) +add_executable(inkscape ${main_SRC} ) +add_executable(inkview inkview.cpp ) + + if(UNIX) # message after building. @@ -526,10 +526,6 @@ endif() add_dependencies(inkscape inkscape_version) -if (NOT "${WITH_EXT_GDL}") - list (APPEND INKSCAPE_LIBS "gdl_LIB") -endif() - set(INKSCAPE_TARGET_LIBS # order from automake #sp_LIB @@ -552,5 +548,16 @@ set(INKSCAPE_TARGET_LIBS ${INKSCAPE_LIBS} ) -target_link_libraries(inkscape ${INKSCAPE_TARGET_LIBS}) -target_link_libraries(inkview ${INKSCAPE_TARGET_LIBS}) +if (NOT "${WITH_EXT_GDL}") + # Insert it at the beginning of the list as the windows build fails otherwise + list (INSERT INKSCAPE_TARGET_LIBS 0 "gdl_LIB") +endif() + + +# Link the inkscape_base library against all external dependencies +target_link_libraries(inkscape_base ${INKSCAPE_TARGET_LIBS}) + +# Link inkscape and inkview against inkscape_base +target_link_libraries(inkscape inkscape_base ) +target_link_libraries(inkview inkscape_base) + -- cgit v1.2.3