Files
itgmania212121/CMake/CMakeMacros.cmake
T
Jason Felds dc94728628 Introduce cmake (min 2.8.12) to StepMania.
tl-dr: view the Build directory to see.

This is intended to replace the project files that we presently maintain
so that only a single set is needed instead of multiples.

The following setups were used for testing:

* Windows 8 and Visual Studio 2013 Desktop Express
* Windows 7 and Visual Studio 2012
* Mac OS X Mavericks and Xcode
* Ubuntu and makefiles
* Fedora 21 and makefiles

All three operating systems can generate projects, compile, link, and
run. Windows and Mac OS X users will find their compiled binary in the
same location as before, but Linux users will be surprised: it goes
straight into the root directory, along with a symlinked GtkModules.so
as appropriate. There is no more need for a manual symlinking step.

Known issues:

* At this time, MinGW likely does not work. Extra time will be needed.
* The WITH_JPEG option may go away, and we'll just always require it.
* Some linux libraries can use the system equivalents, but that is not up yet.

For more information, check out the Build directory.
2015-03-21 20:15:15 -04:00

42 lines
1.4 KiB
CMake

function(sm_append_simple_target_property target property str)
get_target_property(current_property ${target} ${property})
if (current_property)
list(APPEND current_property ${str})
set_target_properties(${target} PROPERTIES ${property} "${current_property}")
else()
set_target_properties(${target} PROPERTIES ${property} ${str})
endif()
endfunction()
function(sm_add_compile_definition target def)
sm_append_simple_target_property(${target} COMPILE_DEFINITIONS ${def})
endfunction()
function(sm_add_compile_flag target flag)
sm_append_simple_target_property(${target} COMPILE_FLAGS ${flag})
endfunction()
function(sm_add_link_flag target flag)
if (MSVC)
# Use a modified form of sm_append_simple_target_property.
get_target_property(current_property ${target} LINK_FLAGS)
if (current_property)
set_target_properties(${target} PROPERTIES LINK_FLAGS "${current_property} ${flag}")
else()
set_target_properties(${target} PROPERTIES LINK_FLAGS ${flag})
endif()
else()
sm_append_simple_target_property(${target} LINK_FLAGS ${flag})
endif()
endfunction()
function(disable_project_warnings projectName)
if (MSVC)
sm_add_compile_flag(${projectName} "/W0")
elseif(APPLE)
set_target_properties(${projectName} PROPERTIES XCODE_ATTRIBUTE_GCC_WARN_INHIBIT_ALL_WARNINGS "YES")
else()
set_target_properties(${projectName} PROPERTIES COMPILE_FLAGS "-w")
endif()
endfunction()