Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visual Studio compilation with CMake #11

Merged
merged 5 commits into from
Nov 24, 2014
Merged

Visual Studio compilation with CMake #11

merged 5 commits into from
Nov 24, 2014

Conversation

Jule-
Copy link
Contributor

@Jule- Jule- commented Nov 19, 2014

Following our previous discussions (issue #6), I investigate in order to make some changes to CMake rules in order to make it work on Windows with Visual Studio.

The only prerequisite is to modify cpl_port.h in your GDAL include directory in order to define CPL_DLL declaration:

#ifndef CPL_DLL
#if defined(_MSC_VER) && !defined(CPL_DISABLE_DLL)
#  define CPL_DLL     __declspec(dllexport)
#else
#  if defined(USE_GCC_VISIBILITY_FLAG)
#    define CPL_DLL     __attribute__ ((visibility("default")))
#  else
#    if defined(_MSC_VER)
#      define CPL_DLL     __declspec(dllimport)
#    else
#      define CPL_DLL
#    endif
#  endif
#endif
#endif

If my modifications don't break linux compilation may be you can merge my changes.

HTH

Jule- and others added 5 commits November 19, 2014 11:34
…ithout issues. This means disable all non-workable checks (CXX11, CXX0X and unified GDAL) and remove compilation debug flags.
…eprocessor definitions in order to handle DLL export/import of ctb.

Add GDAL include directories to tool project builds in CMake rules.
Using `CPL_DLL` requires changing GDAL's `cpl_port.h` file which is a hack too
far on many systems so the change is encapsulated in `CTB_DLL`.  This also
re-enables CMake directives that are appropriate for toolchains other than
Visual Studio.
@Jule-
Copy link
Contributor Author

Jule- commented Nov 20, 2014

I've merge your modifications, it work, you can pull them.

homme added a commit that referenced this pull request Nov 24, 2014
Visual Studio compilation with CMake
@homme homme merged commit cbddc79 into geo-data:master Nov 24, 2014
@homme
Copy link
Member

homme commented Nov 24, 2014

Many thanks!

@Jule-
Copy link
Contributor Author

Jule- commented Nov 25, 2014

You're welcome! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants