Skip to content

Commit 7a3c904

Browse files
committed
Always generate and include msuproj_export.h
1 parent 7f7b579 commit 7a3c904

File tree

6 files changed

+14
-15
lines changed

6 files changed

+14
-15
lines changed

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ option(WITH_UPDATES_ACTION "Check for updates action" ON)
3030
#### Compiler flags
3131
set(GCC_FLAGS "-std=gnu++11 -funroll-loops -O3 -Wframe-larger-than=1024 -fopenmp")
3232
set(MSVC_FLAGS "/openmp")
33+
if(NOT BUILD_SHARED_LIBS OR NOT MSVC)
34+
add_definitions("-DMSUPROJ_STATIC_DEFINE=1")
35+
endif()
3336

3437

3538
############### Setting additional variables ###############
@@ -98,6 +101,8 @@ include(GDAL)
98101
######## Library ########
99102
include_directories(src/msuproj)
100103
add_subdirectory(src/msuproj msuproj)
104+
include(GenerateExportHeader)
105+
generate_export_header(msuproj)
101106

102107
##### Applications ######
103108
if(BUILD_CLI)

src/msuproj/CMakeLists.txt

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,6 @@ endif()
2626
add_library(msuproj ${MSUPROJ_SOURCES})
2727
target_link_libraries(msuproj ${GDAL_LIBRARIES})
2828

29-
if(MSVC)
30-
include(GenerateExportHeader)
31-
generate_export_header(msuproj)
32-
endif()
33-
3429
if(BUILD_SHARED_LIBS)
3530

3631
set_target_properties(msuproj
@@ -97,10 +92,8 @@ if(INSTALL_DEV)
9792

9893
# Headers
9994
file(GLOB H_FILES *.h)
100-
list(APPEND H_FILES ${CMAKE_BINARY_DIR}/msuproj_version.h)
101-
if(MSVC)
102-
list(APPEND H_FILES ${CMAKE_BINARY_DIR}/msuproj/msuproj_export.h)
103-
endif()
95+
list(APPEND H_FILES ${CMAKE_BINARY_DIR}/msuproj_version.h
96+
${CMAKE_BINARY_DIR}/msuproj_export.h)
10497
foreach(H_FILE ${H_FILES})
10598
get_filename_component(H_FILE_NAME ${H_FILE} NAME)
10699
set(OUT_H_FILE ${CMAKE_BINARY_DIR}/include/${H_FILE_NAME})

src/msuproj/msucore.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@
22
#define MSUCORE_H
33

44
#include <msuproj_version.h>
5-
#if _MSC_VER && !__INTEL_COMPILER
6-
# include <msuproj/msuproj_export.h>
7-
#else
8-
# define MSUPROJ_EXPORT
9-
#endif
5+
#include <msuproj_export.h>
106

117
#include <string>
128

src/msuproj/msupixeltransformer.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#include "msupixeltransformer.h"
22

3+
#include <cstring>
4+
35
msumr::PixelTransformer::PixelTransformer(const unsigned int &raster_x_size, const unsigned int &raster_y_size,
46
const unsigned int &gcpgrid_x_size, const unsigned int &gcpgrid_y_size,
57
GCP *gcps, double *geo_transform) :

src/msuproj/msuproj.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#include <msuproj.h>
22
#include <logoimage.hpp>
33
#include <msugcpgrid.h>
4+
45
#include <ogrsf_frmts.h>
6+
57
#include <fstream>
68
#include <cfloat>
79
#include <vector>

src/msuproj/msuproj.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
#ifndef MSUPROJ_H
22
#define MSUPROJ_H
33

4-
#include <msucore.h>
54
#include <msugcpgrid.h>
65

6+
#include <gdal_priv.h>
7+
78
namespace msumr {
89

910
/**

0 commit comments

Comments
 (0)