-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
replace the existing build system with cmake
- Loading branch information
Felix Fietkau
committed
Mar 26, 2011
1 parent
9080634
commit b298632
Showing
7 changed files
with
92 additions
and
179 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,15 @@ | ||
Makefile | ||
CMakeCache.txt | ||
CMakeFiles | ||
*.cmake | ||
*.o | ||
*.a | ||
*.so | ||
*.dylib | ||
install_manifest.txt | ||
|
||
uci | ||
uci-static | ||
ucimap-example | ||
*.[oa] | ||
*.so* | ||
*.dylib* | ||
.*.swp | ||
.gdb* | ||
uci_config.h | ||
test/save |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
cmake_minimum_required(VERSION 2.6) | ||
|
||
PROJECT(uci C) | ||
|
||
SET(CMAKE_INSTALL_PREFIX /usr) | ||
|
||
ADD_DEFINITIONS(-Os -Wall -Werror --std=gnu99 -g3 -DUCI_PREFIX="${CMAKE_INSTALL_PREFIX}") | ||
|
||
OPTION(UCI_PLUGIN_SUPPORT "plugin support" ON) | ||
OPTION(UCI_DEBUG "debugging support" OFF) | ||
OPTION(UCI_DEBUG_TYPECAST "typecast debugging support" OFF) | ||
OPTION(BUILD_LUA "build Lua plugin" ON) | ||
|
||
CONFIGURE_FILE( ${CMAKE_SOURCE_DIR}/uci_config.h.in ${CMAKE_SOURCE_DIR}/uci_config.h ) | ||
|
||
SET(LIB_SOURCES libuci.c file.c ucimap.c util.c delta.c) | ||
|
||
ADD_LIBRARY(uci-shared SHARED ${LIB_SOURCES}) | ||
SET_TARGET_PROPERTIES(uci-shared PROPERTIES OUTPUT_NAME uci) | ||
|
||
ADD_LIBRARY(uci-static STATIC ${LIB_SOURCES}) | ||
SET_TARGET_PROPERTIES(uci-static PROPERTIES OUTPUT_NAME uci) | ||
|
||
ADD_EXECUTABLE(cli cli.c) | ||
SET_TARGET_PROPERTIES(cli PROPERTIES OUTPUT_NAME uci) | ||
TARGET_LINK_LIBRARIES(cli uci-shared) | ||
|
||
ADD_EXECUTABLE(cli-static cli.c) | ||
SET_TARGET_PROPERTIES(cli-static PROPERTIES OUTPUT_NAME uci-static) | ||
TARGET_LINK_LIBRARIES(cli-static uci-static) | ||
|
||
ADD_EXECUTABLE(ucimap-example ucimap-example.c) | ||
TARGET_LINK_LIBRARIES(ucimap-example uci-static) | ||
|
||
ADD_SUBDIRECTORY(lua) | ||
|
||
INSTALL(FILES uci.h uci_config.h ucimap.h | ||
DESTINATION include/libubox | ||
) | ||
|
||
INSTALL(TARGETS uci-shared uci-static cli cli-static | ||
ARCHIVE DESTINATION lib | ||
LIBRARY DESTINATION lib | ||
RUNTIME DESTINATION bin | ||
) | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
cmake_minimum_required(VERSION 2.6) | ||
|
||
PROJECT(uci C) | ||
|
||
SET(CMAKE_INSTALL_PREFIX /) | ||
|
||
ADD_DEFINITIONS(-Os -Wall -Werror --std=gnu99 -g3) | ||
|
||
IF(APPLE) | ||
SET(CMAKE_SHARED_MODULE_CREATE_C_FLAGS "${CMAKE_SHARED_MODULE_CREATE_C_FLAGS} -undefined dynamic_lookup") | ||
ENDIF(APPLE) | ||
|
||
EXECUTE_PROCESS( | ||
COMMAND lua -e "for k in string.gmatch(package.cpath .. \";\", \"([^;]+)/..so;\") do if k:sub(1,1) == \"/\" then print(k) break end end" | ||
OUTPUT_VARIABLE LUAPATH | ||
RESULT_VARIABLE LUA_CHECK_RES | ||
OUTPUT_STRIP_TRAILING_WHITESPACE | ||
) | ||
|
||
IF(NOT ${LUA_CHECK_RES} EQUAL 0 OR ${LUAPATH} EQUAL "") | ||
MESSAGE(SEND_ERROR "Lua was not found on your system") | ||
ENDIF() | ||
|
||
ADD_LIBRARY(uci_lua MODULE uci.c) | ||
SET_TARGET_PROPERTIES(uci_lua PROPERTIES | ||
OUTPUT_NAME uci | ||
PREFIX "" | ||
) | ||
TARGET_LINK_LIBRARIES(uci_lua uci) | ||
|
||
INSTALL(TARGETS uci_lua | ||
LIBRARY DESTINATION ${LUAPATH} | ||
) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#cmakedefine UCI_PLUGIN_SUPPORT 1 | ||
#cmakedefine UCI_DEBUG 1 | ||
#cmakedefine UCI_DEBUG_TYPECAST 1 |