Giter Site home page Giter Site logo

cgold's People

Contributors

b8adamson avatar basiliuss avatar brunom avatar dasgeek avatar ejricha avatar headupinclouds avatar jlquinn avatar kirkrudolph avatar krisl avatar neroburner avatar rpaaron avatar ruslo avatar traversaro avatar zhkvia avatar

Stargazers

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

Watchers

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

cgold's Issues

Is it possible to send return value via argument?

In Return Value, it recommends to set a variable to the parent scope to return a value from function.

But I am wondering if it is possible to return a value via argument of function. It is more commonly seen in CMake for example: ProcessorCount(N), N is a output argument of function.

Is the function argument in CMake passed by reference?

Could I translate this guide to Chinese

I've read many cmake guide or tutorial, but many of them are old-fashioned.
I find what i need in your guide. And i wanna to share this to my Chinese friends.
Is this fine to translate it

Ch 3.7.3: path to mymodule

The example in cmake-sources/with-external-module-good doesn't work because the path to mymodule.cmake isn't fully specified (CMAKE Error: include could not find load file: mymodule).

How should the include statement look correctly?
Add the line list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/../external") before?

Using 'macro'

The only way to set variable to parent of the parent scope.

Don't use the -H and -B flags for specifiying the source and build directory

In https://cgold.readthedocs.io/en/latest/tutorials/out-of-source.html (and on other pages), the -H. and -B flags are used.

According to http://stackoverflow.com/a/31092052, this is undocumented because it shouldn't be used. The answer links to https://cmake.org/pipermail/cmake-developers/2016-June/028843.html, it says

These are undocumented because they are internal options that
are not meant for public use.

So I guess the flags shouldn't be used in the tutorial.

MSYS/MinGW

  • MSYS -> make.exe
  • MinGW -> mingw-make.exe

PUBLIC/PRIVATE linking

cmake_minimum_required(VERSION 3.2)
project(foo)

add_library(foo foo.cpp)
target_compile_definitions(foo PUBLIC FOO_FEATURE)

add_library(baz_1 baz_1.cpp)
target_link_libraries(baz_1 PUBLIC foo) # Case 1

add_library(baz_2 baz_2.cpp)
target_link_libraries(baz_2 PRIVATE foo) # Case 2

add_executable(boo_1 boo_1.cpp)
target_link_libraries(boo_1 PRIVATE baz_1)

add_executable(boo_2 boo_2.cpp)
target_link_libraries(boo_2 PRIVATE baz_2)
/usr/bin/c++ -DFOO_FEATURE -o foo.cpp.o -c foo.cpp

/usr/bin/c++ -DFOO_FEATURE -o baz_1.cpp.o -c baz_1.cpp
/usr/bin/c++ -DFOO_FEATURE -o boo_1.cpp.o -c boo_1.cpp # FOO_FEATURE added, foo headers can be used in boo_1.cpp
/usr/bin/c++ boo_1.cpp.o -o boo_1 libbaz_1.a libfoo.a  # libfoo.a added, linking is static, we may need symbols

/usr/bin/c++ -DFOO_FEATURE -o baz_2.cpp.o -c baz_2.cpp
/usr/bin/c++ -o boo_2.cpp.o -c boo_2.cpp               # FOO_FEATURE is missing, can't use foo headers in boo_2.cpp
/usr/bin/c++ boo_2.cpp.o -o boo_2 libbaz_2.a libfoo.a  # libfoo.a added even if PRIVATE used

configure_file

Always use @ONLY form.

# CMakeLists.txt
set(A "0")
configure_file(foo.cmake.in foo.cmake)
# foo.cmake.in
set(A "1")
message("A = ${A}") # A from CMakeLists.txt will be used!
# foo.cmake
message("A = ")

Object libraries

In docs/rejected/object-libraries.rst, the affirmation that "library can't be used on the right hand side of target_link_libraries command" is wrong since CMake 3.12.

Wrong source link

In this file:
CGold/docs/tutorials/libraries/symbols/tools.rst

The link duplicates:
/examples/library-examples/library-symbols/Boo.cpp

It seems to me, Foo.cpp must be in the second case.

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.