Custom target

This commit is contained in:
Alexey Pelykh 2013-08-19 10:41:54 +03:00
parent aa4f280d63
commit a4510f51a6

View file

@ -24,8 +24,9 @@ file(GLOB_RECURSE core_sources_client "${OSMAND_ROOT}/core/client/*.c*")
file(GLOB core_swig "${OSMAND_ROOT}/core.swig") file(GLOB core_swig "${OSMAND_ROOT}/core.swig")
file(GLOB_RECURSE core_swig_subfiles "${OSMAND_ROOT}/swig/*") file(GLOB_RECURSE core_swig_subfiles "${OSMAND_ROOT}/swig/*")
if(CMAKE_HOST_WIN32 AND NOT CYGWIN) if(CMAKE_HOST_WIN32 AND NOT CYGWIN)
add_custom_command(OUTPUT "${CMAKE_CURRENT_LIST_DIR}/c-src/swig.cpp" add_custom_target(OsmAndJNI_generate_swig
COMMAND bash ARGS --login "${CMAKE_CURRENT_LIST_DIR}/generate-swig.sh" ALL
bash --login "${CMAKE_CURRENT_LIST_DIR}/generate-swig.sh"
DEPENDS DEPENDS
${core_includes} ${core_includes}
${core_headers} ${core_headers}
@ -36,8 +37,9 @@ if(CMAKE_HOST_WIN32 AND NOT CYGWIN)
${core_swig_subfiles} ${core_swig_subfiles}
COMMENT "Generating sources...") COMMENT "Generating sources...")
else() else()
add_custom_command(OUTPUT "${CMAKE_CURRENT_LIST_DIR}/c-src/swig.cpp" add_custom_target(OsmAndJNI_generate_swig
COMMAND "${CMAKE_CURRENT_LIST_DIR}/generate-swig.sh" ALL
"${CMAKE_CURRENT_LIST_DIR}/generate-swig.sh"
DEPENDS DEPENDS
${core_includes} ${core_includes}
${core_headers} ${core_headers}
@ -48,12 +50,10 @@ else()
${core_swig_subfiles} ${core_swig_subfiles}
COMMENT "Generating sources...") COMMENT "Generating sources...")
endif() endif()
add_custom_target(OsmAndJNI_generate_swig set_source_files_properties("${CMAKE_CURRENT_LIST_DIR}/c-src/swig.cpp"
ALL PROPERTIES
# DEPENDS GENERATED TRUE
# "${CMAKE_CURRENT_LIST_DIR}/c-src/swig.cpp"
) )
set_source_files_properties("${CMAKE_CURRENT_LIST_DIR}/c-src/swig.cpp" PROPERTIES GENERATED TRUE)
if(CMAKE_SHARED_LIBS_ALLOWED_ON_TARGET) if(CMAKE_SHARED_LIBS_ALLOWED_ON_TARGET)
add_library(OsmAndJNI SHARED add_library(OsmAndJNI SHARED