From a4510f51a6b366eaa410ad44e420e824d06de046 Mon Sep 17 00:00:00 2001 From: Alexey Pelykh Date: Mon, 19 Aug 2013 10:41:54 +0300 Subject: [PATCH] Custom target --- OsmAnd-java/CMakeLists.txt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/OsmAnd-java/CMakeLists.txt b/OsmAnd-java/CMakeLists.txt index 7b63afdd7c..3b480c9aec 100644 --- a/OsmAnd-java/CMakeLists.txt +++ b/OsmAnd-java/CMakeLists.txt @@ -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_RECURSE core_swig_subfiles "${OSMAND_ROOT}/swig/*") if(CMAKE_HOST_WIN32 AND NOT CYGWIN) - add_custom_command(OUTPUT "${CMAKE_CURRENT_LIST_DIR}/c-src/swig.cpp" - COMMAND bash ARGS --login "${CMAKE_CURRENT_LIST_DIR}/generate-swig.sh" + add_custom_target(OsmAndJNI_generate_swig + ALL + bash --login "${CMAKE_CURRENT_LIST_DIR}/generate-swig.sh" DEPENDS ${core_includes} ${core_headers} @@ -36,8 +37,9 @@ if(CMAKE_HOST_WIN32 AND NOT CYGWIN) ${core_swig_subfiles} COMMENT "Generating sources...") else() - add_custom_command(OUTPUT "${CMAKE_CURRENT_LIST_DIR}/c-src/swig.cpp" - COMMAND "${CMAKE_CURRENT_LIST_DIR}/generate-swig.sh" + add_custom_target(OsmAndJNI_generate_swig + ALL + "${CMAKE_CURRENT_LIST_DIR}/generate-swig.sh" DEPENDS ${core_includes} ${core_headers} @@ -48,12 +50,10 @@ else() ${core_swig_subfiles} COMMENT "Generating sources...") endif() -add_custom_target(OsmAndJNI_generate_swig - ALL -# DEPENDS -# "${CMAKE_CURRENT_LIST_DIR}/c-src/swig.cpp" +set_source_files_properties("${CMAKE_CURRENT_LIST_DIR}/c-src/swig.cpp" + PROPERTIES + GENERATED TRUE ) -set_source_files_properties("${CMAKE_CURRENT_LIST_DIR}/c-src/swig.cpp" PROPERTIES GENERATED TRUE) if(CMAKE_SHARED_LIBS_ALLOWED_ON_TARGET) add_library(OsmAndJNI SHARED