daily pastebin goal
29%
SHARE
TWEET

Untitled

a guest Mar 9th, 2019 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. cmake_minimum_required(VERSION 3.4)
  2. project(tspart)
  3.  
  4. list(APPEND CMAKE_PREFIX_PATH ${CMAKE_SOURCE_DIR}/deps)
  5.  
  6. #set(SFML_STATIC_LIBRARIES TRUE) # set this for static builds, you must have compiled SFML as static though
  7.  
  8.  
  9. find_package(SFML 2.5 COMPONENTS graphics window system REQUIRED)
  10. find_package(TGUI 0.8 REQUIRED)
  11.  
  12.  
  13. #find_program(MAGICK_CONFIG "Magick++-config")
  14. # Ask about CXX and lib flags/locations
  15. #execute_process(COMMAND "${MAGICK_CONFIG}" "--cxxflags" OUTPUT_VARIABLE MAGICK_CXX_FLAGS)
  16. #execute_process(COMMAND "${MAGICK_CONFIG}" "--libs" OUTPUT_VARIABLE MAGICK_LD_FLAGS)
  17. # Remove trailing whitespace (CMAKE warns about this)
  18. #string(STRIP "${MAGICK_CXX_FLAGS}" MAGICK_CXX_FLAGS)
  19. #string(STRIP "${MAGICK_LD_FLAGS}" MAGICK_LD_FLAGS)
  20.  
  21.  
  22. set(EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR})
  23.  
  24. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -O3 /std:c++17 ${MAGICK_CXX_FLAGS} ${MAGICK_LD_FLAGS}")
  25. set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,-rpath=libs")
  26.  
  27.  
  28. include_directories(${CMAKE_SOURCE_DIR}/include)
  29.  
  30. file(GLOB_RECURSE sources ${CMAKE_SOURCE_DIR}/src/*.cc src/*.cpp)
  31. file(GLOB_RECURSE tools ${CMAKE_SOURCE_DIR}/tools/*.cc)
  32.  
  33. add_library(tspart ${sources})
  34. target_link_libraries(tspart sfml-graphics sfml-window sfml-system)
  35.  
  36. set(libraries tspart tgui)
  37.  
  38. add_definitions( -DMAGICKCORE_QUANTUM_DEPTH=16 )
  39. add_definitions( -DMAGICKCORE_HDRI_ENABLE=0 )
  40. find_package(ImageMagick COMPONENTS Magick++)
  41. include_directories(${ImageMagick_INCLUDE_DIRS})
  42.  
  43. foreach(tool_src ${tools})
  44.     get_filename_component(binary ${tool_src} NAME_WE)
  45.     file(RELATIVE_PATH local_path ${CMAKE_SOURCE_DIR}/tools/ ${tool_src})
  46.     get_filename_component(local_dir ${local_path} DIRECTORY)
  47.     add_executable(${binary} ${tool_src})
  48.     set_target_properties(${binary} PROPERTIES
  49.         RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/${local_dir}
  50.     )
  51.     target_link_libraries(${binary} ${libraries})
  52.     target_link_libraries(${binary} ${ImageMagick_LIBRARIES})
  53. endforeach()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top