Specify output name in biicode

147 Views Asked by At

I have a project generated via the simple layout. My layout.bii:

cmake: bii/cmake
lib: bii/lib
build: bii/build

deps: bii/deps
auto-root-block: True

When I perform the following...

bii cpp:configure -G "Visual Studio 12"
bii cpp:build

... It modifies layout.bii to add this line at the end root-block: user/testsdl2.

This seems to be in conflict with the auto-root-block flag and may be related to my issue.

My question: The file generated is user_testsdl2_main.exe. How do I specify something like "testsdl2.exe"?

1

There are 1 best solutions below

4
drodri On BEST ANSWER

The auto-root-block: True behavior works as follows:

  • If there is inside the project root a biicode.conf corresponding to the main project block, with a [parent] section, then, the block name will be taken from it.
  • If there is no biicode.conf with parent, then the block name will be automatically defined from the current user and the project folder name. Changing either of them, should rename the block.

Renaming the project folder is simple, changing the current user name is done with:

$ bii user myusername

If you want a specific block-name, write either the [parent] or disable the auto-root-block and write manually the root-block.

Changing the executable output name is simple with CMake. Add to your CMakeLists.txt:

ADD_BIICODE_TARGETS()
SET_TARGET_PROPERTIES(${BII_main_TARGET} PROPERTIES OUTPUT_NAME testsdl2)

Where the actual tartet name will depend on the path of the file containing the main() function, if it is inside src/myfile.cpp, then the EXEcutable target name will be ${BII_src_myfile_TARGET}

Another tip, from 2.6.3, you can skip the cpp:, and write just bii build, bii configure