aboutsummaryrefslogtreecommitdiff
path: root/cmake/UseVala.cmake
diff options
context:
space:
mode:
authorMarvin W <git@larma.de>2017-03-11 23:20:25 +0100
committerMarvin W <git@larma.de>2017-03-11 23:58:34 +0100
commitcd6b904e970291a63551d0f1d80bbd550e778ec8 (patch)
tree21842cccc9115462e4cd6cd23e37e8cca9e14523 /cmake/UseVala.cmake
parent083df7e73775d8f81e380f12f6d63c2012a6b617 (diff)
downloaddino-cd6b904e970291a63551d0f1d80bbd550e778ec8.tar.gz
dino-cd6b904e970291a63551d0f1d80bbd550e778ec8.zip
CMake: merge created header+vapi files into a single directory
Diffstat (limited to 'cmake/UseVala.cmake')
-rw-r--r--cmake/UseVala.cmake24
1 files changed, 15 insertions, 9 deletions
diff --git a/cmake/UseVala.cmake b/cmake/UseVala.cmake
index ae090bb1..2ba01ee7 100644
--- a/cmake/UseVala.cmake
+++ b/cmake/UseVala.cmake
@@ -115,7 +115,7 @@ function(_vala_mkdir_for_file file)
endfunction()
function(vala_precompile output)
- cmake_parse_arguments(ARGS "FAST_VAPI" "DIRECTORY;GENERATE_HEADER;GENERATE_VAPI"
+ cmake_parse_arguments(ARGS "FAST_VAPI" "DIRECTORY;GENERATE_HEADER;GENERATE_VAPI;EXPORTS_DIR"
"SOURCES;PACKAGES;OPTIONS;DEFINITIONS;CUSTOM_VAPIS;GRESOURCES" ${ARGN})
set(ARGS_FAST_VAPI true)
@@ -125,7 +125,13 @@ function(vala_precompile output)
else(ARGS_DIRECTORY)
set(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
endif(ARGS_DIRECTORY)
- include_directories(${DIRECTORY})
+ if(ARGS_EXPORTS_DIR)
+ set(ARGS_EXPORTS_DIR ${CMAKE_BINARY_DIR}/${ARGS_EXPORTS_DIR})
+ else(ARGS_EXPORTS_DIR)
+ set(ARGS_EXPORTS_DIR ${CMAKE_BINARY_DIR}/exports)
+ endif(ARGS_EXPORTS_DIR)
+ file(MAKE_DIRECTORY "${ARGS_EXPORTS_DIR}")
+ include_directories(${DIRECTORY} ${ARGS_EXPORTS_DIR})
set(vala_pkg_opts "")
foreach(pkg ${ARGS_PACKAGES})
@@ -160,9 +166,9 @@ function(vala_precompile output)
set(vapi_arguments "")
if(ARGS_GENERATE_VAPI)
- list(APPEND out_extra_files "${DIRECTORY}/${ARGS_GENERATE_VAPI}.vapi")
- list(APPEND out_extra_files "${DIRECTORY}/${ARGS_GENERATE_VAPI}-internal.vapi")
- set(vapi_arguments "--vapi=${ARGS_GENERATE_VAPI}.vapi" "--internal-vapi=${ARGS_GENERATE_VAPI}-internal.vapi")
+ list(APPEND out_extra_files "${ARGS_EXPORTS_DIR}/${ARGS_GENERATE_VAPI}.vapi")
+ list(APPEND out_extra_files "${ARGS_EXPORTS_DIR}/${ARGS_GENERATE_VAPI}_internal.vapi")
+ set(vapi_arguments "--vapi=${ARGS_EXPORTS_DIR}/${ARGS_GENERATE_VAPI}.vapi" "--internal-vapi=${ARGS_EXPORTS_DIR}/${ARGS_GENERATE_VAPI}_internal.vapi")
# Header and internal header is needed to generate internal vapi
if (NOT ARGS_GENERATE_HEADER)
@@ -172,10 +178,10 @@ function(vala_precompile output)
set(header_arguments "")
if(ARGS_GENERATE_HEADER)
- list(APPEND out_extra_files "${DIRECTORY}/${ARGS_GENERATE_HEADER}.h")
- list(APPEND out_extra_files "${DIRECTORY}/${ARGS_GENERATE_HEADER}_internal.h")
- list(APPEND header_arguments "--header=${DIRECTORY}/${ARGS_GENERATE_HEADER}.h")
- list(APPEND header_arguments "--internal-header=${DIRECTORY}/${ARGS_GENERATE_HEADER}_internal.h")
+ list(APPEND out_extra_files "${ARGS_EXPORTS_DIR}/${ARGS_GENERATE_HEADER}.h")
+ list(APPEND out_extra_files "${ARGS_EXPORTS_DIR}/${ARGS_GENERATE_HEADER}_internal.h")
+ list(APPEND header_arguments "--header=${ARGS_EXPORTS_DIR}/${ARGS_GENERATE_HEADER}.h")
+ list(APPEND header_arguments "--internal-header=${ARGS_EXPORTS_DIR}/${ARGS_GENERATE_HEADER}_internal.h")
endif(ARGS_GENERATE_HEADER)
if(ARGS_FAST_VAPI)