FrameworkLayout.cmake 1.15 KB
Newer Older
1 2 3
cmake_minimum_required(VERSION 3.4)
enable_language(C)

4 5 6
set(CMAKE_CONFIGURATION_TYPES "Debug" CACHE INTERNAL "Supported configuration types")
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}) # get rid of ${EFFECTIVE_PLATFORM_NAME}

7
add_library(Framework ${FRAMEWORK_TYPE}
8 9
            foo.c
            foo.h
10 11 12 13
            res.txt
            flatresource.txt
            deepresource.txt
            some.txt)
14 15 16 17
if("${CMAKE_FRAMEWORK}" STREQUAL "")
  set_target_properties(Framework PROPERTIES
                        FRAMEWORK TRUE)
endif()
18 19 20
set_target_properties(Framework PROPERTIES
                      PUBLIC_HEADER foo.h
                      RESOURCE "res.txt")
21 22 23
set_source_files_properties(flatresource.txt PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
set_source_files_properties(deepresource.txt PROPERTIES MACOSX_PACKAGE_LOCATION Resources/deep)
set_source_files_properties(some.txt PROPERTIES MACOSX_PACKAGE_LOCATION somedir)
24 25 26

add_custom_command(TARGET Framework POST_BUILD
                   COMMAND /usr/bin/file $<TARGET_FILE:Framework>)
27

28
file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/FrameworkName.cmake CONTENT "set(framework-dir \"$<TARGET_BUNDLE_DIR:Framework>\")\n")