From 246a3e0634a31fe297aad70257bf81a4fa932dc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Gonz=C3=A1lez=20Moreno?= Date: Wed, 20 Jun 2018 10:42:07 +0200 Subject: [PATCH] Refs #3010. Fixing windows installer. --- CMakeLists.txt | 6 +----- cmake/common/eprosima_libraries.cmake | 7 +++++-- cmake/dev/generate_msvc_libraries.cmake | 7 +------ src/cpp/CMakeLists.txt | 6 +++--- 4 files changed, 10 insertions(+), 16 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1193129b923..0f102c1b0c8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -98,9 +98,6 @@ message(STATUS "To change de version modify the file configure.ac") # Generation of windows installers. ############################################################################### option(EPROSIMA_INSTALLER "Activate the creation of a build to create windows installers" OFF) -if(WIN32) - option(EPROSIMA_INSTALLER_MINION "Informs this is part of an installer" OFF) -endif() ############################################################################### # Warning level @@ -116,7 +113,7 @@ if(MSVC OR MSVC_IDE) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EPROSIMA_EXTRA_CMAKE_CXX_FLAGS}") endif() else() - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic -Wextra -Wno-unknown-pragmas -std=c++11") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic -Wextra -Wno-unknown-pragmas") if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined") elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") @@ -182,7 +179,6 @@ endif() # eProsima build options ############################################################################### option(EPROSIMA_BUILD "Activate internal building" OFF) -option(MINION "Tells if it is a subproject of a superproject" OFF) if(EPROSIMA_INSTALLER) set(EPROSIMA_BUILD ON) diff --git a/cmake/common/eprosima_libraries.cmake b/cmake/common/eprosima_libraries.cmake index 9161e6ce063..184955802c5 100644 --- a/cmake/common/eprosima_libraries.cmake +++ b/cmake/common/eprosima_libraries.cmake @@ -14,7 +14,7 @@ macro(eprosima_find_package package) - if(NOT ${package}_FOUND AND NOT (EPROSIMA_INSTALLER AND (MSVC OR MSVC_IDE))) + if(NOT ${package}_FOUND) # Parse arguments. set(options REQUIRED) @@ -29,7 +29,10 @@ macro(eprosima_find_package package) option(THIRDPARTY_${package} "Activate the use of internal thirdparty ${package}" OFF) - find_package(${package} QUIET) + if(NOT EPROSIMA_INSTALLER) + find_package(${package} QUIET) + endif() + if(NOT ${package}_FOUND AND (THIRDPARTY OR THIRDPARTY_${package})) set(SUBDIRECTORY_EXIST TRUE) if(THIRDPARTY_UPDATE OR NOT EXISTS "${PROJECT_SOURCE_DIR}/thirdparty/${package}/CMakeLists.txt") diff --git a/cmake/dev/generate_msvc_libraries.cmake b/cmake/dev/generate_msvc_libraries.cmake index 2759b25a63f..18c48c15c29 100644 --- a/cmake/dev/generate_msvc_libraries.cmake +++ b/cmake/dev/generate_msvc_libraries.cmake @@ -37,13 +37,8 @@ macro(generate_msvc_libraries platform) COMMAND ${CMAKE_COMMAND} -E make_directory "${PROJECT_BINARY_DIR}/eprosima_installer/${platform}" ) - set(SECURITY_ACTIVATION) - if(NOT EPROSIMA_INSTALLER_MINION) - set(SECURITY_ACTIVATION "-DOPENSSL_ROOT_DIR=${OPENSSL_ROOT_} -DSECURITY=ON") - endif() - add_custom_target(${PROJECT_NAME}_${platform} ALL - COMMAND ${CMAKE_COMMAND} -G "${GENERATOR_}" -DEPROSIMA_BUILD=ON -DMINION=ON -DEPROSIMA_INSTALLER_MINION=ON ${SECURITY_ACTIVATION} -DCMAKE_INSTALL_PREFIX:PATH=${PROJECT_BINARY_DIR}/eprosima_installer/${platform}/install ${PROJECT_SOURCE_DIR} + COMMAND ${CMAKE_COMMAND} -G "${GENERATOR_}" -DEPROSIMA_BUILD=ON -DEPROSIMA_INSTALLER_MINION=ON -DOPENSSL_ROOT_DIR=${OPENSSL_ROOT_} -DSECURITY=ON -DCMAKE_INSTALL_PREFIX:PATH=${PROJECT_BINARY_DIR}/eprosima_installer/${platform}/install ${PROJECT_SOURCE_DIR} COMMAND ${CMAKE_COMMAND} --build . --target install --config Release COMMAND ${CMAKE_COMMAND} --build . --target install --config Debug WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/eprosima_installer/${platform} diff --git a/src/cpp/CMakeLists.txt b/src/cpp/CMakeLists.txt index 8f223ce8822..8793a98b955 100644 --- a/src/cpp/CMakeLists.txt +++ b/src/cpp/CMakeLists.txt @@ -230,7 +230,7 @@ if(MSVC OR MSVC_IDE) generate_msvc_libraries(x64Win64VS2013) generate_msvc_libraries(i86Win32VS2015) generate_msvc_libraries(x64Win64VS2015) - else() + elseif(NOT EPROSIMA_INSTALLER) add_library(${PROJECT_NAME} SHARED ${${PROJECT_NAME}_source_files}) add_library(${PROJECT_NAME}_static STATIC ${${PROJECT_NAME}_source_files}) @@ -376,12 +376,12 @@ endif() # Install libraries if(MSVC OR MSVC_IDE) - if(EPROSIMA_INSTALLER) + if(EPROSIMA_INSTALLER AND IS_TOP_LEVEL) install_msvc_libraries(i86Win32VS2013) install_msvc_libraries(x64Win64VS2013) install_msvc_libraries(i86Win32VS2015) install_msvc_libraries(x64Win64VS2015) - else() + elseif(NOT EPROSIMA_INSTALLER) set(DIR_EXTENSION "") if(EPROSIMA_INSTALLER_MINION) set(DIR_EXTENSION "/${MSVC_ARCH}")