views:

293

answers:

2

I have never compiled programs using CMake. I have downloaded the latest SVN of Allegro and tried compiling it multiple times, but no luck. I have looked allover the internet and have not found anything helpful. I have chosen to compile it for Visual Studio 9 2008. I don't really know where I have to link the source and the build. The Allegro files are confusing. I don't know if this can be useful, but I also got a hold of the lib files. If anyone knows how I should link the files to properly compile, I would be very glad.

Here is the CMakeCash.Text content:

# This is the CMakeCache file.
# For build in directory: c:/lib/Allegro4.9
# You can edit this file to change values found and used by cmake.
# If you do not want to change any of the values, simply exit the editor.
# If you do want to change a value, simply edit, save, and exit the editor.
# The syntax for the file is as follows:
# KEY:TYPE=VALUE
# KEY is the name of a variable in the cache.
# TYPE is a hint to GUI's for the type of VALUE, DO NOT EDIT TYPE!.
# VALUE is the current value for the KEY.

########################
# EXTERNAL cache entries
########################


########################
# INTERNAL cache entries
########################

//This is the directory where this CMakeCache.txt was created
CMAKE_CACHEFILE_DIR:INTERNAL=c:/lib/Allegro4.9
//Major version of cmake used to create the current loaded cache
CMAKE_CACHE_MAJOR_VERSION:INTERNAL=2
//Minor version of cmake used to create the current loaded cache
CMAKE_CACHE_MINOR_VERSION:INTERNAL=8
//Patch version of cmake used to create the current loaded cache
CMAKE_CACHE_PATCH_VERSION:INTERNAL=0

Also, here is the event list, the error is bound to be found inside:

Check for working C compiler: cl
Check for working C compiler: cl -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Check for working CXX compiler: cl
Check for working CXX compiler: cl -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Guessed MSVC directory: cl
Allowing MSVC to use SSE instructions
Check if the system is big endian
Searching 16 bit integer
Looking for sys/types.h
Looking for sys/types.h - found
Looking for stdint.h
Looking for stdint.h - not 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
Looking for include files ALLEGRO_HAVE_DIRENT_H
Looking for include files ALLEGRO_HAVE_DIRENT_H - not found.
Looking for include files ALLEGRO_HAVE_INTTYPES_H
Looking for include files ALLEGRO_HAVE_INTTYPES_H - not found.
Looking for include files ALLEGRO_HAVE_LINUX_JOYSTICK_H
Looking for include files ALLEGRO_HAVE_LINUX_JOYSTICK_H - not found.
Looking for include files ALLEGRO_HAVE_STDBOOL_H
Looking for include files ALLEGRO_HAVE_STDBOOL_H - not found.
Looking for include files ALLEGRO_HAVE_STDINT_H
Looking for include files ALLEGRO_HAVE_STDINT_H - not found.
Looking for include files ALLEGRO_HAVE_SYS_IO_H
Looking for include files ALLEGRO_HAVE_SYS_IO_H - not found.
Looking for include files ALLEGRO_HAVE_SYS_STAT_H
Looking for include files ALLEGRO_HAVE_SYS_STAT_H - found
Looking for include files ALLEGRO_HAVE_SYS_TIME_H
Looking for include files ALLEGRO_HAVE_SYS_TIME_H - not found.
Looking for include files ALLEGRO_HAVE_TIME_H
Looking for include files ALLEGRO_HAVE_TIME_H - found
Looking for include files ALLEGRO_HAVE_SYS_UTSNAME_H
Looking for include files ALLEGRO_HAVE_SYS_UTSNAME_H - not found.
Looking for include files ALLEGRO_HAVE_SYS_TYPES_H
Looking for include files ALLEGRO_HAVE_SYS_TYPES_H - found
Looking for include files ALLEGRO_HAVE_SOUNDCARD_H
Looking for include files ALLEGRO_HAVE_SOUNDCARD_H - not found.
Looking for include files ALLEGRO_HAVE_SYS_SOUNDCARD_H
Looking for include files ALLEGRO_HAVE_SYS_SOUNDCARD_H - not found.
Looking for include files ALLEGRO_HAVE_MACHINE_SOUNDCARD_H
Looking for include files ALLEGRO_HAVE_MACHINE_SOUNDCARD_H - not found.
Looking for include files ALLEGRO_HAVE_LINUX_SOUNDCARD_H
Looking for include files ALLEGRO_HAVE_LINUX_SOUNDCARD_H - not found.
Looking for include files ALLEGRO_HAVE_OSATOMIC_H
Looking for include files ALLEGRO_HAVE_OSATOMIC_H - not found.
Looking for getexecname
Looking for getexecname - not found
Looking for mkstemp
Looking for mkstemp - not found
Looking for mmap
Looking for mmap - not found
Looking for mprotect
Looking for mprotect - not found
Looking for sched_yield
Looking for sched_yield - not found
Looking for stricmp
Looking for stricmp - found
Looking for strlwr
Looking for strlwr - found
Looking for strupr
Looking for strupr - found
Looking for sysconf
Looking for sysconf - not found
Looking for fseeko
Looking for fseeko - not found
Looking for ftello
Looking for ftello - not found
Check size of _Bool
Check size of _Bool - failed
Performing Test ALLEGRO_HAVE_PROCFS_ARGCV
Performing Test ALLEGRO_HAVE_PROCFS_ARGCV - Failed
Performing Test ALLEGRO_HAVE_SV_PROCFS_H
Performing Test ALLEGRO_HAVE_SV_PROCFS_H - Failed
Performing Test ALLEGRO_HAVE_VA_COPY
Performing Test ALLEGRO_HAVE_VA_COPY - Failed
Check if constructors are supported - no
Could NOT find DINPUT  (missing:  DINPUT_INCLUDE_DIR DINPUT_LIBRARY)
CMake Error at CMakeLists.txt:565 (message):
  Windows port requires DirectInput (not found).


Configuring incomplete, errors occurred!
+1  A: 

If cmake is failing, it should tell you what went wrong, ie: if you're missing required dependencies.

Please post the actual errors you see from cmake, and/or the compiler if cmake itself didn't fail.

edit:

There you go, your errors:

Could NOT find DINPUT (missing: DINPUT_INCLUDE_DIR DINPUT_LIBRARY) CMake Error at CMakeLists.txt:565 (message): Windows port requires DirectInput (not found).

That's a common issue and is fixed in newer releases. 4.9.14 is ancient. Please upgrade to the latest release, or even straight from SVN.

Tomasu
I have just updated with the CMakeCache ans also the build events. The errors should be in there.
And I've updated my answer ;)
Tomasu
Really? How can 4.9.14 be older? Its just about the most recent version. Well, I might as well try with the older version which is more stable. This may be the solution.
4.9.16 is the latest release, and 4.9.17 will be out this weekend I assume.
Tomasu
I tried compiling 4.9.16 and still got an error.Could NOT find DINPUT (missing: DINPUT_INCLUDE_DIR DINPUT_LIBRARY)CMake Error at CMakeLists.txt:558 (message): Windows port requires DirectInput (not found).Could it be that I am not linking the proper files to CMake?
My friend trentg has your answer, and what he means by MSVC command prompt, is the option to open a command prompt inside MSVC, instead of using the run box to open up cmd.exe manually. msvc will setup some special env vars that way. also make sure you follow his instructions.
Tomasu
+1  A: 

First, run cmake from the MSVC command prompt, not the regular command prompt. Then set the INCLUDE and LIB environment variables to point to your directx installation. For example:

set INCLUDE=C:\Program Files\Microsoft DirectX SDK (August 2009)\Include set LIB=C:\Program Files\Microsoft DirectX SDK (August 2009)\lib\x86

Notice the lack of quotes ("). Do not use quotes. Then delete CMakeCache.txt and run cmake again, and it should find directx.

trentg
What do you mean by the MSVC command prompt?
Alright, now I understand what you mean. Also, I am now downloading the Microsoft DirectX SDK (august 2009) I will install it and try the command you showed. Thanks for the help everyone!