Development > Coding

Using cmake to setup build env

<< < (6/11) > >>

Mattn:
Very nice job. It would be cool if the cmake file could get some more love though. Using:

  add_library(common ${COMMON_SRC})
  target_link_libraries(common ${COMMON_DEPS})

  add_executable(ufoded ${UFODED_SRC})
  target_link_libraries(ufoded common)

would greatly reduce compile times.

hwoarangmy:

--- Quote from: Mattn on September 17, 2015, 08:23:42 pm ---Using:

  add_library(common ${COMMON_SRC})
  target_link_libraries(common ${COMMON_DEPS})

  add_executable(ufoded ${UFODED_SRC})
  target_link_libraries(ufoded common)

would greatly reduce compile times.
--- End quote ---
I'm comfortable with C/C++ but I'm not a cmake expert and I didn't look into UFOAI code very deep (only for the errors the compiler was complaining about).
However, every projects do not share the same common sources files. Using a project with the common sources would decrease compile time but increase executables size since they will embed not wanted stuff. That's a choice to make ^^

BTW, same goes for "shared" sources I guess.

Mattn:
true - but the symbols are stripped anyway.

I did something for my sideproject at https://github.com/mgerhardy/caveexpress - the cmake scripts will try to find a system wide installed lib, if not found, it will pick the embedded one. This would be cool for linux.

Would also be cool to get some feedback from some Xcode users whether the cmake script works for them.

hwoarangmy:
I've found something interesting:
http://www.cmake.org/pipermail/cmake-developers/2012-March/003693.html

I will keep you in touch

EDIT: other link:
http://www.cmake.org/Wiki/CMake/Tutorials/Object_Library

Mattn:
That's what I meant.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version