KicadLib/CMakeLists.txt

71 lines
2.4 KiB
CMake
Raw Normal View History

2014-01-17 20:56:42 +01:00
project( kicad-library )
2014-01-17 20:56:42 +01:00
cmake_minimum_required( VERSION 2.6.1 FATAL_ERROR )
# Locations for install targets.
2014-01-17 20:56:42 +01:00
if( UNIX )
if( APPLE )
2013-12-29 00:49:40 +01:00
# Like all variables, CMAKE_INSTALL_PREFIX can be over-ridden on the command line.
2014-01-17 20:56:42 +01:00
set( CMAKE_INSTALL_PREFIX /
CACHE PATH "" )
2013-12-29 00:49:40 +01:00
# Everything without leading / is relative to CMAKE_INSTALL_PREFIX.
2014-01-17 20:56:42 +01:00
set( KICAD_DATA "Library/Application Support/kicad/"
CACHE PATH "Location of KiCad data files." )
set( KICAD_MODULES ${KICAD_DATA}/modules )
set( KICAD_LIBRARY ${KICAD_DATA}/library )
set( KICAD_TEMPLATE ${KICAD_DATA}/template )
else()
# Like all variables, CMAKE_INSTALL_PREFIX can be over-ridden on the command line.
2014-01-17 20:56:42 +01:00
set( CMAKE_INSTALL_PREFIX /usr/local
CACHE PATH "")
2008-03-31 03:32:15 +02:00
# Everything without leading / is relative to CMAKE_INSTALL_PREFIX.
2014-01-17 20:56:42 +01:00
set( KICAD_DATA share/kicad
CACHE PATH "Location of KiCad data files." )
set( KICAD_MODULES ${KICAD_DATA}/modules )
set( KICAD_LIBRARY ${KICAD_DATA}/library )
set( KICAD_TEMPLATE ${KICAD_DATA}/template )
endif()
endif()
2008-03-11 16:57:54 +01:00
if(WIN32)
# Like all variables, CMAKE_INSTALL_PREFIX can be over-ridden on the command line.
2014-01-17 20:56:42 +01:00
set( CMAKE_INSTALL_PREFIX c:/kicad
CACHE PATH "" )
2008-03-31 03:32:15 +02:00
# Everything without leading / is relative to CMAKE_INSTALL_PREFIX.
2014-01-17 20:56:42 +01:00
set( KICAD_MODULES modules )
set( KICAD_LIBRARY library )
set( KICAD_TEMPLATE template )
endif()
mark_as_advanced( KICAD_DATA KICAD_MODULES KICAD_LIBRARY )
2013-12-02 16:51:33 +01:00
if( UNIX )
set( KICAD_USER_CONFIG_DIR "$ENV{HOME}/.config/kicad"
CACHE PATH "Location of user specifig KiCad config files" )
2013-12-02 16:51:33 +01:00
elseif( MINGW )
set( KICAD_USER_CONFIG_DIR "$ENV{%APPDATA%}/kicad"
CACHE PATH "Location of user specifig KiCad config files" )
2013-12-02 16:51:33 +01:00
endif()
2013-12-02 16:51:33 +01:00
mark_as_advanced( KICAD_USER_CONFIG_DIR )
#================================================
# "make uninstall" rules
#================================================
configure_file(
"${PROJECT_SOURCE_DIR}/CMakeModules/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY )
add_custom_target( uninstall
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" )
2008-03-31 03:32:15 +02:00
# CMake will look in these dirs for nested 'CMakeLists.txt' files.
# Resources.
2014-01-17 20:56:42 +01:00
add_subdirectory( library )
add_subdirectory( modules )
add_subdirectory( template )