forked from GaijinEntertainment/quirrel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
49 lines (44 loc) · 1.7 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
47
48
49
set(SQMODULES_SRC
path.cpp
sqmodules.cpp
)
if(NOT DISABLE_DYNAMIC)
add_library(sqmodules SHARED ${SQMODULES_SRC})
add_library(squirrel::sqmodules ALIAS sqmodules)
set_property(TARGET sqmodules PROPERTY EXPORT_NAME sqmodules)
target_link_libraries(sqmodules sqstdlib squirrel)
if(NOT SQ_DISABLE_INSTALLER)
install(TARGETS sqmodules EXPORT squirrel
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT Libraries
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Libraries NAMELINK_SKIP
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Libraries
)
install(TARGETS sqmodules EXPORT squirrel
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Development NAMELINK_ONLY
)
endif()
target_include_directories(sqmodules PUBLIC
"$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
)
endif()
if(NOT DISABLE_STATIC)
add_library(sqmodules_static STATIC ${SQMODULES_SRC})
add_library(squirrel::sqmodules_static ALIAS sqmodules_static)
set_property(TARGET sqmodules_static PROPERTY EXPORT_NAME sqmodules_static)
if(NOT SQ_DISABLE_INSTALLER)
install(TARGETS sqmodules_static EXPORT squirrel ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Development)
endif()
target_include_directories(sqmodules_static PUBLIC
"$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
)
endif()
if(LONG_OUTPUT_NAMES)
if(NOT DISABLE_DYNAMIC)
set_target_properties(sqmodules PROPERTIES OUTPUT_NAME sqmodules)
endif()
if(NOT DISABLE_STATIC)
set_target_properties(sqmodules_static PROPERTIES OUTPUT_NAME sqmodules_static)
endif()
endif()