From 7a3c9046e8f0633dac44dab892d21c41b52659b5 Mon Sep 17 00:00:00 2001 From: Petr Tsymbarovich Date: Thu, 14 Jan 2016 00:30:20 +0300 Subject: [PATCH] Always generate and include msuproj_export.h --- CMakeLists.txt | 5 +++++ src/msuproj/CMakeLists.txt | 11 ++--------- src/msuproj/msucore.h | 6 +----- src/msuproj/msupixeltransformer.cpp | 2 ++ src/msuproj/msuproj.cpp | 2 ++ src/msuproj/msuproj.h | 3 ++- 6 files changed, 14 insertions(+), 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 81d0d82..820b491 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,6 +30,9 @@ option(WITH_UPDATES_ACTION "Check for updates action" ON) #### Compiler flags set(GCC_FLAGS "-std=gnu++11 -funroll-loops -O3 -Wframe-larger-than=1024 -fopenmp") set(MSVC_FLAGS "/openmp") +if(NOT BUILD_SHARED_LIBS OR NOT MSVC) + add_definitions("-DMSUPROJ_STATIC_DEFINE=1") +endif() ############### Setting additional variables ############### @@ -98,6 +101,8 @@ include(GDAL) ######## Library ######## include_directories(src/msuproj) add_subdirectory(src/msuproj msuproj) +include(GenerateExportHeader) +generate_export_header(msuproj) ##### Applications ###### if(BUILD_CLI) diff --git a/src/msuproj/CMakeLists.txt b/src/msuproj/CMakeLists.txt index 89235b9..df7081c 100644 --- a/src/msuproj/CMakeLists.txt +++ b/src/msuproj/CMakeLists.txt @@ -26,11 +26,6 @@ endif() add_library(msuproj ${MSUPROJ_SOURCES}) target_link_libraries(msuproj ${GDAL_LIBRARIES}) -if(MSVC) - include(GenerateExportHeader) - generate_export_header(msuproj) -endif() - if(BUILD_SHARED_LIBS) set_target_properties(msuproj @@ -97,10 +92,8 @@ if(INSTALL_DEV) # Headers file(GLOB H_FILES *.h) - list(APPEND H_FILES ${CMAKE_BINARY_DIR}/msuproj_version.h) - if(MSVC) - list(APPEND H_FILES ${CMAKE_BINARY_DIR}/msuproj/msuproj_export.h) - endif() + list(APPEND H_FILES ${CMAKE_BINARY_DIR}/msuproj_version.h + ${CMAKE_BINARY_DIR}/msuproj_export.h) foreach(H_FILE ${H_FILES}) get_filename_component(H_FILE_NAME ${H_FILE} NAME) set(OUT_H_FILE ${CMAKE_BINARY_DIR}/include/${H_FILE_NAME}) diff --git a/src/msuproj/msucore.h b/src/msuproj/msucore.h index 32f9988..a38fb87 100644 --- a/src/msuproj/msucore.h +++ b/src/msuproj/msucore.h @@ -2,11 +2,7 @@ #define MSUCORE_H #include -#if _MSC_VER && !__INTEL_COMPILER -# include -#else -# define MSUPROJ_EXPORT -#endif +#include #include diff --git a/src/msuproj/msupixeltransformer.cpp b/src/msuproj/msupixeltransformer.cpp index 62b61b2..61546ca 100644 --- a/src/msuproj/msupixeltransformer.cpp +++ b/src/msuproj/msupixeltransformer.cpp @@ -1,5 +1,7 @@ #include "msupixeltransformer.h" +#include + msumr::PixelTransformer::PixelTransformer(const unsigned int &raster_x_size, const unsigned int &raster_y_size, const unsigned int &gcpgrid_x_size, const unsigned int &gcpgrid_y_size, GCP *gcps, double *geo_transform) : diff --git a/src/msuproj/msuproj.cpp b/src/msuproj/msuproj.cpp index 9fe2d93..e837bec 100644 --- a/src/msuproj/msuproj.cpp +++ b/src/msuproj/msuproj.cpp @@ -1,7 +1,9 @@ #include #include #include + #include + #include #include #include diff --git a/src/msuproj/msuproj.h b/src/msuproj/msuproj.h index f33164c..62feb14 100644 --- a/src/msuproj/msuproj.h +++ b/src/msuproj/msuproj.h @@ -1,9 +1,10 @@ #ifndef MSUPROJ_H #define MSUPROJ_H -#include #include +#include + namespace msumr { /**