4 set(ROOJSPACKER_MAIN_VALA_SOURCES
8 set(ROOJS_VALA_CUSTOM_VAPIS
9 ${CMAKE_BINARY_DIR}/${LIBRARY_PATH}/${ROOJSPACKER_PKG_NAME}.vapi)
11 set(ROOJSPACKER_VALA_PACKAGES
21 # Compile Vala sources to C
22 vala_precompile_target(
23 "${PROJECT_NAME}-valabin"
24 ROOJSPACKER_MAIN_C_SOURCES
25 ${ROOJS_VALA_CUSTOM_VAPIS}
26 ${ROOJSPACKER_MAIN_VALA_SOURCES}
27 PACKAGES ${ROOJSPACKER_VALA_PACKAGES}
28 DEPENDS "${ROOJSPACKER_LIBRARY_NAME}-vala")
30 # Tell CMake to create an executable named "my-project"
31 add_executable(${PROJECT_NAME}
32 ${ROOJSPACKER_MAIN_C_SOURCES})
34 # Make sure the Vala sources are compiled to C before attempting to
35 # build the executable.
36 add_dependencies("${PROJECT_NAME}" "${PROJECT_NAME}-valabin")
38 # We need to add the directory where the C header for our library is
39 # installed, otherwise we'll get an error from the C compiler.
40 set_target_properties(${PROJECT_NAME} PROPERTIES
41 INCLUDE_DIRECTORIES ${CMAKE_BINARY_DIR}/roojspacker)
43 # Any libraries that your tests need to link to should go here.
44 # Usually this will just be your library.
45 target_link_libraries(${PROJECT_NAME}
46 ${ROOJSPACKER_LIBRARY_NAME})
48 # Install the executable.
49 install (TARGETS ${PROJECT_NAME}
50 RUNTIME DESTINATION bin ${CMAKE_INSTALL_BINDIR})
52 # Generate a .gitignore
53 file(WRITE ".gitignore" "# Automatically generated by CMake, do not modify.\n")
56 "roojspacker${CMAKE_EXECUTABLE_SUFFIX}")
57 file(APPEND ".gitignore" "/${file}\n")
59 foreach(file ${ROOJSPACKER_MAIN_SOURCES})
60 string(REPLACE "${CMAKE_CURRENT_BINARY_DIR}/" "" file ${file})
61 file(APPEND ".gitignore" "/${file}\n")