Browse code

modernize CMakeLists.txt

Nat! authored on 11-09-2017 13:39:25
Showing 2 changed files
... ...
@@ -13,64 +13,26 @@ else()
13 13
   include( Release)
14 14
 endif()
15 15
 
16
-set(HEADERS
17
-src/mulle_align.h
18
-src/mulle_vararg.h
19
-)
16
+include( CMakeSourcesAndHeaders.txt)
20 17
 
21
-set( SOURCES
22
-src/mulle_vararg.c
23
-)
24 18
 
25
-add_library(mulle_vararg
19
+add_library( mulle_vararg
26 20
 ${SOURCES}
27 21
 )
28 22
 
29 23
 
30
-INSTALL(TARGETS mulle_vararg DESTINATION "lib")
31
-INSTALL(FILES ${HEADERS} DESTINATION "include/mulle_vararg")
32
-
33
-
34
-#
35
-# standalone shared library (for tests)
36
-#
37
-
38
-if( MSVC)
39
-  set( DEF_FILE mulle_vararg_standalone.def)
40
-  set_source_files_properties( ${DEF_FILE} PROPERTIES HEADER_FILE_ONLY TRUE)
41
-  set( CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS OFF)
42
-  set( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /DEF:${DEF_FILE}")
43
-  # /NODEFAULTLIB:MSVCRT")
44
-endif()
45
-
46
-
47
-add_library( mulle_vararg_standalone SHARED
48
-src/mulle_vararg_standalone.c
49
-${DEF_FILE}
50
-)
51
-
52
-add_dependencies( mulle_vararg_standalone mulle_vararg)
53
-
54
-
55
-set( DEPENDENCY_LIBRARIES
56
-)
57
-
58
-
59
-if( MSVC)
60
-   add_custom_command( OUTPUT ${DEF_FILE}
61
-                       COMMAND mulle-mingw-dumpdef.bat -o "${DEF_FILE}" --prefix "mulle" ${DEPENDENCY_LIBRARIES} $<TARGET_FILE:mulle_vararg>
62
-                       DEPENDS "${DEPENDENCY_LIBRARIES}" mulle_vararg
63
-                       VERBATIM)
64
-endif()
65
-
24
+set( STANDALONE_BASE_NAME "mulle_vararg")
25
+set( STANDALONE_NAME "mulle_vararg_standalone")
66 26
 
67
-TARGET_LINK_LIBRARIES( mulle_vararg_standalone
68
-${BEGIN_ALL_LOAD}
69
-mulle_vararg
27
+set( TARGET_ALL_LOAD_LIBRARIES
28
+$<TARGET_FILE:mulle_vararg>
70 29
 ${DEPENDENCY_LIBRARIES}
71
-${END_ALL_LOAD}
72 30
 )
73 31
 
32
+include( Standalone)
33
+
34
+INSTALL( TARGETS  DESTINATION "lib")
35
+INSTALL(TARGETS mulle_vararg mulle_vararg_standalone DESTINATION "lib")
36
+INSTALL(FILES ${HEADERS} DESTINATION "include/mulle_vararg")
74 37
 
75
-INSTALL( TARGETS mulle_vararg_standalone DESTINATION "lib")
76 38
 
77 39
new file mode 100644
... ...
@@ -0,0 +1,9 @@
1
+
2
+set(HEADERS
3
+src/mulle_align.h
4
+src/mulle_vararg.h
5
+)
6
+
7
+set( SOURCES
8
+src/mulle_vararg.c
9
+)