0
|
1 Notes on building DynCall with CMake
|
|
2 ====================================
|
|
3
|
|
4
|
|
5 Build with CMake (in-source)
|
|
6 ----------------------------
|
|
7
|
|
8 cd <dyncall-source-dir>
|
|
9
|
|
10 On Unix:
|
|
11 cmake .
|
|
12 make
|
|
13
|
|
14 On Windows:
|
|
15 cmake . -G "NMake Makefiles"
|
|
16 nmake /f Makefile
|
|
17
|
|
18 NOTE: Assembly Support is broken for Visual Studio Generators in CMake
|
|
19 So we support NMake for now only.
|
|
20
|
|
21 Install in a specific location
|
|
22 ------------------------------
|
|
23 cmake -DCMAKE_INSTALL_PREFIX=<absolute-path>
|
|
24
|
|
25
|
|
26 Tested settings
|
|
27 ---------------
|
|
28 - CMake Unix Makefile generators on Mac OS X and Linux.
|
|
29
|
|
30
|
|
31 Using from other CMake-based projects
|
|
32 -------------------------------------
|
|
33 Under buildsys/cmake/Modules you find some Find*() scripts
|
|
34 which you might find useful.
|
|
35
|
|
36
|
|
37 Make Universal Binary
|
|
38 ---------------------
|
|
39 cmake -DCMAKE_OSX_ARCHITECTURES="i386;x86_64;ppc"
|
|
40
|
|
41
|
|
42 CMake Framework
|
|
43 ---------------
|
|
44 The project name is "DynCall".
|
|
45 Each library in the source tree represents a target (not a sub-project!).
|
|
46 Support scripts for 'find_package' are at buildsys/cmake/Modules.
|
|
47
|
|
48 find_package( [DynLoad | DynCall | DynCallback] )
|
|
49
|
|
50 will set the variables:
|
|
51
|
|
52 Dyn*_INCLUDE_DIRS
|
|
53 Dyn*_LIBRARIES
|
|
54
|
|
55
|
|
56 Using dyncall libraries in other CMake projects
|
|
57 -----------------------------------------------
|
|
58 find_package(DynLoad REQUIRED)
|
|
59 add_includes(${DynLoad_INCLUDE_DIRS})
|
|
60 target_link_libraries( ... ${DynLoad_LIBRARIES})
|
|
61
|
|
62
|
|
63 Use as sub-project within CMake top-level project
|
|
64 -------------------------------------------------
|
|
65
|
|
66 add_subdirectory(path/to/dyncall/project/tree)
|
|
67 set(DynLoad_DIR ${DynCall_SOURCE_DIR}/dynload)
|
|
68 set(DynCall_DIR ${DynCall_SOURCE_DIR}/dyncall)
|
|
69 set(DynCallback_DIR ${DynCall_SOURCE_DIR}/dyncallback)
|
|
70
|
|
71 has the effect, that the 'find_package' works from within the project source
|
|
72 tree.
|
|
73
|
|
74
|
|
75 Building for SPARC64 Architectures
|
|
76 ----------------------------------
|
|
77
|
|
78 Supported Compilers: GCC, SunPro
|
|
79 Add -m64 to C, C++ and ASM flags, e.g.
|
|
80
|
|
81 $ cmake -DCMAKE_C_FLAGS=-m64 -DCMAKE_ASM_FLAGS=-m64 -DCMAKE_ASM_CXX_FLAGS=-m64
|
|
82
|