Skip to content

fix(cmakelists): Improve CMakeLists.txt#38

Merged
tomghuang merged 2 commits intoargtable:masterfrom
myd7349:fix-cmake-build
Nov 24, 2019
Merged

fix(cmakelists): Improve CMakeLists.txt#38
tomghuang merged 2 commits intoargtable:masterfrom
myd7349:fix-cmake-build

Conversation

@myd7349
Copy link
Copy Markdown
Contributor

@myd7349 myd7349 commented Aug 21, 2019

  • Fix MSVC build failure caused by unsupported compiler flags
    MSVC doesn't support /Wpedantic, 'Werror' flag:
    mkdir build
    cd build
    cmake ..
    cmake --build .
    

    cl : Command line error D8021: invalid numeric argument '/Wpedantic' [C:\Users\vcpkg\Desktop\argtable3\build\src\argtable3.vcxproj]
    cl : Command line error D8021: invalid numeric argument '/Wextra' [C:\Users\vcpkg\Desktop\argtable3\build\src\argtable3.vcxproj]

  • Install DLL file into bin on Windows
    CMake recommands us to install DLL files into bin directory: https://cmake.org/cmake/help/latest/command/install.html
  • Set INTERFACE_INCLUDE_DIRECTORIES properly
  • Do not build tests when ARGTABLE3_ENABLE_TESTS is OFF
  • Discard ARGTABLE3_INSTALL_LIBDIR, ARGTABLE3_INSTALL_INCLUDEDIR
    GNUInstallDirs module is also available on Windows, so use CMAKE_INSTALL_LIBDIR, CMAKE_INSTALL_INCLUDEDIR instead.

- Fix MSVC build failure caused by unsupported compiler flags
- Install DLL file
- Set INTERFACE_INCLUDE_DIRECTORIES properly
- Do not build tests when ARGTABLE3_ENABLE_TESTS is OFF
- Discard ARGTABLE3_INSTALL_LIBDIR, ARGTABLE3_INSTALL_INCLUDEDIR
- Define argtable3_IMPORTS for Win32 shared library
@myd7349 myd7349 marked this pull request as ready for review September 1, 2019 08:28
@tomghuang tomghuang merged commit b906967 into argtable:master Nov 24, 2019
@tomghuang
Copy link
Copy Markdown
Contributor

@myd7349 Thanks a lot for you pull request. I've learned some CMake tricks from you.

@myd7349 myd7349 deleted the fix-cmake-build branch November 25, 2019 00:22
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