diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2020-08-08 11:53:00 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2020-08-08 11:53:00 +0200 |
commit | b623f5953691b2a0614e6f1f4def86bdbb9a4113 (patch) | |
tree | 18102bd36f7e22eb2ba2b9f880e4cb29346f4cb8 /app/bin/CMakeLists.txt | |
parent | 359b557176b9bb2ff1aed2082641eed39c358d0d (diff) |
New upstream version 5.2.0Beta2.1upstream/5.2.0Beta2.1
Diffstat (limited to 'app/bin/CMakeLists.txt')
-rw-r--r-- | app/bin/CMakeLists.txt | 110 |
1 files changed, 96 insertions, 14 deletions
diff --git a/app/bin/CMakeLists.txt b/app/bin/CMakeLists.txt index 74b1bc8..2dea1bc 100644 --- a/app/bin/CMakeLists.txt +++ b/app/bin/CMakeLists.txt @@ -1,5 +1,6 @@ +include( CheckSymbolExists ) + ADD_EXECUTABLE(cnvdsgn cnvdsgn.c utility.c) -GET_TARGET_PROPERTY(cnvdsgn_EXE cnvdsgn LOCATION) IF(NOT WIN32) TARGET_LINK_LIBRARIES(cnvdsgn m) ENDIF(NOT WIN32) @@ -8,7 +9,7 @@ MACRO(GENERATE_LIN lin_name) ADD_CUSTOM_COMMAND( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${lin_name}.lin DEPENDS cnvdsgn ${CMAKE_CURRENT_SOURCE_DIR}/${lin_name}.src - COMMAND ${cnvdsgn_EXE} < ${CMAKE_CURRENT_SOURCE_DIR}/${lin_name}.src > ${CMAKE_CURRENT_BINARY_DIR}/${lin_name}.lin + COMMAND cnvdsgn < ${CMAKE_CURRENT_SOURCE_DIR}/${lin_name}.src > ${CMAKE_CURRENT_BINARY_DIR}/${lin_name}.lin ) ENDMACRO(GENERATE_LIN) @@ -24,6 +25,9 @@ GENERATE_LIN(tosslip) GENERATE_LIN(tostrsct) GENERATE_LIN(towye) GENERATE_LIN(toxing) +GENERATE_LIN(tocornu) +GENERATE_LIN(tocornuwye) +GENERATE_LIN(tocornu3way) SET(LIN_SOURCES ${CMAKE_CURRENT_BINARY_DIR}/to3way.lin @@ -38,19 +42,21 @@ SET(LIN_SOURCES ${CMAKE_CURRENT_BINARY_DIR}/tostrsct.lin ${CMAKE_CURRENT_BINARY_DIR}/towye.lin ${CMAKE_CURRENT_BINARY_DIR}/toxing.lin + ${CMAKE_CURRENT_BINARY_DIR}/tocornu.lin + ${CMAKE_CURRENT_BINARY_DIR}/tocornuwye.lin + ${CMAKE_CURRENT_BINARY_DIR}/tocornu3way.lin ) -GET_TARGET_PROPERTY(genhelp_EXE genhelp LOCATION) - ADD_CUSTOM_COMMAND( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/bllnhlp.c - DEPENDS genhelp ${help_SOURCE_DIR}/genhelp.in - COMMAND ${genhelp_EXE} ${GENHELP_OPTS} ${help_SOURCE_DIR}/genhelp.in ${CMAKE_CURRENT_BINARY_DIR}/bllnhlp.c + DEPENDS genhelp ${help_SOURCE_DIR}/genhelp.json + COMMAND genhelp ${GENHELP_OPTS} ${help_SOURCE_DIR}/genhelp.json ${CMAKE_CURRENT_BINARY_DIR}/bllnhlp.c ) SET(SOURCES ${LIN_SOURCES} appdefaults.c + archive.c bllnhlp.c cbezier.c cblock.c @@ -95,6 +101,7 @@ SET(SOURCES dcontmgm.c dease.c denum.c + directory.c dlayer.c doption.c dpricels.c @@ -104,33 +111,72 @@ SET(SOURCES dxfformat.c dxfoutput.c elev.c + file2uri.c + file2uri.h fileio.c + filenoteui.c i18n.c layout.c + linknoteui.c lprintf.c macro.c + manifest.c misc2.c param.c + paramfile.c + paramfilelist.c + paramfilesearch_ui.c + partcatalog.c paths.c + shortentext.c shrtpath.c smalldlg.c + stringxtc.c tbezier.c tcornu.c tcurve.c tease.c + textnoteui.c track.c + trknote.c trkseg.c tstraigh.c utility.c + validator.c + cJSON.c + archive.h + directory.h + manifest.h + validator.h ) +# add UTF-8 conversion utilities on Windows +if(WIN32) + set( SOURCES + ${SOURCES} + utf8convert.c + include/utf8convert.h + ) +endif(WIN32) + +set (SOURCES + ${SOURCES} + include/dirent.h + include/paramfile.h + include/paramfilelist.h +) + INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) INCLUDE_DIRECTORIES(${XTrkCAD_BINARY_DIR}) INCLUDE_DIRECTORIES(${help_BINARY_DIR}) INCLUDE_DIRECTORIES(${wlib_SOURCE_DIR}/include) +include_directories(${FREEIMAGE_INCLUDE_PATH}) +INCLUDE_DIRECTORIES(${LIBZIP_INCLUDE_DIR_ZIP}) +INCLUDE_DIRECTORIES(${CJSON_INCLUDE}) LINK_DIRECTORIES(${GTK_LIBRARY_DIRS}) LINK_DIRECTORIES(${GTK_WEBKIT_LIBRARY_DIRS}) +LINK_DIRECTORIES(${LIBZIP_LIBZIP_LIBRARY}) ADD_LIBRARY(xtrkcad-lib ${SOURCES}) @@ -145,18 +191,22 @@ TARGET_LINK_LIBRARIES(xtrkcad xtrkcad-lib) TARGET_LINK_LIBRARIES(xtrkcad xtrkcad-wlib) TARGET_LINK_LIBRARIES(xtrkcad xtrkcad-cornu) TARGET_LINK_LIBRARIES(xtrkcad dynstring) +target_link_libraries(xtrkcad ${LIBZIP_LIBRARY} ${LIBZIP_LIBRARIES}) ADD_EXECUTABLE(mkturnout ${LIN_SOURCES} ctodesgn.c utility.c + ) SET_TARGET_PROPERTIES(mkturnout PROPERTIES COMPILE_FLAGS -DMKTURNOUT) +TARGET_LINK_LIBRARIES(mkturnout xtrkcad-cornu) + IF(NOT WIN32) TARGET_LINK_LIBRARIES(mkturnout m) TARGET_LINK_LIBRARIES(xtrkcad m) - + # Link libintl for systems where it is a separate library find_library( INTL_LIBRARY intl ) if(INTL_LIBRARY) @@ -164,25 +214,57 @@ IF(NOT WIN32) endif(INTL_LIBRARY) ELSE(NOT WIN32) TARGET_LINK_LIBRARIES(mkturnout xtrkcad-wlib) -ENDIF(NOT WIN32) + + # copy dlls into the build dir for easier debugging + add_custom_command( + TARGET xtrkcad POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy + ${FREEIMAGE_SHAREDLIB} + ${CMAKE_CURRENT_BINARY_DIR} + ) + + add_custom_command( + TARGET xtrkcad POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy + ${LIBZIP_SHAREDLIB} + ${CMAKE_CURRENT_BINARY_DIR} + ) + + add_custom_command( + TARGET xtrkcad POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy + ${ZLIB_SHAREDLIB} + ${CMAKE_CURRENT_BINARY_DIR} + ) + + # add dll to install package + install(FILES + ${LIBZIP_SHAREDLIB} + DESTINATION ${XTRKCAD_BIN_INSTALL_DIR} + ) + install(FILES + ${ZLIB_SHAREDLIB} + DESTINATION ${XTRKCAD_BIN_INSTALL_DIR} + ) +ENDIF(NOT WIN32) # for testing only, should be IF(APPLE) ... IF(APPLE) - ADD_EXECUTABLE( helphelper helphelper.c ) + ADD_EXECUTABLE( helphelper helphelper.c ) FIND_LIBRARY(COREFOUNDATION_LIBRARY CoreFoundation) - FIND_LIBRARY(CARBON_LIBRARY Carbon) + FIND_LIBRARY(CARBON_LIBRARY Carbon) TARGET_lINK_LIBRARIES(helphelper ${COREFOUNDATION_LIBRARY} ${CARBON_LIBRARY}) INSTALL( TARGETS helphelper RUNTIME DESTINATION ${XTRKCAD_BIN_INSTALL_DIR} ) ENDIF(APPLE) - + INSTALL( TARGETS xtrkcad RUNTIME DESTINATION ${XTRKCAD_BIN_INSTALL_DIR} ) - -if(XTRKCAD_TESTING AND CMOCKA_FOUND) + +if(XTRKCAD_TESTING AND CMOCKA_FOUND) add_subdirectory( unittest ) -endif() +endif() |