This is the main qiBuild module. It encapsulates the creation of programs, scripts and libraries, handling dependencies and install rules, in an easy, elegant and standard way.
There could be differents targets:
See also
qi_create_bin(name [<remaining args> ...]
[NO_INSTALL]
[NO_RPATH]
[EXCLUDE_FROM_ALL]
[WIN32]
[MACOSX_BUNDLE]
[SUBFOLDER <subfolder>]
[SRC <src> ...]
[DEPENDS <depends> ...]
[SUBMODULE <submodule> ...]
)
Arguments: |
|
---|
Create an executable. The target name should be unique.
Example
##
## target examples
##
project(SampleTarget)
#add_subdirectory(fooscript)
add_subdirectory(foolib)
add_subdirectory(foobin)
qi_create_bin(myprog SRC main.cpp)
qi_create_lib(mylib SRC mylib.h mylib.c)
qi_create_script(name source [NO_INSTALL]
[SUBFOLDER <subfolder>]
)
Arguments: |
|
---|
Create a script. This will generate rules to install it in the sdk.
qi_create_lib(name [<remaining args> ...]
[STATIC]
[SHARED]
[MODULE]
[NO_INSTALL]
[EXCLUDE_FROM_ALL]
[NO_RPATH]
[NO_FPIC]
[SUBFOLDER <subfolder>]
[SRC <src> ...]
[SUBMODULE <submodule> ...]
[DEPENDS <depends> ...]
)
Arguments: |
|
---|
Create a library or a module
The target name should be unique.
Static vs shared
To build a module (library loaded at runtime), use:
qi_create_lib(myLib MODULE SRC ....)
If you need your library to be static, use:
qi_create_lib(mylib STATIC SRC ....)
If you need your library to be shared, use:
qi_create_lib(mylib SHARED SRC ....)
If you want to let the user choose, use:
qi_create_lib(mylib SRC ....)
But the user can set BUILD_SHARED_LIBS=OFF to compile everything in static by default.
Warning ! This is quite not the standard CMake behavior
Example
##
## target examples
##
project(SampleTarget)
#add_subdirectory(fooscript)
add_subdirectory(foolib)
add_subdirectory(foobin)
qi_create_bin(myprog SRC main.cpp)
qi_create_lib(mylib SRC mylib.h mylib.c)
qi_create_config_h(OUT_PATH source dest [<remaining args> ...]
)
Arguments: |
|
---|
Create a configuration file
Configures a header named ${dest} using the source file from ${source} using configure_file In addition:
If you need the header to be generated in a subdirectory (recommended), simply use something like:
qi_create_config_h(_out config.h.in foo/config.h)
Note that both arguments must be relative paths