File: CMakeLists.txt

package info (click to toggle)
cmake 2.8.11.1-1~bpo70+1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy-backports
  • size: 37,056 kB
  • sloc: cpp: 157,219; ansic: 137,155; yacc: 3,254; sh: 2,745; xml: 2,483; lex: 1,028; lisp: 215; python: 199; objc: 134; f90: 105; perl: 99; fortran: 93; makefile: 65; tcl: 55; asm: 28; php: 25; ruby: 22; java: 20
file content (56 lines) | stat: -rw-r--r-- 1,942 bytes parent folder | download | duplicates (2)
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
#this is adapted from FireBreath (http://www.firebreath.org)

cmake_minimum_required(VERSION 2.8)

project(CFBundleTest)

include(PluginConfig.cmake)

message ("Creating Mac Browser Plugin project ${PROJECT_NAME}")
set(SOURCES
    np_macmain.cpp
    Localized.r
    ${CMAKE_CURRENT_BINARY_DIR}/Info.plist
    ${CMAKE_CURRENT_BINARY_DIR}/InfoPlist.strings
    ${CMAKE_CURRENT_BINARY_DIR}/Localized.rsrc
)

add_library( ${PROJECT_NAME} MODULE
    ${SOURCES}
    )

set (RCFILES ${CMAKE_CURRENT_SOURCE_DIR}/Localized.r)

configure_file(Info.plist.in ${CMAKE_CURRENT_BINARY_DIR}/Info.plist)
configure_file(InfoPlist.strings.in ${CMAKE_CURRENT_BINARY_DIR}/InfoPlist.strings)

# Compile the resource file
find_program(RC_COMPILER Rez NO_DEFAULT_PATHS PATHS /Developer/Tools)
if(NOT RC_COMPILER)
  message(FATAL_ERROR "could not find Rez to build resources from .r file...")
endif()

execute_process(COMMAND
    ${RC_COMPILER} ${RCFILES} -useDF -o ${CMAKE_CURRENT_BINARY_DIR}/Localized.rsrc
    )

set_source_files_properties(
    ${CMAKE_CURRENT_BINARY_DIR}/Localized.rsrc
    PROPERTIES GENERATED 1
    )
# note that for some reason, the makefile and xcode generators use a different
# property to indicate where the Info.plist file is :-/ For that reason, we
# specify it twice so it will work both places
set_target_properties(CFBundleTest PROPERTIES
    BUNDLE 1
    BUNDLE_EXTENSION plugin
    XCODE_ATTRIBUTE_WRAPPER_EXTENSION plugin  #sets the extension to .plugin
    XCODE_ATTRIBUTE_MACH_O_TYPE mh_bundle
    XCODE_ATTRIBUTE_INFOPLIST_FILE ${CMAKE_CURRENT_BINARY_DIR}/Info.plist
    MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_BINARY_DIR}/Info.plist
    LINK_FLAGS "-Wl,-exported_symbols_list,\"${CMAKE_CURRENT_SOURCE_DIR}/ExportList_plugin.txt\"")

set_source_files_properties(
    ${CMAKE_CURRENT_BINARY_DIR}/InfoPlist.strings
    ${CMAKE_CURRENT_BINARY_DIR}/Localized.rsrc
    PROPERTIES MACOSX_PACKAGE_LOCATION "Resources/English.lproj")