CMake: Add Bindings library from subdirectory
This commit is contained in:
parent
84fef3c156
commit
8325304693
|
@ -30,3 +30,9 @@ SET (HDRS
|
||||||
WebPlugin.h
|
WebPlugin.h
|
||||||
tolua++.h
|
tolua++.h
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(NOT MSVC)
|
||||||
|
add_library(Bindings ${SRCS} ${HDRS})
|
||||||
|
|
||||||
|
target_link_libraries(Bindings lua sqlite tolualib polarssl)
|
||||||
|
endif()
|
||||||
|
|
|
@ -6,7 +6,7 @@ include_directories (SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/../lib/jsoncpp/include"
|
||||||
include_directories (SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/../lib/polarssl/include")
|
include_directories (SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/../lib/polarssl/include")
|
||||||
|
|
||||||
set(FOLDERS
|
set(FOLDERS
|
||||||
OSSupport HTTPServer Items Blocks Protocol Generating PolarSSL++
|
OSSupport HTTPServer Items Blocks Protocol Generating PolarSSL++ Bindings
|
||||||
WorldStorage Mobs Entities Simulator UI BlockEntities Generating/Prefabs
|
WorldStorage Mobs Entities Simulator UI BlockEntities Generating/Prefabs
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -250,26 +250,14 @@ set_source_files_properties(Bindings/Bindings.h PROPERTIES GENERATED TRUE)
|
||||||
if (NOT MSVC)
|
if (NOT MSVC)
|
||||||
|
|
||||||
# Bindings need to reference other folders, so they are done here instead
|
# Bindings need to reference other folders, so they are done here instead
|
||||||
|
|
||||||
# lib dependencies are not included
|
# lib dependencies are not included
|
||||||
|
|
||||||
include_directories ("${CMAKE_CURRENT_SOURCE_DIR}/../lib/polarssl/include")
|
include_directories ("${CMAKE_CURRENT_SOURCE_DIR}/../lib/polarssl/include")
|
||||||
|
|
||||||
#add cpp files here
|
foreach(folder ${FOLDERS})
|
||||||
add_library(Bindings
|
add_subdirectory(${folder})
|
||||||
Bindings/Bindings
|
endforeach(folder)
|
||||||
Bindings/DeprecatedBindings
|
|
||||||
Bindings/LuaChunkStay
|
|
||||||
Bindings/LuaState
|
|
||||||
Bindings/LuaWindow
|
|
||||||
Bindings/ManualBindings
|
|
||||||
Bindings/Plugin
|
|
||||||
Bindings/PluginLua
|
|
||||||
Bindings/PluginManager
|
|
||||||
Bindings/WebPlugin
|
|
||||||
)
|
|
||||||
|
|
||||||
target_link_libraries(Bindings lua sqlite tolualib polarssl)
|
|
||||||
|
|
||||||
#clear file
|
#clear file
|
||||||
file(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/Bindings/BindingDependecies.txt)
|
file(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/Bindings/BindingDependecies.txt)
|
||||||
|
@ -280,10 +268,6 @@ if (NOT MSVC)
|
||||||
|
|
||||||
set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "Bindings.cpp Bindings.h")
|
set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "Bindings.cpp Bindings.h")
|
||||||
|
|
||||||
foreach(folder ${FOLDERS})
|
|
||||||
add_subdirectory(${folder})
|
|
||||||
endforeach(folder)
|
|
||||||
|
|
||||||
list(APPEND SOURCE "${SRCS}")
|
list(APPEND SOURCE "${SRCS}")
|
||||||
list(APPEND SOURCE "${HDRS}")
|
list(APPEND SOURCE "${HDRS}")
|
||||||
|
|
||||||
|
@ -299,7 +283,6 @@ else ()
|
||||||
source_group(Bindings FILES "Bindings/Bindings.cpp" "Bindings/Bindings.h")
|
source_group(Bindings FILES "Bindings/Bindings.cpp" "Bindings/Bindings.h")
|
||||||
|
|
||||||
# Add all subfolders as solution-folders:
|
# Add all subfolders as solution-folders:
|
||||||
list(APPEND FOLDERS "Bindings")
|
|
||||||
function(includefolder PATH)
|
function(includefolder PATH)
|
||||||
FILE(GLOB FOLDER_FILES
|
FILE(GLOB FOLDER_FILES
|
||||||
"${PATH}/*.cpp"
|
"${PATH}/*.cpp"
|
||||||
|
|
Loading…
Reference in New Issue