summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMoritz Eberl <moritz@semiodesk.com>2016-04-16 10:54:58 +0000
committerMoritz Eberl <moritz@semiodesk.com>2016-04-16 10:54:58 +0000
commitd877a378a6d1b11417c73862ddb82be680f66378 (patch)
tree14cf835e2c09818ed35c7544ebe2dc28096ddd3f /src
parentMerge and fixed CMake build (diff)
downloadinkscape-d877a378a6d1b11417c73862ddb82be680f66378.tar.gz
inkscape-d877a378a6d1b11417c73862ddb82be680f66378.zip
CMake build creates a shared libinkscape_base library and links inkscape and inkview against it.
(bzr r14761.1.6)
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt31
1 files changed, 19 insertions, 12 deletions
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} $<TARGET_OBJECTS:inkscape_base>)
-add_executable(inkview inkview.cpp $<TARGET_OBJECTS:inkscape_base>)
+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)
+