-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
46 lines (33 loc) · 1.28 KB
/
CMakeLists.txt
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
cmake_minimum_required(VERSION 3.15)
project( MulleObjCClionDemo C)
set( CMAKE_C_STANDARD 11)
#
# Install FoundationWrap into local folder "usr"
#
set( DEPENDENCY_DIR "usr")
include_directories( "generic")
include_directories( BEFORE SYSTEM "${DEPENDENCY_DIR}/include" )
find_library( C_WRAP_LIB NAMES ${CMAKE_STATIC_LIBRARY_PREFIX}c-wrap${CMAKE_STATIC_LIBRARY_SUFFIX}
PATHS "${DEPENDENCY_DIR}/lib"
NO_DEFAULT_PATH)
find_library( FOUNDATION_WRAP_LIB NAMES ${CMAKE_STATIC_LIBRARY_PREFIX}FoundationWrap${CMAKE_STATIC_LIBRARY_SUFFIX}
PATHS "${DEPENDENCY_DIR}/lib"
NO_DEFAULT_PATH)
find_library( FOUNDATION_WRAP_STARTUP_LIB NAMES ${CMAKE_STATIC_LIBRARY_PREFIX}FoundationWrap-startup${CMAKE_STATIC_LIBRARY_SUFFIX}
PATHS "${DEPENDENCY_DIR}/lib"
NO_DEFAULT_PATH)
if( UNIX)
link_libraries( -Wl,--whole-archive ${FOUNDATION_WRAP_LIB} -Wl,--no-whole-archive)
link_libraries( -Wl,--export-dynamic -Wl,--whole-archive ${FOUNDATION_WRAP_STARTUP_LIB} -Wl,--no-whole-archive)
else()
message( FATAL_ERROR "unsupported platform")
endif()
link_libraries( ${C_WRAP_LIB})
if( UNIX)
link_libraries( -ldl)
link_libraries( -lm)
endif()
#
# managed by CLion
#
add_executable( ${PROJECT_NAME} main.m FooBar.m FooBar.h generic/import-private.h generic/import.h)