[cmake] output lib to root/lib

This commit is contained in:
James Chen 2013-11-04 14:49:42 +08:00
parent f17aa8b450
commit 9be8ca3714
19 changed files with 110 additions and 13 deletions

View File

@ -62,7 +62,6 @@ link_directories(
add_subdirectory(cocos/math/kazmath)
# chipmunk library
set(BUILD_STATIC 1)
add_subdirectory(external/chipmunk/src)
# box2d library

View File

@ -140,3 +140,10 @@ target_link_libraries(cocos2d
rt
z
)
set_target_properties(cocos2d
PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib"
)

View File

@ -9,4 +9,11 @@ add_library(audio STATIC
target_link_libraries(audio
fmodex64
)
)
set_target_properties(audio
PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib"
)

View File

@ -18,3 +18,10 @@ set(COCOS_BASE_SRC
add_library(cocosbase STATIC
${COCOS_BASE_SRC}
)
set_target_properties(cocosbase
PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib"
)

View File

@ -31,3 +31,10 @@ include_directories(
add_library(cocosbuilder STATIC
${CCB_SRC}
)
set_target_properties(cocosbuilder
PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib"
)

View File

@ -45,3 +45,10 @@ add_library(cocostudio STATIC
target_link_libraries(cocostudio
jsoncpp
)
set_target_properties(cocostudio
PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib"
)

View File

@ -29,3 +29,10 @@ include_directories(
add_library(spine STATIC
${SPINE_SRC}
)
set_target_properties(spine
PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib"
)

View File

@ -27,3 +27,8 @@ add_library(gui STATIC
${GUI_SRC}
)
set_target_properties(gui
PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib"
)

View File

@ -14,4 +14,10 @@ SET(KAZMATH_SOURCES
${CMAKE_SOURCE_DIR}/cocos/math/kazmath/src/GL/matrix.c
)
ADD_SUBDIRECTORY(src)
ADD_SUBDIRECTORY(src)
set_target_properties(kazmath
PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib"
)

View File

@ -10,3 +10,10 @@ add_library(network STATIC
target_link_libraries(network
curl
)
set_target_properties(network
PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib"
)

View File

@ -32,3 +32,10 @@ include_directories(
add_library(extensions STATIC
${EXTENSIONS_SRC}
)
set_target_properties(extensions
PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib"
)

View File

@ -1,3 +1,5 @@
set(BUILD_STATIC 1)
file(GLOB chipmunk_source_files "*.c" "constraints/*.c")
file(GLOB chipmunk_public_header "${chipmunk_SOURCE_DIR}/include/chipmunk/*.h")
file(GLOB chipmunk_constraint_header "${chipmunk_SOURCE_DIR}/include/chipmunk/constraints/*.h")
@ -39,3 +41,10 @@ if(BUILD_SHARED OR INSTALL_STATIC)
install(FILES ${chipmunk_public_header} DESTINATION include/chipmunk)
install(FILES ${chipmunk_constraint_header} DESTINATION include/chipmunk/constraints)
endif(BUILD_SHARED OR INSTALL_STATIC)
set_target_properties(chipmunk_static
PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib"
)

View File

@ -1,6 +1,6 @@
set(JSONCPP_SRC
json_reader.cpp
json_value.cpp
json_value.cpp
json_writer.cpp
)
@ -12,3 +12,9 @@ add_library(jsoncpp STATIC
${JSONCPP_SRC}
)
set_target_properties(jsoncpp
PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib"
)

View File

@ -5,3 +5,10 @@ set(TINYXML2_SRC
add_library(tinyxml2 STATIC
${TINYXML2_SRC}
)
set_target_properties(tinyxml2
PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib"
)

View File

@ -6,3 +6,10 @@ set(UNZIP_SRC
add_library(unzip STATIC
${UNZIP_SRC}
)
set_target_properties(unzip
PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib"
)

View File

@ -13,9 +13,9 @@ add_executable(${SAMPLE_NAME}
target_link_libraries(${SAMPLE_NAME} audio cocos2d)
set(SAMPLE_BIN_DIR "${CMAKE_BINARY_DIR}/bin/${SAMPLE_NAME}")
set(SAMPLE_BIN_DIR "${CMAKE_SOURCE_DIR}/bin/${SAMPLE_NAME}")
SET_TARGET_PROPERTIES(${SAMPLE_NAME} PROPERTIES
set_target_properties(${SAMPLE_NAME} PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${SAMPLE_BIN_DIR}")
COPY_RES( ${SAMPLE_NAME} "Resources/*" "${SAMPLE_BIN_DIR}")

View File

@ -154,9 +154,9 @@ target_link_libraries(${SAMPLE_NAME}
box2d
)
set(SAMPLE_BIN_DIR "${CMAKE_BINARY_DIR}/bin/${SAMPLE_NAME}")
set(SAMPLE_BIN_DIR "${CMAKE_SOURCE_DIR}/bin/${SAMPLE_NAME}")
SET_TARGET_PROPERTIES(${SAMPLE_NAME} PROPERTIES
set_target_properties(${SAMPLE_NAME} PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${SAMPLE_BIN_DIR}")
COPY_RES( ${SAMPLE_NAME} "Resources/*" "${SAMPLE_BIN_DIR}")

View File

@ -28,9 +28,9 @@ target_link_libraries(${SAMPLE_NAME}
cocos2d
)
set(SAMPLE_BIN_DIR "${CMAKE_BINARY_DIR}/bin/${SAMPLE_NAME}")
set(SAMPLE_BIN_DIR "${CMAKE_SOURCE_DIR}/bin/${SAMPLE_NAME}")
SET_TARGET_PROPERTIES(${SAMPLE_NAME} PROPERTIES
set_target_properties(${SAMPLE_NAME} PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${SAMPLE_BIN_DIR}")
COPY_RES( ${SAMPLE_NAME} "Resources/*" "${SAMPLE_BIN_DIR}")

View File

@ -28,10 +28,12 @@ target_link_libraries(${SAMPLE_NAME}
cocos2d
)
set(SAMPLE_BIN_DIR "${CMAKE_BINARY_DIR}/bin/${SAMPLE_NAME}")
set(SAMPLE_BIN_DIR "${CMAKE_SOURCE_DIR}/bin/${SAMPLE_NAME}")
SET_TARGET_PROPERTIES(${SAMPLE_NAME} PROPERTIES
set_target_properties(${SAMPLE_NAME} PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${SAMPLE_BIN_DIR}")
COPY_RES( ${SAMPLE_NAME} "Resources/*" "${SAMPLE_BIN_DIR}")
COPY_RES(${SAMPLE_NAME} "Resources/*" "${SAMPLE_BIN_DIR}")
COPY_RES_EXTRA(${SAMPLE_NAME} "${CMAKE_SOURCE_DIR}/samples/TestCpp/Resources/*")
# "${SAMPLE_BIN_DIR}")