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

Update CMake project #217

Merged
merged 6 commits into from
Nov 1, 2020
Merged

Update CMake project #217

merged 6 commits into from
Nov 1, 2020

Conversation

winterheart
Copy link
Contributor

Update cmake requirements to 3.1 and rewrite project with features that enhanced in 3.1 version. Added GNUInstallDirs extension for installing target, added exported targets for reuse in external CMake projects.

Update and cleanup project.
Simplify project for install targets, remove redundant variables.
Adding files for external CMake projects. External project can now call
find_package(WildMidi) and use WildMidi::libwildmidi_dynamic and
WildMidi::libwildmidi_static dependencies.
@psi29a
Copy link
Member

psi29a commented Nov 1, 2020

@winterheart Thanks for the re-write!
Can you also bump the MacOS version in travis so that we can have some coverage on that side please?
https://travis-ci.org/github/Mindwerks/wildmidi/jobs/740251599

@winterheart
Copy link
Contributor Author

I was intended to switch Github Actions (#216) since there is easy to configuration and maintain. Anyway, Travis configuration updated.

@psi29a
Copy link
Member

psi29a commented Nov 1, 2020

Thanks!

@psi29a psi29a merged commit 9755157 into Mindwerks:master Nov 1, 2020
@sezero
Copy link
Contributor

sezero commented Nov 1, 2020

I get the following error when trying to cross-compile for windows x64:

cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-MinGW64.cmake ..
-- The C compiler identification is GNU 4.5.4
-- Check for working C compiler: /opt/cross_win64/bin/x86_64-w64-mingw32-gcc
-- Check for working C compiler: /opt/cross_win64/bin/x86_64-w64-mingw32-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Setting build type to 'Debug' as none was specified.
-- Build Type: Debug
-- Performing Test HAVE___BUILTIN_EXPECT
-- Performing Test HAVE___BUILTIN_EXPECT - Success
-- Performing Test HAVE_C_INLINE
-- Performing Test HAVE_C_INLINE - Success
-- Performing Test HAVE_C___INLINE__
-- Performing Test HAVE_C___INLINE__ - Success
-- Performing Test HAVE_C___INLINE
-- Performing Test HAVE_C___INLINE - Success
-- Performing Test HAVE_NO_UNDEFINED
-- Performing Test HAVE_NO_UNDEFINED - Success
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for inttypes.h
-- Looking for inttypes.h - found
-- Check if the system is big endian
-- Searching 16 bit integer
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Using unsigned short
-- Check if the system is big endian - little endian
CMake Error at src/CMakeLists.txt:217 (INSTALL):
  INSTALL Library TARGETS given no DESTINATION!


-- Configuring incomplete, errors occurred!

@sezero
Copy link
Contributor

sezero commented Nov 2, 2020

Well, here is another gem: This time building for linux with static library enabled:

$ cmake -DCMAKE_BUILD_TYPE=Release -DWANT_STATIC=1 .
-- The C compiler identification is GNU 7.3.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Build Type: Release
-- Performing Test HAVE_VISIBILITY_DEFAULT
-- Performing Test HAVE_VISIBILITY_DEFAULT - Success
-- Performing Test HAVE_VISIBILITY_HIDDEN
-- Performing Test HAVE_VISIBILITY_HIDDEN - Success
-- Performing Test HAVE___BUILTIN_EXPECT
-- Performing Test HAVE___BUILTIN_EXPECT - Success
-- Performing Test HAVE_C_INLINE
-- Performing Test HAVE_C_INLINE - Success
-- Performing Test HAVE_C___INLINE__
-- Performing Test HAVE_C___INLINE__ - Success
-- Performing Test HAVE_C___INLINE
-- Performing Test HAVE_C___INLINE - Success
-- Performing Test HAVE_NO_UNDEFINED
-- Performing Test HAVE_NO_UNDEFINED - Success
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for inttypes.h
-- Looking for inttypes.h - found
-- Check if the system is big endian
-- Searching 16 bit integer
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Using unsigned short
-- Check if the system is big endian - little endian
-- Found ALSA: /usr/lib64/libasound.so (found version "1.1.5") 
-- Found OpenAL: /usr/lib64/libopenal.so  
-- Looking for OSS...
-- Looking for include file sys/soundcard.h
-- Looking for include file sys/soundcard.h - found
-- Looking for include file machine/soundcard.h
-- Looking for include file machine/soundcard.h - not found
-- Looking for include file soundcard.h
-- Looking for include file soundcard.h - not found
-- Performing Test OSS_FOUND
-- Performing Test OSS_FOUND - Success
-- Found OSS.
-- M_LIBRARY: /usr/lib64/libm.so
CMake Error at src/CMakeLists.txt:210 (INSTALL):
  INSTALL TARGETS given no ARCHIVE DESTINATION for static library target
  "libwildmidi_static".


-- Configuring incomplete, errors occurred!

Either fix this crap or revert these changesets.

@winterheart
Copy link
Contributor Author

@sezero can you please post cmake --version and cmake --trace -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-MinGW64.cmake .. output.
I tried every available configuration, and don't get same errors.

@sezero
Copy link
Contributor

sezero commented Nov 2, 2020

@sezero can you please post cmake --version and cmake --trace -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-MinGW64.cmake .. output.

$ PATH=$HOME/opt/cmake3.9/bin:$PATH cmake --version
cmake version 3.9.6

CMake suite maintained and supported by Kitware (kitware.com/cmake).

$ PATH=$HOME/opt/cmake3.9/bin:$PATH cmake --trace -DCMAKE_TOOLCHAIN_FILE=cmake/Toolchain-MinGW64.cmake . &> ../trace.txt
Gzip'ed trace.txt attached.
trace.txt.gz

@sezero
Copy link
Contributor

sezero commented Nov 2, 2020

In case you need, for the other setup:

$ cmake --version
cmake version 3.11.2

CMake suite maintained and supported by Kitware (kitware.com/cmake).

$ CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ cmake --trace . &> trace1.txt
Gzipped trace1.txt attached
trace1.txt.gz

$ cmake --trace -DWANT_STATIC=1 . &> trace2.txt
Gzipped trace2.txt attached
trace2.txt.gz

@winterheart
Copy link
Contributor Author

Can you please try this branch - https://github.com/winterheart/wildmidi/tree/cmake-2 (commit 4e37c97)

@sezero
Copy link
Contributor

sezero commented Nov 2, 2020

Can you please try this branch - https://github.com/winterheart/wildmidi/tree/cmake-2 (commit 4e37c97)

Doesn't make a difference:

$ git log|head -5
commit 4e37c975ef77b18dfd20f23b1cb9a60a3cc45e4d
Author: Azamat H. Hackimov <[email protected]>
Date:   Mon Nov 2 13:57:14 2020 +0300

    Specify ARCHIVE and RUNTIME destinations for INSTALL

Neither with mingw:

-- Check if the system is big endian - little endian
CMake Error at src/CMakeLists.txt:231 (INSTALL):
  INSTALL Library TARGETS given no DESTINATION!


-- Configuring incomplete, errors occurred!

Nor with -DWANT_STATIC=1:

CMake Error at src/CMakeLists.txt:231 (INSTALL):
  INSTALL TARGETS given no ARCHIVE DESTINATION for static library target
  "libwildmidi_static".


-- Configuring incomplete, errors occurred!

@sezero
Copy link
Contributor

sezero commented Nov 2, 2020

... And it fails even without specifying any options:

$ PATH=$HOME/opt/cmake3.9/bin:$PATH cmake .
[...]
CMake Error at src/CMakeLists.txt:231 (INSTALL):
  INSTALL TARGETS given no LIBRARY DESTINATION for shared library target
  "libwildmidi_dynamic".

@winterheart
Copy link
Contributor Author

@sezero please test new changes winterheart@c03732a

@sezero
Copy link
Contributor

sezero commented Nov 2, 2020

@sezero please test new changes winterheart@c03732a

Seems to work. Send a new pull req. with the fix.

winterheart added a commit to winterheart/wildmidi that referenced this pull request Nov 2, 2020
Fix regression introduced in Mindwerks#217. MinGW uses own layout install, so DLLs and
executables goes to RUNTIME, static libs - to ARCHIVE destinations.
Additional optimizations for installation targets.
sezero pushed a commit that referenced this pull request Nov 2, 2020
Fix regression introduced in #217. MinGW uses own layout install, so DLLs and
executables goes to RUNTIME, static libs - to ARCHIVE destinations.
Additional optimizations for installation targets.
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.

3 participants