]> git.lyx.org Git - features.git/commitdiff
cmake: add shared library support
authorPeter Kümmel <syntheticpp@gmx.net>
Tue, 27 Mar 2007 18:26:36 +0000 (18:26 +0000)
committerPeter Kümmel <syntheticpp@gmx.net>
Tue, 27 Mar 2007 18:26:36 +0000 (18:26 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17599 a592a061-630c-0410-9148-cb99ea01b6c8

development/cmake/CMakeLists.txt
development/cmake/src/frontends/CMakeLists.txt
development/cmake/src/frontends/controllers/CMakeLists.txt
development/cmake/src/frontends/qt4/CMakeLists.txt
development/cmake/src/graphics/CMakeLists.txt
development/cmake/src/insets/CMakeLists.txt
development/cmake/src/mathed/CMakeLists.txt
development/cmake/src/support/CMakeLists.txt

index c190b0f212f23c5178665b8ea03455b792a4cbd0..2c10af054b76a720620f241fd6359bc9ca23d09b 100644 (file)
@@ -47,6 +47,7 @@ endif(merge OR MERGE_FILES)
 set(CMAKE_BUILD_TYPE)
 if(profile)
        set(CMAKE_BUILD_TYPE Profile CACHE TYPE STRING FORCE)
+       set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pg" CACHE TYPE STRING FORCE)
        set(profile)
 endif(profile)
 if(release)
@@ -57,6 +58,12 @@ if(debug)
        set(CMAKE_BUILD_TYPE Debug)
 endif(debug)
 
+if(shared)
+       set(library_type SHARED)
+       message(STATUS "building shared libraries")
+else(shared)
+       set(library_type STATIC)
+endif(shared)
 
 if(UNIX)
        if(NOT quiet)
index 4f1d234f5f28f981f0e8b3b9b9535ee8b863fa6c..3072627d36c3c120ab5ea42c73e122eebd5fe24a 100644 (file)
@@ -19,10 +19,10 @@ lyx_add_msvc_pch(frontends)
 
 
 if(NOT MERGE_FILES)
-       add_library(frontends STATIC ${frontends_sources} ${frontends_headers})
+       add_library(frontends ${library_type} ${frontends_sources} ${frontends_headers})
 else(NOT MERGE_FILES)
        lyx_merge_files(allinone frontends_sources)
-       add_library(frontends STATIC                                    
+       add_library(frontends ${library_type}                                   
                                        ${CMAKE_CURRENT_BINARY_DIR}/allinone_const.C
                                        ${CMAKE_CURRENT_BINARY_DIR}/allinone_touched.C)
 endif(NOT MERGE_FILES)
index 2c1517d4d62f79ba5fa15f77a32b4a5ad2b82de5..09272911ee33be3726a17af2369c286fd9fb3337 100644 (file)
@@ -14,10 +14,10 @@ lyx_add_msvc_pch(controllers)
 include_directories(${TOP_SRC_DIR}/src/frontends/controllers)
 
 if(NOT MERGE_FILES)
-       add_library(controllers STATIC ${controllers_sources} ${controllers_headers})
+       add_library(controllers ${library_type} ${controllers_sources} ${controllers_headers})
 else(NOT MERGE_FILES)
        lyx_merge_files(allinone controllers_sources)
-       add_library(controllers STATIC 
+       add_library(controllers ${library_type} 
                                        ${CMAKE_CURRENT_BINARY_DIR}/allinone_const.C
                                        ${CMAKE_CURRENT_BINARY_DIR}/allinone_touched.C)
 endif(NOT MERGE_FILES)
index d39ff3a0fc99cbb9a2bfc55658bdd464f39d29a8..46fadefb9cedafd65defbe0bb576603732e212e7 100644 (file)
@@ -41,14 +41,14 @@ if(MERGE_FILES)
        set(depends_moc_uic ${frontends_qt4_headers} ${ui_files})
        SET_SOURCE_FILES_PROPERTIES(allinone_const.C PROPERTIES OBJECT_DEPENDS "${depends_moc_uic}")
        SET_SOURCE_FILES_PROPERTIES(allinone_touched.C PROPERTIES OBJECT_DEPENDS "${depends_moc_uic}")
-       add_library(frontend_qt4 STATIC 
+       add_library(frontend_qt4 ${library_type} 
                                        ${CMAKE_CURRENT_BINARY_DIR}/allinone_const.C
                                        ${CMAKE_CURRENT_BINARY_DIR}/allinone_touched.C
                                        ${frontends_qt4_headers} 
                                        ${ui_files}
        )
 else(MERGE_FILES)      
-       add_library(frontend_qt4 STATIC ${frontends_qt4_sources} ${frontends_qt4_headers} ${ui_files})
+       add_library(frontend_qt4 ${library_type}  ${frontends_qt4_sources} ${frontends_qt4_headers} ${ui_files})
 endif(MERGE_FILES)
 
 target_link_libraries(frontend_qt4 ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} controllers)
index e6c2c2f1c70f734575f0a39bc70a1b0ed153855f..55780f33116fe71b947f56a9dbb057a818c28fd3 100644 (file)
@@ -15,10 +15,10 @@ lyx_add_msvc_pch(graphics)
 include_directories(${TOP_SRC_DIR}/src/graphics)
 
 if(NOT MERGE_FILES)
-       add_library(graphics STATIC ${graphics_sources} ${graphics_headers})
+       add_library(graphics ${library_type} ${graphics_sources} ${graphics_headers})
 else(NOT MERGE_FILES)
        lyx_merge_files(allinone graphics_sources)
-       add_library(graphics STATIC 
+       add_library(graphics ${library_type} 
                                        ${CMAKE_CURRENT_BINARY_DIR}/allinone_const.C
                                        ${CMAKE_CURRENT_BINARY_DIR}/allinone_touched.C)
 endif(NOT MERGE_FILES)
index 1e0fa5c6a6f57cdf27a6faa680c3eca4d0d2843d..fb62388b0f54af8831907317b79cb449880a4ea0 100644 (file)
@@ -17,10 +17,10 @@ include_directories(${TOP_SRC_DIR}/src/insets)
 
 
 if(NOT MERGE_FILES)
-       add_library(insets STATIC ${insets_sources} ${insets_headers})
+       add_library(insets ${library_type} ${insets_sources} ${insets_headers})
 else(NOT MERGE_FILES)
        lyx_merge_files(allinone insets_sources)
-       add_library(insets STATIC 
+       add_library(insets ${library_type}
                                        ${CMAKE_CURRENT_BINARY_DIR}/allinone_const.C
                                        ${CMAKE_CURRENT_BINARY_DIR}/allinone_touched.C)
 endif(NOT MERGE_FILES)
index 3ba1de93d86f1c57b1375e25131a416a69efbbc1..e5bfe3962710472e056f8c16fd055557976843dd 100644 (file)
@@ -18,10 +18,10 @@ lyx_add_msvc_pch(mathed)
 include_directories(${TOP_SRC_DIR}/src/mathed)
 
 if(NOT MERGE_FILES)
-       add_library(mathed STATIC ${mathed_sources} ${mathed_headers})
+       add_library(mathed ${library_type} ${mathed_sources} ${mathed_headers})
 else(NOT MERGE_FILES)
        lyx_merge_files(allinone mathed_sources)
-       add_library(mathed STATIC 
+       add_library(mathed ${library_type}
                                        ${CMAKE_CURRENT_BINARY_DIR}/allinone_const.C
                                        ${CMAKE_CURRENT_BINARY_DIR}/allinone_touched.C)
 endif(NOT MERGE_FILES)
index 70bac0afb8df18c04a7e7424b55b414779625948..cc6d09f8f40e8028e51b69b76d0227fb224d4433 100644 (file)
@@ -27,7 +27,7 @@ lyx_add_msvc_pch(support)
 include_directories(${TOP_SRC_DIR}/src/support ${ICONV_INCLUDE_DIR})
 
 if(NOT MERGE_FILES)
-       add_library(support STATIC ${support_sources} ${support_headers})
+       add_library(support ${library_type} ${support_sources} ${support_headers})
 else(NOT MERGE_FILES)
        # move to front
        list(REMOVE_ITEM support_sources ${TOP_SRC_DIR}/src/support/convert.C)
@@ -36,7 +36,7 @@ else(NOT MERGE_FILES)
        list(APPEND support_sources ${TOP_SRC_DIR}/src/support/lstrings.C)
        list(REVERSE support_sources)
        lyx_merge_files(allinone support_sources)
-       add_library(support STATIC 
+       add_library(support ${library_type}
                                        ${CMAKE_CURRENT_BINARY_DIR}/allinone_const.C
                                        ${CMAKE_CURRENT_BINARY_DIR}/allinone_touched.C)