* Added command line tool example similar to 'sopranocmd'
[kdebindings.git] / smoke / qtscript / CMakeLists.txt
blob29d424339d2ce61c8c7a5fe1ed3b438a6d9b7943
2 include_directories( ${QT_INCLUDES} ${CMAKE_SOURCE_DIR}/smoke  )
4 IF(NOT PERL_FOUND)
5     FIND_PACKAGE(PERL REQUIRED)
6 ENDIF(NOT PERL_FOUND)
8 ########### next target ###############
10 add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/smokedata.cpp
11         ${CMAKE_CURRENT_BINARY_DIR}/x_1.cpp
13         COMMAND ${PERL_EXECUTABLE} ARGS ${CMAKE_CURRENT_BINARY_DIR}/generate.pl
14         DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/generate.pl
16         WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
18 macro_add_file_dependencies( ${CMAKE_CURRENT_BINARY_DIR}/smokedata.cpp ${CMAKE_CURRENT_BINARY_DIR}/x_1.cpp )
20 include_directories (${CMAKE_SOURCE_DIR}/smoke ${CMAKE_SOURCE_DIR}/smoke/qtscript )
22 set(smokeqtscript_LIB_SRCS ${CMAKE_CURRENT_BINARY_DIR}/smokedata.cpp
23         ${CMAKE_CURRENT_BINARY_DIR}/x_1.cpp)
25 IF(CMAKE_CXX_FLAGS MATCHES "-fvisibility")
26     ADD_DEFINITIONS(-DGCC_VISIBILITY)
27 ENDIF(CMAKE_CXX_FLAGS MATCHES "-fvisibility")
28 add_library(smokeqtscript SHARED ${smokeqtscript_LIB_SRCS})
30 target_link_libraries(smokeqtscript smokeqt ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTNETWORK_LIBRARY} ${QT_QTSCRIPT_LIBRARY})
32 set_target_properties(smokeqtscript PROPERTIES VERSION 2.0.0 SOVERSION 2 )
34 install(TARGETS smokeqtscript DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX} )
35 install(FILES ${CMAKE_SOURCE_DIR}/smoke/qtscript_smoke.h DESTINATION include/smoke )
37 FOREACH(incname ${QT_INCLUDES})
38     SET(qt_incs "'${incname}', ${qt_incs}")
39 ENDFOREACH(incname)
41 configure_file(generate.pl.cmake ${CMAKE_CURRENT_BINARY_DIR}/generate.pl @ONLY)