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: aheinecke@25: set(CINST_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 aheinecke@101: ${CMAKE_CURRENT_SOURCE_DIR}/main.c aheinecke@25: ) wilde@223: add_executable(cinst ${CINST_SOURCES}) aheinecke@25: aheinecke@68: if (WIN32) aheinecke@363: set(WIN_EXTRA_LIBS -lcrypt32 -luserenv -lshell32) aheinecke@68: endif(WIN32) aheinecke@37: aheinecke@37: target_link_libraries(cinst aheinecke@408: trustbridge_common aheinecke@37: ${PROFILING_LIBS} aheinecke@68: ${POLARSSL_LIBRARIES} aheinecke@68: ${WIN_EXTRA_LIBS}) aheinecke@68: aheinecke@124: install(TARGETS cinst DESTINATION bin) andre@1019: if (WIN32) andre@1019: add_custom_command( andre@1019: TARGET cinst andre@1019: POST_BUILD andre@1019: COMMAND ${CMAKE_STRIP} cinst.exe andre@1019: ) andre@1071: if (NOT RELEASE_BUILD) andre@1071: add_custom_command( andre@1071: TARGET cinst 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@1071: -h sha256 -in ${CMAKE_CURRENT_BINARY_DIR}/cinst.exe andre@1071: -out ${CMAKE_CURRENT_BINARY_DIR}/cinst-signed.exe && andre@1071: mv ${CMAKE_CURRENT_BINARY_DIR}/cinst-signed.exe ${CMAKE_CURRENT_BINARY_DIR}/cinst.exe andre@1071: ) andre@1071: endif() andre@1019: else() andre@1019: add_custom_command( andre@1019: TARGET cinst andre@1019: POST_BUILD andre@1019: COMMAND strip cinst andre@1019: ) andre@1019: endif() aheinecke@124: wilde@223: # ---------------------------------------------------------------------- wilde@223: # Mozilla nss store specific certificate installer: andre@834: set(MOZILLA_SOURCES andre@834: ${CMAKE_CURRENT_SOURCE_DIR}/nss-secitemlist.c andre@834: ${CMAKE_CURRENT_SOURCE_DIR}/mozilla.c andre@834: ) wilde@223: andre@834: if(WIN32 OR NSS_FOUND) andre@834: include_directories(${NSS_INCLUDE_DIRS}) andre@834: add_executable(mozilla ${MOZILLA_SOURCES}) andre@834: target_link_libraries(mozilla andre@834: trustbridge_common andre@834: ${POLARSSL_LIBRARIES} andre@834: ${NSS_LIBRARIES} andre@834: ${PROFILING_LIBS}) andre@834: set_target_properties(mozilla PROPERTIES COMPILE_FLAGS "-std=c99") andre@834: install(TARGETS mozilla DESTINATION bin) andre@1019: andre@1019: if (WIN32) andre@1019: add_custom_command( andre@1019: TARGET mozilla andre@1019: POST_BUILD andre@1019: COMMAND ${CMAKE_STRIP} mozilla.exe andre@1019: ) andre@1071: if (NOT RELEASE_BUILD) andre@1071: add_custom_command( andre@1071: TARGET mozilla 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@1071: -h sha256 -in ${CMAKE_CURRENT_BINARY_DIR}/mozilla.exe andre@1071: -out ${CMAKE_CURRENT_BINARY_DIR}/mozilla-signed.exe && andre@1071: mv ${CMAKE_CURRENT_BINARY_DIR}/mozilla-signed.exe ${CMAKE_CURRENT_BINARY_DIR}/mozilla.exe andre@1071: ) andre@1071: endif() andre@1019: else() andre@1019: add_custom_command( andre@1019: TARGET mozilla andre@1019: POST_BUILD andre@1019: COMMAND strip mozilla andre@1019: ) andre@1019: endif() wilde@223: else() wilde@223: message(STATUS "WARNING: Could not find nss. Mozilla cert installer will not be build!") wilde@223: endif()