Permalink
Browse files

FIREBREATH-37 Support prebuilt static libs

  • Loading branch information...
1 parent 3921284 commit eb69607b73ce35d2c183eccd50b8f6d00c44f25c Richard Bateman committed Apr 11, 2011
View
@@ -22,3 +22,4 @@ src/libs/openssl/openssl
*.kdev*
.kdev*
tags
+bin
View
@@ -18,12 +18,13 @@ set (CMAKE_BACKWARDS_COMPATIBILITY 2.6)
set_property(GLOBAL PROPERTY USE_FOLDERS On)
Project (FireBreath)
-set(FB_EXPORT_FILE FireBreath_Exports.cmake)
# First, find FB_ROOT
get_filename_component(FB_ROOT ${CMAKE_CURRENT_LIST_FILE} PATH CACHE)
include(${FB_ROOT}/cmake/common.cmake)
+set(FB_EXPORT_FILE ${CMAKE_BINARY_DIR}/FireBreath_Exports.cmake)
+file(REMOVE ${FB_EXPORT_FILE})
add_subdirectory(${FB_ROOT}/cmake ${FB_BUILD_DIR}/cmake_common)
if (APPLE)
@@ -45,10 +46,21 @@ endif()
if (UNIX AND NOT APPLE)
find_package(Threads REQUIRED)
endif()
+
+if (EXISTS ${FB_ROOT}/bin/FireBreath_Exports.cmake AND NOT FB_BINONLY)
+ set(FIREBREATH_LIBDIR "${FB_ROOT}/bin")
+endif()
+
+if (FIREBREATH_LIBDIR)
+ include(${FIREBREATH_LIBDIR}/FireBreath_Exports.cmake)
+endif()
+
add_boost_library(thread)
add_boost_library(system)
if (WITH_SYSTEM_BOOST)
add_boost_library(date_time)
+elseif(NOT FIREBREATH_LIBDIR)
+ export(TARGETS ${Boost_LIBRARIES} APPEND FILE ${FB_EXPORT_FILE})
endif()
# Common core projects -- projects that don't have any plugin specific code,
@@ -66,29 +78,33 @@ if (NOT FB_SCRIPTINGCORE_LOADED)
endif()
endif()
-# search the project src dir for plugin project directories
-file (GLOB PLUGIN_PROJECTS
- ${FB_PROJECTS_DIR}/[^.]*
- )
+if (NOT FB_BINONLY)
+ # search the project src dir for plugin project directories
+ file (GLOB PLUGIN_PROJECTS
+ ${FB_PROJECTS_DIR}/[^.]*
+ )
-if (VERBOSE)
- message("Searching ${PROJECTS_SOURCE_DIR}/*: found ${PLUGIN_PROJECTS}")
-endif()
-
-# loop through the found directories and add any with a CMakeLists.txt and a PluginConfig.cmake
-# as a subproject
-foreach (CURPROJECT ${PLUGIN_PROJECTS})
- if (EXISTS "${CURPROJECT}/CMakeLists.txt" AND EXISTS "${CURPROJECT}/PluginConfig.cmake")
- set (FOUND_PROJECTS 1)
- get_filename_component(PROJNAME ${CURPROJECT} NAME_WE)
- if (VERBOSE)
- message("Configuring plugin project ${CURPROJECT} in ${FB_PROJECTS_BINARY_DIR}/${PROJNAME}")
- endif()
- add_firebreath_plugin(${CURPROJECT} ${PROJNAME})
- else()
- message("${CURPROJECT}/ does not seem to be a FireBreath Plugin")
+ if (VERBOSE)
+ message("Searching ${PROJECTS_SOURCE_DIR}/*: found ${PLUGIN_PROJECTS}")
endif()
-endforeach()
+
+ # loop through the found directories and add any with a CMakeLists.txt and a PluginConfig.cmake
+ # as a subproject
+ foreach (CURPROJECT ${PLUGIN_PROJECTS})
+ if (EXISTS "${CURPROJECT}/CMakeLists.txt" AND EXISTS "${CURPROJECT}/PluginConfig.cmake")
+ set (FOUND_PROJECTS 1)
+ get_filename_component(PROJNAME ${CURPROJECT} NAME_WE)
+ if (VERBOSE)
+ message("Configuring plugin project ${CURPROJECT} in ${FB_PROJECTS_BINARY_DIR}/${PROJNAME}")
+ endif()
+ add_firebreath_plugin(${CURPROJECT} ${PROJNAME})
+ else()
+ message("${CURPROJECT}/ does not seem to be a FireBreath Plugin")
+ endif()
+ endforeach()
+else()
+ message("Projects configured to build FireBreath binaries")
+endif()
# Common projects -- projects that don't have any plugin specific code
if (NOT FB_SCRIPTINGCORE_LOADED)
@@ -101,9 +117,11 @@ if (NOT FB_SCRIPTINGCORE_LOADED)
#add_subdirectory(${FB_NPAPICORETEST_SOURCE_DIR}) # - not functional, needs to be re-done
endif()
-if (NOT FOUND_PROJECTS AND "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
- # If this file is the root file then we should have a projects directory
- MESSAGE("No projects found in ${PROJECTS_SOURCE_DIR}/.")
- MESSAGE(FATAL_ERROR "To build examples, run 'prep<ver> examples'")
+if (NOT FB_BINONLY)
+ if (NOT FOUND_PROJECTS AND "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
+ # If this file is the root file then we should have a projects directory
+ MESSAGE("No projects found in ${PROJECTS_SOURCE_DIR}/.")
+ MESSAGE(FATAL_ERROR "To build examples, run 'prep<ver> examples'")
+ endif()
endif()
View
@@ -95,7 +95,8 @@ macro (add_boost_library BOOST_LIB)
list(APPEND Boost_LIBRARIES boost_${BOOST_LIB})
list(REMOVE_DUPLICATES Boost_LIBRARIES)
- if (NOT TARGET boost_${BOOST_LIB})
+ get_target_property(_BL_EXISTS boost_${BOOST_LIB} TYPE)
+ if (NOT _BL_EXISTS)
add_subdirectory(${FB_BOOST_SOURCE_DIR}/libs/${BOOST_LIB} ${CMAKE_BINARY_DIR}/boost/libs/${BOOST_LIB})
endif()
endif()
@@ -76,8 +76,4 @@ target_link_libraries(${PROJECT_NAME}
PluginCore
ScriptingCore
)
-if (NOT WITH_SYSTEM_BOOST)
- export(TARGETS ActiveXCore ${CMAKE_THREAD_LIBS_INIT} ${Boost_LIBRARIES} ${LIBDL_LIBRARIES} APPEND FILE ${FB_EXPORT_FILE})
-else()
- export(TARGETS ActiveXCore ${CMAKE_THREAD_LIBS_INIT} ${LIBDL_LIBRARIES} APPEND FILE ${FB_EXPORT_FILE})
-endif()
+export(TARGETS ActiveXCore ${CMAKE_THREAD_LIBS_INIT} ${LIBDL_LIBRARIES} APPEND FILE ${FB_EXPORT_FILE})
@@ -106,8 +106,4 @@ target_link_libraries(${PROJECT_NAME}
${LIBDL_LIBRARIES}
)
-if (NOT WITH_SYSTEM_BOOST)
- export(TARGETS NpapiCore ${Boost_LIBRARIES} APPEND FILE ${FB_EXPORT_FILE})
-else()
- export(TARGETS NpapiCore APPEND FILE ${FB_EXPORT_FILE})
-endif()
+export(TARGETS NpapiCore APPEND FILE ${FB_EXPORT_FILE})
@@ -90,8 +90,4 @@ set (SOURCES
add_library(${PROJECT_NAME} STATIC ${SOURCES})
set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER "FireBreath Core")
-if (NOT WITH_SYSTEM_BOOST)
- export(TARGETS PluginCore ${Boost_LIBRARIES} APPEND FILE ${FB_EXPORT_FILE})
-else()
- export(TARGETS PluginCore APPEND FILE ${FB_EXPORT_FILE})
-endif()
+export(TARGETS PluginCore APPEND FILE ${FB_EXPORT_FILE})
@@ -99,8 +99,4 @@ target_link_libraries(${PROJECT_NAME}
set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER "FireBreath Core")
-if (NOT WITH_SYSTEM_BOOST)
- export(TARGETS ScriptingCore ${Boost_LIBRARIES} APPEND FILE ${FB_EXPORT_FILE})
-else()
- export(TARGETS ScriptingCore APPEND FILE ${FB_EXPORT_FILE})
-endif()
+export(TARGETS ScriptingCore APPEND FILE ${FB_EXPORT_FILE})
@@ -33,11 +33,11 @@ endif()
include_directories (
${Boost_INCLUDE_DIRS}
${CMAKE_CURRENT_SOURCE_DIR}
- ${SCRIPTINGCORE_SOURCE_DIR}
- ${PLUGINAUTO_SOURCE_DIR}
- ${PLUGINCORE_SOURCE_DIR}
+ ${FB_SCRIPTINGCORE_SOURCE_DIR}
+ ${FB_PLUGINAUTO_SOURCE_DIR}
+ ${FB_PLUGINCORE_SOURCE_DIR}
${FBLIB_INCLUDE_DIRS}
- ${CONFIG_DIR}
+ ${FB_CONFIG_DIR}
)
file (GLOB GENERAL_SRC RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
@@ -16,8 +16,6 @@
cmake_minimum_required (VERSION 2.6)
set (CMAKE_BACKWARDS_COMPATIBILITY 2.6)
-include(${CMAKE_DIR}/common.cmake)
-
include(FindOpenSSL)
if (OPENSSL_FOUND)
@@ -57,6 +57,7 @@ endif()
add_library (UnitTest++ STATIC ${SOURCES})
set_target_properties(UnitTest++ PROPERTIES FOLDER "UnitTests")
+export(TARGETS UnitTest++ APPEND FILE ${FB_EXPORT_FILE})
add_definitions(
-D_CRT_SECURE_NO_DEPRECATE

0 comments on commit eb69607

Please sign in to comment.