Using XCODE_PRODUCT_TYPE to make kexts

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Using XCODE_PRODUCT_TYPE to make kexts

Harry Mallon
Hello,

I am almost there making kexts with XCode generator and CMake. However they appear as "com.apple.product-type.bundle" rather than "com.apple.product-type.kernel-extension.iokit" in the Xcode project file. This means they do not get the Xcode/kext magic compile line without lots of manual setting (which I can't get right at the moment). Looking at the code https://gitlab.kitware.com/cmake/cmake/blob/master/Source/cmGlobalXCodeGenerator.cxx it seems setting XCODE_PRODUCT_TYPE on the target should work. But it doesn't work for me. Any ideas?

Harry

Harry Mallon

CODEX | Software Engineer

60 Poland Street | London | England | W1F 7NT

E [hidden email] | T <a id="c1-id-17" style="TEXT-DECORATION: none; COLOR: gray" href="callto:&#43;44 203 7000 989"> +44 203 7000 989 

Website | Facebook | Twitter


--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Using XCODE_PRODUCT_TYPE to make kexts

Harry Mallon
Hi again,

Sorry look like it is not in the release build yet.

Harry

Harry Mallon

CODEX | Software Engineer

60 Poland Street | London | England | W1F 7NT

E [hidden email] | T <a id="c1-id-17" style="TEXT-DECORATION: none; COLOR: gray" href="callto:&#43;44 203 7000 989"> +44 203 7000 989 

Website | Facebook | Twitter

On 16 Jan 2017, at 14:37, Harry Mallon <[hidden email]> wrote:

Hello,

I am almost there making kexts with XCode generator and CMake. However they appear as "com.apple.product-type.bundle" rather than "com.apple.product-type.kernel-extension.iokit" in the Xcode project file. This means they do not get the Xcode/kext magic compile line without lots of manual setting (which I can't get right at the moment). Looking at the code https://gitlab.kitware.com/cmake/cmake/blob/master/Source/cmGlobalXCodeGenerator.cxx it seems setting XCODE_PRODUCT_TYPE on the target should work. But it doesn't work for me. Any ideas?

Harry


--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Using XCODE_PRODUCT_TYPE to make kexts

CMake mailing list
Hello,

On 16/01/2017 15:43, Harry Mallon wrote:
> Sorry look like it is not in the release build yet.

correct, please use a recent nightly:

https://cmake.org/files/dev/?C=M;O=D

Maybe you could report back if the attribute works for you.

Thanks,
Gregor
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Using XCODE_PRODUCT_TYPE to make kexts

Harry Mallon
Hi Gregor,

With a CMake file similar to the following I seem to be able to make proper kexts with the latest nightly 3.7.20170113-g26509. At least they seem to be working, I have been bitten before. "kextutil -nt X.kext" is useful for testing them. This could close the issue https://gitlab.kitware.com/cmake/cmake/issues/13487.

Harry

================================================
    find_path(KERNEL_INCLUDE_DIR IOKit/pci/IOPCIDevice.h)

    add_library(driver MODULE
        Kext.cpp
        Kext.h
    )

    target_include_directories(driver
        PRIVATE ${KERNEL_INCLUDE_DIR}
    )

    set(driver_name "Driver")
    set(driver_id "com.driver.driver")
    set(driver_version "1.0.0")

    set_target_properties(driver PROPERTIES
        BUNDLE YES
        BUNDLE_EXTENSION kext
        INSTALL_RPATH "" # rpath must not be set!
        MACOSX_BUNDLE_BUNDLE_NAME ${driver_name}
        MACOSX_BUNDLE_BUNDLE_VERSION ${driver_version}
        MACOSX_BUNDLE_GUI_IDENTIFIER ${driver_id}
        MACOSX_BUNDLE_INFO_PLIST CmakeTemplate.plist.in
        OUTPUT_NAME ${driver_name}
        XCODE_ATTRIBUTE_MODULE_NAME ${driver_id}
        XCODE_ATTRIBUTE_MODULE_VERSION ${driver_version}
        XCODE_PRODUCT_TYPE "com.apple.product-type.kernel-extension.iokit"
    )

    install(TARGETS driver
        DESTINATION Library/Extensions
        COMPONENT driver
    )

    # Now we do a signing routine which we rolled ourselves

================================================

Harry Mallon

CODEX | Software Engineer

60 Poland Street | London | England | W1F 7NT

E [hidden email] | T <a id="c1-id-17" style="TEXT-DECORATION: none; COLOR: gray" href="callto:&#43;44 203 7000 989"> +44 203 7000 989 

Website | Facebook | Twitter


--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake