aheinecke@405: # Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik aheinecke@405: # Software engineering by Intevation GmbH aheinecke@405: # aheinecke@405: # This file is Free Software under the GNU GPL (v>=2) aheinecke@405: # and comes with ABSOLUTELY NO WARRANTY! aheinecke@405: # See LICENSE.txt for details. aheinecke@405: aheinecke@101: cmake_minimum_required(VERSION 2.8) aheinecke@101: aheinecke@25: set(CMAKE_AUTOMOC OFF) aheinecke@25: aheinecke@101: include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../common) aheinecke@37: andre@1176: set(trustbridge-certificate-installer_SOURCES aheinecke@137: ${CMAKE_CURRENT_SOURCE_DIR}/windowsstore.c andre@302: ${CMAKE_CURRENT_SOURCE_DIR}/nssstore_linux.c aheinecke@324: ${CMAKE_CURRENT_SOURCE_DIR}/nssstore_win.c andre@1176: ${CMAKE_CURRENT_SOURCE_DIR}/certificate-installer.c aheinecke@25: ) andre@1220: if (WIN32) andre@1220: # Add asInvoker manifest to avoid windows heuristics andre@1220: # that want to always run an -installer with admin rights. andre@1220: set(trustbridge-certificate-installer_SOURCES andre@1220: ${trustbridge-certificate-installer_SOURCES} andre@1220: ${CMAKE_CURRENT_SOURCE_DIR}/asInvoker.rc) andre@1220: endif() andre@1220: andre@1220: andre@1176: add_executable(trustbridge-certificate-installer ${trustbridge-certificate-installer_SOURCES}) aheinecke@25: aheinecke@68: if (WIN32) aheinecke@363: set(WIN_EXTRA_LIBS -lcrypt32 -luserenv -lshell32) andre@1288: set(WIN_EXTRA_LIBS_NSS -lcrypt32) aheinecke@68: endif(WIN32) aheinecke@37: andre@1176: target_link_libraries(trustbridge-certificate-installer aheinecke@408: trustbridge_common aheinecke@37: ${PROFILING_LIBS} aheinecke@68: ${POLARSSL_LIBRARIES} aheinecke@68: ${WIN_EXTRA_LIBS}) aheinecke@68: andre@1176: install(TARGETS trustbridge-certificate-installer DESTINATION bin) andre@1019: if (WIN32) andre@1019: add_custom_command( andre@1176: TARGET trustbridge-certificate-installer andre@1019: POST_BUILD andre@1176: COMMAND ${CMAKE_STRIP} trustbridge-certificate-installer.exe andre@1019: ) andre@1071: if (NOT RELEASE_BUILD) andre@1071: add_custom_command( andre@1176: TARGET trustbridge-certificate-installer andre@1071: POST_BUILD andre@1071: COMMAND ${OSSLSIGNCODE_EXECUTABLE} sign -certs ${CMAKE_SOURCE_DIR}/ui/tests/data/codesign/codesigning.pem andre@1071: -key ${CMAKE_SOURCE_DIR}/ui/tests/data/codesign/codesigning.key andre@1176: -h sha256 -in ${CMAKE_CURRENT_BINARY_DIR}/trustbridge-certificate-installer.exe andre@1176: -out ${CMAKE_CURRENT_BINARY_DIR}/trustbridge-certificate-installer-signed.exe && andre@1196: mv ${CMAKE_CURRENT_BINARY_DIR}/trustbridge-certificate-installer-signed.exe ${CMAKE_CURRENT_BINARY_DIR}/trustbridge-certificate-installer.exe andre@1071: ) andre@1071: endif() andre@1019: else() andre@1019: add_custom_command( andre@1176: TARGET trustbridge-certificate-installer andre@1019: POST_BUILD andre@1176: COMMAND strip trustbridge-certificate-installer andre@1019: ) andre@1019: endif() aheinecke@124: wilde@223: # ---------------------------------------------------------------------- andre@1175: # trustbridge-nss-installer nss store specific certificate installer: andre@1175: set(trustbridge-nss-installer_SOURCES andre@834: ${CMAKE_CURRENT_SOURCE_DIR}/nss-secitemlist.c andre@1175: ${CMAKE_CURRENT_SOURCE_DIR}/nss-installer.c andre@834: ) wilde@223: andre@1220: if (WIN32) andre@1220: # Add asInvoker manifest to avoid windows heuristics andre@1220: # that want to always run an -installer with admin rights. andre@1220: set(trustbridge-nss-installer_SOURCES andre@1220: ${trustbridge-nss-installer_SOURCES} andre@1220: ${CMAKE_CURRENT_SOURCE_DIR}/asInvoker.rc) andre@1220: endif() andre@1220: andre@1220: andre@834: if(WIN32 OR NSS_FOUND) andre@834: include_directories(${NSS_INCLUDE_DIRS}) andre@1175: add_executable(trustbridge-nss-installer ${trustbridge-nss-installer_SOURCES}) andre@1175: target_link_libraries(trustbridge-nss-installer andre@834: trustbridge_common andre@834: ${POLARSSL_LIBRARIES} andre@834: ${NSS_LIBRARIES} andre@1288: ${PROFILING_LIBS} andre@1288: ${WIN_EXTRA_LIBS_NSS}) andre@1175: set_target_properties(trustbridge-nss-installer PROPERTIES COMPILE_FLAGS "-std=c99") andre@1175: install(TARGETS trustbridge-nss-installer DESTINATION bin) andre@1019: andre@1019: if (WIN32) andre@1019: add_custom_command( andre@1175: TARGET trustbridge-nss-installer andre@1019: POST_BUILD andre@1175: COMMAND ${CMAKE_STRIP} trustbridge-nss-installer.exe andre@1019: ) andre@1071: if (NOT RELEASE_BUILD) andre@1071: add_custom_command( andre@1175: TARGET trustbridge-nss-installer andre@1071: POST_BUILD andre@1071: COMMAND ${OSSLSIGNCODE_EXECUTABLE} sign -certs ${CMAKE_SOURCE_DIR}/ui/tests/data/codesign/codesigning.pem andre@1071: -key ${CMAKE_SOURCE_DIR}/ui/tests/data/codesign/codesigning.key andre@1175: -h sha256 -in ${CMAKE_CURRENT_BINARY_DIR}/trustbridge-nss-installer.exe andre@1175: -out ${CMAKE_CURRENT_BINARY_DIR}/trustbridge-nss-installer-signed.exe && andre@1175: mv ${CMAKE_CURRENT_BINARY_DIR}/trustbridge-nss-installer-signed.exe ${CMAKE_CURRENT_BINARY_DIR}/trustbridge-nss-installer.exe andre@1071: ) andre@1071: endif() andre@1019: else() andre@1019: add_custom_command( andre@1175: TARGET trustbridge-nss-installer andre@1019: POST_BUILD andre@1175: COMMAND strip trustbridge-nss-installer andre@1019: ) andre@1019: endif() wilde@223: else() andre@1175: message(STATUS "WARNING: Could not find nss. trustbridge-nss-installer cert installer will not be build!") wilde@223: endif()