<div dir="ltr"><p style="margin-top:0px;font-family:Helvetica,Arial,sans-serif;font-size:15px">I want to build a shared library for Linux and a static library for Windows. So I have tried:</p><pre style="overflow:auto;font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;font-size:15px"><code style="font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;font-size:1em;overflow:auto;background:rgb(249,249,249);display:block;padding:0.5em;max-height:500px"> set (_star_lib_name "StdStars")
 
 add_library(${_star_lib_name} 
             $<$<CXX_COMPILER_ID:GNU>:SHARED>
             $<$<CXX_COMPILER_ID:MSVC>:STATIC> 
             ""
 )
</code></pre><p style="font-family:Helvetica,Arial,sans-serif;font-size:15px">but that gives me error:</p><pre style="overflow:auto;font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;font-size:15px"><code style="font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;font-size:1em;overflow:auto;background:rgb(249,249,249);display:block;padding:0.5em;max-height:500px">CMake Error at C:/SVNProj/zodiac/branches/TRY_TML_CMake_3Oct2019/StarLibs/StdStars/CMakeLists.txt:7 (add_library):
Cannot find source file:

    STATIC

  Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h++ .hm
  .hpp .hxx .in .txx
</code></pre><p style="font-family:Helvetica,Arial,sans-serif;font-size:15px">What is the correct way of doing this please?</p></div>