CMake and static linking


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
28 views
There is a small self-written parser cross-platform toy using SDL. The C++ Language. Under Win32 and Win64 is going in mingw-w64, gcc 4.5.1.

I want the following: in Assembly under Windows, link the dependencies statically. Not hunting to carry over a dozen libraries. Now in the build environment have both versions of libraries: static and dynamic linking. By default, gcc prefers to link dynamically. So he chose the static version of the libraries you want to add to them the key static. And then in front required libraries that are dynamically linkouts (OpenGL), add key -dynamic.

Question: how to make/teach cmake to collect the necessary command line?
by | 28 views

2 Answers

0 like 0 dislike
if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
Your code...
else()
Your code...
endif(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
\r
\rwww.paraview.org/Wiki/CMake_Useful_Variables
by
0 like 0 dislike
If I remember correctly, for target_link_libraries no difference Libin static or dynamic.
If you want a specific option to the compiler or linker, in these cases, using set_target_properties. There are COMPILE_FLAGS and LINK_FLAGS, and lots of other things (see www.cmake.org/cmake/help/v2.8.12/cmake.html#section_PropertiesonTargets)
by

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
110,608 questions
257,186 answers
0 comments
28,013 users