Code Monkey home page Code Monkey logo

terrac's People

Contributors

qix- avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

terrac's Issues

Add CMake generation function

Not sure exactly how it should be provided (directly in the CMakeLists.txt here? as a package for find_package()?) but here is the toolchain function I've been using to create Terra projects with terrac:

function (terra_module_directories)
	foreach (arg IN LISTS ARGN)
		list (APPEND TERRA_MODPATH "${arg}")
	endforeach ()
	set (TERRA_MODPATH "${TERRA_MODPATH}" PARENT_SCOPE)
endfunction ()

function (add_terra_executable ARG_NAME)
	if (ARGC LESS 2)
		message (FATAL_ERROR "add_terra_executable(name, ...) requires at least one source")
	endif ()

	get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
	foreach (DIR IN LISTS dirs)
		list (APPEND includedirs "-I")
		list (APPEND includedirs "${DIR}")
	endforeach ()
	foreach (modpath IN LISTS TERRA_MODPATH)
		list (APPEND includedirs "-m")
		list (APPEND includedirs "${modpath}")
	endforeach ()

	foreach (file IN LISTS ARGN)
		get_filename_component (ext "${file}" EXT)
		if (ext STREQUAL ".t")
			get_filename_component (fileabs "${file}" ABSOLUTE BASE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
			file (TO_CMAKE_PATH "${fileabs}" fileabssrc)
			file (RELATIVE_PATH filerel "${CMAKE_CURRENT_SOURCE_DIR}" "${fileabssrc}")
			get_filename_component (output "${filerel}" ABSOLUTE BASE_DIR "${CMAKE_CURRENT_BINARY_DIR}")
			get_filename_component (filedir "${fileabs}" DIRECTORY)

			message(STATUS "terra: ${output}.o")
			add_custom_command (
				OUTPUT "${output}.o"
				COMMAND "$<TARGET_FILE:terrac>" ARGS -I "${filedir}" -P "${CMAKE_CURRENT_BINARY_DIR}" -D "${output}.d" -o "${output}.o" ${includedirs} "${fileabs}"
				WORKING_DIRECTORY "${filedir}"
				MAIN_DEPENDENCY "${fileabs}"
				DEPFILE "${output}.d"
				COMMENT "Terra: ${output}.o"
				VERBATIM
				COMMAND_EXPAND_LISTS)

			list (APPEND link_sources "${output}.o")
		else ()
			list (APPEND compile_sources "${file}")
		endif ()
	endforeach ()

	list (LENGTH compile_sources compile_sources_count)
	if (compile_sources_count EQUAL 0)
		message (FATAL_ERROR "add_terra_executable(name, ...) requires at least one non-terra source file (I know, I know...)")
	endif ()

	list (LENGTH link_sources link_sources_count)

	add_executable ("${ARG_NAME}" ${compile_sources})
	if (link_sources_count GREATER 0)
		target_link_libraries ("${ARG_NAME}" ${link_sources})

		add_custom_target ("${ARG_NAME}__terra"
			DEPENDS "${link_sources}")

		add_dependencies ("${ARG_NAME}" "${ARG_NAME}__terra")
		add_dependencies ("${ARG_NAME}__terra" terrac)
	endif ()
endfunction ()

Anyone have any preferences on how this gets distributed?

Submodules are private and require authenticating to github

The filesystem and xopt submodules, required to build terrac, are private and require authentication when I try to update.

This prevents anyone without authorization to them from compiling terrac.

Not sure what to do here, since I'm not even able to know what these libraries are supposed to be, but they could be made public or there could be a copy of them inside terrac's repository.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.