CMakeLists.txt 1.8 KB

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