-
Notifications
You must be signed in to change notification settings - Fork 289
/
CMakeLists.txt
93 lines (78 loc) · 3.19 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#/**********************************************************\
#Original Author: Richard Bateman (taxilian)
#
#Created: Nov 20, 2009
#License: Dual license model; choose one of two:
# New BSD License
# http://www.opensource.org/licenses/bsd-license.php
# - or -
# GNU Lesser General Public License, version 2.1
# http://www.gnu.org/licenses/lgpl-2.1.html
#
#Copyright 2009 PacketPass, Inc and the Firebreath development team
#\**********************************************************/
# Written to work with cmake 2.6
cmake_minimum_required (VERSION 2.6)
set (CMAKE_BACKWARDS_COMPATIBILITY 2.6)
Project (FireBreath)
set(CMAKE_DIR ${CMAKE_SOURCE_DIR}/cmake)
include(${CMAKE_DIR}/common.cmake)
#check to make sure we're either using WITH_SYSTEM_BOOST or have the firebreath-boost lib installed
check_boost()
if (APPLE)
clear_xcode_patches()
endif()
if (NOT EXISTS ${PROJECTS_SOURCE_DIR})
message(FATAL_ERROR "The specified project directory ${PROJECTS_SOURCE_DIR} is not found")
endif()
if (VERBOSE)
message("Firebreath solution dir: " ${PROJECT_BINARY_DIR})
endif()
find_package(Threads REQUIRED)
add_boost_library(thread)
add_boost_library(system)
if (WITH_SYSTEM_BOOST)
add_boost_library(date_time)
endif()
# Common core projects -- projects that don't have any plugin specific code,
# but are required before any plugins are loaded
add_subdirectory(${SCRIPTINGCORE_SOURCE_DIR})
add_subdirectory(${PLUGINCORE_SOURCE_DIR})
add_subdirectory(${NPAPICORE_SOURCE_DIR})
if (WIN32)
add_subdirectory(${ACTIVEXCORE_SOURCE_DIR})
endif()
# search the project src dir for plugin project directories
file (GLOB PLUGIN_PROJECTS
${PROJECTS_SOURCE_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)
configure_file(${CMAKE_DIR}/projectConfig_main.cmake.in ${PROJECTS_BINARY_DIR}/${PROJNAME}/projectConfig.cmake COPYONLY)
if (VERBOSE)
message("Configuring plugin project ${CURPROJECT} in ${PROJECTS_BINARY_DIR}/${PROJNAME}")
endif()
add_subdirectory("${CURPROJECT}" "${PROJECTS_BINARY_DIR}/${PROJNAME}")
else()
message("${CURPROJECT}/ does not seem to be a FireBreath Plugin")
endif()
endforeach()
# Common projects -- projects that don't have any plugin specific code
add_subdirectory(${UNITTEST_FW_SOURCE_DIR})
add_subdirectory(${NPAPIHOST_SOURCE_DIR})
add_subdirectory(${SCRIPTINGCORETEST_SOURCE_DIR})
if (WIN32)
add_subdirectory(${ACTIVEXCORETEST_SOURCE_DIR})
endif()
#add_subdirectory(${NPAPICORETEST_SOURCE_DIR}) # - not functional, needs to be re-done
if (NOT FOUND_PROJECTS)
MESSAGE("No projects found in ${PROJECTS_SOURCE_DIR}/.")
MESSAGE(FATAL_ERROR "To build examples, run 'prep<ver> examples'")
endif()