CMakeLists.txt 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. # WinPR: Windows Portable Runtime
  2. # winpr-hash cmake build script
  3. #
  4. # Copyright 2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
  5. #
  6. # Licensed under the Apache License, Version 2.0 (the "License");
  7. # you may not use this file except in compliance with the License.
  8. # You may obtain a copy of the License at
  9. #
  10. # http://www.apache.org/licenses/LICENSE-2.0
  11. #
  12. # Unless required by applicable law or agreed to in writing, software
  13. # distributed under the License is distributed on an "AS IS" BASIS,
  14. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. # See the License for the specific language governing permissions and
  16. # limitations under the License.
  17. set(MODULE_NAME "winpr-hash")
  18. set(MODULE_PREFIX "WINPR_TOOLS_HASH")
  19. set(${MODULE_PREFIX}_SRCS
  20. hash.c)
  21. # On windows create dll version information.
  22. # Vendor, product and year are already set in top level CMakeLists.txt
  23. if (WIN32)
  24. set(RC_VERSION_MAJOR ${WINPR_VERSION_MAJOR})
  25. set(RC_VERSION_MINOR ${WINPR_VERSION_MINOR})
  26. set(RC_VERSION_BUILD ${WINPR_VERSION_REVISION})
  27. set(RC_VERSION_FILE "${MODULE_NAME}${CMAKE_EXECUTABLE_SUFFIX}")
  28. configure_file(
  29. ${CMAKE_SOURCE_DIR}/addin/cmake/WindowsDLLVersion.rc.in
  30. ${CMAKE_CURRENT_BINARY_DIR}/version.rc
  31. @ONLY)
  32. set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/version.rc)
  33. endif()
  34. add_executable(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS})
  35. set(${MODULE_PREFIX}_LIBS winpr)
  36. target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS})
  37. install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT tools EXPORT WinPRTargets)
  38. if (WITH_PDB_SAVE AND MSVC)
  39. install(FILES ${RVC_PDB_BINARY_DIR}/${MODULE_NAME}.pdb DESTINATION ${RVC_PDBSAVE_PATH} COMPONENT symbols)
  40. endif()
  41. set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "WinPR/Tools")