Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: m!m on July 27, 2016, 08:36:29 am

Title: The CMake build system
Post by: m!m on July 27, 2016, 08:36:29 am
The new build system based on CMake (https://cmake.org/) has just been merged into master. This means that there are a few changes to how a build is compiled. A description of some common tasks can be found in the GitHub wiki: https://github.com/scp-fs2open/fs2open.github.com/wiki/CMake

Before you do anything, make sure you have updated your git submodules, either by running git submodule update --init --recursive or by cloning the repository with the --recursive flag.

Changes on Windows:
Previously we maintained multiple project files for the individual Visual Studio versions. These are no longer needed and have been removed. Instead, CMake now generates these files. First, you need to download the latest version of CMake from the website I linked above. Then, follow the steps in the Readme (https://github.com/scp-fs2open/fs2open.github.com#building) for generating your project files. The generated files are standard Visual Studio files so you can just open them using the standard methods.

Changes on Linux:
There aren't a lot of conceptual changes here. Instead of running ./autogen.sh you now need to run cmake.

Changes on Mac:
Similarly to Windows, you will now need to generate your project files. The process is similar to the Windows workflow so just follow those instructions.

If you have any troubles or questions about the new setup, I would be happy to answer them here or on IRC.
Title: Re: The CMake build system
Post by: Yarn on July 27, 2016, 01:23:07 pm
I get an error message whenever I try to generate the project files:
Quote
Error in configuration process, project files may be invalid

Here's what gets logged to the bottom portion of the CMake window (errors are preceded by dashes):
Code: [Select]
The C compiler identification is MSVC 19.0.24210.0
The CXX compiler identification is MSVC 19.0.24210.0
Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe
Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe
Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Detecting CXX compile features
Detecting CXX compile features - done
--CMake Error at cmake/toolchain-msvc.cmake:2 (include):
--  include could not find load file:
--
--    EnableExtraCompilerWarnings
--Call Stack (most recent call first):
--  cmake/toolchain.cmake:11 (include)
--  CMakeLists.txt:118 (INCLUDE)


Doing configuration specific to visual studio...
--CMake Error at cmake/toolchain-msvc.cmake:26 (globally_enable_extra_compiler_warnings):
--  Unknown CMake command "globally_enable_extra_compiler_warnings".
--Call Stack (most recent call first):
--  cmake/toolchain.cmake:11 (include)
--  CMakeLists.txt:118 (INCLUDE)


Configuring incomplete, errors occurred!
See also "C:/Games/FreeSpace2/fs2_open/master_build/CMakeFiles/CMakeOutput.log".

In case it's useful, here's the CMakeCache.txt file that's generated:
Code: [Select]
# This is the CMakeCache file.
# For build in directory: c:/Games/FreeSpace2/fs2_open/master_build
# It was generated by CMake: C:/Program Files/CMake/bin/cmake.exe
# 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 GUIs for the type of VALUE, DO NOT EDIT TYPE!.
# VALUE is the current value for the KEY.

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

//Available configurations
CMAKE_CONFIGURATION_TYPES:STRING=Debug;Release;FastDebug

//Flags used by the compiler during all build types.
CMAKE_CXX_FLAGS:STRING= /DWIN32 /D_WINDOWS /W3 /GR /EHsc

//Flags used by the compiler during debug builds.
CMAKE_CXX_FLAGS_DEBUG:STRING=/D_DEBUG /MDd /Zi /Ob0 /Od /RTC1

//Flags used by the compiler during release builds for minimum
// size.
CMAKE_CXX_FLAGS_MINSIZEREL:STRING=/MD /O1 /Ob1 /DNDEBUG

//Flags used by the compiler during release builds.
CMAKE_CXX_FLAGS_RELEASE:STRING=/MD /O2 /Ob2 /DNDEBUG

//Flags used by the compiler during release builds with debug info.
CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=/MD /Zi /O2 /Ob1 /DNDEBUG

//Libraries linked by default with all C++ applications.
CMAKE_CXX_STANDARD_LIBRARIES:STRING=kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib

//Flags used by the compiler during all build types.
CMAKE_C_FLAGS:STRING= /DWIN32 /D_WINDOWS /W3

//Flags used by the compiler during debug builds.
CMAKE_C_FLAGS_DEBUG:STRING=/D_DEBUG /MDd /Zi /Ob0 /Od /RTC1

//Flags used by the compiler during release builds for minimum
// size.
CMAKE_C_FLAGS_MINSIZEREL:STRING=/MD /O1 /Ob1 /DNDEBUG

//Flags used by the compiler during release builds.
CMAKE_C_FLAGS_RELEASE:STRING=/MD /O2 /Ob2 /DNDEBUG

//Flags used by the compiler during release builds with debug info.
CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=/MD /Zi /O2 /Ob1 /DNDEBUG

//Libraries linked by default with all C applications.
CMAKE_C_STANDARD_LIBRARIES:STRING=kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib

//Flags used by the linker.
CMAKE_EXE_LINKER_FLAGS:STRING= /machine:X86

//Flags used by the linker during debug builds.
CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING=/debug /INCREMENTAL

//Flags used by the linker during release minsize builds.
CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING=/INCREMENTAL:NO

//Flags used by the linker during release builds.
CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING=/INCREMENTAL:NO

//Flags used by the linker during Release with Debug Info builds.
CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING=/debug /INCREMENTAL

//Install path
CMAKE_INSTALL_PREFIX:FILEPATH=C:/Games/FreeSpace2

//Path to a program.
CMAKE_LINKER:FILEPATH=C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/link.exe

//Flags used by the linker during the creation of modules.
CMAKE_MODULE_LINKER_FLAGS:STRING= /machine:X86

//Flags used by the linker during debug builds.
CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING=/debug /INCREMENTAL

//Flags used by the linker during release minsize builds.
CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING=/INCREMENTAL:NO

//Flags used by the linker during release builds.
CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING=/INCREMENTAL:NO

//Flags used by the linker during Release with Debug Info builds.
CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING=/debug /INCREMENTAL

//Value Computed by CMake
CMAKE_PROJECT_NAME:STATIC=FS2_Open

//RC compiler
CMAKE_RC_COMPILER:FILEPATH=rc

//Flags for Windows Resource Compiler.
CMAKE_RC_FLAGS:STRING=' /DWIN32 '

//Flags used by the linker during the creation of dll's.
CMAKE_SHARED_LINKER_FLAGS:STRING= /machine:X86

//Flags used by the linker during debug builds.
CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING=/debug /INCREMENTAL

//Flags used by the linker during release minsize builds.
CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING=/INCREMENTAL:NO

//Flags used by the linker during release builds.
CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING=/INCREMENTAL:NO

//Flags used by the linker during Release with Debug Info builds.
CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING=/debug /INCREMENTAL

//If set, runtime paths are not added when installing shared libraries,
// but are added when building.
CMAKE_SKIP_INSTALL_RPATH:BOOL=NO

//If set, runtime paths are not added when using shared libraries.
CMAKE_SKIP_RPATH:BOOL=NO

//Flags used by the linker during the creation of static libraries.
CMAKE_STATIC_LINKER_FLAGS:STRING= /machine:X86

//Flags used by the linker during debug builds.
CMAKE_STATIC_LINKER_FLAGS_DEBUG:STRING=

//Flags used by the linker during release minsize builds.
CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL:STRING=

//Flags used by the linker during release builds.
CMAKE_STATIC_LINKER_FLAGS_RELEASE:STRING=

//Flags used by the linker during Release with Debug Info builds.
CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING=

//If this value is on, makefiles will be generated without the
// .SILENT directive, and all commands will be echoed to the console
// during the make.  This is useful for debugging only. With Visual
// Studio IDE projects all commands are done without /nologo.
CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE

//Enable cotire, this speeds up builds but may cause issues while
// developing (default = OFF)
COTIRE_ENABLE:BOOL=OFF

//Executable output path
EXECUTABLE_OUTPUT_PATH:PATH=C:/Games/FreeSpace2/fs2_open/master_build/bin

//Value Computed by CMake
FS2_Open_BINARY_DIR:STATIC=C:/Games/FreeSpace2/fs2_open/master_build

//Value Computed by CMake
FS2_Open_SOURCE_DIR:STATIC=C:/Games/FreeSpace2/fs2_open/master

//Build FRED2 binary
FSO_BUILD_FRED2:BOOL=ON

//Build and use the included libraries istead of using the system
// headers and libraries
FSO_BUILD_INCLUDED_LIBS:BOOL=ON

//Build tools related to FSO
FSO_BUILD_TOOLS:BOOL=OFF

//Build wxFRED2 binary
FSO_BUILD_WXFRED2:BOOL=OFF

//Generate binaries in development mode, only use if you know what
// you're doing!
FSO_DEVELOPMENT_MODE:BOOL=OFF

//Determines if warnings in the build are considered fatal errors,
// primarily used for CI
FSO_FATAL_WARNINGS:BOOL=OFF

//The path of the FreeSpace directory you want to use. Please note
// that you will have to change CMAKE_INSTALL_PREFIX if you change
// this at some point.
FSO_FREESPACE_PATH:FILEPATH=C:/Games/FreeSpace2

//Install some debug files (currently only PDB files on windows)
FSO_INSTALL_DEBUG_FILES:BOOL=OFF

//Additional arguments passed to a generated executable when run
// with the generated build files.
FSO_RUN_ARGUMENTS:STRING=

//Use LuaJIT for Lua scripting, needs a working internet connection!
FSO_USE_LUAJIT:BOOL=OFF

//Download and build OpenAL Soft instead of using the system libraries
FSO_USE_OPENALSOFT:BOOL=OFF

//Use Windows specific text-to-speach libraries
FSO_USE_SPEECH:BOOL=ON

//Enable voice recognition support
FSO_USE_VOICEREC:BOOL=ON

//Library output path
LIBRARY_OUTPUT_PATH:PATH=C:/Games/FreeSpace2/fs2_open/master_build/bin

//Use the dynamically linked version of the runtime
MSVC_USE_RUNTIME_DLL:BOOL=OFF


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

//This is the directory where this CMakeCache.txt was created
CMAKE_CACHEFILE_DIR:INTERNAL=c:/Games/FreeSpace2/fs2_open/master_build
//Major version of cmake used to create the current loaded cache
CMAKE_CACHE_MAJOR_VERSION:INTERNAL=3
//Minor version of cmake used to create the current loaded cache
CMAKE_CACHE_MINOR_VERSION:INTERNAL=6
//Patch version of cmake used to create the current loaded cache
CMAKE_CACHE_PATCH_VERSION:INTERNAL=1
//Path to CMake executable.
CMAKE_COMMAND:INTERNAL=C:/Program Files/CMake/bin/cmake.exe
//Path to cpack program executable.
CMAKE_CPACK_COMMAND:INTERNAL=C:/Program Files/CMake/bin/cpack.exe
//Path to ctest program executable.
CMAKE_CTEST_COMMAND:INTERNAL=C:/Program Files/CMake/bin/ctest.exe
//ADVANCED property for variable: CMAKE_CXX_FLAGS
CMAKE_CXX_FLAGS-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_CXX_FLAGS_DEBUG
CMAKE_CXX_FLAGS_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_CXX_FLAGS_MINSIZEREL
CMAKE_CXX_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_RELEASE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELWITHDEBINFO
CMAKE_CXX_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_CXX_STANDARD_LIBRARIES
CMAKE_CXX_STANDARD_LIBRARIES-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_C_FLAGS
CMAKE_C_FLAGS-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_C_FLAGS_DEBUG
CMAKE_C_FLAGS_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_C_FLAGS_MINSIZEREL
CMAKE_C_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_C_FLAGS_RELEASE
CMAKE_C_FLAGS_RELEASE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_C_FLAGS_RELWITHDEBINFO
CMAKE_C_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_C_STANDARD_LIBRARIES
CMAKE_C_STANDARD_LIBRARIES-ADVANCED:INTERNAL=1
//Executable file format
CMAKE_EXECUTABLE_FORMAT:INTERNAL=Unknown
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS
CMAKE_EXE_LINKER_FLAGS-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_DEBUG
CMAKE_EXE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL
CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELEASE
CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO
CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
//Name of external makefile project generator.
CMAKE_EXTRA_GENERATOR:INTERNAL=
//Name of generator.
CMAKE_GENERATOR:INTERNAL=Visual Studio 14 2015
//Name of generator platform.
CMAKE_GENERATOR_PLATFORM:INTERNAL=
//Name of generator toolset.
CMAKE_GENERATOR_TOOLSET:INTERNAL=
//Source directory with the top level CMakeLists.txt file for this
// project
CMAKE_HOME_DIRECTORY:INTERNAL=C:/Games/FreeSpace2/fs2_open/master
//ADVANCED property for variable: CMAKE_LINKER
CMAKE_LINKER-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS
CMAKE_MODULE_LINKER_FLAGS-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_DEBUG
CMAKE_MODULE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL
CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELEASE
CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO
CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
//number of local generators
CMAKE_NUMBER_OF_MAKEFILES:INTERNAL=1
//ADVANCED property for variable: CMAKE_RC_COMPILER
CMAKE_RC_COMPILER-ADVANCED:INTERNAL=1
CMAKE_RC_COMPILER_WORKS:INTERNAL=1
//ADVANCED property for variable: CMAKE_RC_FLAGS
CMAKE_RC_FLAGS-ADVANCED:INTERNAL=1
//Path to CMake installation.
CMAKE_ROOT:INTERNAL=C:/Program Files/CMake/share/cmake-3.6
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS
CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG
CMAKE_SHARED_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL
CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELEASE
CMAKE_SHARED_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO
CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_SKIP_INSTALL_RPATH
CMAKE_SKIP_INSTALL_RPATH-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_SKIP_RPATH
CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS
CMAKE_STATIC_LINKER_FLAGS-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_DEBUG
CMAKE_STATIC_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL
CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELEASE
CMAKE_STATIC_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO
CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE
CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: COTIRE_ENABLE
COTIRE_ENABLE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: FSO_BUILD_INCLUDED_LIBS
FSO_BUILD_INCLUDED_LIBS-ADVANCED:INTERNAL=1
//ADVANCED property for variable: FSO_DEVELOPMENT_MODE
FSO_DEVELOPMENT_MODE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: FSO_FATAL_WARNINGS
FSO_FATAL_WARNINGS-ADVANCED:INTERNAL=1
//ADVANCED property for variable: FSO_INSTALL_DEBUG_FILES
FSO_INSTALL_DEBUG_FILES-ADVANCED:INTERNAL=1
//ADVANCED property for variable: FSO_USE_LUAJIT
FSO_USE_LUAJIT-ADVANCED:INTERNAL=1
//ADVANCED property for variable: FSO_USE_OPENALSOFT
FSO_USE_OPENALSOFT-ADVANCED:INTERNAL=1
//ADVANCED property for variable: MSVC_USE_RUNTIME_DLL
MSVC_USE_RUNTIME_DLL-ADVANCED:INTERNAL=1
TARGET_COPY_DIRS:INTERNAL=
TARGET_COPY_FILES:INTERNAL=

I'm using CMake 3.6.1 64-bit, Git for Windows 2.9.2 64-bit, and Visual Studio Community 2015 Update 3. This happens even with a clean repository checkout.
Title: Re: The CMake build system
Post by: m!m on July 27, 2016, 01:26:06 pm
Before you do anything, make sure you have updated your git submodules, either by running git submodule update --init --recursive or by clong the repository with the --recursive flag.
Title: Re: The CMake build system
Post by: Yarn on July 27, 2016, 03:00:00 pm
I honestly thought that the "submodules" were part of Git for Windows and that those had to be updated by installing the latest Git for Windows. Guess I was totally wrong.

For those of us using TortoiseGit, you can update the submodules without using Bash by doing the following:
Title: Re: The CMake build system
Post by: The E on July 27, 2016, 03:05:11 pm
To explain what submodules are in git parlance: A submodule is a way to link to an external git repository to pull in data from there. If you have a project that links to a specific library, you can use submodules to pull the code you need, eliminating the need to maintain a copy of that code by yourself.
Title: Re: The CMake build system
Post by: Yarn on July 27, 2016, 03:45:23 pm
Is it possible to have the EXEs automatically be copied to the FS2 folder? The pre-CMake projects did this and I enjoyed the convenience. (In case you want to know, I left all settings at their defaults: CMAKE_INSTALL_PREFIX and FSO_FREESPACE_PATH are set to my FS2 folder, but EXECUTABLE_OUTPUT_PATH and LIBRARY_OUTPUT_PATH are not.)
Title: Re: The CMake build system
Post by: m!m on July 27, 2016, 03:46:50 pm
If you build the "INSTALL" target, the executables and DLLs will be copied to your FSO folder.
Title: Re: The CMake build system
Post by: Yarn on July 27, 2016, 04:41:20 pm
I figured out how to make Visual Studio 2015 build the INSTALL target when F7 is pressed:

Is there a reason that the INSTALL target is not enabled by default?
Title: Re: The CMake build system
Post by: m!m on July 28, 2016, 03:11:03 am
The reason is that a build of the entire project should not have any side effects outside the build directory. If you want to copy the files to the FSO directory you can just build the INSTALL project and everything else will be done automatically. If you just want to start the new executable directly, you don't have to copy it. Just use Ctrl+F5 and FSO will be started with the correct root directory.
Title: Re: The CMake build system
Post by: karajorma on August 03, 2016, 06:14:32 am
Okay, I gave this a try but the builds are not being automatically moved to my FS2 folder at the end of the build process any more. Is this intentional or did I configure something incorrectly?
Title: Re: The CMake build system
Post by: m!m on August 03, 2016, 06:16:32 am
It's intentional, if you want to copy the executable to your FS2 folder you need to build the INSTALL target. For that you need to either set the FS2PATH environment variable or set the CMake variable CMAKE_INSTALL_PREFIX to your FS2 path.
Title: Re: The CMake build system
Post by: karajorma on August 03, 2016, 06:30:02 am
Okay, here's the issue. I have Diaspora, TBP and FS2 which are obviously installed in different directories. I need to be able to run, debug and play all of them. In the past, I'd simply point the debugger at whichever executable was in the relevent folder.

What am I supposed to do now?
Title: Re: The CMake build system
Post by: m!m on August 03, 2016, 06:57:24 am
If you take a look at the Readme in the repository you would notice that you can set the FSO_FREESPACE_PATH CMake variable to set in which directory the executable is run. You can set that to the root of the desired TC and use that to debug that specific TC.
You can also set the working directory directly because I removed the code that would always change the current directory to the location of the executable.
Title: Re: The CMake build system
Post by: karajorma on August 03, 2016, 10:53:57 am
Ah, okay so the latter should solve my issues.
Title: Re: The CMake build system
Post by: m!m on August 12, 2016, 02:30:56 am
The pull request 788 (https://github.com/scp-fs2open/fs2open.github.com/pull/788) may cause an error upon configuration since the sdlmain setup was changed. If that happens, delete the cache and rerun the configuration in the CMake GUI. That should fix it.
Title: Re: The CMake build system
Post by: Phantom Hoover on August 12, 2016, 04:07:15 am
Honestly I don't understand why cmake keeps this cache around that makes it impossible to update a lot of configuration without deleting it manually?
Title: Re: The CMake build system
Post by: m!m on August 12, 2016, 04:10:31 am
Almost all configuration changes can be done without deleting the cache. This was just a very specific change that caused existing cache values to become invalid.
Title: Re: The CMake build system
Post by: Phantom Hoover on August 12, 2016, 04:18:16 am
Oh, okay. I just still can't find any way of changing CFLAGS if I set them by exporting an environment variable.
Title: Re: The CMake build system
Post by: m!m on August 12, 2016, 04:19:43 am
The current setup requires them to be set every time CMake runs the configure step or they will be overwritten by the default values. If that is not sufficient for you, you could submit a pull request with the required changes.
Title: Re: The CMake build system
Post by: Phantom Hoover on August 16, 2016, 06:09:56 am
The current setup requires them to be set every time CMake runs the configure step or they will be overwritten by the default values. If that is not sufficient for you, you could submit a pull request with the required changes.

This is not true at all; once CMakeCache.txt is generated nothing I do short of deleting it (or the line in it that sets CFLAGS) can change them. This includes running cmake .. with CFLAGS unset.
Title: Re: The CMake build system
Post by: m!m on August 16, 2016, 06:43:02 am
I'll take a look at it when I have the time.
Title: Re: The CMake build system
Post by: m!m on August 16, 2016, 11:51:27 am
I just tested setting CXXFLAGS to different values and every time the value showed up in the makefile. If you pass VERBOSE=1 to make you will see the entire command that is used for compiling a file which you can use to check if your custom flags show up in the make file.
Title: Re: The CMake build system
Post by: Bryan See on October 23, 2016, 10:02:40 pm
It seems that I'm having problems building the project files for compilation using CMake. I use Visual Studio 2015 on Windows 10 (using the Anniversary Update). Can anyone provide a concrete step here and on Wiki?
Title: Re: The CMake build system
Post by: chief1983 on October 24, 2016, 05:18:57 pm
Could you explain your problem more clearly?  What steps you performed, what problem you're having?  I see that our documentation doesn't exactly hold your hand through the entire process step by step, I guess it assumes some familiarity with CMake still.
Title: Re: The CMake build system
Post by: Bryan See on October 25, 2016, 01:52:57 pm
I use Cmake-gui. I specified the Where is the source code and where to build the binaries. I clicked configure. Then, I get this:

Code: [Select]
cotire 1.7.8 loaded.
Doing configuration specific to visual studio...
Configuring Windows specific things and stuff...
Building libjpeg from source
Building zlib from source
Building libpng from source
Building lua from source
Could not find OpenAL libraries on system, using included pre-built libraries
Building jansson from source...

Could NOT find Doxygen (missing:  DOXYGEN_EXECUTABLE)
Building FRED2: ON
Using text to speech: ON
Using voice recogition: ON
Building FSO tools: OFF
Building wxFRED: OFF
Fatal warnings: OFF
Configuring done

Then I click "Generate". I'm getting a message that some files aren't properly configured.
Title: Re: The CMake build system
Post by: chief1983 on October 25, 2016, 02:08:01 pm
Your code looks outdated, as there is nothing there about ffmpeg.  Are you attempting to configure for the latest master or some other branch, or old version?
Title: Re: The CMake build system
Post by: Bryan See on November 08, 2016, 11:58:48 am
Yes. I'm trying to configure for the latest. I'd like to keeping up the latest.
Title: Re: The CMake build system
Post by: chief1983 on November 08, 2016, 12:02:47 pm
Well, the latest master on Github should check for/download ffmpeg during the cmake process.  Since that didn't happen, there's something wrong/outdated with your setup.
Title: Re: The CMake build system
Post by: Goober5000 on December 04, 2016, 10:39:36 am
I ran into an error while using git bisect to investigate PR #1051 (https://github.com/scp-fs2open/fs2open.github.com/issues/1051).  I began with the latest master checked out which had just been built successfully.  Then I kicked off a bisection and checked out the fs2_open_3_7_4 tag, like so...

Code: [Select]
>git status
On branch master
Your branch is up-to-date with 'origin/master'.

nothing to commit, working directory clean

>git bisect start

>git bisect bad

>git fetch upstream --tags
remote: Counting objects: 486, done.
remote: Compressing objects: 100% (16/16), done.
remote: Total 486 (delta 182), reused 177 (delta 177), pack-reused 293
Receiving objects: 100% (486/486), 122.75 KiB | 0 bytes/s, done.
Resolving deltas: 100% (252/252), completed with 129 local objects.
From github.com:scp-fs2open/fs2open.github.com
   d60b756..0e99ae7  coverity_scan -> upstream/coverity_scan
 * [new tag]         fs2_open_3_7_4_RC2 -> fs2_open_3_7_4_RC2
 * [new tag]         fs2_open_3_7_4_RC3 -> fs2_open_3_7_4_RC3
 * [new tag]         fs2_open_3_7_4_final -> fs2_open_3_7_4_final
[lots of nightly tags]

>git checkout fs2_open_3_7_4_final
warning: unable to rmdir cmake/external/cotire: Directory not empty
warning: unable to rmdir cmake/external/rpavlik-cmake-modules: Directory not empty
Checking out files: 100% (2923/2923), done.
Note: checking out 'fs2_open_3_7_4_final'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b new_branch_name

HEAD is now at 24a9a12... Automated 3.7.4 Final versioning commit

>git bisect good
Bisecting: a merge base must be tested
[dc708ccbbb61c6dd63307262ffe3be3794a732bb] Merge pull request #547 from Goober5000/game_level_seed

>git status
HEAD detached at dc708cc
You are currently bisecting, started from branch 'master'.
  (use "git bisect reset" to get back to the original branch)

Untracked files:
  (use "git add <file>..." to include in what will be committed)

        cmake/

nothing added to commit but untracked files present (use "git add" to track)

Immediately after that, when trying to build, Visual Studio generates a whole bunch of this sort of error:
Quote
CUSTOMBUILD : CMake error : The source directory "<project dir>" does not appear to contain CMakeLists.txt.

CMake-gui also displays this error:
Quote
CMake Error: The source directory "<project dir>" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.

Where did CMakeLists.txt go, and why?


I have used git bisect many times successfully in the past and never encountered this error before.
Title: Re: The CMake build system
Post by: m!m on December 04, 2016, 11:00:12 am
Does CMakeLists.txt actually exist in the project directory? It was added after 3.7.4 final so at least for some of the commits there will be no CMakeLists.txt.
Title: Re: The CMake build system
Post by: chief1983 on December 04, 2016, 11:28:13 am
Yeah, if you bisect over that long of a time range you might have to use the old method to compile again.
Title: Re: The CMake build system
Post by: Goober5000 on December 04, 2016, 11:56:22 am
...Derp, you're right. :snipe: I thought CMake had been added earlier.  Not seeing the forest for the trees.

It's compiling now.
Title: Re: The CMake build system
Post by: Bryan See on May 24, 2017, 02:10:26 pm
Can it support VS2017?
Title: Re: The CMake build system
Post by: The E on May 24, 2017, 02:14:09 pm
It does. VS2017 even has CMAKE support built-in (If CMAKE didn't support all of our main development platforms, we wouldn't be using it)
Title: Re: The CMake build system
Post by: ksotar on December 08, 2017, 11:51:04 am
How can I build for OS X while on Windows? A lot of my friends somehow happens to have Macs.
Title: Re: The CMake build system
Post by: m!m on December 08, 2017, 11:53:27 am
You can't. Apple does not want anyone to use MacOS in a VM when the host system is not a Mac as well and cross-compiling probably doesn't work. Especially not if you are on Windows.
Title: Re: The CMake build system
Post by: ksotar on December 08, 2017, 11:59:00 am
:nono:
Alright then. I'll go and trash iTunes now out from my Win7, long time worth to do it.
Title: Re: The CMake build system
Post by: chief1983 on December 08, 2017, 12:35:17 pm
Well hold on now.  This is actually related to a problem I've wanted to solve for a while.   We can now kick off release builds via a Web page.  With some added options, I am wondering if we could request build sets for arbitrary forks/branches, with custom notification options (forum post, email, etc).
Title: Re: The CMake build system
Post by: m!m on December 08, 2017, 12:37:03 pm
Some time ago I expanded the nightly system to also support arbitrary test build compilation: https://github.com/scp-fs2open/fs2open.github.com/wiki/Automated-Test-Build-compilation

However, that requires push access to the main repository so only badged members can use that at the moment.
Title: Re: The CMake build system
Post by: chief1983 on December 08, 2017, 02:13:07 pm
So, let's assume we got the ability to do custom builds of any branch on the main repo, via the web frontend writing a push, which I think is what we do now.  Theoretically then, any fork could set up the hooks so that it could be compatible with the system, and I could add supported forks to the web frontend right?  Or perhaps people could arbitrarily specify any fork repo URL they want and it would be on them to make sure it was set up?
Title: Re: The CMake build system
Post by: m!m on December 08, 2017, 02:19:49 pm
The problem with allowing other forks to upload builds is that it reveals the password of the FTP host to everyone since if anyone can specify their own repository and branch then that branch could have been altered so that it prints the password to the console while compiling the builds. Also, the encryption system of Travis CI and Appveyor do only work for a single repository so scaling it to multiple forks is not trivial.

The easiest solution would be to just have a manual or semi-manual system where a pull request for a test build branch is created by the contributor and a developer with push access can then check if nothing nefarious is being done with the CI scripts.
Title: Re: The CMake build system
Post by: chief1983 on December 08, 2017, 03:20:03 pm
What if we automate that actual check?  Compare the requested fork's build scripts to the main repo's via diff, as long as they're cool, let it fly?  I mean I guess a user-intervention based process would probably be safer in case methods we didn't think of occur.
Title: Re: The CMake build system
Post by: chief1983 on December 08, 2017, 08:57:21 pm
Another possibility could be that anyone requesting builds from a fork provide their own upload credentials to be used.  Being able to host the builds would be great but being able to upload custom builds to a given location would still be a huge help I think.
Title: Re: The CMake build system
Post by: jr2 on December 08, 2017, 11:16:33 pm
How can I build for OS X while on Windows? A lot of my friends somehow happens to have Macs.

Not while on Windows, no, but it's possible (sometimes) to dual or triple -boot Mac OS X, Windows (and Linux if you want that too).

Post over on /r/hackintosh (http://reddit.com/r/hackintosh) see if your hardware is currently supported.  They also have a Discord server (https://discord.gg/u8V7N5C)
Title: Re: The CMake build system
Post by: ngld on December 10, 2017, 04:48:10 am
Since Hackintosh has been mentioned (which is against Apple's EULA), I'll mention that you actually CAN run a macOS VM on Windows with either VmWare or VirtualBox. It doesn't work out-of-the box and requires a few tricks but it's possible... However, that also violates Apple's EULA so I won't explain how until a mod can tell me if we're allowed to talk about it here.
Title: Re: The CMake build system
Post by: jr2 on December 10, 2017, 11:16:01 pm
Oh.  Yes, I forgot.  It's illegal to run Apple's software, which you purchase (well, I'll assume you purchased it) on hardware which you also purchased, unless it was purchased from Apple for an exorbitant markup.  I mean, $2800 for a laptop with an i7 and an RX 560 + 512GB SSD, 15" display which isn't even as high-res as a Surface Pro.  Oh wait, you're paying for that Apple experience.  So $1500 for the laptop (maybe) and the rest is that slick OS.     /rant

I could see not supporting non-Apple configurations, but the whole EULA business... yeeesh   

Anyways, feel free to redact my comment if we don't want to be talking in gray areas.  I hadn't remembered to take that into consideration when linking to other discussions on the topic.  :nervous:
Title: Re: The CMake build system
Post by: ksotar on December 11, 2017, 03:56:36 am
I think I remember now, why I never even looked to Apple products.

I can understand almost everything, but not been able to build from other platforms...
Looks like my friends with Macs are going to learn how to build by themselves.
Title: Re: The CMake build system
Post by: chief1983 on December 11, 2017, 07:16:39 am
Depending on how often you need it, asking a dev with a mac is always an option.
Title: Re: The CMake build system
Post by: jr2 on December 11, 2017, 11:57:55 am
Depending on how often you need it, asking a dev with a mac is always an option.

Must be nice being one of 5 guys in town with a pickup...  (as in, when people move, they always ask you to help or to borrow your truck, and if there's very few of you, you'll quickly lose patience with that).

Can you target Mac from Linux?  If so, you can target it from Windows through Linux subsystem for Windows (https://docs.microsoft.com/en-us/windows/wsl/install-win10)
Title: Re: The CMake build system
Post by: chief1983 on December 11, 2017, 12:00:43 pm
Yeah I like my toys so I have both a truck and a Mac :)
Title: Re: The CMake build system
Post by: jr2 on December 11, 2017, 12:08:01 pm
Yeah I like my toys so I have both a truck and a Mac :)

I actually like Mac too.  I just hate the price.  My wife bought one through her school, and I always want to play with it, love the click integration.. the price it just outlandish, however.  Imagine a Tesla Model S with the price tag of a Ferrari, Roadster with the price tag of a Ford GT (not Mustang GT) or a Model 3 with the price tag of a Corvette.

Teslas are amazing cars, just not that amazing.  Same with Apple. And they don't even produce the product domestically, or make their own parts!!  They produce them in the same places Samsung et al do, for the same prices (or just use Samsung parts), and then turn around and charge 5x the price!  I just can't believe they can't see how much market share they could capture if they'd drop the price a little, and loosen a few of the restrictions.
Title: Re: The CMake build system
Post by: Cyborg17 on December 11, 2017, 08:41:09 pm
I got a refurbished mac for $140 from 2007...  Works great.  Runs El Capitan.  User experience. Very pleased.
Title: Re: The CMake build system
Post by: jr2 on December 12, 2017, 02:23:15 am
I got a refurbished mac for $140 from 2007...  Works great.  Runs El Capitan.  User experience. Very pleased.

That's pretty cool, I like that kind of price (apparently, after a certain age, even Macs become competitive with PCs, either that, or you got lucky).
Title: Re: The CMake build system
Post by: den5 on December 18, 2017, 09:55:11 am
Hello! I tried to compile fs2_open and I got these errors. What's wrong? I'm using visual studio 2013 ultimate

Code: [Select]
Warning 3 warning D9025: overriding '/Zm170' with '/Zm200' C:\fs2_OSE\code\cl code
Warning 4 warning D9025: overriding '/Zm170' with '/Zm200' C:\fs2_OSE\code\cl code
Warning 5 warning D9025: overriding '/Zm170' with '/Zm200' C:\fs2_OSE\code\cl code
Warning 6 warning D9025: overriding '/Zm170' with '/Zm200' C:\fs2_OSE\code\cl code
Warning 7 warning D9025: overriding '/Zm170' with '/Zm200' C:\fs2_OSE\code\cl code
Warning 8 warning D9025: overriding '/Zm170' with '/Zm200' C:\fs2_OSE\code\cl code
Warning 9 warning D9025: overriding '/Zm170' with '/Zm200' C:\fs2_OSE\code\cl code
Warning 10 warning D9025: overriding '/Zm170' with '/Zm200' C:\fs2_OSE\code\cl code
Warning 11 warning D9025: overriding '/Zm170' with '/Zm200' C:\fs2_OSE\code\cl code
Warning 12 warning D9025: overriding '/Zm170' with '/Zm200' C:\fs2_OSE\code\cl code
Warning 1 warning D9025: overriding '/W3' with '/w' C:\fs2_OSE\lib\opengl\gl\cl glad
Warning 2 warning D9025: overriding '/W3' with '/w' C:\fs2_OSE\lib\opengl\gl\cl glad_wgl
Error 14 error D8040: error creating or communicating with child process C:\fs2_OSE\code\cl code
Error 16 error D8040: error creating or communicating with child process C:\fs2_OSE\freespace2\cl Freespace2
Error 32 error D8040: error creating or communicating with child process C:\fs2_OSE\fred2\cl FRED2
Error 17 error C2893: Failed to specialize function template 'void handle_inconsistent_flag(flagset<T,T::NUM_VALUES> &,T,int)' C:\Users\Denis\Documents\GitHub\fs2open.github.com\fred2\initialstatus.cpp 464 1 FRED2
Error 18 error C2893: Failed to specialize function template 'void handle_inconsistent_flag(flagset<T,T::NUM_VALUES> &,T,int)' C:\Users\Denis\Documents\GitHub\fs2open.github.com\fred2\initialstatus.cpp 465 1 FRED2
Error 19 error C2893: Failed to specialize function template 'void handle_inconsistent_flag(flagset<T,T::NUM_VALUES> &,T,int)' C:\Users\Denis\Documents\GitHub\fs2open.github.com\fred2\initialstatus.cpp 466 1 FRED2
Error 20 error C2893: Failed to specialize function template 'void handle_inconsistent_flag(flagset<T,T::NUM_VALUES> &,T,int)' C:\Users\Denis\Documents\GitHub\fs2open.github.com\fred2\initialstatus.cpp 467 1 FRED2
Error 21 error C2893: Failed to specialize function template 'void handle_inconsistent_flag(flagset<T,T::NUM_VALUES> &,T,int)' C:\Users\Denis\Documents\GitHub\fs2open.github.com\fred2\initialstatus.cpp 468 1 FRED2
Error 22 error C2893: Failed to specialize function template 'void handle_inconsistent_flag(flagset<T,T::NUM_VALUES> &,T,int)' C:\Users\Denis\Documents\GitHub\fs2open.github.com\fred2\initialstatus.cpp 469 1 FRED2
Error 23 error C2893: Failed to specialize function template 'void handle_inconsistent_flag(flagset<T,T::NUM_VALUES> &,T,int)' C:\Users\Denis\Documents\GitHub\fs2open.github.com\fred2\initialstatus.cpp 470 1 FRED2
Error 24 error C2893: Failed to specialize function template 'void handle_inconsistent_flag(flagset<T,T::NUM_VALUES> &,T,int)' C:\Users\Denis\Documents\GitHub\fs2open.github.com\fred2\initialstatus.cpp 484 1 FRED2
Error 25 error C2893: Failed to specialize function template 'void handle_inconsistent_flag(flagset<T,T::NUM_VALUES> &,T,int)' C:\Users\Denis\Documents\GitHub\fs2open.github.com\fred2\initialstatus.cpp 485 1 FRED2
Error 26 error C2893: Failed to specialize function template 'void handle_inconsistent_flag(flagset<T,T::NUM_VALUES> &,T,int)' C:\Users\Denis\Documents\GitHub\fs2open.github.com\fred2\initialstatus.cpp 486 1 FRED2
Error 27 error C2893: Failed to specialize function template 'void handle_inconsistent_flag(flagset<T,T::NUM_VALUES> &,T,int)' C:\Users\Denis\Documents\GitHub\fs2open.github.com\fred2\initialstatus.cpp 487 1 FRED2
Error 28 error C2893: Failed to specialize function template 'void handle_inconsistent_flag(flagset<T,T::NUM_VALUES> &,T,int)' C:\Users\Denis\Documents\GitHub\fs2open.github.com\fred2\initialstatus.cpp 488 1 FRED2
Error 29 error C2893: Failed to specialize function template 'void handle_inconsistent_flag(flagset<T,T::NUM_VALUES> &,T,int)' C:\Users\Denis\Documents\GitHub\fs2open.github.com\fred2\initialstatus.cpp 489 1 FRED2
Error 30 error C2893: Failed to specialize function template 'void handle_inconsistent_flag(flagset<T,T::NUM_VALUES> &,T,int)' C:\Users\Denis\Documents\GitHub\fs2open.github.com\fred2\initialstatus.cpp 490 1 FRED2
Error 13 error C1001: An internal error has occurred in the compiler. C:\Users\Denis\Documents\GitHub\fs2open.github.com\code\sound\openal.h 26 1 code
Error 15 error C1001: An internal error has occurred in the compiler. C:\Users\Denis\Documents\GitHub\fs2open.github.com\code\sound\openal.h 26 1 Freespace2
Error 31 error C1001: An internal error has occurred in the compiler. C:\Users\Denis\Documents\GitHub\fs2open.github.com\code\sound\openal.h 26 1 FRED2
Title: Re: The CMake build system
Post by: m!m on December 18, 2017, 09:58:58 am
Is that the entire log output? Visual Studio usually shows more detailed error messages in the full log output.
Title: Re: The CMake build system
Post by: den5 on December 18, 2017, 10:10:36 am
This appeared in the error list. Where i can find full error log?

this from output
Code: [Select]
1>------ Skipped Build: Project: clean_cotire, Configuration: Release x64 ------
1>Project not selected to build for this solution configuration
2>------ Skipped Build: Project: code_pch_pre, Configuration: Release x64 ------
2>Project not selected to build for this solution configuration
3>------ Build started: Project: code, Configuration: Release x64 ------
3>cl : Command line warning D9025: overriding '/Zm170' with '/Zm200'
3>cl : Command line warning D9025: overriding '/Zm170' with '/Zm200'
3>cl : Command line warning D9025: overriding '/Zm170' with '/Zm200'
3>cl : Command line warning D9025: overriding '/Zm170' with '/Zm200'
3>  cmdline.cpp
3>  cutscenes.cpp
3>  movie.cpp
3>cl : Command line warning D9025: overriding '/Zm170' with '/Zm200'
3>cl : Command line warning D9025: overriding '/Zm170' with '/Zm200'
3>cl : Command line warning D9025: overriding '/Zm170' with '/Zm200'
3>  VideoPresenter.cpp
3>  AudioDecoder.cpp
3>  FFMPEGDecoder.cpp
3>cl : Command line warning D9025: overriding '/Zm170' with '/Zm200'
3>  internal.cpp
3>cl : Command line warning D9025: overriding '/Zm170' with '/Zm200'
3>  SubtitleDecoder.cpp
3>  VideoDecoder.cpp
3>  ddsutils.cpp
3>  console.cpp
3>  consolecmds.cpp
3>  consoleparse.cpp
3>  def_files-win32.cpp
3>  exceptionhandler.cpp
3>  fireballs.cpp
3>  warpineffect.cpp
3>  contexthelp.cpp
3>C:\Users\Denis\Documents\GitHub\fs2open.github.com\code\sound/openal.h(26): fatal error C1001: An internal error has occurred in the compiler.
3>  (compiler file 'msc1.cpp', line 1325)
3>   To work around this problem, try simplifying or changing the program near the locations listed above.
3>  Please choose the Technical Support command on the Visual C++
3>   Help menu, or open the Technical Support help file for more information (C:\Users\Denis\Documents\GitHub\fs2open.github.com\code\cutscene\movie.cpp)
3>  INTERNAL COMPILER ERROR in 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\x86_amd64\CL.exe'
3>      Please choose the Technical Support command on the Visual C++
3>      Help menu, or open the Technical Support help file for more information
3>  gameplayhelp.cpp
3>C:\Users\Denis\Documents\GitHub\fs2open.github.com\code\sound/openal.h(26): fatal error C1001: An internal error has occurred in the compiler.
3>  (compiler file 'msc1.cpp', line 1325)
3>   To work around this problem, try simplifying or changing the program near the locations listed above.
3>  Please choose the Technical Support command on the Visual C++
3>   Help menu, or open the Technical Support help file for more information (C:\Users\Denis\Documents\GitHub\fs2open.github.com\code\cmdline\cmdline.cpp)
3>  INTERNAL COMPILER ERROR in 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\x86_amd64\CL.exe'
3>      Please choose the Technical Support command on the Visual C++
3>      Help menu, or open the Technical Support help file for more information
3>cl : Command line error D8040: error creating or communicating with child process
4>------ Build started: Project: Freespace2, Configuration: Release x64 ------
5>------ Build started: Project: FRED2, Configuration: Release x64 ------
4>  freespace.cpp
5>  initialstatus.cpp
5>  missionsave.cpp
5>  restrictpaths.cpp
5>  setglobalshipflags.cpp
5>  sexp_tree.cpp
5>  shieldsysdlg.cpp
5>  ship_select.cpp
5>  shipchecklistbox.cpp
4>C:\Users\Denis\Documents\GitHub\fs2open.github.com\code\sound/openal.h(26): fatal error C1001: An internal error has occurred in the compiler.
4>  (compiler file 'msc1.cpp', line 1325)
4>   To work around this problem, try simplifying or changing the program near the locations listed above.
4>  Please choose the Technical Support command on the Visual C++
4>   Help menu, or open the Technical Support help file for more information
4>  INTERNAL COMPILER ERROR in 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\x86_amd64\CL.exe'
4>      Please choose the Technical Support command on the Visual C++
4>      Help menu, or open the Technical Support help file for more information
6>------ Skipped Build: Project: launch_fso, Configuration: Release x64 ------
6>Project not selected to build for this solution configuration
5>  shipclasseditordlg.cpp
5>C:\Users\Denis\Documents\GitHub\fs2open.github.com\fred2\initialstatus.cpp(464): error C2893: Failed to specialize function template 'void handle_inconsistent_flag(flagset<T,T::NUM_VALUES> &,T,int)'
5>          With the following template arguments:
5>          'T=Ship::Ship_Flags'
5>C:\Users\Denis\Documents\GitHub\fs2open.github.com\fred2\initialstatus.cpp(465): error C2893: Failed to specialize function template 'void handle_inconsistent_flag(flagset<T,T::NUM_VALUES> &,T,int)'
5>          With the following template arguments:
5>          'T=Ship::Ship_Flags'
5>C:\Users\Denis\Documents\GitHub\fs2open.github.com\fred2\initialstatus.cpp(466): error C2893: Failed to specialize function template 'void handle_inconsistent_flag(flagset<T,T::NUM_VALUES> &,T,int)'
5>          With the following template arguments:
5>          'T=Ship::Ship_Flags'
5>C:\Users\Denis\Documents\GitHub\fs2open.github.com\fred2\initialstatus.cpp(467): error C2893: Failed to specialize function template 'void handle_inconsistent_flag(flagset<T,T::NUM_VALUES> &,T,int)'
5>          With the following template arguments:
5>          'T=Ship::Ship_Flags'
5>C:\Users\Denis\Documents\GitHub\fs2open.github.com\fred2\initialstatus.cpp(468): error C2893: Failed to specialize function template 'void handle_inconsistent_flag(flagset<T,T::NUM_VALUES> &,T,int)'
5>          With the following template arguments:
5>          'T=Ship::Ship_Flags'
5>C:\Users\Denis\Documents\GitHub\fs2open.github.com\fred2\initialstatus.cpp(469): error C2893: Failed to specialize function template 'void handle_inconsistent_flag(flagset<T,T::NUM_VALUES> &,T,int)'
5>          With the following template arguments:
5>          'T=Ship::Ship_Flags'
5>C:\Users\Denis\Documents\GitHub\fs2open.github.com\fred2\initialstatus.cpp(470): error C2893: Failed to specialize function template 'void handle_inconsistent_flag(flagset<T,T::NUM_VALUES> &,T,int)'
5>          With the following template arguments:
5>          'T=Ship::Ship_Flags'
5>C:\Users\Denis\Documents\GitHub\fs2open.github.com\fred2\initialstatus.cpp(484): error C2893: Failed to specialize function template 'void handle_inconsistent_flag(flagset<T,T::NUM_VALUES> &,T,int)'
5>          With the following template arguments:
5>          'T=Ship::Ship_Flags'
5>C:\Users\Denis\Documents\GitHub\fs2open.github.com\fred2\initialstatus.cpp(485): error C2893: Failed to specialize function template 'void handle_inconsistent_flag(flagset<T,T::NUM_VALUES> &,T,int)'
5>          With the following template arguments:
5>          'T=Ship::Ship_Flags'
5>C:\Users\Denis\Documents\GitHub\fs2open.github.com\fred2\initialstatus.cpp(486): error C2893: Failed to specialize function template 'void handle_inconsistent_flag(flagset<T,T::NUM_VALUES> &,T,int)'
5>          With the following template arguments:
5>          'T=Ship::Ship_Flags'
5>C:\Users\Denis\Documents\GitHub\fs2open.github.com\fred2\initialstatus.cpp(487): error C2893: Failed to specialize function template 'void handle_inconsistent_flag(flagset<T,T::NUM_VALUES> &,T,int)'
5>          With the following template arguments:
5>          'T=Ship::Ship_Flags'
5>C:\Users\Denis\Documents\GitHub\fs2open.github.com\fred2\initialstatus.cpp(488): error C2893: Failed to specialize function template 'void handle_inconsistent_flag(flagset<T,T::NUM_VALUES> &,T,int)'
5>          With the following template arguments:
5>          'T=Ship::Ship_Flags'
5>C:\Users\Denis\Documents\GitHub\fs2open.github.com\fred2\initialstatus.cpp(489): error C2893: Failed to specialize function template 'void handle_inconsistent_flag(flagset<T,T::NUM_VALUES> &,T,int)'
5>          With the following template arguments:
5>          'T=Ship::Ship_Flags'
5>C:\Users\Denis\Documents\GitHub\fs2open.github.com\fred2\initialstatus.cpp(490): error C2893: Failed to specialize function template 'void handle_inconsistent_flag(flagset<T,T::NUM_VALUES> &,T,int)'
5>          With the following template arguments:
5>          'T=Ship::Ship_Flags'
5>  shipeditordlg.cpp
5>C:\Users\Denis\Documents\GitHub\fs2open.github.com\code\sound/openal.h(26): fatal error C1001: An internal error has occurred in the compiler.
5>  (compiler file 'msc1.cpp', line 1325)
5>   To work around this problem, try simplifying or changing the program near the locations listed above.
5>  Please choose the Technical Support command on the Visual C++
5>   Help menu, or open the Technical Support help file for more information (C:\Users\Denis\Documents\GitHub\fs2open.github.com\fred2\sexp_tree.cpp)
5>  INTERNAL COMPILER ERROR in 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\x86_amd64\CL.exe'
5>      Please choose the Technical Support command on the Visual C++
5>      Help menu, or open the Technical Support help file for more information
5>C:\Users\Denis\Documents\GitHub\fs2open.github.com\code\sound/openal.h(26): fatal error C1001: An internal error has occurred in the compiler.
5>  (compiler file 'msc1.cpp', line 1325)
5>   To work around this problem, try simplifying or changing the program near the locations listed above.
5>  Please choose the Technical Support command on the Visual C++
5>   Help menu, or open the Technical Support help file for more information (C:\Users\Denis\Documents\GitHub\fs2open.github.com\fred2\missionsave.cpp)
5>  INTERNAL COMPILER ERROR in 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\x86_amd64\CL.exe'
5>      Please choose the Technical Support command on the Visual C++
5>      Help menu, or open the Technical Support help file for more information
5>cl : Command line error D8040: error creating or communicating with child process
7>------ Skipped Build: Project: INSTALL, Configuration: Release x64 ------
7>Project not selected to build for this solution configuration
8>------ Skipped Build: Project: PACKAGE, Configuration: Release x64 ------
8>Project not selected to build for this solution configuration
========== Build: 0 succeeded, 3 failed, 11 up-to-date, 5 skipped ==========
Title: Re: The CMake build system
Post by: m!m on December 18, 2017, 10:17:27 am
It has been some time since I used VS2013 but I think the error log is in the same tab pane as the error list but I don't know the exact title of the tab.

EDIT: Nevermind, I didn't see the edit...

EDIT2: Try updating Visual Studio (or just install the community version of VS2017). That code definitely compiles with VS2013 so this is likely some sort of compiler bug that has been fixed in a later version.
Title: Re: The CMake build system
Post by: den5 on January 19, 2018, 03:38:02 am
I got VS2017 and was able to compile fs2_open. But now another problem. The game crashes at any time, any mods \ campaign \ mission. This does not happen with Nightly Builds. What happened this time?

[attachment stolen by Russian hackers]
Title: Re: The CMake build system
Post by: m!m on January 19, 2018, 03:40:42 am
Try compiling a debug build and launching FSO with an attached debugger. That will show where the crash occurs.
Title: Re: The CMake build system
Post by: AdmiralRalwood on January 19, 2018, 09:54:37 am
Try compiling a debug build and launching FSO with an attached debugger. That will show where the crash occurs.
If you try this and it doesn't crash in non-Release builds, and you're compiling AVX or AVX2 builds, you may have encountered a compiler bug (https://developercommunity.visualstudio.com/content/problem/102123/illegal-instruction-generated-by-c-compiler-in-avx.html).
Title: Re: The CMake build system
Post by: den5 on January 19, 2018, 12:03:04 pm
Try compiling a debug build and launching FSO with an attached debugger. That will show where the crash occurs.
If you try this and it doesn't crash in non-Release builds, and you're compiling AVX or AVX2 builds, you may have encountered a compiler bug (https://developercommunity.visualstudio.com/content/problem/102123/illegal-instruction-generated-by-c-compiler-in-avx.html).

I compiled debug build and it doesn't crash where the standard and fast debug does it. This SSE2 build, my processor does not support AVX\ AVX2.
Title: Re: The CMake build system
Post by: den5 on January 25, 2018, 10:30:31 pm
I installed VS2015, compiled build and it works fine. There are no crashes like before. So I don't know what's wrong with VS2017.
Title: Re: The CMake build system
Post by: ksotar on October 20, 2018, 02:26:43 pm
If you want to build SSE2 version (or other variants instead of AVX), then you should alter
Code: [Select]
MSVC_SIMD_INSTRUCTIONS and set it to SSE2. You may not see that option at start, but if you check 'Advanced' on top, it will show (BTW 'Grouped' is very convenient).