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)
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)
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)
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)
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)
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)
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)
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)
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)
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)