aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/gmsh/linking-and-naming.diff
blob: d21911561426e14345b686067784cc535dc18eab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 46937b2..67ddec5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1748,6 +1748,7 @@ endforeach()
 if(ENABLE_BUILD_LIB)
   add_library(lib STATIC ${GMSH_SRC})
   set_target_properties(lib PROPERTIES OUTPUT_NAME gmsh)
+  target_link_libraries(lib ${LINK_LIBRARIES})
   if(MSVC)
     set_target_properties(lib PROPERTIES DEBUG_POSTFIX d)
     if(ENABLE_MSVC_STATIC_RUNTIME)
@@ -1793,26 +1794,23 @@ endif()
 
 # binary targets
 if(HAVE_FLTK)
-  if(ENABLE_BUILD_DYNAMIC)
-    add_executable(gmsh WIN32 src/common/Main.cpp)
-    target_link_libraries(gmsh shared)
-  else()
-    add_executable(gmsh WIN32 src/common/Main.cpp ${GMSH_SRC})
-  endif()
+  add_executable(gmsh WIN32 src/common/Main.cpp)
   # we could add this to create a minimal app bundle even without install
   # if(APPLE AND NOT ENABLE_OS_SPECIFIC_INSTALL)
   #  set_target_properties(gmsh PROPERTIES MACOSX_BUNDLE ON
   #    MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/utils/misc/gmsh_dev.plist)
   # endif()
 else()
-  if(ENABLE_BUILD_DYNAMIC)
-    add_executable(gmsh src/common/Main.cpp)
-    target_link_libraries(gmsh shared)
-  else()
-    add_executable(gmsh src/common/Main.cpp ${GMSH_SRC})
-  endif()
+  add_executable(gmsh src/common/Main.cpp)
+endif()
+if(TARGET shared)
+  target_link_libraries(gmsh shared)
+elseif(TARGET lib)
+  target_link_libraries(gmsh lib)
+else()
+  target_sources(gmsh ${GMSH_SRC})
 endif()
-target_link_libraries(gmsh ${LINK_LIBRARIES})
+set_target_properties(gmsh PROPERTIES PDB_NAME gmsh.exe)
 
 # OS specific linker options
 if(WIN32 AND NOT MSVC)