Skip to content

Xcode support #34

@springmeyer

Description

@springmeyer

Many developers at Mapbox have come to rely on the XCode IDE for developing C++ on OS X. It offers some amazing productivity enhancers like code completion, code folding, a built-in GUI for static analysis and address sanitizers, and more. This is why mapbox/node-cpp-skel#13 was added to node-cpp-skel.

For hpp-skel the support will be much easier to add since we are using cmake here and cmake can autogenerate xcode files. Mirroring node-cpp-skel support will be as easy as adding:

diff --git a/CMakeLists.txt b/CMakeLists.txt
index a81a292..aa0f8ce 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -12,4 +12,4 @@ include_directories(SYSTEM ${MASON_PACKAGE_catch_INCLUDE_DIRS})
 
 include_directories("${PROJECT_SOURCE_DIR}/include")
 
-add_executable(unit-tests test/test.cpp)
\ No newline at end of file
+add_executable(unit-tests ${PROJECT_SOURCE_DIR}/include test/test.cpp)
\ No newline at end of file
diff --git a/Makefile b/Makefile
index ad76d68..89b2584 100644
--- a/Makefile
+++ b/Makefile
@@ -9,6 +9,9 @@ debug:
 test: default 
        ./build/unit-tests
 
+xcode:
+       rm -rf build/* && mkdir -p build && cd build && cmake ../ -G Xcode && open *xcodeproj
+
 coverage:
        ./scripts/coverage.sh

The change of +add_executable(unit-tests ${PROJECT_SOURCE_DIR}/include test/test.cpp) gets the headers to show up in XCode (otherwise it does not see them by default).

/cc @kkaefer

screen shot 2017-08-24 at 5 03 08 pm

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions