Skip to content

Commit

Permalink
Merge branch 'release-2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidZemon committed Jan 14, 2016
2 parents ce3d8bb + fdf6e46 commit acdf324
Show file tree
Hide file tree
Showing 291 changed files with 44,717 additions and 8,843 deletions.
20 changes: 20 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# EditorConfig is awesome: http://EditorConfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
indent_style = space
indent_size = 2

# I like two spaces for some languages
[*.json,*.xml,*.html]
indent_size = 2

# Makefiles must use tabs
[Makefile]
indent_style = tab
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text eol=lf
32 changes: 25 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,31 @@
/docs
/Debug
/.idea
/.settings
/docs/html
/docs/latex
/docs/man
/docs/rtf
/docs/xml
/docs/docbook
.idea/
/simple
/Examples/TestApp
/.external_downloads
bin/
CMakeFiles
CMakeCache.txt
cmake_install.cmake
CMakeLists.txt.user
__pycache__
.cproject
.project
.**project
**.cbp
objects.mk
sources.mk
subdir.mk
makefile
**.elf
**.o
**.a
Makefile
**.pyc
**~
**.swp
**.zip
**.iml
atlassian-ide-plugin.xml
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[submodule "libpropeller"]
path = libpropeller
url = https://github.com/libpropeller/libpropeller.git
[submodule "propsideworkspace"]
path = propsideworkspace
url = https://github.com/parallaxinc/propsideworkspace.git
82 changes: 82 additions & 0 deletions CMakeCPack.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
set(CPACK_GENERATOR
ZIP
DEB
RPM
NSIS
)

set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY 0)
set(CPACK_INSTALL_CMAKE_PROJECTS
"${CMAKE_BINARY_DIR}"
"${PROJECT_NAME}"
ALL
/
)
set(CPACK_PROJECT_URL "http://david.zemon.name/PropWare")
set(CPACK_PACKAGE_VENDOR "David Zemon")
set(CPACK_PACKAGE_CONTACT "David Zemon <[email protected]>")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "C++ objects and CMake build system for Parallax Propeller")
set(CPACK_RESOURCE_FILE_README "${PROJECT_SOURCE_DIR}/README.md")
set(CPACK_CMAKE_GENERATOR "Unix Makefiles")
set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
set(CPACK_PACKAGE_VERSION
${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH})
if (PROJECT_VERSION_TWEAK)
set(CPACK_PACKAGE_VERSION ${CPACK_PACKAGE_VERSION}.${PROJECT_VERSION_TWEAK})
endif ()

# NSIS Specific
set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON)
set(CPACK_NSIS_HELP_LINK "${CPACK_PROJECT_URL}")
set(CPACK_NSIS_URL_INFO_ABOUT "${CPACK_PROJECT_URL}")
set(CPACK_NSIS_CONTACT "${CPACK_PACKAGE_CONTACT}")
set(CPACK_NSIS_MUI_ICON "${PROJECT_SOURCE_DIR}/docs/images/PropWare_Logo.ico")
set(CPACK_NSIS_MUI_UNIICON "${PROJECT_SOURCE_DIR}/docs/images/PropWare_Logo.ico")
set(CPACK_NSIS_INSTALL_ROOT C:)
set(CPACK_PACKAGE_INSTALL_DIRECTORY PropWare) # Required because default contains spaces and version number
set(CPACK_NSIS_EXECUTABLES_DIRECTORY .)
set(CPACK_PACKAGE_EXECUTABLES
"${CUSTOM_WIN32_CMAKE_INSTALL_DIR}\\\\bin\\\\cmake" CMake
"${CUSTOM_WIN32_CMAKE_INSTALL_DIR}\\\\bin\\\\cmake-gui" "CMake GUI"
"${CUSTOM_WIN32_CMAKE_INSTALL_DIR}\\\\bin\\\\ctest" CTest
"${CUSTOM_WIN32_CMAKE_INSTALL_DIR}\\\\bin\\\\cpack" CPack)

# Debian Specific
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "${CPACK_PROJECT_URL}")
set(CPACK_DEBIAN_PACKAGE_SECTION devel)
set(CPACK_DEBIAN_PACKAGE_PRIORITY optional)
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
set(CPACK_DEBIAN_PACKAGE_RECOMMENDS "make")
set(CPACK_DEBIAN_PACKAGE_REPLACES "cmake")

# RPM Specific
set(CPACK_RPM_PACKAGE_URL "${CPACK_PROJECT_URL}")
set(CPACK_RPM_PACKAGE_SUGGESTS "make")
set(CPACK_RPM_PACKAGE_OBSOLETES "cmake")
set(CPACK_PACKAGE_RELOCATABLE ON)

# Components
set(CPACK_ARCHIVE_COMPONENT_INSTALL ON)
set(CPACK_DEB_COMPONENT_INSTALL ON)
set(CPACK_RPM_COMPONENT_INSTALL ON)
set(CPACK_NSIS_COMPONENT_INSTALL ON)

set(CPACK_COMPONENT_PROPWARE_DISPLAY_NAME "Headers/Libraries")
set(CPACK_COMPONENT_PROPWARE_DESCRIPTION "Headers and static libraries for PropWare, Simple and libpropeller")
set(CPACK_COMPONENT_CMAKE_DISPLAY_NAME "CMake")
set(CPACK_COMPONENT_CMAKE_DESCRIPTION "Complete CMake installation with additional files for easy Propeller development")
set(CPACK_COMPONENT_EXAMPLES_DISPLAY_NAME "Examples")
set(CPACK_COMPONENT_EXAMPLES_DESCRIPTION "Examples projects for each of PropWare, Simple and libpropeller using the PropWare build system")
set(CPACK_COMPONENT_WIN_CMAKE_DISPLAY_NAME "${CPACK_COMPONENT_CMAKE_DISPLAY_NAME}")
set(CPACK_COMPONENT_WIN_CMAKE_DESCRIPTION "${CPACK_COMPONENT_CMAKE_DESCRIPTION}")
set(CPACK_COMPONENT_LINUX_SPIN2CPP_DISPLAY_NAME "Spin2Cpp")
set(CPACK_COMPONENT_LINUX_SPIN2CPP_DESCRIPTION "Compile Spin files for use in C/C++ projects")
set(CPACK_COMPONENT_WIN_SPIN2CPP_DISPLAY_NAME "${CPACK_COMPONENT_LINUX_SPIN2CPP_DISPLAY_NAME}")
set(CPACK_COMPONENT_WIN_SPIN2CPP_DESCRIPTION "${CPACK_COMPONENT_LINUX_SPIN2CPP_DESCRIPTION}")

configure_file("${PROJECT_SOURCE_DIR}/CMakeCPackOptions.cmake.in"
"${PROJECT_BINARY_DIR}/CMakeCPackOptions.cmake" @ONLY)
set(CPACK_PROJECT_CONFIG_FILE "${PROJECT_BINARY_DIR}/CMakeCPackOptions.cmake")
include(CPack)
17 changes: 17 additions & 0 deletions CMakeCPackOptions.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# This file is configured at cmake time, and loaded at cpack time.
# To pass variables to cpack from cmake, they must be configured
# in this file.

if (CPACK_GENERATOR MATCHES "ZIP")
set(CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE OFF)
set(CPACK_COMPONENTS_IGNORE_GROUPS ON)
set(CPACK_COMPONENTS_ALL propware examples win_cmake cmake osx_cmake)
elseif (CPACK_GENERATOR MATCHES "NSIS")
set(CPACK_COMPONENTS_ALL propware examples win_cmake win_spin2cpp)
elseif (CPACK_GENERATOR MATCHES "DEB")
set(CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE ON)
set(CPACK_COMPONENTS_ALL propware examples cmake linux_spin2cpp)
elseif (CPACK_GENERATOR MATCHES "RPM")
set(CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE ON)
set(CPACK_COMPONENTS_ALL propware examples cmake linux_spin2cpp)
endif ()
42 changes: 42 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
cmake_minimum_required(VERSION 3.3)

set(PROPWARE_MAIN_PACKAGE TRUE)

# Get the PropWare version
file(READ "${CMAKE_CURRENT_LIST_DIR}/version.txt" VERSION)
string(STRIP ${VERSION} VERSION)

if (DEFINED ENV{BUILD_NUMBER} AND NOT DEFINED ENV{PROPWARE_RELEASE})
set(VERSION "${VERSION}.$ENV{BUILD_NUMBER}")
endif ()

# Load special modules
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/CMakeModules")
find_package(PropWare REQUIRED)

# Allow using `if (VAR IN_LIST MY_LIST)`. Requires CMake 3.3
cmake_policy(SET CMP0057 NEW)

# Set the project, version number and all languages used
project(PropWare
VERSION ${VERSION}
LANGUAGES C CXX ASM COGC COGCXX ECOGC ECOGCXX DAT SPIN2DAT)

add_subdirectory(external_libs) # Make sure this is first since it modifies the include directories needed later
add_subdirectory(PropWare)
add_subdirectory(Examples)
add_subdirectory(test)

find_package(Doxygen)
if (DOXYGEN_FOUND)
add_custom_target(docs
"${DOXYGEN_EXECUTABLE}" Doxyfile
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}")
endif ()

include(ExternalProject)
include(./DownloadCMakeBinaries.cmake)
include(./DownloadSpin2cpp.cmake)

include(./CMakePropWareInstall.cmake)
include(./CMakeCPack.cmake)
52 changes: 52 additions & 0 deletions CMakeModules/CMakeCOGCCompiler.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
set(CMAKE_COGC_COMPILER "@CMAKE_C_COMPILER@")
set(CMAKE_COGC_COMPILER_ARG1 "@CMAKE_C_COMPILER_ARG1@")
set(CMAKE_COGC_COMPILER_ID "@CMAKE_C_COMPILER_ID@")
set(CMAKE_COGC_COMPILER_VERSION "@CMAKE_C_COMPILER_VERSION@")
set(CMAKE_COGC_PLATFORM_ID "@CMAKE_C_PLATFORM_ID@")
set(CMAKE_COGC_SIMULATE_ID "@CMAKE_C_SIMULATE_ID@")
set(CMAKE_COGC_SIMULATE_VERSION "@CMAKE_C_SIMULATE_VERSION@")
@SET_MSVC_COGC_ARCHITECTURE_ID@
set(CMAKE_AR "@CMAKE_AR@")
set(CMAKE_RANLIB "@CMAKE_RANLIB@")
set(CMAKE_LINKER "@CMAKE_LINKER@")
set(CMAKE_COMPILER_IS_GNUCC 1)
set(CMAKE_COGC_COMPILER_LOADED 1)
set(CMAKE_COGC_COMPILER_WORKS 1)
set(CMAKE_COGC_ABI_COMPILED @CMAKE_C_ABI_COMPILED@)
set(CMAKE_COMPILER_IS_MINGW @CMAKE_COMPILER_IS_MINGW@)
set(CMAKE_COMPILER_IS_CYGWIN @CMAKE_COMPILER_IS_CYGWIN@)

set(CMAKE_COGC_COMPILER_ENV_VAR "CC")

set(CMAKE_COGC_COMPILER_ID_RUN 1)
set(CMAKE_COGC_SOURCE_FILE_EXTENSIONS cogc)
set(CMAKE_COGC_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC)
set(CMAKE_COGC_LINKER_PREFERENCE 50)

set(LINKER_LANGUAGE C)
# Save compiler ABI information.
set(CMAKE_COGC_SIZEOF_DATA_PTR "@CMAKE_C_SIZEOF_DATA_PTR@")
set(CMAKE_COGC_COMPILER_ABI "@CMAKE_C_COMPILER_ABI@")
set(CMAKE_COGC_LIBRARY_ARCHITECTURE "@CMAKE_C_LIBRARY_ARCHITECTURE@")

if(CMAKE_COGC_SIZEOF_DATA_PTR)
set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}")
endif()

if(CMAKE_COGC_COMPILER_ABI)
set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}")
endif()

if(CMAKE_COGC_LIBRARY_ARCHITECTURE)
set(CMAKE_LIBRARY_ARCHITECTURE "@CMAKE_C_LIBRARY_ARCHITECTURE@")
endif()

@CMAKE_COGC_SYSROOT_FLAG_CODE@
@CMAKE_COGC_OSX_DEPLOYMENT_TARGET_FLAG_CODE@

set(CMAKE_COGC_IMPLICIT_LINK_LIBRARIES "@CMAKE_C_IMPLICIT_LINK_LIBRARIES@")
set(CMAKE_COGC_IMPLICIT_LINK_DIRECTORIES "@CMAKE_C_IMPLICIT_LINK_DIRECTORIES@")
set(CMAKE_COGC_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "@CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES@")

@SET_CMAKE_CMCLDEPS_EXECUTABLE@
@SET_CMAKE_CL_SHOWINCLUDES_PREFIX@
117 changes: 117 additions & 0 deletions CMakeModules/CMakeCOGCInformation.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
# This file sets the basic flags for the COGC language in CMake.
# It also loads the available platform file for the system-compiler
# if it exists.
# It also loads a system - compiler - processor (or target hardware)
# specific file, which is mainly useful for crosscompiling and embedded systems.

# some compilers use different extensions (e.g. sdcc uses .rel)
# so set the extension here first so it can be overridden by the compiler specific file
set(CMAKE_COGC_OUTPUT_EXTENSION .cog)

set(_INCLUDED_FILE 0)

set(CMAKE_BASE_NAME gcc)

#include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL)

# This should be included before the _INIT variables are
# used to initialize the cache. Since the rule variables
# have if blocks on them, users can still define them here.
# But, it should still be after the platform file so changes can
# be made to those values.

if(CMAKE_USER_MAKE_RULES_OVERRIDE)
# Save the full path of the file so try_compile can use it.
include(${CMAKE_USER_MAKE_RULES_OVERRIDE} RESULT_VARIABLE _override)
set(CMAKE_USER_MAKE_RULES_OVERRIDE "${_override}")
endif()

if(CMAKE_USER_MAKE_RULES_OVERRIDE_COGC)
# Save the full path of the file so try_compile can use it.
include(${CMAKE_USER_MAKE_RULES_OVERRIDE_COGC} RESULT_VARIABLE _override)
set(CMAKE_USER_MAKE_RULES_OVERRIDE_COGC "${_override}")
endif()


# for most systems a module is the same as a shared library
# so unless the variable CMAKE_MODULE_EXISTS is set just
# copy the values from the LIBRARY variables
if(NOT CMAKE_MODULE_EXISTS)
set(CMAKE_SHARED_MODULE_COGC_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS})
set(CMAKE_SHARED_MODULE_CREATE_COGC_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS})
endif()

# avoid just having a space as the initial value for the cache
if(CMAKE_C_FLAGS_INIT STREQUAL " ")
set(CMAKE_C_FLAGS_INIT)
endif()
set (CMAKE_COGC_FLAGS "${CMAKE_C_FLAGS_INIT}" CACHE STRING
"Flags used by the compiler during all build types.")

if(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
# default build type is none
if(NOT CMAKE_NO_BUILD_TYPE)
set (CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE_INIT} CACHE STRING
"Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.")
endif()
set (CMAKE_COGC_FLAGS_DEBUG "${CMAKE_COGC_FLAGS_DEBUG_INIT}" CACHE STRING
"Flags used by the compiler during debug builds.")
set (CMAKE_COGC_FLAGS_MINSIZEREL "${CMAKE_COGC_FLAGS_MINSIZEREL_INIT}" CACHE STRING
"Flags used by the compiler during release builds for minimum size.")
set (CMAKE_COGC_FLAGS_RELEASE "${CMAKE_COGC_FLAGS_RELEASE_INIT}" CACHE STRING
"Flags used by the compiler during release builds.")
set (CMAKE_COGC_FLAGS_RELWITHDEBINFO "${CMAKE_COGC_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING
"Flags used by the compiler during release builds with debug info.")
endif()

if(CMAKE_C_STANDARD_LIBRARIES_INIT)
set(CMAKE_COGC_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES_INIT}"
CACHE STRING "Libraries linked by default with all C applications.")
mark_as_advanced(CMAKE_COGC_STANDARD_LIBRARIES)
endif()

include(CMakeCommonLanguageInclude)

# now define the following rule variables

# CMAKE_C_CREATE_SHARED_LIBRARY
# CMAKE_C_CREATE_SHARED_MODULE
# CMAKE_C_COMPILE_OBJECT
# CMAKE_C_LINK_EXECUTABLE

# variables supplied by the generator at use time
# <TARGET>
# <TARGET_BASE> the target without the suffix
# <OBJECTS>
# <OBJECT>
# <LINK_LIBRARIES>
# <FLAGS>
# <LINK_FLAGS>

# C compiler information
# <CMAKE_C_COMPILER>
# <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS>
# <CMAKE_SHARED_MODULE_CREATE_C_FLAGS>
# <CMAKE_C_LINK_FLAGS>

# Static library tools
# <CMAKE_AR>
# <CMAKE_RANLIB>

set(CMAKE_INCLUDE_FLAG_COGC ${CMAKE_INCLUDE_FLAG_C})

set(CMAKE_COGC_ARCHIVE_CREATE ${CMAKE_C_ARCHIVE_CREATE})
set(CMAKE_COGC_ARCHIVE_APPEND ${CMAKE_C_ARCHIVE_APPEND})
set(CMAKE_COGC_ARCHIVE_FINISH ${CMAKE_C_ARCHIVE_FINISH})
set(CMAKE_COGC_COMPILE_OBJECT
"<CMAKE_C_COMPILER> <DEFINES> ${CMAKE_COGC_FLAGS_INIT} <FLAGS> -o <OBJECT> <SOURCE>"
"${CMAKE_COMMAND} -DOBJCOPY=\"${CMAKE_OBJCOPY}\" -DFILE=<OBJECT> -P ${PROPWARE_RUN_OBJCOPY}")

mark_as_advanced(
CMAKE_COGC_FLAGS
CMAKE_COGC_FLAGS_DEBUG
CMAKE_COGC_FLAGS_MINSIZEREL
CMAKE_COGC_FLAGS_RELEASE
CMAKE_COGC_FLAGS_RELWITHDEBINFO
)
set(CMAKE_COGC_INFORMATION_LOADED 1)
Loading

0 comments on commit acdf324

Please sign in to comment.